/* ====================================================================
   Quiz Copa 2026 — estilos (mobile-first)
   ==================================================================== */

:root {
  --azul: #0b1f3a;
  --azul-2: #12305c;
  --verde: #00b16a;
  --verde-2: #06d27e;
  --vermelho: #e0383e;
  --ouro: #f5b81f;
  --branco: #ffffff;
  --cinza: #9fb0c7;
  --cinza-claro: #e8eef6;
  --card: #16294a;
  --radius: 18px;
  --sombra: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Garante que o atributo [hidden] esconda mesmo elementos com display
   explícito (flex/grid), que de outra forma ignorariam o display:none padrão. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--azul);
  color: var(--branco);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background:
    radial-gradient(1200px 500px at 50% -10%, #1d3e74 0%, rgba(29, 62, 116, 0) 60%),
    var(--azul);
  min-height: 100dvh;
}

/* ---------- Bloqueio em desktop ---------- */
.desktop-block {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.db-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  max-width: 420px;
  box-shadow: var(--sombra);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.db-emoji { font-size: 64px; margin-bottom: 12px; }
.db-card h1 { margin-bottom: 16px; color: var(--verde-2); }
.db-card p { color: var(--cinza-claro); margin-bottom: 10px; line-height: 1.5; }

/* ---------- App / telas ---------- */
.app {
  max-width: 540px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  min-height: 100dvh;
}
.screen { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Marca / login ---------- */
.brand { text-align: center; margin: 28px 0 22px; }
.brand-trophy { font-size: 60px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); }
.brand h1 { font-size: 34px; letter-spacing: 0.5px; }
.brand h1 span { color: var(--ouro); }
.brand-sub { color: var(--cinza); letter-spacing: 3px; font-size: 13px; margin-top: 4px; text-transform: uppercase; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--sombra);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.card.no-pad { padding: 6px; overflow: hidden; }

.form h2 { margin-bottom: 6px; }
.form label {
  display: block;
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--cinza-claro);
}
.form input {
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0f2444;
  color: var(--branco);
  font-size: 16px;
}
.form input:focus { outline: 2px solid var(--verde); border-color: transparent; }

/* ---------- Botões ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 15px;
  margin-top: 18px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--verde) 0%, var(--verde-2) 100%); color: #04140c; }
.btn-ghost-full { background: transparent; color: var(--cinza-claro); border: 1px solid rgba(255,255,255,.15); margin-top: 10px; }
.btn-ghost {
  background: transparent; color: var(--cinza-claro);
  border: none; font-size: 15px; cursor: pointer; padding: 6px 4px;
}
.link-admin {
  display: block; width: 100%; margin-top: 22px;
  background: transparent; color: var(--cinza);
  border: 1px dashed rgba(255,255,255,.18); border-radius: 12px;
  padding: 12px; font-size: 14px; cursor: pointer;
}
.btn-circ {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--card); color: var(--branco);
  border: 1px solid rgba(255,255,255,.12); font-size: 24px; cursor: pointer;
}

.muted { color: var(--cinza); }
.small { font-size: 12px; }
.center { text-align: center; }
.erro { color: var(--vermelho); margin-top: 12px; font-size: 14px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 18px;
}
.topbar h2 { font-size: 20px; }

/* ---------- Menu ---------- */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--card); border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius); padding: 20px 16px; cursor: pointer;
  color: var(--branco); text-align: left; box-shadow: var(--sombra);
  font-size: 17px; font-weight: 700;
}
.tile:active { transform: scale(0.98); }
.tile small { font-weight: 400; color: var(--cinza); font-size: 12px; }
.tile-emoji { font-size: 30px; }
.tile-quiz { border-top: 3px solid var(--verde); }
.tile-fc { border-top: 3px solid var(--ouro); }
.tile-perfil { border-top: 3px solid #4aa3ff; }
.tile-sobre { border-top: 3px solid var(--vermelho); }

/* ---------- Quiz ---------- */
.quiz-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.placar { font-weight: 700; }
.barra { height: 8px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.barra-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--verde), var(--ouro)); transition: width 0.3s ease; }

.pergunta { font-size: 19px; font-weight: 700; line-height: 1.35; margin-bottom: 18px; }
.opcoes { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.opcao {
  width: 100%; text-align: left; padding: 15px 16px;
  border-radius: 13px; border: 1px solid rgba(255,255,255,.14);
  background: #0f2444; color: var(--branco); font-size: 16px; cursor: pointer;
  transition: background 0.15s ease;
}
.opcao:active { background: #163058; }
.opcao:disabled { cursor: default; opacity: 0.95; }
.opcao.certo { background: rgba(0,177,106,.22); border-color: var(--verde); }
.opcao.errado { background: rgba(224,56,62,.22); border-color: var(--vermelho); }

.feedback { margin-top: 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.feedback-ok { background: rgba(0,177,106,.15); border: 1px solid var(--verde); }
.feedback-erro { background: rgba(224,56,62,.15); border: 1px solid var(--vermelho); }

.quiz-fim { text-align: center; }
.quiz-fim-pct { font-size: 64px; font-weight: 800; color: var(--ouro); margin-bottom: 6px; }
.quiz-fim-msg { font-size: 18px; font-weight: 700; margin-bottom: 8px; }

/* ---------- Flashcards ---------- */
.flashcard { perspective: 1200px; margin: 8px 0 22px; cursor: pointer; }
.flashcard-inner {
  position: relative; width: 100%; min-height: 280px;
  transition: transform 0.5s; transform-style: preserve-3d;
}
.flashcard.virado .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius); padding: 28px 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; box-shadow: var(--sombra);
}
.flashcard-frente { background: linear-gradient(135deg, var(--azul-2), #1b407a); border: 1px solid rgba(255,255,255,.08); }
.flashcard-verso {
  background: linear-gradient(135deg, var(--verde), var(--verde-2));
  color: #04140c; transform: rotateY(180deg);
}
.flashcard-face p { font-size: 20px; font-weight: 700; line-height: 1.4; }
.fc-tag {
  position: absolute; top: 14px; left: 16px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.7;
}
.fc-dica { position: absolute; bottom: 14px; opacity: 0.6; font-size: 12px; }
.fc-controles { display: flex; align-items: center; justify-content: center; gap: 14px; }
.fc-controles .btn { margin-top: 0; flex: 1; max-width: 200px; }

/* ---------- Perfil ---------- */
.perfil-cabeca { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--verde), var(--ouro));
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat {
  background: var(--card); border-radius: 14px; padding: 14px 6px;
  text-align: center; border: 1px solid rgba(255,255,255,.06);
}
.stat span { display: block; font-size: 24px; font-weight: 800; }
.stat small { color: var(--cinza); font-size: 11px; }
.stat-ok span { color: var(--verde-2); }
.stat-erro span { color: var(--vermelho); }
.stat-best span { color: var(--ouro); }

.sec-titulo { margin: 22px 0 10px; font-size: 16px; }
.historico { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.historico li {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); padding: 12px 14px; border-radius: 12px;
  font-size: 13px; border: 1px solid rgba(255,255,255,.06);
}
.historico li span { color: var(--cinza); }
.historico li.vazio { justify-content: center; color: var(--cinza); }

/* ---------- Sobre ---------- */
.sobre-lista { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.sobre-lista dt { color: var(--ouro); font-weight: 700; font-size: 14px; }
.sobre-lista dd { color: var(--cinza-claro); font-size: 14px; }

/* ---------- Ranking / admin ---------- */
.ranking { width: 100%; border-collapse: collapse; font-size: 14px; }
.ranking th, .ranking td { padding: 12px 8px; text-align: center; }
.ranking thead th { color: var(--cinza); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid rgba(255,255,255,.1); }
.ranking tbody tr { border-bottom: 1px solid rgba(255,255,255,.05); }
.ranking .pos { font-size: 18px; width: 44px; }
.ranking .nome { text-align: left; font-weight: 700; }
.ranking .vazio { color: var(--cinza); padding: 22px; }
