/* Layout: a single phone-width column, chat-like; one deliberate dark world (night-shift monitor): warm pulse = human, cold cyan = machines */
/* Tokens (cores, fontes, raios) em tokens.css. */
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 40px;
}
#app { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--cold); outline-offset: 2px; }

/* Home */
.hero { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
.ecg { width: 100%; height: 64px; }
.ecg path { fill: none; stroke: var(--pulse); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(2.6rem, 13vw, 3.6rem); line-height: .92; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 em { font-style: normal; color: var(--pulse); }
.lede { color: var(--muted); margin: 0; font-size: 1.05rem; max-width: 36ch; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rules li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.rules b { font-family: var(--f-mono); font-size: .8rem; color: var(--bg); background: var(--cold); border-radius: 6px; height: 24px; display: grid; place-items: center; }
.status { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.dot.off { background: var(--warn); }

.btn { background: var(--pulse); color: var(--on-pulse); border: 0; border-radius: 14px; padding: 16px 20px; font-weight: 700; font-size: 1.05rem; width: 100%; transition: transform .1s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--fg); }
a.btn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
/* "Paga um café": símbolo oficial do Ko-fi (public/kofi.svg, do kit de marca do Ko-fi). */
a.btn.btn-kofi { display: flex; align-items: center; justify-content: center; gap: 10px; }
.kofi-link img { vertical-align: -2px; margin-right: 5px; }
.support-thanks { display: flex; align-items: center; gap: 12px; margin: 0; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; display: flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--fg); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.small { font-size: .82rem; color: var(--muted); margin: 0; }

/* Game header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* Sair da partida: discreto, no canto do cabeçalho da ronda e do ecrã de entrada. */
/* Com o ✕, o cabeçalho da ronda tem de caber numa linha: avatares um pouco mais pequenos, sem quebra. */
.top .round { white-space: nowrap; }
.top .daily-tag { display: block; color: var(--cold); }
.top .roster { flex-wrap: nowrap; gap: 4px; margin-left: auto; }
.top .roster .av { width: 26px; height: 26px; font-size: .72rem; }
.kofi-link { white-space: nowrap; }
.quit { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 1.5px solid var(--line); color: var(--muted); font-size: .85rem; line-height: 1; padding: 0; }
.quit:hover { color: var(--fg); border-color: var(--pulse); }
.top-actions { flex: none; display: flex; gap: 6px; }
.mute[aria-pressed="true"] { opacity: .7; }
.intro-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.intro-top .eyebrow { margin: 0; }
.round { font-family: var(--f-mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.round strong { color: var(--fg); }
.roster { display: flex; gap: 6px; flex-wrap: wrap; }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; font-size: .78rem; color: #15112A; flex: none; }
.av.out { opacity: .25; filter: grayscale(1); }
.av.me { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pulse); }

.card { background: var(--surface); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cold); margin: 0; }
.challenge { font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; line-height: 1.12; margin: 0; text-wrap: balance; }
.you-are { font-size: .9rem; color: var(--muted); margin: 0; }
.you-are strong { color: var(--pulse); }

textarea { width: 100%; min-height: 96px; resize: none; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; color: var(--fg); padding: 12px; font: inherit; }
.timer { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--cold); width: 100%; transition: width 1s linear, background .3s; }
.timer i.low { background: var(--pulse); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: .78rem; color: var(--muted); }

/* Chat feed */
.feed { display: flex; flex-direction: column; gap: 10px; }
.msg { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; animation: pop .35s ease-out both; }
.bubble { background: var(--surface); border-radius: 4px 14px 14px 14px; padding: 9px 12px; min-width: 0; overflow-wrap: anywhere; }
.bubble .who { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); display: block; margin-bottom: 2px; }
.msg.mine .bubble { background: color-mix(in srgb, var(--pulse) 18%, var(--surface)); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.votegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.vote { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; text-align: left; font-weight: 600; }
.vote:hover { border-color: var(--cold); }

.thinking { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 0; text-align: center; color: var(--muted); }
.beat { width: 54px; height: 54px; border-radius: 50%; background: var(--cold); animation: beat 1.1s ease-in-out infinite; }
/* Ecrã de entrada */
.intro { display: flex; flex-direction: column; gap: 14px; padding: 24px 0; min-height: 70vh; cursor: pointer; }
.intro-status { font-weight: 700; font-size: 1.2rem; margin: 0; }
.intro-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.intro-p { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 12px; padding: 8px 12px; font-weight: 600; animation: pop .3s ease-out both; }
.intro-p .small { margin-left: auto; color: var(--muted); font-weight: 400; }
.intro-reveal { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 1.1rem; padding-top: 8px; animation: pop .4s ease-out both; }
.intro-reveal p { margin: 0; }
.av.big { width: 64px; height: 64px; font-size: 1.6rem; }
.intro-skip { text-align: center; color: var(--muted); margin-top: auto; }
@keyframes beat { 0%,100% { transform: scale(.7); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

.votes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.votes li { background: var(--surface); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; animation: pop .35s ease-out both; }
.votes .line { font-weight: 600; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.votes .arrow { color: var(--muted); }
.votes .tgt-me { color: var(--pulse); }
.votes q { color: var(--muted); font-size: .92rem; }

.verdict { border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; animation: pop .4s ease-out both; }
.verdict h2 { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; line-height: 1.05; margin: 0; }
.verdict p { margin: 0; }
.verdict.safe { background: color-mix(in srgb, var(--cold) 16%, var(--surface)); }
.verdict.caught { background: color-mix(in srgb, var(--pulse) 26%, var(--surface)); }
.delayed { animation: pop .4s ease-out both; }

.grid-share { font-family: var(--f-mono); background: var(--surface-2); border-radius: 12px; padding: 14px; white-space: pre-wrap; margin: 0; font-size: .95rem; user-select: all; }
.notice { font-size: .82rem; color: var(--warn); margin: 0; }
.tip { font-size: .82rem; color: var(--muted); margin: 8px 0; padding-left: 10px; border-left: 2px solid var(--cold); }

/* Brand bar on every screen: the heartbeat never stops */
.brand { max-width: 460px; margin: 0 auto 14px; display: flex; align-items: center; gap: 10px; }
.brand canvas { width: 96px; height: 32px; flex: none; }
.brand .word { font-family: var(--f-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand .word em { font-style: normal; color: var(--pulse); }
.brand #status { margin-left: auto; min-width: 0; }
/* Roda das definições: só no início (onde está o palco). */
.gear { display: none; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: transparent; border: 1.5px solid var(--line); color: var(--muted); flex: none; }
.gear:hover { color: var(--fg); border-color: var(--cold); }
body:has(#app .stage) .gear { display: grid; }
/* Definições: escolhas em segmentos */
.set-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.set-opts button { width: 100%; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 600; color: var(--fg); }
.set-opts button[aria-checked="true"] { background: var(--tint-cold); border-color: var(--cold); }

/* Home stage: human vs machine, drawn live on canvas */
.stage { position: relative; border-radius: 22px; overflow: hidden; background:
  radial-gradient(110% 80% at 20% 45%, color-mix(in srgb, var(--pulse) 16%, transparent), transparent 62%),
  radial-gradient(110% 80% at 80% 45%, color-mix(in srgb, var(--cold) 13%, transparent), transparent 62%),
  var(--surface); }
.stage canvas { display: block; width: 100%; height: 270px; }
.stage .vs { position: absolute; left: 0; right: 0; top: 14px; margin: 0; text-align: center; font-family: var(--f-display); font-weight: 800; font-size: clamp(1.8rem, 9vw, 2.3rem); letter-spacing: -0.02em; line-height: 1; pointer-events: none; }
.vs .h { color: var(--pulse); } .vs .a { color: var(--cold); } .vs .q { color: var(--fg); }

.play { font-size: 1.25rem; padding: 18px; animation: glow 1.7s ease-in-out infinite; }
.play small { display: block; font-weight: 500; font-size: .8rem; opacity: .85; margin-top: 2px; }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pulse) 55%, transparent); }
  55% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--pulse) 0%, transparent); }
}

/* Modos: os jogáveis lado a lado (os futuros ficam numa linha por baixo). */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--surface); border: 1.5px solid transparent; border-radius: 16px; padding: 12px; color: var(--fg); width: 100%; min-width: 0; }
.mode-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.soon { margin: -6px 2px 0; }
.mode[aria-pressed="true"] { border-color: var(--pulse); background: color-mix(in srgb, var(--pulse) 9%, var(--surface)); }
.mode[aria-disabled="true"] { cursor: default; }
.mode[aria-disabled="true"] .ico, .mode[aria-disabled="true"] b { opacity: .6; }
.mode .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; font-size: .78rem; background: var(--surface-2); color: var(--cold); }
.mode[aria-pressed="true"] .ico { color: var(--pulse); }
.mode b { display: block; font-size: 1rem; }
.mode .d { display: block; color: var(--muted); font-size: .85rem; line-height: 1.3; }
.badge { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.on { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
details.how { background: var(--surface); border-radius: 16px; padding: 12px 14px; }
details.how summary { cursor: pointer; font-weight: 600; }
details.how .rules { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ecg path { stroke-dashoffset: 0; }
}
/* "Reduzir animações" nas definições. */
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; }
:root[data-motion="reduce"] .ecg path { stroke-dashoffset: 0; }

/* Ranking */
.rank-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; color: var(--fg); }
.rank-link b { display: block; }
.rank-link .d { display: block; color: var(--muted); font-size: .85rem; line-height: 1.3; }
.rank-link:hover { border-color: var(--cold); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { background: transparent; border: 0; border-radius: 9px; padding: 9px; font-weight: 600; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface-2); color: var(--fg); }
.hvm { display: flex; justify-content: space-between; font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; }
.hvm .h { color: var(--pulse); } .hvm .a { color: var(--cold); }
.hvm-bar { height: 12px; border-radius: 6px; background: var(--cold); overflow: hidden; }
.hvm-bar i { display: block; height: 100%; background: var(--pulse); }
.rks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rk { display: grid; grid-template-columns: 20px minmax(0, 1fr) 70px; grid-template-areas: "pos nm val" "pos bar bar"; gap: 4px 10px; align-items: center; }
.rk .pos { grid-area: pos; font-family: var(--f-mono); font-weight: 700; color: var(--cold); align-self: start; }
.rk .nm { grid-area: nm; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rk .nm small { display: inline-block; margin-left: 8px; font-family: var(--f-mono); font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.rk .val { grid-area: val; text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.rk .bar { grid-area: bar; position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); }
.rk .bar i { display: block; height: 100%; border-radius: 4px; background: var(--cold); }
.rk .bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); }
.rk.ref .nm, .rk.ref .val { color: var(--muted); }
.rk.ref .bar i { background: var(--muted); }
.rk.human .bar i { background: var(--pulse); }
.rk.human .nm, .rk.human .val { color: var(--pulse); }
.tbl { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; white-space: normal; }
.tbl th { font-family: var(--f-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
.lede .tag { display: block; color: var(--fg); font-weight: 700; margin-bottom: 2px; }
@media (max-width: 420px) { .brand canvas { width: 56px; } .status .lbl { display: none; } }
/* Ecrãs muito estreitos: os jogadores passam para uma segunda linha, por baixo da ronda e dos botões. */
@media (max-width: 379px) {
  .top { flex-wrap: wrap; row-gap: 8px; }
  .top .roster { order: 3; width: 100%; margin-left: 0; gap: 6px; }
  .top-actions { margin-left: auto; }
}
.hvm-bar.empty, .hvm-bar.empty i { background: var(--surface-2); }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--fg); }

/* Desafios */
.ch-card { background: color-mix(in srgb, var(--cold) 9%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cold) 35%, transparent); }
.ch-eyebrow { color: var(--cold); }
.seq { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seq span { min-width: 44px; height: 44px; padding: 0 10px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--surface-2); font-family: var(--f-mono); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.seq.padrao span { font-size: 1.5rem; font-family: var(--f-body); }
.seq .gap { background: transparent; border: 2px dashed var(--cold); color: var(--cold); }
input.val, input.why { width: 100%; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-md); color: var(--fg); padding: 12px; font: inherit; }
input.val { font-family: var(--f-mono); font-size: 1.3rem; font-weight: 700; }
input.val:focus-visible, input.why:focus-visible { outline: 2px solid var(--cold); outline-offset: 2px; }
.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.opt { height: 56px; border-radius: var(--r-md); background: var(--surface-2); border: 1.5px solid var(--line); font-size: 1.6rem; }
.opt[aria-pressed="true"] { border-color: var(--cold); background: color-mix(in srgb, var(--cold) 20%, var(--surface-2)); }
.big-word { font-family: var(--f-display); font-weight: 800; font-size: clamp(2.2rem, 12vw, 3rem); line-height: 1; margin: 0; color: var(--cold); text-transform: lowercase; }
.bubble .time { margin-left: 8px; font-family: var(--f-mono); font-size: .68rem; color: var(--cold); background: color-mix(in srgb, var(--cold) 14%, transparent); padding: 1px 6px; border-radius: 999px; }
.seg { grid-template-columns: repeat(4, 1fr); }
.seg button { padding: 9px 4px; font-size: .9rem; }

/* Ranking de humanos e alcunhas */
.seg.tabs3 { grid-template-columns: repeat(3, 1fr); }
/* Alcunha no início: uma linha discreta acima do botão Jogar. */
.me-line { margin: -4px 2px -6px; color: var(--muted); }
.me-line b { color: var(--fg); overflow-wrap: anywhere; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--cold); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.standing-big { margin: 0; font-family: var(--f-display); font-size: 1.25rem; font-weight: 700; overflow-wrap: anywhere; }
.standing-big b { color: var(--pulse); font-size: 1.6rem; }
.tier { color: var(--cold); }
.rk.plain { grid-template-areas: "pos nm val"; }
.rk.hm .nm small { display: block; margin-left: 0; margin-top: 2px; text-transform: none; letter-spacing: 0; }
.flag { background: none; border: 0; color: var(--muted); font-size: .9rem; padding: 0 4px; cursor: pointer; }
.flag:hover { color: var(--warn); }
.gap-row { text-align: center; color: var(--muted); }
.tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tiers li { display: flex; justify-content: space-between; font-size: .9rem; }
.tiers span { color: var(--muted); font-family: var(--f-mono); font-size: .8rem; }

/* ---------- Ecrãs largos (computador) ----------
   No telemóvel tudo é uma coluna; os contentores abaixo não existem para o layout (display: contents).
   A partir de 900 px, o início, os rankings e as definições usam o espaço em colunas.
   A partida continua numa coluna estreita (é um chat). */
.col, .rk-cols, .set-grid { display: contents; }
/* No telemóvel as colunas desaparecem (display: contents): esta ordem repõe a sequência de sempre
   (resultado, apoio, posição, respostas, botões). */
.ord-1 { order: 1; } .ord-2 { order: 2; } .ord-3 { order: 3; }
@media (min-width: 900px) {
  body[data-screen="home"] #app, body[data-screen="home"] .brand,
  body[data-screen="ranking"] #app, body[data-screen="ranking"] .brand,
  body[data-screen="settings"] #app, body[data-screen="settings"] .brand { max-width: 1100px; }

  body[data-screen="home"] #app { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  body[data-screen="home"] .col { display: flex; flex-direction: column; gap: 18px; }
  body[data-screen="home"] .stage canvas { height: 340px; }

  /* No computador há espaço: as introduções ocupam a largura toda. */
  .lede { max-width: none; }

  /* Fim de partida e Prova de Vida já feita: resultado à esquerda; apoio e botões à direita. */
  body[data-screen="end"] #app, body[data-screen="end"] .brand,
  body[data-screen="done"] #app, body[data-screen="done"] .brand { max-width: 1100px; }
  body[data-screen="end"] #app, body[data-screen="done"] #app { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px 32px; align-items: start; }
  body[data-screen="end"] .hero, body[data-screen="done"] .hero { grid-column: 1 / -1; }
  body[data-screen="end"] .col, body[data-screen="done"] .col { display: flex; flex-direction: column; gap: 18px; }

  /* Salas: o menu e a sala de espera usam as mesmas duas colunas. */
  body[data-screen="room-menu"] #app, body[data-screen="room-menu"] .brand,
  body[data-screen="room-lobby"] #app, body[data-screen="room-lobby"] .brand { max-width: 1100px; }
  body[data-screen="room-menu"] #app, body[data-screen="room-lobby"] #app { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px 32px; align-items: start; }
  body[data-screen="room-menu"] .hero, body[data-screen="room-lobby"] .hero { grid-column: 1 / -1; }
  body[data-screen="room-menu"] .col, body[data-screen="room-lobby"] .col { display: flex; flex-direction: column; gap: 18px; }

  .rk-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .rk-hum { grid-template-areas: "mine list" "tiers list"; }
  .rk-hum .rk-mine { grid-area: mine; } .rk-hum .rk-list { grid-area: list; } .rk-hum .rk-tiers { grid-area: tiers; }
  body[data-screen="ranking"] #app > .btn { max-width: 460px; width: 100%; justify-self: center; margin-inline: auto; }

  .set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  body[data-screen="settings"] #app > .btn { max-width: 460px; width: 100%; margin-inline: auto; }
}

/* Partida no computador: conversa ao centro e painel lateral (fase 2). */
.game-side { display: none; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plist li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; font-weight: 600; }
.plist li small { color: var(--muted); font-weight: 400; font-family: var(--f-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.plist li.me small { color: var(--pulse); }
.plist li.out > span { color: var(--muted); text-decoration: line-through; }
.slots { display: flex; gap: 6px; margin: 0; font-size: 1.4rem; line-height: 1; }
.slots .slot { display: inline-block; width: 1.1em; height: 1.1em; border: 1.5px dashed var(--line); border-radius: 4px; }
@media (min-width: 900px) {
  body[data-screen="game"] #app, body[data-screen="game"] .brand { max-width: 880px; }
  body[data-screen="game"] #app:has(.game-side) { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
  .game-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  .game-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
  .game-main .top .roster { display: none; }
  .game-side .votegrid { grid-template-columns: 1fr 1fr; }
}

/* Votar na própria resposta: "Agora vota" em destaque, botão em cada mensagem e barra de confirmação fixa. */
.vote-now { background: var(--tint-pulse); border: 1.5px solid var(--pulse); }
.vote-now .eyebrow { color: var(--pulse); }
.vote-now p:last-child { margin: 0; }
.msg.votable { grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; }
.vote-on { background: transparent; border: 1.5px solid var(--pulse); color: var(--pulse); border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.vote-on:hover { background: var(--tint-pulse); }
.vote-on[aria-pressed="true"] { background: var(--pulse); color: var(--on-pulse); }
/* Tempo para votar: barra fixa em baixo, sempre à vista enquanto se lê. */
.vote-timer { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 5; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }

/* ---------- Salas privadas ---------- */
.room-code { font-family: var(--f-mono); font-size: 2.6rem; font-weight: 700; letter-spacing: .28em; text-align: center; margin: 6px 0 14px; color: var(--pulse); }
.room-code.small-code { font-size: 1.6rem; margin: 2px 0 10px; }
.code-input { font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .3em; text-align: center; font-size: 1.4rem; margin-bottom: 10px; }
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.members li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; font-weight: 600; }
.members li.off > span:nth-child(2) { color: var(--muted); }
.members li small { color: var(--muted); font-family: var(--f-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.reveal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reveal li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.reveal li small { display: block; color: var(--muted); font-size: .8rem; }
.reveal li.is-ai .badge { background: color-mix(in srgb, var(--cold) 20%, transparent); color: var(--cold); }
.reveal li.is-human .badge { background: color-mix(in srgb, var(--pulse) 20%, transparent); color: var(--pulse); }
.bubble .who .flag { margin-left: 4px; font-size: .8rem; }

/* Prestígio: a mesa no fim do Infiltrado. */
.table-bots { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.table-bots li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.table-bots li small { display: block; color: var(--muted); font-size: .8rem; }

/* O atributo hidden ganha sempre (os cartões com display próprio não o ignoram). */
[hidden] { display: none !important; }
