/* NetGame — estilo funcional mínimo. O visual definitivo vem depois,
   isso aqui é só o suficiente pra enxergar a operação funcionando. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #14141c;
  color: #f1f1f5;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow-x: hidden; /* rede de segurança contra qualquer elemento que vaze da tela no mobile */
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid #2a2a36;
}
.brand-net {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: inherit;
  text-decoration: none;
}
.brand-net-accent { color: #a78bfa; }

.top-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.top-nav { display: flex; align-items: center; gap: 14px; padding-right: 16px; border-right: 1px solid #2a2a36; }

/* Deslogado: a barra do topo mostra só o botão "Entrar" — o form (nick,
   senha, cadastrar, esqueci senha) fica escondido num dropdown ancorado
   nele, só aparece quando clicado. Evita empilhar 2 inputs + 3 links
   sempre visíveis ao lado do "Como jogar"/"Ranking". */
.auth-area { position: relative; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.auth-area button {
  background: #6c4dff; border: none; color: #fff; border-radius: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.auth-area button:hover { background: #7d61ff; }
.auth-account-link { color: #f1f1f5; text-decoration: none; font-weight: 600; }
.auth-account-link:hover { color: #a78bfa; text-decoration: underline; }

.auth-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 20;
  background: #1c1c26; border: 1px solid #2a2a36; border-radius: 12px;
  padding: 16px; width: 220px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}
.auth-dropdown[hidden] { display: none; } /* [hidden] e a classe têm a mesma especificidade — sem isso o flex acima vence e o dropdown fica sempre aberto */
.auth-dropdown .auth-inputs { display: flex; flex-direction: column; gap: 8px; }
.auth-dropdown input {
  background: #14141c; border: 1px solid #33333f; color: #f1f1f5;
  border-radius: 8px; padding: 9px 10px; font-size: 16px; width: 100%;
  /* 16px pra não deixar o Safari/iOS dar zoom automático ao focar o campo */
}
/* Autofill do navegador força um fundo claro por padrão — sobrescreve pra
   continuar parecendo um campo escuro normal, sem o "flash" branco/amarelo. */
.auth-dropdown input:-webkit-autofill,
.auth-dropdown input:-webkit-autofill:hover,
.auth-dropdown input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f1f1f5;
  -webkit-box-shadow: 0 0 0 1000px #14141c inset;
  transition: background-color 9999s ease-in-out 0s;
}
.auth-dropdown .auth-submit-btn { width: 100%; }
.auth-links { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: #666672; white-space: nowrap; }
.auth-links a { color: #666672; text-decoration: none; }
.auth-links a:hover { color: #9a9aad; }
.auth-links-sep { color: #3a3a48; }
.auth-error { color: #ff6b6b; font-size: 12px; }

.layout {
  display: flex;
  gap: 20px;
  padding: 20px 24px 60px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: flex-start;
}
.room { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sidebar { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: #1c1c26;
  border: 1px solid #2a2a36;
  border-radius: 14px;
  padding: 18px 20px;
}
.card-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: #9a9aad; margin-bottom: 12px;
}

.round-card .theme-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.round-card .theme-title { font-size: 24px; font-weight: 700; min-width: 0; }
.round-card .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: #a78bfa; margin-bottom: 6px; }
.card-footer-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; gap: 12px;
}
.card-footer-row .found-count, .card-footer-row .pause-timer { font-size: 12px; color: #9a9aad; margin-top: 0; }
.report-theme-btn {
  background: transparent; border: 1px solid #33333f; color: #666672;
  border-radius: 8px; padding: 3px 10px; font-size: 11px; cursor: pointer;
  flex-shrink: 0;
}
.report-theme-btn:hover { border-color: #ff8a3d; color: #ff8a3d; }
.report-theme-btn:disabled { cursor: default; opacity: 0.7; }
.timer {
  width: 64px; height: 64px; border-radius: 50%; border: 4px solid #ff8a3d;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-weight: 700; font-size: 20px;
}
.timer.urgent { border-color: #ff5050; color: #ff5050; }

.slots { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.slot {
  flex: 1; min-width: 110px; border-radius: 10px; padding: 10px 12px;
  border: 1.5px dashed #33333f; background: #14141c; text-align: center;
}
.slot.found { border-style: solid; border-color: #3ddc84; background: #1a2b22; text-align: left; }
.slot .slot-answer { font-weight: 700; font-size: 14px; }
.slot .slot-by { font-size: 11px; color: #3ddc84; }
.slot .slot-locked { font-size: 11px; color: #666; }

.recap-card .answers-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

/* Destaque de vitória de partida — fica na tela a pausa toda (bem mais que
   um banner de alguns segundos), com o card inteiro ganhando uma borda
   dourada pra não passar despercebido. */
.champion-card { border-color: #d4a03d; }
.champion-banner {
  background: linear-gradient(135deg, #3d2b0f, #1c1c26 70%);
  border: 1px solid #d4a03d;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}
.champion-trophy { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.champion-name { font-size: 26px; font-weight: 800; color: #ffcf7a; }
.champion-label { font-size: 13px; color: #d4a03d; font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.recap-chip {
  min-width: 110px; border-radius: 10px; padding: 12px; text-align: center;
  border: 1.5px solid #3ddc8480; background: #1a2b22;
}
.recap-chip.not-found { border-style: dashed; border-color: #33333f; background: #14141c; color: #777; }
.recap-chip .rc-answer { font-weight: 700; font-size: 13px; }
.recap-chip .rc-by { font-size: 11px; color: #3ddc84; }
.pause-timer { margin-top: 14px; font-size: 13px; color: #9a9aad; }

.feed-card { display: flex; flex-direction: column; }
.feed-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.clear-chat-btn {
  background: transparent; border: 1px solid #33333f; color: #9a9aad;
  border-radius: 8px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.clear-chat-btn:hover { border-color: #55556a; color: #f1f1f5; }
.feed-list {
  display: flex; flex-direction: column; gap: 4px;
  height: 360px; overflow-y: auto; margin-bottom: 14px;
  scroll-behavior: smooth;
}
.feed-row { padding: 5px 10px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.feed-row.correct { background: #1a2b22; }
.feed-row.system.c0 { background: #221c36; color: #d8d0f5; }
.feed-row.system.c1 { background: #16233a; color: #cfe0ff; }
.feed-row.system.c2 { background: #331c2c; color: #f0d0e0; }
.feed-row.system.c3 { background: #143330; color: #bdeee6; }
.feed-row.system.c4 { background: #332912; color: #f0dfb0; }
.feed-row.system.c5 { background: #331616; color: #f2c7c7; }
.feed-row .fn { font-weight: 700; color: #c9c9d6; } /* cor real vem inline por nick (nicknameColor no app.js) */
.bot-badge {
  display: inline-block; font-weight: 700; font-size: 11px; letter-spacing: 0.02em;
  color: #3ddc84; background: #14241a; border-radius: 5px; padding: 1px 6px; margin-right: 2px;
}
.bot-badge.system.c0 { color: #b39dff; background: #2c2350; }
.bot-badge.system.c1 { color: #8fb8ff; background: #1c2f52; }
.bot-badge.system.c2 { color: #e19bc9; background: #43223a; }
.bot-badge.system.c3 { color: #6fd9c7; background: #1c453f; }
.bot-badge.system.c4 { color: #e0b95c; background: #4a3a16; }
.bot-badge.system.c5 { color: #e08080; background: #4a1e1e; }
.feed-row.correct b { color: #3ddc84; }

.guess-area { display: flex; gap: 10px; }
.guess-area input {
  flex: 1; min-width: 0; background: #1c1c26; border: 1px solid #2a2a36; color: #f1f1f5;
  border-radius: 999px; padding: 12px 18px; font-size: 16px;
}
.guess-area button {
  background: #6c4dff; border: none; color: #fff; border-radius: 999px;
  padding: 0 22px; font-weight: 700; cursor: pointer;
}
.guess-area .locked-msg {
  color: #9a9aad; font-size: 14px; padding: 10px 4px;
}

.online-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.online-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; flex-shrink: 0; }

.match-target { font-size: 12px; color: #9a9aad; margin-bottom: 12px; margin-top: -6px; }
.leaderboard { display: flex; flex-direction: column; gap: 10px; }
.lb-row { display: flex; align-items: center; gap: 10px; }
.lb-rank { width: 18px; color: #666; font-size: 13px; font-weight: 700; }
.lb-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.lb-bar-wrap { flex: 1; height: 5px; background: #14141c; border-radius: 999px; overflow: hidden; margin: 0 6px; }
.lb-bar { height: 100%; background: #ff8a3d; }
.lb-points { font-weight: 700; font-size: 13px; width: 26px; text-align: right; }

.confetti-overlay { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 999; }
.confetti-piece {
  position: absolute; top: -20px; width: 8px; height: 14px; opacity: 0.9;
  animation-name: confetti-fall; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.5; }
}

.back-link { color: #9a9aad; text-decoration: none; font-size: 14px; }
.back-link:hover { color: #f1f1f5; }
.ranking-link {
  color: #9a9aad; text-decoration: none; font-size: 14px; margin-right: 16px;
  background: transparent; border: none; font-family: inherit; cursor: pointer; padding: 0;
}
.ranking-link:hover { color: #f1f1f5; }

.ranking-panel { background: #181820; border-bottom: 1px solid #2a2a36; }
.ranking-panel-inner { max-width: 1100px; margin: 0 auto; padding: 18px 24px 24px; }
.ranking-panel .your-rank-card { margin: 14px 0; }

.ranking-page { max-width: 800px; margin: 0 auto; padding: 32px 24px 60px; }
.ranking-title { font-size: 24px; margin: 0 0 20px; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  background: #1c1c26; border: 1px solid #2a2a36; color: #9a9aad;
  border-radius: 999px; padding: 8px 18px; font-size: 14px; cursor: pointer;
}
.tab:hover { color: #f1f1f5; }
.tab.active { background: #6c4dff; border-color: #6c4dff; color: #fff; font-weight: 600; }

.your-rank-card { margin-bottom: 20px; }
.your-rank-body { display: flex; flex-direction: column; gap: 6px; }
.your-rank-row { font-size: 14px; }
.your-rank-label { color: #9a9aad; margin-right: 6px; }
.your-rank-pos { color: #a78bfa; font-weight: 700; }

.ranking-columns { display: flex; gap: 20px; flex-wrap: wrap; }
.ranking-card { flex: 1; min-width: 280px; }
.ranking-list { display: flex; flex-direction: column; gap: 8px; }
.ranking-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #2a2a36; }
.ranking-row:last-child { border-bottom: none; }
.ranking-rank { width: 22px; color: #666; font-weight: 700; font-size: 13px; }
.ranking-name { flex: 1; font-weight: 600; font-size: 14px; }
.ranking-value { font-weight: 600; font-size: 13px; color: #9a9aad; }
.rk-wins { font-weight: 700; color: #ff8a3d; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 14, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 1000;
}
.modal-card {
  background: #1c1c26; border: 1px solid #2a2a36; border-radius: 14px;
  padding: 22px 24px; width: 100%; max-width: 380px;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.modal-text { font-size: 13.5px; color: #9a9aad; line-height: 1.5; margin-bottom: 14px; }
.modal-theme-name { color: #f1f1f5; font-weight: 700; }
.modal-textarea {
  width: 100%; min-height: 80px; resize: vertical;
  background: #14141c; border: 1px solid #33333f; color: #f1f1f5;
  border-radius: 10px; padding: 10px 12px; font-size: 16px;
  font-family: inherit; margin-bottom: 16px;
}
.modal-textarea:focus { outline: none; border-color: #6c4dff; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-btn {
  background: transparent; border: 1px solid #33333f; color: #9a9aad;
  border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.modal-btn:hover { border-color: #55556a; color: #f1f1f5; }
.modal-btn:disabled { cursor: default; opacity: 0.7; }
.modal-btn-primary { background: #6c4dff; border-color: #6c4dff; color: #fff; }
.modal-btn-primary:hover { background: #7d61ff; border-color: #7d61ff; color: #fff; }

.site-footer {
  text-align: center; padding: 20px 24px 32px; border-top: 1px solid #2a2a36; margin-top: 12px;
}
.site-footer-brand { display: block; font-weight: 800; font-size: 15px; letter-spacing: 0.02em; color: #f1f1f5; text-decoration: none; margin-bottom: 4px; }
.site-footer-sub { font-size: 12px; color: #55556a; }

.rules-page { max-width: 720px; margin: 0 auto; padding: 32px 24px 60px; }
.rules-title { font-size: 26px; margin: 0 0 10px; }
.rules-intro { color: #9a9aad; font-size: 14.5px; line-height: 1.6; margin: 0 0 28px; }
.rules-steps { list-style: none; margin: 0 0 32px; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.rules-step {
  display: flex; gap: 16px; align-items: flex-start;
  background: #1c1c26; border: 1px solid #2a2a36; border-radius: 14px; padding: 16px 18px;
}
.rules-step-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: #6c4dff; color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.rules-step-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.rules-step-body p { margin: 0; color: #9a9aad; font-size: 13.5px; line-height: 1.6; }
.rules-cta {
  display: inline-block; background: #6c4dff; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 14px; padding: 12px 22px; border-radius: 999px;
}
.rules-cta:hover { background: #7d61ff; }

.auth-page { max-width: 420px; margin: 0 auto; padding: 40px 24px 60px; }
.auth-page-title { font-size: 22px; margin: 0 0 6px; }
.auth-page-sub { color: #9a9aad; font-size: 13.5px; margin: 0 0 24px; line-height: 1.5; }
.auth-form-card { background: #1c1c26; border: 1px solid #2a2a36; border-radius: 14px; padding: 24px; }
.auth-form-card-title { font-weight: 700; font-size: 15px; margin-bottom: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.auth-field label { font-size: 13px; color: #9a9aad; font-weight: 600; }
.auth-field input {
  background: #14141c; border: 1px solid #33333f; color: #f1f1f5;
  border-radius: 10px; padding: 10px 14px; font-size: 16px;
}
.auth-field input:focus { outline: none; border-color: #6c4dff; }
.auth-hint { font-size: 12.5px; color: #666672; margin: -10px 0 16px; line-height: 1.5; }
.auth-submit {
  width: 100%; background: #6c4dff; border: none; color: #fff;
  border-radius: 999px; padding: 13px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.auth-submit:hover { background: #7d61ff; }
.auth-submit:disabled { opacity: 0.7; cursor: default; }
.auth-success { color: #3ddc84; font-size: 14px; line-height: 1.6; }
.auth-form-links { margin-top: 16px; font-size: 13px; color: #9a9aad; text-align: center; }
.auth-form-links a { color: #a78bfa; text-decoration: none; }
.auth-form-links a:hover { text-decoration: underline; }

.win-banner {
  background: linear-gradient(90deg, #3d2b0f, #1c1c26);
  border: 1px solid #d4a03d;
  border-radius: 14px;
  padding: 16px 20px;
  font-weight: 700;
  color: #ffcf7a;
}

/* ===== Mobile ===== */
@media (max-width: 760px) {
  .top { padding: 12px 16px; }
  .brand-net { font-size: 16px; }
  .top-nav { border-right: none; padding-right: 0; }
  .top-right { width: 100%; justify-content: space-between; }

  .layout {
    flex-direction: column;
    padding: 14px 14px 40px;
    gap: 14px;
  }
  .sidebar { width: 100%; }

  .card { padding: 14px 16px; }

  .round-card .theme-title { font-size: 19px; }
  .timer { width: 50px; height: 50px; font-size: 15px; border-width: 3px; }

  .slot { min-width: calc(50% - 5px); flex: none; }
  .recap-chip { min-width: calc(50% - 5px); flex: none; }

  .feed-list { height: 300px; }

  .auth-dropdown { width: min(220px, calc(100vw - 32px)); }

  .ranking-panel-inner, .ranking-page, .rules-page, .auth-page { padding-left: 14px; padding-right: 14px; }
  .rules-step { padding: 14px; gap: 12px; }
  .ranking-columns { gap: 14px; }
  .ranking-card { min-width: 100%; }
  .tab { padding: 7px 14px; font-size: 13px; }

  .modal-card { padding: 18px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .modal-btn { flex: 1; min-width: 100px; }

  .site-footer { padding: 16px 16px 26px; line-height: 1.6; }
}

@media (max-width: 420px) {
  .round-card .theme-title { font-size: 17px; }
  .slot, .recap-chip { min-width: 100%; }
}
