:root {
  --bg: #0b1020;
  --bg-2: #131a30;
  --painel: #1a2340;
  --painel-2: #222d52;
  --borda: #2c3a63;
  --texto: #e8edff;
  --texto-suave: #9aa6cc;
  --acento: #58e1c4;
  --acento-2: #6aa6ff;
  --erro: #ff6b81;
  --ok: #58e1c4;
  --aviso: #ffcf6b;
  --raio: 16px;
  --sombra: 0 20px 60px rgba(0, 0, 0, 0.45);
  --fonte: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--fonte);
  color: var(--texto);
  background:
    radial-gradient(1100px 600px at 15% -10%, #1b2954 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 10%, #16324a 0%, transparent 50%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.palco {
  width: 100%;
  max-width: 620px;
}

/* ---- Telas ---- */
.tela { display: none; }
.tela--ativa {
  display: block;
  animation: aparecer 0.35s ease both;
}
@keyframes aparecer {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Tela inicial ---- */
#tela-inicio { text-align: center; }

.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.logo__tile {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  font-size: 52px;
  font-weight: 800;
  color: #06241f;
  border-radius: 20px;
  background: linear-gradient(150deg, var(--acento), var(--acento-2));
  box-shadow: var(--sombra), inset 0 0 0 4px rgba(255, 255, 255, 0.15);
  transform: rotate(-4deg);
}

.titulo {
  font-size: clamp(28px, 7vw, 44px);
  margin: 4px 0 10px;
  letter-spacing: -0.5px;
}
.subtitulo {
  color: var(--texto-suave);
  font-size: 16px;
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto 22px;
}

.regras {
  list-style: none;
  padding: 0;
  margin: 0 auto 28px;
  max-width: 420px;
  text-align: left;
}
.regras li {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: 12px;
  font-size: 14.5px;
  position: relative;
  padding-left: 40px;
}
.regras li::before {
  content: "›";
  position: absolute;
  left: 16px;
  color: var(--acento);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.4;
}
.regras em { color: var(--acento); font-style: normal; font-weight: 600; }

.status {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--texto-suave);
}
.status--erro { color: var(--erro); }

/* ---- Botões ---- */
.botao {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #06241f;
  background: linear-gradient(150deg, var(--acento), var(--acento-2));
  border: none;
  border-radius: 12px;
  padding: 13px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 8px 24px rgba(88, 225, 196, 0.18);
}
.botao:hover { filter: brightness(1.06); transform: translateY(-1px); }
.botao:active { transform: translateY(0); }
.botao:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
  box-shadow: none;
  transform: none;
}
.botao--grande { padding: 16px 40px; font-size: 18px; }
.botao--secundario {
  background: var(--painel-2);
  color: var(--texto);
  box-shadow: none;
  border: 1px solid var(--borda);
}
.botao--secundario:hover { background: #2a376a; }

/* ---- Placar ---- */
.placar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.placar__item {
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.placar__item--destaque {
  background: linear-gradient(150deg, rgba(88, 225, 196, 0.16), rgba(106, 166, 255, 0.16));
  border-color: rgba(88, 225, 196, 0.4);
}
.placar__rotulo {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--texto-suave);
}
.placar__valor {
  display: block;
  font-size: 24px;
  font-weight: 800;
  margin-top: 2px;
}
.placar__item--destaque .placar__valor { color: var(--acento); }

/* ---- Progresso ---- */
.progresso { margin-bottom: 16px; }
.progresso__texto {
  display: block;
  font-size: 13px;
  color: var(--texto-suave);
  margin-bottom: 6px;
}
.progresso__barra {
  height: 8px;
  background: var(--painel);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--borda);
}
.progresso__preenchido {
  height: 100%;
  width: 16.66%;
  background: linear-gradient(90deg, var(--acento), var(--acento-2));
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---- Pistas ---- */
.pistas {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pista {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 14px 16px;
  line-height: 1.5;
}
.pista--nova {
  animation: revelar 0.4s ease both;
  border-color: rgba(88, 225, 196, 0.5);
}
@keyframes revelar {
  from { opacity: 0; transform: translateY(-6px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pista__num {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #06241f;
  background: linear-gradient(150deg, var(--acento), var(--acento-2));
  border-radius: 8px;
}
.pista__texto { flex: 1; font-size: 15.5px; }

/* ---- Palpite ---- */
.palpite {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.palpite__entrada {
  flex: 1;
  font-family: inherit;
  font-size: 16px;
  color: var(--texto);
  background: var(--bg-2);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.palpite__entrada::placeholder { color: var(--texto-suave); }
.palpite__entrada:focus {
  border-color: var(--acento);
  box-shadow: 0 0 0 3px rgba(88, 225, 196, 0.18);
}
.palpite__entrada:disabled { opacity: 0.5; }

.acoes { margin-bottom: 14px; }
.acoes .botao { width: 100%; }

/* ---- Tentativas já feitas (histórico da rodada) ---- */
.tentativas-feitas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tentativas-feitas__rotulo {
  font-size: 13px;
  color: var(--texto-suave);
  font-weight: 600;
}
.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--erro);
  background: rgba(255, 107, 129, 0.12);
  border: 1px solid rgba(255, 107, 129, 0.35);
  border-radius: 999px;
  padding: 4px 11px 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  animation: chipEntra 0.25s ease both;
}
.chip::before { content: "✕"; font-size: 11px; opacity: 0.8; }
@keyframes chipEntra {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Feedback ---- */
.feedback {
  min-height: 22px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
}
.feedback--erro { color: var(--erro); }
.feedback--neutro { color: var(--aviso); }
.feedback--ok { color: var(--ok); }

/* ---- Tela de fim ---- */
#tela-fim { text-align: center; }
.emblema {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 8px;
  animation: pop 0.4s ease both;
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.fim__titulo { font-size: 30px; margin: 0 0 20px; }

.resposta-card {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 16px;
  max-width: 420px;
  margin: 0 auto 18px;
}
.resposta-card__tile {
  flex: 0 0 84px;
  height: 84px;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--acento), var(--acento-2));
  color: #06241f;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}
.resposta-card__numero {
  position: absolute;
  top: 7px;
  left: 9px;
  font-size: 13px;
  font-weight: 700;
}
.resposta-card__simbolo { font-size: 38px; font-weight: 800; }
.resposta-card__info { display: flex; flex-direction: column; gap: 4px; }
.resposta-card__nome { font-size: 22px; font-weight: 800; }
.resposta-card__detalhe { font-size: 14px; color: var(--texto-suave); }

.fim__pontos { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.fim__pontos--ganho { color: var(--acento); }
.fim__sessao { color: var(--texto-suave); margin: 0 0 24px; }

/* ---- Rodapé ---- */
.rodape {
  margin-top: 26px;
  text-align: center;
}
.rodape__link {
  color: var(--texto-suave);
  font-size: 13px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.rodape__link:hover { opacity: 1; color: var(--acento); }

/* ---- Responsivo ---- */
@media (max-width: 480px) {
  .placar { grid-template-columns: repeat(2, 1fr); }
  .palpite { flex-direction: column; }
  .palpite .botao { width: 100%; }
  .botao--grande { width: 100%; }
}
