/* =========================================================
   Detetive da Turma — estilos
   ========================================================= */
:root {
  --azul: #3b82f6;      --azul-esc: #1d4ed8;
  --verde: #22c55e;     --verde-esc: #15803d;
  --roxo: #8b5cf6;      --roxo-esc: #6d28d9;
  --laranja: #f97316;   --laranja-esc: #c2410c;
  --rosa: #ec4899;
  --vermelho: #ef4444;  --vermelho-esc: #b91c1c;
  --cinza: #e2e8f0;     --cinza-esc: #94a3b8;
  --texto: #1e293b;     --texto-suave: #475569;
  --card: rgba(255, 255, 255, 0.94);
  --raio: 24px;
  --sombra: 0 18px 45px rgba(30, 41, 59, 0.18);
}

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

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

body {
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
  color: var(--texto);
  background: linear-gradient(135deg, #7ee8fa 0%, #a8edea 15%, #fed6e3 35%, #ffd86f 60%, #a1e3a0 80%, #8fd3f4 100%);
  background-size: 400% 400%;
  animation: gradiente 18s ease infinite;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@keyframes gradiente {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

button { font-family: inherit; cursor: pointer; }
.oculto { display: none !important; }
.centro { text-align: center; margin-top: 18px; }
.txt-verde { color: var(--verde-esc); }
.txt-vermelho { color: var(--vermelho-esc); }

/* ---------- Bolhas decorativas ---------- */
.fundo-bolhas { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fundo-bolhas span {
  position: absolute; bottom: -160px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  animation: subir 22s linear infinite;
}
.fundo-bolhas span:nth-child(1) { left: 6%;  width: 90px;  height: 90px;  animation-duration: 19s; }
.fundo-bolhas span:nth-child(2) { left: 22%; width: 40px;  height: 40px;  animation-duration: 14s; animation-delay: 3s; }
.fundo-bolhas span:nth-child(3) { left: 45%; width: 130px; height: 130px; animation-duration: 26s; animation-delay: 6s; }
.fundo-bolhas span:nth-child(4) { left: 65%; width: 60px;  height: 60px;  animation-duration: 17s; animation-delay: 1s; }
.fundo-bolhas span:nth-child(5) { left: 82%; width: 100px; height: 100px; animation-duration: 23s; animation-delay: 9s; }
.fundo-bolhas span:nth-child(6) { left: 93%; width: 35px;  height: 35px;  animation-duration: 15s; animation-delay: 5s; }
@keyframes subir {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-120vh) scale(1.3); opacity: 0; }
}

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

/* ---------- Barra do topo ---------- */
.barra-topo {
  position: fixed; top: 14px; right: 16px; z-index: 50;
  display: flex; gap: 10px;
}
.btn-topo {
  height: 48px; min-width: 48px; padding: 0 16px;
  border: none; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 0 rgba(30, 41, 59, 0.18), 0 8px 18px rgba(30, 41, 59, 0.12);
  font-size: 1.05rem; font-weight: 800; color: var(--roxo-esc);
  transition: transform .12s, box-shadow .12s;
}
.btn-topo:hover { transform: translateY(-2px); }
.btn-topo:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(30, 41, 59, 0.18); }
.btn-som { font-size: 1.4rem; padding: 0; width: 48px; }

/* ---------- Estrutura de telas ---------- */
.palco {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 20px 40px;
}
.tela { display: none; width: 100%; max-width: 1000px; }
.tela.ativa { display: block; animation: entrarTela .45s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes entrarTela {
  from { opacity: 0; transform: translateY(26px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.card {
  background: var(--card);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  border: 3px solid rgba(255, 255, 255, 0.85);
  padding: 32px;
  backdrop-filter: blur(6px);
}

/* ---------- Botões ---------- */
.btn {
  --cor: var(--azul); --cor-esc: var(--azul-esc);
  border: none; border-radius: 18px;
  padding: 14px 26px;
  font-size: 1.1rem; font-weight: 800; letter-spacing: .3px;
  color: #fff; background: var(--cor);
  box-shadow: 0 6px 0 var(--cor-esc), 0 12px 22px rgba(30, 41, 59, 0.18);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
  user-select: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-2px); box-shadow: 0 8px 0 var(--cor-esc), 0 16px 26px rgba(30, 41, 59, 0.2); }
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--cor-esc), 0 4px 8px rgba(30, 41, 59, 0.2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .btn-topo:focus-visible, .opcao:focus-visible { outline: 4px solid rgba(59, 130, 246, .45); outline-offset: 3px; }
.btn-grande { font-size: 1.5rem; padding: 20px 34px; border-radius: 22px; }
.btn-medio { font-size: 1.15rem; padding: 15px 26px; }
.btn-verde { --cor: var(--verde); --cor-esc: var(--verde-esc); }
.btn-azul { --cor: var(--azul); --cor-esc: var(--azul-esc); }
.btn-roxo { --cor: var(--roxo); --cor-esc: var(--roxo-esc); }
.btn-laranja { --cor: var(--laranja); --cor-esc: var(--laranja-esc); }
.btn-cinza { --cor: #f1f5f9; --cor-esc: var(--cinza-esc); color: var(--texto); }
.link-discreto {
  background: none; border: none; margin-top: 18px;
  color: var(--texto-suave); font-weight: 700; font-size: .95rem; text-decoration: underline;
}
.link-discreto:hover { color: var(--azul-esc); }

/* ---------- Home ---------- */
.home-conteudo { text-align: center; }
.logo-lupa {
  font-size: 6.5rem; line-height: 1;
  filter: drop-shadow(0 12px 18px rgba(30, 41, 59, .25));
  animation: flutuar 3.2s ease-in-out infinite;
}
@keyframes flutuar {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-16px) rotate(4deg); }
}
.titulo-jogo {
  font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 900; line-height: 1.05;
  color: #fff; margin: 10px 0 8px;
  text-shadow: 0 4px 0 var(--roxo-esc), 0 10px 25px rgba(76, 29, 149, .35);
  animation: flutuar 4s ease-in-out infinite .4s;
}
.titulo-jogo span { color: #fde047; }
.subtitulo { font-size: 1.25rem; font-weight: 700; color: var(--texto); opacity: .85; margin-bottom: 14px; }
.home-saudacao {
  display: inline-block; margin-bottom: 8px; padding: 8px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); font-weight: 800; color: var(--verde-esc);
}
.menu-home {
  display: flex; flex-direction: column; gap: 20px;
  max-width: 380px; margin: 26px auto 0;
}

/* ---------- Barras de progresso ---------- */
.barra { height: 14px; background: rgba(255, 255, 255, .7); border-radius: 999px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .08); }
.barra-preenchida { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #34d399, #3b82f6); transition: width .5s ease; }
.barra-rosa { background: linear-gradient(90deg, #f59e0b, #ec4899); }

/* ---------- Cadastro ---------- */
.card-cadastro { max-width: 680px; margin: 0 auto; }
.cadastro-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.etiqueta { font-weight: 900; font-size: 1.15rem; color: var(--roxo-esc); }
.cad-contador { font-weight: 800; color: var(--texto-suave); background: #f1f5f9; padding: 6px 14px; border-radius: 999px; }
.aviso-info {
  margin-top: 16px; padding: 12px 16px; border-radius: 14px;
  background: #ecfdf5; border: 2px solid #a7f3d0; color: var(--verde-esc); font-weight: 700;
}
.pergunta-box { text-align: center; padding: 30px 0 10px; }
.pergunta-box.animar { animation: deslizar .35s ease; }
@keyframes deslizar { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.pergunta-emoji { font-size: 3.6rem; margin-bottom: 10px; animation: pulo 2.4s ease-in-out infinite; }
@keyframes pulo { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.pergunta-texto { display: block; font-size: 1.6rem; font-weight: 900; margin-bottom: 22px; line-height: 1.25; }
.campo {
  width: 100%; padding: 18px 20px;
  font-family: inherit; font-size: 1.3rem; font-weight: 700; color: var(--texto);
  border: 3px solid var(--cinza); border-radius: 18px; background: #fff;
  outline: none; transition: border-color .2s, box-shadow .2s; text-align: center;
}
.campo:focus { border-color: var(--azul); box-shadow: 0 0 0 5px rgba(59, 130, 246, .18); }
.campo.invalido { border-color: var(--vermelho); animation: tremer .4s; }
.erro-campo { color: var(--vermelho-esc); font-weight: 800; margin-top: 10px; }
.cadastro-botoes { display: flex; justify-content: space-between; gap: 14px; margin-top: 26px; }
.cadastro-botoes .btn { flex: 1; }

/* ---------- Memorização ---------- */
.painel-topo { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.cronometro-box {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 20px; padding: 10px 22px; box-shadow: var(--sombra);
}
.cronometro-rotulo { font-weight: 800; color: var(--texto-suave); }
.cronometro { font-size: 2.3rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--azul-esc); }
.cronometro.urgente { color: var(--vermelho); animation: pulo .8s ease-in-out infinite; }
.info-turma { display: flex; gap: 10px; flex-wrap: wrap; }
.pilula { background: var(--roxo); color: #fff; font-weight: 800; padding: 10px 18px; border-radius: 999px; box-shadow: 0 4px 0 var(--roxo-esc); }
.pilula-clara { background: rgba(255, 255, 255, .85); color: var(--texto-suave); box-shadow: none; }
.pilula.piscar { animation: destaque 1.2s ease; }
@keyframes destaque { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.15); background: var(--verde); } }
.barra-tempo { margin-bottom: 22px; height: 12px; }

.mem-area { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.btn-seta { --cor: #fff; --cor-esc: var(--cinza-esc); color: var(--azul-esc); padding: 18px 16px; white-space: nowrap; }
.card-colega { padding: 26px 30px; min-height: 380px; }
.card-colega.animar { animation: deslizar .35s ease; }
.colega-cabecalho { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 3px dashed var(--cinza); }
.avatar {
  width: 78px; height: 78px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 900; color: #fff;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .15);
}
.colega-nome { font-size: 2.3rem; font-weight: 900; line-height: 1.1; color: var(--roxo-esc); word-break: break-word; }
.colega-sub { font-weight: 700; color: var(--texto-suave); }
.fatos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; list-style: none; }
.fato { display: flex; gap: 10px; align-items: flex-start; background: #f8fafc; border-radius: 14px; padding: 10px 12px; font-size: 1.02rem; line-height: 1.35; }
.fato-emoji { font-size: 1.3rem; flex-shrink: 0; }
.fato strong { color: var(--azul-esc); }
.mem-posicao { text-align: center; margin-top: 12px; font-weight: 800; color: var(--texto-suave); }
.card-aguardando { text-align: center; max-width: 620px; margin: 10px auto; }
.card-aguardando h2 { font-size: 1.7rem; margin: 10px 0; }
.card-aguardando p { color: var(--texto-suave); font-weight: 600; margin-bottom: 16px; }
.aguardando-icone { font-size: 4rem; animation: girar 2.5s ease-in-out infinite; display: inline-block; }
@keyframes girar { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(180deg); } }

/* ---------- Jogo ---------- */
.placar-jogo { display: flex; justify-content: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.placar-item {
  background: var(--card); border-radius: 20px; padding: 10px 26px; min-width: 140px;
  text-align: center; box-shadow: var(--sombra);
}
.placar-rotulo { display: block; font-size: .85rem; font-weight: 800; text-transform: uppercase; color: var(--texto-suave); letter-spacing: 1px; }
.placar-valor { font-size: 2rem; font-weight: 900; color: var(--azul-esc); font-variant-numeric: tabular-nums; }
.placar-pontos .placar-valor { color: var(--laranja-esc); }
.placar-valor.subiu { animation: subiu .6s ease; }
.placar-valor.desceu { animation: desceu .6s ease; }
@keyframes subiu { 40% { transform: scale(1.4); color: var(--verde); } }
@keyframes desceu { 40% { transform: scale(.8); color: var(--vermelho); } }

.area-dado { text-align: center; padding: 30px 0 10px; }
.cena-dado { width: 150px; height: 150px; margin: 30px auto 40px; perspective: 700px; position: relative; animation: flutuarDado 3s ease-in-out infinite; }
.cena-dado.pulando { animation: pularDado 2s ease; }
@keyframes flutuarDado { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pularDado {
  0% { transform: translateY(0); } 15% { transform: translateY(-90px); } 35% { transform: translateY(0); }
  50% { transform: translateY(-45px); } 65% { transform: translateY(0); } 78% { transform: translateY(-14px); } 100% { transform: translateY(0); }
}
.sombra-dado { position: absolute; left: 15%; right: 15%; bottom: -34px; height: 18px; border-radius: 50%; background: rgba(30, 41, 59, .22); filter: blur(5px); }
.dado {
  width: 150px; height: 150px; position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(25deg);
  transition: transform 2s cubic-bezier(.15, .75, .25, 1);
}
.face {
  position: absolute; inset: 0;
  border-radius: 24px;
  border: 4px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, .18);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  grid-template-areas: "a b c" "d e f" "g h i";
  padding: 18px;
  backface-visibility: hidden;
}
.pip { width: 26px; height: 26px; border-radius: 50%; background: #fff; align-self: center; justify-self: center; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); }
.face-1 { background: linear-gradient(135deg, #f87171, #dc2626); transform: rotateY(0deg) translateZ(75px); }
.face-2 { background: linear-gradient(135deg, #60a5fa, #2563eb); transform: rotateY(90deg) translateZ(75px); }
.face-3 { background: linear-gradient(135deg, #4ade80, #16a34a); transform: rotateX(90deg) translateZ(75px); }
.face-4 { background: linear-gradient(135deg, #facc15, #ca8a04); transform: rotateX(-90deg) translateZ(75px); }
.face-5 { background: linear-gradient(135deg, #c084fc, #7c3aed); transform: rotateY(-90deg) translateZ(75px); }
.face-6 { background: linear-gradient(135deg, #fb923c, #ea580c); transform: rotateY(180deg) translateZ(75px); }
.face-1 .pip { grid-area: e; }
.face-2 .pip:nth-child(1) { grid-area: a; } .face-2 .pip:nth-child(2) { grid-area: i; }
.face-3 .pip:nth-child(1) { grid-area: a; } .face-3 .pip:nth-child(2) { grid-area: e; } .face-3 .pip:nth-child(3) { grid-area: i; }
.face-4 .pip:nth-child(1) { grid-area: a; } .face-4 .pip:nth-child(2) { grid-area: c; } .face-4 .pip:nth-child(3) { grid-area: g; } .face-4 .pip:nth-child(4) { grid-area: i; }
.face-5 .pip:nth-child(1) { grid-area: a; } .face-5 .pip:nth-child(2) { grid-area: c; } .face-5 .pip:nth-child(3) { grid-area: e; } .face-5 .pip:nth-child(4) { grid-area: g; } .face-5 .pip:nth-child(5) { grid-area: i; }
.face-6 .pip:nth-child(1) { grid-area: a; } .face-6 .pip:nth-child(2) { grid-area: c; } .face-6 .pip:nth-child(3) { grid-area: d; } .face-6 .pip:nth-child(4) { grid-area: f; } .face-6 .pip:nth-child(5) { grid-area: g; } .face-6 .pip:nth-child(6) { grid-area: i; }
.dica-dado { font-size: 1.3rem; font-weight: 800; color: var(--texto); margin-bottom: 22px; min-height: 1.6em; }

.card-pergunta { max-width: 820px; margin: 18px auto 0; text-align: center; animation: entrarTela .45s cubic-bezier(.2, .9, .3, 1.2); }
.sorteado-intro { font-size: 1.15rem; font-weight: 800; color: var(--texto-suave); }
.sorteado-nome {
  font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; color: var(--roxo-esc);
  margin: 4px 0 14px; word-break: break-word;
  animation: revelar .6s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes revelar { from { transform: scale(.3) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.pergunta-jogo { font-size: 1.45rem; font-weight: 800; margin-bottom: 22px; line-height: 1.3; }
.opcoes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.opcao {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: 18px;
  border: 3px solid var(--cinza); background: #fff;
  font-size: 1.15rem; font-weight: 700; color: var(--texto);
  box-shadow: 0 5px 0 var(--cinza);
  transition: transform .12s, box-shadow .12s, border-color .2s, background .2s;
}
.opcao:hover:not(:disabled) { border-color: var(--azul); transform: translateY(-2px); box-shadow: 0 7px 0 #bfdbfe; }
.opcao:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--cinza); }
.opcao:disabled { cursor: default; }
.letra {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--azul); color: #fff; font-weight: 900; font-size: 1.2rem;
}
.opcao:nth-child(2) .letra { background: var(--roxo); }
.opcao:nth-child(3) .letra { background: var(--laranja); }
.opcao:nth-child(4) .letra { background: var(--rosa); }
.opcao-texto { word-break: break-word; }
.opcao.certa { border-color: var(--verde); background: #dcfce7; box-shadow: 0 5px 0 var(--verde-esc); animation: pulo .5s ease; }
.opcao.certa .letra { background: var(--verde); }
.opcao.errada { border-color: var(--vermelho); background: #fee2e2; box-shadow: 0 5px 0 var(--vermelho-esc); animation: tremer .45s ease; }
.opcao.errada .letra { background: var(--vermelho); }
.opcao.apagada { opacity: .5; }
@keyframes tremer {
  0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(6px); }
}
.card-pergunta.tremer { animation: tremer .45s ease; }
.feedback { margin-top: 20px; font-size: 1.4rem; font-weight: 900; padding: 12px; border-radius: 16px; animation: revelar .4s ease; }
.feedback.ok { background: #dcfce7; color: var(--verde-esc); }
.feedback.erro { background: #fee2e2; color: var(--vermelho-esc); }

/* ---------- Resultado ---------- */
.card-resultado { max-width: 760px; margin: 0 auto; text-align: center; }
.medalha { font-size: 7rem; line-height: 1; display: inline-block; animation: medalha 1s cubic-bezier(.2, 1.5, .4, 1), balanco 2.8s ease-in-out 1s infinite; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .2)); }
@keyframes medalha { from { transform: scale(0) rotate(-180deg); } to { transform: scale(1) rotate(0); } }
@keyframes balanco { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.05); } }
.res-titulo { font-size: 2.3rem; font-weight: 900; color: var(--roxo-esc); margin: 10px 0 4px; }
.res-mensagem { font-size: 1.15rem; font-weight: 700; color: var(--texto-suave); margin-bottom: 22px; }
.res-placares { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.res-placar { background: #f8fafc; border-radius: 18px; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.res-placar-destaque { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.res-rotulo { font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--texto-suave); }
.res-valor { font-size: 2.6rem; font-weight: 900; color: var(--texto); font-variant-numeric: tabular-nums; }
.res-placar-destaque .res-valor { color: var(--laranja-esc); font-size: 3.2rem; }
.res-detalhe { font-size: .9rem; font-weight: 700; color: var(--texto-suave); }
.selo-recorde {
  margin: 4px auto 18px; padding: 12px 18px; border-radius: 16px;
  background: linear-gradient(90deg, #a78bfa, #ec4899); color: #fff; font-weight: 900; font-size: 1.1rem;
  animation: pulo 1.2s ease-in-out infinite;
}
.botoes-linha { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Ranking ---------- */
.card-ranking { max-width: 720px; margin: 0 auto; text-align: center; }
.cerebro-box { position: relative; width: 170px; height: 150px; margin: 0 auto; }
.cerebro { font-size: 7.5rem; line-height: 150px; position: relative; z-index: 1; animation: pulo 2.2s ease-in-out infinite; filter: drop-shadow(0 10px 14px rgba(236, 72, 153, .35)); }
.cerebro-brilho { position: absolute; inset: 15px; border-radius: 50%; background: radial-gradient(circle, rgba(253, 224, 71, .85), rgba(253, 224, 71, 0) 70%); animation: brilho 2.2s ease-in-out infinite; }
@keyframes brilho { 0%, 100% { transform: scale(.85); opacity: .6; } 50% { transform: scale(1.25); opacity: 1; } }
.faisca { position: absolute; font-size: 1.6rem; animation: faisca 2.4s ease-in-out infinite; z-index: 2; }
.f1 { top: 0; left: 6px; } .f2 { top: 10px; right: 0; animation-delay: .6s; }
.f3 { bottom: 6px; left: 0; animation-delay: 1.2s; } .f4 { bottom: 0; right: 10px; animation-delay: 1.8s; }
@keyframes faisca { 0%, 100% { transform: scale(.6) rotate(0); opacity: .3; } 50% { transform: scale(1.2) rotate(20deg); opacity: 1; } }
.titulo-ranking { font-size: 2.5rem; font-weight: 900; color: var(--roxo-esc); }
.sub-ranking { font-weight: 700; color: var(--texto-suave); margin-bottom: 20px; }
.lista-ranking { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px; margin-bottom: 14px; }
.item-ranking {
  display: flex; align-items: center; gap: 14px;
  background: #f8fafc; border-radius: 16px; padding: 10px 18px;
  font-weight: 800; font-size: 1.15rem;
  animation: deslizar .4s ease both;
}
.item-ranking.eu { outline: 3px solid var(--azul); background: #eff6ff; }
.pos { width: 46px; text-align: center; font-size: 1.3rem; font-weight: 900; color: var(--texto-suave); flex-shrink: 0; }
.item-ranking.top .pos { font-size: 2rem; }
.item-ranking.ouro { background: linear-gradient(90deg, #fef3c7, #fde68a); }
.item-ranking.prata { background: linear-gradient(90deg, #f1f5f9, #e2e8f0); }
.item-ranking.bronze { background: linear-gradient(90deg, #ffedd5, #fed7aa); }
.nome-rank { flex: 1; word-break: break-word; }
.pts-rank { font-weight: 900; color: var(--laranja-esc); white-space: nowrap; }
.ranking-vazio { text-align: center; padding: 24px; color: var(--texto-suave); font-weight: 700; background: #f8fafc; border-radius: 16px; }

/* ---------- Modal ---------- */
.modal-fundo { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: var(--raio); padding: 30px; max-width: 600px; width: 100%; box-shadow: var(--sombra); text-align: center; animation: entrarTela .4s cubic-bezier(.2, .9, .3, 1.2); }
.modal h2 { font-size: 2rem; font-weight: 900; color: var(--azul-esc); margin-bottom: 18px; }
.passos { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.passos li { display: flex; gap: 14px; align-items: center; background: #f8fafc; border-radius: 14px; padding: 12px 16px; font-size: 1.08rem; line-height: 1.4; }
.passos li span { font-size: 1.8rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80;
  background: var(--texto); color: #fff; font-weight: 800; padding: 14px 24px; border-radius: 999px;
  box-shadow: var(--sombra); animation: entrarTela .3s ease; max-width: 90vw; text-align: center;
}
.toast.erro { background: var(--vermelho-esc); }
.toast.ok { background: var(--verde-esc); }

/* ---------- Responsivo ---------- */
@media (max-width: 820px) {
  .mem-area { grid-template-columns: 1fr 1fr; }
  .card-colega { grid-column: 1 / -1; order: -1; }
  .fatos { grid-template-columns: 1fr; }
  .opcoes { grid-template-columns: 1fr; }
  .res-placares { grid-template-columns: 1fr; }
  .barra-topo .btn-topo span { display: none; }
}
@media (max-width: 520px) {
  .card { padding: 22px 18px; }
  .btn-grande { font-size: 1.25rem; padding: 16px 22px; }
  .colega-nome { font-size: 1.7rem; }
  .cronometro { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
