/* ==========================================================================
   Academe · Galaxy Design System
   ========================================================================== */

:root {
  --roxo: #7333ff;
  --roxo-claro: #a880ff;
  --roxo-escuro: #4a1fb8;
  --space: #0d0b14;
  --space-2: #14101f;
  --space-3: #1c1730;
  --linha: rgba(255, 255, 255, 0.09);
  --linha-forte: rgba(255, 255, 255, 0.18);
  --texto: #f3f0ff;
  --texto-2: #b9b2d4;
  --texto-3: #7d769a;
  --ok: #24d17e;
  --erro: #ff4d6d;
  --time1: #7333ff;
  --time2: #17d3e0;
  --ouro: #ffc861;
  --raio: 20px;
  --raio-sm: 13px;
  --sombra: 0 18px 50px rgba(0, 0, 0, 0.55);
  --glow: 0 0 40px rgba(115, 51, 255, 0.45);
  --fonte: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--space);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.55;
  overscroll-behavior-y: none;
}

body {
  background-image:
    radial-gradient(1000px 620px at 12% -8%, rgba(115, 51, 255, 0.32), transparent 62%),
    radial-gradient(760px 520px at 92% 4%, rgba(23, 211, 224, 0.14), transparent 60%),
    radial-gradient(900px 700px at 50% 108%, rgba(115, 51, 255, 0.2), transparent 65%);
  background-attachment: fixed;
}

/* estrelinhas */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 22%, rgba(255,255,255,.55), transparent),
    radial-gradient(1.2px 1.2px at 72% 12%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.6px 1.6px at 42% 68%, rgba(255,255,255,.35), transparent),
    radial-gradient(1.2px 1.2px at 88% 62%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.1px 1.1px at 8% 78%, rgba(255,255,255,.3), transparent),
    radial-gradient(1.5px 1.5px at 60% 90%, rgba(255,255,255,.3), transparent);
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--roxo-claro); }

/* ---------------------------------------------------------------- layout */

.app {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.tela { display: none; flex-direction: column; flex: 1; animation: entra .45s cubic-bezier(.2,.8,.3,1); }
.tela.ativa { display: flex; }

@keyframes entra {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.card {
  background: linear-gradient(160deg, rgba(255,255,255,.075), rgba(255,255,255,.028));
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--sombra);
}

.marca {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  font-size: 11.5px; color: var(--texto-2);
}
.marca .logo {
  height: 26px; width: auto; display: block;
  filter: drop-shadow(0 0 22px rgba(137, 44, 221, .45));
}
.marca .selo-marca {
  padding-left: 10px; border-left: 1px solid var(--linha-forte);
}

/* logo pequeno no fim do jogo e no cartão de chamada */
.marca-fim { display: flex; justify-content: center; padding-top: 20px; }
.marca-fim .logo { height: 22px; width: auto; display: block; opacity: .9; }
.cta .logo-cta {
  width: 40px; height: 40px; display: block; margin: 0 auto 12px;
  border-radius: 11px; box-shadow: 0 8px 26px rgba(137, 44, 221, .45);
}

/* ---------------------------------------------------------------- botões */

.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: var(--fonte); font-weight: 650; font-size: 16.5px;
  padding: 16px 22px; border-radius: 15px;
  background: linear-gradient(135deg, var(--roxo), #9a5bff);
  color: #fff; width: 100%;
  box-shadow: 0 10px 26px rgba(115,51,255,.42);
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost {
  background: rgba(255,255,255,.06); border: 1px solid var(--linha-forte);
  box-shadow: none; color: var(--texto);
}
.btn.sm { padding: 11px 16px; font-size: 14.5px; width: auto; }

/* ---------------------------------------------------------------- intro */

.hero-tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  background: rgba(115,51,255,.18); border: 1px solid rgba(115,51,255,.42);
  font-size: 12.5px; font-weight: 600; color: var(--roxo-claro);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(38px, 12vw, 58px);
  background: linear-gradient(120deg, #fff 18%, var(--roxo-claro) 62%, #17d3e0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 12px;
}
.hero .sub { color: var(--texto-2); font-size: 17px; margin-bottom: 18px; }
.hero .corpo { color: var(--texto-2); font-size: 15.5px; white-space: pre-line; }

.hero { margin-top: auto; padding-top: 18px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 22px 0 26px; margin-top: auto; }
.mini {
  text-align: center; padding: 13px 6px; border-radius: var(--raio-sm);
  background: rgba(255,255,255,.045); border: 1px solid var(--linha);
}
.mini b { display: block; font-size: 20px; color: #fff; }
.mini span { font-size: 11px; color: var(--texto-3); text-transform: uppercase; letter-spacing: .07em; }

/* ---------------------------------------------------------------- setup */

.modo { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 22px; }
.modo button {
  cursor: pointer; text-align: left; padding: 17px 15px; border-radius: var(--raio-sm);
  background: rgba(255,255,255,.045); border: 1.5px solid var(--linha);
  color: var(--texto); font-family: var(--fonte); transition: .2s;
}
.modo button .ico { font-size: 24px; display: block; margin-bottom: 6px; }
.modo button b { display: block; font-size: 15.5px; }
.modo button small { color: var(--texto-3); font-size: 12.5px; line-height: 1.3; display: block; }
.modo button[aria-pressed="true"] {
  border-color: var(--roxo); background: rgba(115,51,255,.16);
  box-shadow: 0 0 0 4px rgba(115,51,255,.13);
}

.campo { margin-bottom: 14px; }
.campo label {
  display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--texto-3); margin-bottom: 7px; font-weight: 600;
}
.campo input, .campo select, .campo textarea {
  width: 100%; padding: 15px 16px; font-size: 16px; font-family: var(--fonte);
  background: rgba(255,255,255,.05); border: 1.5px solid var(--linha);
  border-radius: var(--raio-sm); color: var(--texto); outline: none; transition: .2s;
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
  border-color: var(--roxo); box-shadow: 0 0 0 4px rgba(115,51,255,.15);
}
.campo.t2 input:focus { border-color: var(--time2); box-shadow: 0 0 0 4px rgba(23,211,224,.15); }

/* ---------------------------------------------------------------- rodada */

.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rodada-num { font-size: 12px; color: var(--texto-3); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }

.barra { height: 5px; background: rgba(255,255,255,.09); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.barra i { display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--roxo), var(--time2)); transition: width .45s cubic-bezier(.2,.8,.3,1); }

.placar { display: flex; gap: 8px; margin-bottom: 14px; }
.placar .p {
  flex: 1; padding: 9px 12px; border-radius: 13px; border: 1px solid var(--linha);
  background: rgba(255,255,255,.04); display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  transition: .3s;
}
.placar .p .nome { font-size: 12.5px; color: var(--texto-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placar .p .pts { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.placar .p.t1 { border-color: rgba(115,51,255,.5); }
.placar .p.t1 .pts { color: var(--roxo-claro); }
.placar .p.t2 { border-color: rgba(23,211,224,.5); }
.placar .p.t2 .pts { color: var(--time2); }
.placar .p.vez { background: rgba(115,51,255,.2); box-shadow: 0 0 0 2px rgba(115,51,255,.35); }
.placar .p.t2.vez { background: rgba(23,211,224,.16); box-shadow: 0 0 0 2px rgba(23,211,224,.35); }

.midia {
  position: relative; border-radius: var(--raio); overflow: hidden;
  background: #08070d; border: 1px solid var(--linha); margin-bottom: 14px;
  min-height: 190px; display: flex; align-items: center; justify-content: center;
  flex: 1 1 auto;
}
.midia img, .midia video { width: 100%; display: block; max-height: 100%; object-fit: contain; background: #08070d; }
.midia audio { width: 100%; padding: 24px 16px; }
.midia.carregando { min-height: 220px; }
.carregando-midia {
  display: flex; align-items: center; gap: 11px; color: var(--texto-3); font-size: 13.5px;
}
.carregando-midia span {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--roxo-claro); animation: gira .75s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
.midia img.ampliavel { cursor: zoom-in; }
.inspecionar {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; cursor: pointer;
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 7px 11px;
  background: rgba(8,7,13,.78); color: #fff; font: 650 12px var(--fonte);
  backdrop-filter: blur(9px); box-shadow: 0 5px 18px rgba(0,0,0,.28);
}
#qr, .qr-box > div { display: flex; justify-content: center; padding: 14px; background: #fff; border-radius: 12px; margin-top: 10px; }

.midia .texto-desafio {
  padding: 22px 20px; font-size: 16.5px; line-height: 1.62; white-space: pre-line;
  color: #e9e4ff; font-family: Georgia, 'Times New Roman', serif; max-height: 100%; overflow: auto;
}
.midia .pendente {
  padding: 34px 22px; text-align: center; color: var(--texto-3); font-size: 14px;
}
.midia .pendente b { display: block; color: var(--ouro); margin-bottom: 6px; font-size: 15px; }

.pergunta { font-size: 21px; font-weight: 700; margin-bottom: 16px; letter-spacing: -.015em; }

.timer { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.timer .anel { width: 42px; height: 42px; flex: none; }
.timer .anel circle { fill: none; stroke-width: 5; }
.timer .anel .bg { stroke: rgba(255,255,255,.1); }
.timer .anel .fg { stroke: var(--roxo); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer .anel.urgente .fg { stroke: var(--erro); }
.timer .txt { font-size: 13px; color: var(--texto-3); }
.timer .txt b { color: var(--texto); }

.escolhas { display: grid; gap: 11px; margin-top: auto; padding-top: 8px; }
.escolha {
  cursor: pointer; padding: 19px 20px; border-radius: 16px; font-size: 17.5px; font-weight: 650;
  font-family: var(--fonte); color: var(--texto); text-align: left;
  background: rgba(255,255,255,.055); border: 1.5px solid var(--linha-forte);
  display: flex; align-items: center; gap: 13px; transition: .16s;
}
.escolha .emoji { font-size: 21px; }
.escolha:active { transform: scale(.98); }
.escolha.sel { border-color: var(--roxo); background: rgba(115,51,255,.2); }

/* passa o aparelho */
.passa {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; text-align: center; padding: 30px;
  background: rgba(8,7,13,.93); backdrop-filter: blur(20px);
}
.passa.ativa { display: flex; animation: entra .3s; }
.passa .ico { font-size: 62px; margin-bottom: 14px; animation: balanca 1.6s ease-in-out infinite; }
@keyframes balanca { 0%,100%{transform:translateX(-9px) rotate(-5deg)} 50%{transform:translateX(9px) rotate(5deg)} }
.passa h2 { font-size: 27px; margin-bottom: 9px; }
.passa p { color: var(--texto-2); max-width: 330px; margin: 0 auto 24px; }
.passa .btn { max-width: 330px; }

/* inspeção em tela cheia */
.zoom {
  position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 58px 14px 24px;
  background: rgba(5,4,10,.96); backdrop-filter: blur(16px);
}
.zoom.ativa { display: flex; animation: entra .2s; }
.zoom img {
  max-width: min(1100px, 100%); max-height: calc(100dvh - 120px); object-fit: contain;
  border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.7);
}
.zoom button {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 29px; line-height: 1;
  color: #fff; background: rgba(255,255,255,.1); border: 1px solid var(--linha-forte);
}
.zoom p { margin: 0; color: var(--texto-3); font-size: 12px; text-align: center; }

/* ---------------------------------------------------------------- revelação */

.veredito { text-align: center; padding: 26px 20px 20px; }
.veredito .selo {
  width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  animation: pop .5s cubic-bezier(.2,1.5,.4,1);
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.veredito .selo.certo { background: rgba(36,209,126,.18); border: 2px solid var(--ok); }
.veredito .selo.errado { background: rgba(255,77,109,.15); border: 2px solid var(--erro); }
.veredito .selo.dividido { background: rgba(255,200,97,.15); border: 2px solid var(--ouro); }
.veredito h2 { font-size: 27px; margin-bottom: 6px; }
.veredito .era { color: var(--texto-2); font-size: 15.5px; }
.veredito .era b { color: #fff; }

.ganhos { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin: 15px 0 4px; }
.ganho {
  padding: 7px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 700;
  background: rgba(255,255,255,.06); border: 1px solid var(--linha-forte);
  animation: sobe .55s cubic-bezier(.2,.9,.3,1);
}
@keyframes sobe { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.ganho.t1 { color: var(--roxo-claro); border-color: rgba(115,51,255,.55); }
.ganho.t2 { color: var(--time2); border-color: rgba(23,211,224,.55); }
.ganho.zero { color: var(--texto-3); }

.explica { padding: 20px; }
.explica h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .11em;
  color: var(--roxo-claro); margin-bottom: 10px;
}
.explica .txt { white-space: pre-line; color: var(--texto-2); font-size: 15.3px; line-height: 1.68; }
.explica .txt b, .explica .txt strong { color: #fff; }
.dica {
  margin-top: 16px; padding: 13px 15px; border-radius: 13px;
  background: rgba(255,200,97,.09); border: 1px solid rgba(255,200,97,.32);
  font-size: 14px; color: #ffe4b0;
}
.dica b { color: var(--ouro); }
.fonte { margin-top: 12px; font-size: 12.5px; color: var(--texto-3); }

/* ---------------------------------------------------------------- final */

.final-topo { text-align: center; padding: 26px 18px 8px; }
.final-topo .medalha { font-size: 62px; margin-bottom: 8px; animation: pop .6s cubic-bezier(.2,1.5,.4,1); }
.final-topo h1 { font-size: 30px; margin-bottom: 6px; }
.final-topo .patente {
  display: inline-block; padding: 6px 15px; border-radius: 99px; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, rgba(255,200,97,.2), rgba(115,51,255,.2));
  border: 1px solid rgba(255,200,97,.4); color: var(--ouro); margin-bottom: 4px;
}
.pontuacao {
  font-size: 60px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em;
  background: linear-gradient(120deg, #fff, var(--roxo-claro));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-align: center; line-height: 1.05;
}
.pontuacao-sub { text-align: center; color: var(--texto-3); font-size: 13.5px; margin-bottom: 6px; }

.duelo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 18px; }
.duelo .lado { text-align: center; }
.duelo .lado .n { font-size: 14px; color: var(--texto-2); font-weight: 600; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duelo .lado .s { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.duelo .lado.t1 .s { color: var(--roxo-claro); }
.duelo .lado.t2 .s { color: var(--time2); }
.duelo .lado .a { font-size: 12px; color: var(--texto-3); }
.duelo .x { color: var(--texto-3); font-weight: 700; }
.duelo .lado.vence { position: relative; }
.duelo .lado.vence::after { content: '👑'; position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 20px; }

.ranking { padding: 18px; }
.ranking h3, .recap h3, .cta h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .11em; color: var(--roxo-claro); margin-bottom: 12px;
}
.ranking ol { list-style: none; margin: 0; padding: 0; }
.ranking li {
  display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--linha); font-size: 14.5px;
}
.ranking li:last-child { border-bottom: 0; }
.ranking li .pos { width: 24px; font-weight: 800; color: var(--texto-3); font-variant-numeric: tabular-nums; }
.ranking li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking li .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking li.eu { color: #fff; }
.ranking li.eu .nm::after { content: ' · você'; color: var(--roxo-claro); font-size: 12px; }

.recap { padding: 18px; }
.recap ul { list-style: none; margin: 0; padding: 0; }
.recap li { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--linha); font-size: 14px; color: var(--texto-2); }
.recap li:last-child { border-bottom: 0; }
.recap li .mk { flex: none; font-size: 15px; width: 20px; text-align: center; }

.cta { padding: 20px; text-align: center; background: linear-gradient(160deg, rgba(115,51,255,.2), rgba(115,51,255,.05)); }
.cta h2 { font-size: 20px; margin-bottom: 8px; }
.cta p { color: var(--texto-2); font-size: 14.5px; }

.acoes { display: grid; gap: 10px; margin-top: 16px; }

.rodape { text-align: center; color: var(--texto-3); font-size: 11.5px; padding: 22px 0 8px; }
.marca-fim + .rodape { padding-top: 8px; }

/* ---------------------------------------------------------------- utilidades */

.pilha > * + * { margin-top: 14px; }
.centro { text-align: center; }
.p16 { padding: 18px; }
.mt-auto { margin-top: auto; }
.oculto { display: none !important; }

#confete { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

.som {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; z-index: 20;
  background: rgba(255,255,255,.07); border: 1px solid var(--linha); color: var(--texto-2);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px;
}

@media (min-width: 720px) {
  .app { padding-top: 34px; padding-bottom: 34px; }
  .hero h1 { font-size: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
