:root {
  --fundo: #120a26;
  --fundo2: #1c1238;
  --cartao: rgba(255, 255, 255, .06);
  --cartao-solido: #221647;
  --borda: rgba(255, 255, 255, .12);
  --texto: #f6f2ff;
  --suave: #b4a8dc;
  --amarelo: #ffd23f;
  --rosa: #ff4f8b;
  --verde: #3ddc97;
  --azul: #5ab0ff;
  --vermelho: #ff5a5a;
  --raio: 22px;
  --raio-p: 14px;
  --titulo: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --corpo: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --largura-chat: 360px;
  --sombra: 0 20px 50px rgba(0, 0, 0, .35);
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--corpo);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Fundo com bolhas de cor desfocadas */
.fundo-bolhas { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.fundo-bolhas span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; animation: flutuar 18s ease-in-out infinite alternate; }
.fundo-bolhas span:nth-child(1) { width: 380px; height: 380px; background: #6b3cff; top: -120px; left: -100px; }
.fundo-bolhas span:nth-child(2) { width: 320px; height: 320px; background: var(--rosa); bottom: -120px; right: -80px; animation-delay: -6s; opacity: .3; }
.fundo-bolhas span:nth-child(3) { width: 260px; height: 260px; background: #1fb5a8; top: 40%; left: 55%; animation-delay: -12s; opacity: .22; }
@keyframes flutuar { to { transform: translate(40px, 30px) scale(1.1); } }

body.ocupado { cursor: progress; }
body.ocupado .btn { opacity: .8; }

#layout { min-height: 100vh; min-height: 100dvh; position: relative; z-index: 1; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 96px);
}

.tela { display: flex; flex-direction: column; gap: 14px; animation: entrar .25s ease-out; }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } }
.centro-tela { min-height: 70vh; align-items: center; justify-content: center; text-align: center; }
.centro { text-align: center; }

h1, h2, h3 { margin: 0; font-family: var(--titulo); }
h2 { font-size: 24px; margin-top: 8px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--suave); margin-bottom: 10px; font-family: var(--corpo); font-weight: 700; }
p { margin: 6px 0; line-height: 1.45; }
.mini { font-size: 13px; color: var(--suave); display: block; line-height: 1.35; }
.mini.inline { display: inline; }

/* ----- Logo / início ----- */
.logo { text-align: center; margin: 18px 0 6px; }
.logo-icone {
  width: 92px; height: 92px; margin: 0 auto 16px;
  border-radius: 28px; background: linear-gradient(140deg, #ffe27a, var(--amarelo) 55%, #ffb21f);
  color: var(--fundo); font-family: var(--titulo);
  font-size: 64px; font-weight: 800; line-height: 92px;
  transform: rotate(-8deg);
  box-shadow: 0 14px 40px rgba(255, 210, 63, .35), inset 0 -6px 0 rgba(0, 0, 0, .12);
  animation: balancar 4s ease-in-out infinite;
}
@keyframes balancar { 50% { transform: rotate(6deg) translateY(-4px); } }
.logo h1 { font-size: clamp(38px, 10vw, 52px); line-height: .98; font-weight: 800; letter-spacing: -.03em; }
.sub { color: var(--suave); }
.topo-inicio { display: flex; justify-content: space-between; align-items: center; }
.chip-perfil {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--cartao); border: 1px solid var(--borda); color: var(--texto);
  border-radius: 999px; padding: 4px 14px 4px 4px; font: inherit; font-weight: 600; font-size: 14px;
}
.ou { text-align: center; color: var(--suave); font-size: 14px; margin: 2px 0; }
.links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.aviso { background: var(--cartao); border: 1px solid var(--borda); padding: 12px 14px; border-radius: var(--raio-p); text-align: center; }
.erro { color: var(--vermelho); }

/* ----- Campos ----- */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-size: 14px; color: var(--suave); font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--texto);
  background: rgba(0, 0, 0, .25); border: 1.5px solid var(--borda);
  border-radius: var(--raio-p); padding: 14px; width: 100%;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--amarelo); box-shadow: 0 0 0 4px rgba(255, 210, 63, .15); }
textarea { resize: vertical; line-height: 1.4; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--suave) 50%), linear-gradient(135deg, var(--suave) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
select option, select optgroup { background: var(--cartao-solido); color: var(--texto); }
.linha { display: flex; gap: 10px; }
.cresce { flex: 1; }
.input-codigo { text-transform: uppercase; letter-spacing: .35em; text-align: center; font-weight: 800; font-size: 22px; font-family: var(--titulo); }

/* ----- Botões ----- */
.btn {
  font: inherit; font-weight: 700; color: var(--texto);
  background: rgba(255, 255, 255, .08); border: 1.5px solid var(--borda);
  border-radius: var(--raio-p); padding: 14px 18px; cursor: pointer;
  transition: transform .08s ease, background .2s, box-shadow .2s;
  touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primario { background: linear-gradient(180deg, #ffe066, var(--amarelo)); border-color: transparent; color: #1a1033; box-shadow: 0 8px 24px rgba(255, 210, 63, .25); }
.btn.escuro { background: #1a1033; border-color: #1a1033; color: var(--amarelo); }
.btn.grande { font-size: 18px; padding: 17px; width: 100%; }
.btn.pequeno { font-size: 14px; padding: 8px 12px; border-radius: 10px; }
.btn.fantasma { background: transparent; }
.btn.link { background: transparent; border: none; color: var(--suave); text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
.btn.perigo { border-color: rgba(255, 90, 90, .6); color: var(--vermelho); background: transparent; }
.btn.google { background: #fff; color: #1f1f1f; border-color: #fff; }
.btn.google .g { font-weight: 800; font-size: 20px; background: linear-gradient(90deg, #4285f4, #ea4335, #fbbc05, #34a853); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ----- Cartões ----- */
.cartao {
  background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; flex-direction: column; gap: 10px;
}
.cartao > h3 { margin-bottom: 0; }
.cartao.vidro { background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)); box-shadow: var(--sombra); }
.cartao.centro { align-items: center; }
.grade-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }

.cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cab-centro { font-weight: 700; color: var(--suave); font-size: 15px; }
.codigo-sala { font-weight: 800; font-size: 22px; letter-spacing: .15em; font-family: var(--titulo); }
.codigo-grande { font-size: clamp(48px, 14vw, 68px); font-weight: 800; letter-spacing: .18em; color: var(--amarelo); font-family: var(--titulo); line-height: 1; margin: 4px 0 8px; text-shadow: 0 6px 30px rgba(255, 210, 63, .35); }

/* ----- Avatares ----- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: #1a1033; font-size: 15px; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .25);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.mini-av { width: 24px; height: 24px; font-size: 11px; border-width: 1px; }
.avatar.mini-av.vazio { visibility: hidden; }
.avatar.grande-m { width: 54px; height: 54px; font-size: 22px; }
.avatar.grande { width: 84px; height: 84px; font-size: 34px; margin: 0 auto; }

.jogadores, .placar { list-style: none; margin: 0; padding: 0; }
.jogadores li, .placar li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--borda);
}
.jogadores li:last-child, .placar li:last-child { border-bottom: none; }
.quem { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.quem > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.pos { width: 18px; color: var(--suave); font-weight: 700; font-size: 14px; }
.jogadores li.destaque { color: var(--amarelo); font-weight: 700; }
.placar li.eu b, .placar li.eu .quem { color: var(--amarelo); }
.pontos { color: var(--suave); font-weight: 700; white-space: nowrap; }
.pontos.ganhou { color: var(--verde); }

.espera { text-align: center; color: var(--suave); padding: 10px; }
.dica { background: rgba(255, 210, 63, .08); border: 1px dashed rgba(255, 210, 63, .6); border-radius: var(--raio-p); padding: 12px 14px; font-size: 14px; line-height: 1.45; }

/* ----- Modos ----- */
.modos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modo {
  font: inherit; color: var(--texto); text-align: left; cursor: pointer;
  background: rgba(0, 0, 0, .2); border: 1.5px solid var(--borda); border-radius: var(--raio-p);
  padding: 12px; display: flex; flex-direction: column; gap: 3px;
}
.modo:disabled { cursor: default; }
.modo.ativo { border-color: var(--amarelo); background: rgba(255, 210, 63, .1); }
.modo:not(.ativo):disabled { opacity: .5; }
.modo-icone { font-size: 24px; }

/* ----- Rodada ----- */
.info-rodada { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--suave); flex-wrap: wrap; }
.progresso { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; margin-top: -6px; }
.progresso span { display: block; height: 100%; background: linear-gradient(90deg, var(--rosa), var(--amarelo)); border-radius: 99px; transition: width .4s; }

.vez {
  background: var(--cartao); border: 1.5px solid var(--borda); border-radius: var(--raio);
  padding: 20px 18px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.vez > * { width: 100%; }
.vez .avatar { width: auto; }
.vez-titulo { font-family: var(--titulo); font-size: 28px; font-weight: 800; line-height: 1.05; letter-spacing: -.01em; }
blockquote { margin: 8px 0; font-size: 21px; font-weight: 700; line-height: 1.3; font-family: var(--titulo); }
.vez.sua-vez, .modal.sua-vez {
  background: linear-gradient(160deg, #ffe066, var(--amarelo) 60%, #ffbf2e);
  color: #1a1033; border-color: transparent;
  animation: pulsar 1.6s ease-in-out infinite;
}
.vez.sua-vez .mini, .modal.sua-vez .mini, .modal.sua-vez .campo > span { color: #4a3a12; }
.modal.sua-vez textarea { background: rgba(255, 255, 255, .7); color: #1a1033; border-color: rgba(26, 16, 51, .25); }
.modal.sua-vez .btn:not(.escuro):not(.link) { background: rgba(26, 16, 51, .1); color: #1a1033; border-color: rgba(26, 16, 51, .25); }
.modal.sua-vez .btn.link { color: #4a3a12; }
.vez.te-perguntam { border-color: var(--rosa); }
.vez.te-perguntam .vez-titulo { color: var(--rosa); }

@keyframes pulsar {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 63, .5); }
  50% { box-shadow: 0 0 0 14px rgba(255, 210, 63, 0); }
}

.duelo { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.duelo-pessoa { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 15px; max-width: 120px; text-align: center; }
.duelo-seta { font-size: 13px; color: var(--suave); }
.modal.sua-vez .duelo-seta { color: #4a3a12; }

.carta {
  font: inherit; color: var(--texto); width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-radius: var(--raio); padding: 22px 16px; cursor: pointer;
  border: 1.5px dashed rgba(255, 255, 255, .25); background: var(--cartao);
}
.carta strong { font-size: clamp(26px, 8vw, 34px); line-height: 1.1; font-family: var(--titulo); }
.carta-icone { font-size: 40px; }
.carta.dentro { border: 1.5px solid var(--verde); background: rgba(61, 220, 151, .1); }
.carta.dentro strong { color: var(--verde); }
.carta.fora { border: 1.5px solid var(--rosa); background: rgba(255, 79, 139, .1); }
.carta.fora strong { color: var(--rosa); }
.lembrete { font: inherit; font-size: 14px; background: rgba(26, 16, 51, .08); border: 1px dashed rgba(26, 16, 51, .3); color: inherit; border-radius: 10px; padding: 8px 10px; cursor: pointer; }

.palavras { display: flex; flex-wrap: wrap; gap: 8px; }
.palavra { background: rgba(255, 255, 255, .07); border: 1px solid var(--borda); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 500; }
.palavra.secreta { background: var(--verde); border-color: var(--verde); color: #10261c; font-weight: 800; }

.grade-opcoes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.btn.opcao { padding: 14px 10px; font-size: 15px; flex-direction: column; gap: 6px; min-height: 64px; text-align: center; }
.btn.opcao.marcado { background: var(--rosa); border-color: var(--rosa); box-shadow: 0 8px 24px rgba(255, 79, 139, .35); }

.revelacao { text-align: center; align-items: center; }
.palavra-revelada { font-size: clamp(32px, 10vw, 44px); font-weight: 800; color: var(--amarelo); font-family: var(--titulo); line-height: 1.05; }

/* ----- Respostas da rodada ----- */
.respostas summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.respostas summary::-webkit-details-marker { display: none; }
.respostas summary::after { content: "▾"; color: var(--suave); transition: transform .2s; }
.respostas:not([open]) summary::after { transform: rotate(-90deg); }
.respostas summary h3 { margin: 0; }
.qa { border-top: 1px solid var(--borda); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.qa-quem { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--suave); flex-wrap: wrap; }
.qa-pergunta { font-weight: 600; }
.qa-resposta { background: rgba(90, 176, 255, .12); border-left: 3px solid var(--azul); padding: 8px 10px; border-radius: 0 10px 10px 0; font-weight: 600; }

/* ----- Modal da vez (modo online) ----- */
.modal-fundo {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(8, 4, 20, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px 12px calc(env(safe-area-inset-bottom) + 12px);
  animation: aparecer .2s ease-out;
}
@keyframes aparecer { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--cartao-solido); border: 1px solid var(--borda); border-radius: 26px;
  padding: 18px; box-shadow: var(--sombra);
  display: flex; flex-direction: column; gap: 12px; text-align: center;
  animation: subir .28s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes subir { from { transform: translateY(40px); opacity: 0; } }
.modal .campo { text-align: left; }
.modal.respondido { border-color: var(--azul); }
.modal-topo { display: flex; justify-content: space-between; align-items: center; }
.resposta-grande {
  font-family: var(--titulo); font-size: 24px; font-weight: 800; line-height: 1.2;
  background: rgba(90, 176, 255, .15); border: 1.5px solid var(--azul); border-radius: 18px; padding: 16px;
  animation: subir .3s ease-out;
}
.barra-tempo { height: 5px; background: rgba(255, 255, 255, .1); border-radius: 99px; overflow: hidden; }
.barra-tempo span { display: block; height: 100%; width: 100%; background: var(--azul); transform-origin: left; animation: tempo 5s linear forwards; }
@keyframes tempo { to { transform: scaleX(0); } }
.digitando { color: var(--suave); font-size: 16px; }
.pontinhos { display: inline-flex; gap: 3px; margin-left: 4px; }
.pontinhos i { width: 5px; height: 5px; border-radius: 50%; background: var(--suave); animation: pulo 1s infinite; }
.pontinhos i:nth-child(2) { animation-delay: .15s; }
.pontinhos i:nth-child(3) { animation-delay: .3s; }
@keyframes pulo { 50% { transform: translateY(-4px); opacity: .4; } }
.pilula-modal {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 35;
  bottom: calc(env(safe-area-inset-bottom) + 16px); max-width: calc(100vw - 110px);
  font: inherit; font-weight: 600; font-size: 14px; color: #1a1033; cursor: pointer;
  background: var(--amarelo); border: none; border-radius: 999px; padding: 12px 18px;
  box-shadow: var(--sombra); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pilula-modal .mini { color: #4a3a12; }
/* no celular, deixa espaço para o botão do chat não cobrir o modal */
body.com-chat.na-sala .modal-fundo { padding-bottom: calc(env(safe-area-inset-bottom) + 84px); }

/* ----- Perfil ----- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: rgba(0, 0, 0, .2); border-radius: var(--raio-p); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--titulo); font-size: 28px; color: var(--amarelo); }
.stat span { font-size: 13px; color: var(--suave); line-height: 1.3; }

.regras ol, .regras ul { padding-left: 20px; margin: 0 0 6px; line-height: 1.5; }
.regras li { margin-bottom: 6px; }

/* ----- Categorias ----- */
.item-cat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--borda); }
.item-cat:last-child { border-bottom: none; }
.item-cat .acoes { display: flex; gap: 6px; flex-shrink: 0; }

/* ----- Chat ----- */
.chat { display: none; }
body.com-chat.na-sala .chat {
  display: flex; flex-direction: column;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: min(78vh, 640px); height: min(78dvh, 640px);
  background: var(--cartao-solido); border-top: 1px solid var(--borda);
  border-radius: 24px 24px 0 0; box-shadow: 0 -20px 50px rgba(0, 0, 0, .45);
  transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .9, .3, 1);
}
body.com-chat.na-sala.chat-aberto .chat { transform: translateY(0); }
.chat-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 16px 10px; border-bottom: 1px solid var(--borda); }
.chat-lista { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.chat-vazio { margin: auto; }
.msg { display: flex; align-items: flex-end; gap: 6px; max-width: 85%; margin-top: 6px; }
.msg.seguida { margin-top: 0; }
.msg.minha { align-self: flex-end; flex-direction: row-reverse; }
.bolha { background: rgba(255, 255, 255, .08); border-radius: 16px 16px 16px 4px; padding: 7px 11px; display: flex; flex-direction: column; min-width: 60px; }
.msg.minha .bolha { background: var(--amarelo); color: #1a1033; border-radius: 16px 16px 4px 16px; }
.msg-nome { font-size: 12px; font-weight: 700; color: var(--azul); }
.msg-texto { font-size: 15px; line-height: 1.35; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-hora { font-size: 10px; opacity: .6; align-self: flex-end; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px); border-top: 1px solid var(--borda); }
.chat-form input { padding: 12px 14px; border-radius: 999px; }
.chat-form .btn { border-radius: 999px; width: 48px; padding: 0; flex-shrink: 0; }

.chat-botao {
  position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 44;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(160deg, var(--rosa), #c2286a); color: #fff; font-size: 26px;
  box-shadow: 0 10px 30px rgba(255, 79, 139, .45);
}
.chat-botao[hidden] { display: none; }
.badge {
  position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 99px; background: var(--amarelo); color: #1a1033; font: 800 12px/22px var(--corpo);
}
.badge[hidden] { display: none; }
body.chat-aberto .chat-botao { display: none; }

/* ----- Flash de "sua vez" ----- */
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: var(--amarelo); z-index: 100; }
#flash.ativo { animation: piscar 1.4s ease-out; }
#flash.leve { background: var(--rosa); animation: piscar-leve .6s ease-out; }
@keyframes piscar {
  0% { opacity: .9; } 15% { opacity: 0; } 30% { opacity: .9; } 45% { opacity: 0; } 60% { opacity: .9; } 100% { opacity: 0; }
}
@keyframes piscar-leve { 0% { opacity: .45; } 100% { opacity: 0; } }

/* ----- Toast ----- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 16px);
  transform: translateX(-50%); z-index: 110;
  background: var(--texto); color: #1a1033; font-weight: 600;
  padding: 12px 18px; border-radius: var(--raio-p); max-width: 90vw; text-align: center;
  box-shadow: var(--sombra); animation: descer .25s ease-out;
  transition: opacity .4s;
}
@keyframes descer { from { transform: translate(-50%, -10px); opacity: 0; } }
.toast.sai { opacity: 0; }

.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid var(--borda); border-top-color: var(--amarelo);
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ===================== Responsivo ===================== */
@media (max-width: 360px) {
  .grade-opcoes, .modos, .stats { grid-template-columns: 1fr; }
  .vez-titulo { font-size: 24px; }
}

@media (min-width: 640px) {
  body { font-size: 17px; }
  #app { max-width: 640px; padding-left: 24px; padding-right: 24px; }
  .grade-2 { grid-template-columns: 1fr 1fr; }
  .grade-opcoes { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .modal-fundo { align-items: center; }
}

/* Computador: chat vira uma coluna fixa ao lado do jogo */
@media (min-width: 900px) {
  body.com-chat.na-sala #layout { display: grid; grid-template-columns: 1fr var(--largura-chat); }
  body.com-chat.na-sala #app { max-width: 720px; width: 100%; }
  body.com-chat.na-sala .chat {
    position: sticky; top: 0; left: auto; right: auto; bottom: auto;
    height: 100vh; height: 100dvh; transform: none; border-radius: 0;
    border-top: none; border-left: 1px solid var(--borda); box-shadow: none;
    background: rgba(28, 18, 56, .85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  body.com-chat.na-sala .chat-fechar, body.com-chat.na-sala .chat-botao { display: none; }
  body.com-chat.na-sala .modal-fundo { right: var(--largura-chat); padding-bottom: 12px; }
  body.com-chat.na-sala .pilula-modal { left: calc((100% - var(--largura-chat)) / 2); }
  #app { padding-bottom: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .barra-tempo span { animation: none; }
}
