/* Parou! — esquema "Placa". Tela parada e limpa; só se mexe nos momentos que importam. */

@font-face { font-family: Archivo; font-weight: 500; font-display: swap; src: url('/fonts/archivo-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Archivo; font-weight: 800; font-display: swap; src: url('/fonts/archivo-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Archivo; font-weight: 500; font-display: swap; src: url('/fonts/archivo-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Archivo; font-weight: 800; font-display: swap; src: url('/fonts/archivo-latin-ext-800-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #EFEFEC;
  --ink: #111111;
  --ink-2: #4A4A4A;
  --line: #6B6B6B;
  --paper: #FFFFFF;
  --key: #FFFFFF;
  --kbd: #D9D9D5;
  --key-2: #A8A8A4;
  --stop: #C81E1E;
  --rara: #6D28D9;
  --boa: #16A34A;
  --comum: #FACC15;
  --negada: #3F3F46;
  --night: #111111;
  --night-ink: #EFEFEC;
  --night-2: #B8B8B4;
  --pad: 16px;
  --field: clamp(34px, 5.4dvh, 44px);
  --keyh: clamp(42px, 6.4dvh, 52px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--ink); overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@supports not (height: 1dvh) { :root { --field: 34px; --keyh: 40px; } }
body {
  font-family: Archivo, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
a { color: inherit; }
input { font: inherit; border-radius: 0; }
.noscript { padding: 24px; }

#app {
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  overflow: hidden;
}
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px var(--pad) max(16px, env(safe-area-inset-bottom)); gap: 12px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.screen input { -webkit-user-select: text; user-select: text; }
.screen.scroll, .scroll-box { overflow-y: auto; }
.grow { flex: 1; min-height: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.center { align-items: center; justify-content: center; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Tipografia ---------- */
.brand { font-size: clamp(64px, 22vw, 92px); font-weight: 800; line-height: .95; letter-spacing: -2px; }
.h1 { font-size: 32px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.h2 { font-size: 22px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.over { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--ink-2); text-transform: uppercase; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.big { font-size: 72px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Botões ---------- */
.btn {
  height: 56px; width: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  background: var(--ink); color: var(--bg);
}
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
.btn.stop { background: var(--stop); color: #FFFFFF; height: 60px; font-size: 26px; letter-spacing: 4px; }
.btn.off { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 3px var(--line); font-size: 16px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; }
.chip { height: 24px; padding: 0 6px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.chip.stop { background: var(--stop); color: #FFFFFF; }
.chip.line { box-shadow: inset 0 0 0 2px currentColor; }

/* ---------- Campos ---------- */
.input {
  width: 100%; height: 56px; padding: 0 14px;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  font-size: 20px; font-weight: 800; letter-spacing: 1px;
}
.label { font-size: 14px; color: var(--ink-2); }

/* ---------- Cabeçalho do jogo ---------- */
.letter { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); font-size: 32px; font-weight: 800; }
.timer { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.hurry { color: var(--stop); }

/* ---------- Adversários ---------- */
.opps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 16px; }
.opps.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opp { min-width: 0; height: 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink-2); }
.opp .name { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; }
.opp .name > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.opp.last { color: var(--ink); font-weight: 800; animation: pulse .8s infinite; }
.opp.off .name > span { text-decoration: line-through; }
.opp.done .name::after { content: '· pronto'; font-weight: 800; flex: none; }
.sq { display: flex; gap: 3px; flex: none; }
.sq i { width: 14px; height: 14px; box-shadow: inset 0 0 0 2px var(--line); }
.sq i.on { background: var(--ink); box-shadow: none; animation: pop .3s; }
.ghost-ico { width: 14px; height: 14px; flex: none; }

/* ---------- Campos de resposta ---------- */
.fields { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 8px; row-gap: 5px; align-items: center; }
.fields .flabel { font-size: 14px; line-height: 1.1; color: var(--ink-2); }
.fields .flabel.cur { color: var(--ink); font-weight: 800; }
.field {
  height: var(--field); padding: 0 12px; display: flex; align-items: center; text-align: left;
  font-size: 18px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  box-shadow: inset 0 0 0 1px var(--line); background: var(--bg); color: var(--ink);
  overflow: hidden; white-space: nowrap;
}
.field.done { background: var(--ink); color: var(--bg); box-shadow: none; }
.field.done.lock { animation: lock .3s cubic-bezier(.2, 1.6, .4, 1); }
.field.cur { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
.field.cur::after { content: ''; width: 2px; height: 60%; margin-left: 2px; background: var(--ink); animation: blink 1s steps(1) infinite; }
.field.bad { animation: shake .4s; box-shadow: inset 0 0 0 3px var(--ink); }
.field.frozen { opacity: .8; }

/* ---------- Teclado ---------- */
.kbd { background: var(--kbd); padding: 5px 2px max(8px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 0; margin: 0 calc(-1 * var(--pad)) calc(-1 * max(16px, env(safe-area-inset-bottom))); }
.kbd .kr { display: flex; gap: 0; }
.kbd .kr.mid { padding: 0 4.5%; }
/* Borda transparente: a área de toque cobre o vão entre as teclas (sem zonas mortas). */
.key { flex: 1; height: calc(var(--keyh) + 6px); border: 3px solid transparent; background: var(--key); background-clip: padding-box; box-shadow: inset 0 -2px 0 var(--key-2); color: var(--ink); font-size: 17px; font-weight: 800; display: flex; align-items: center; justify-content: center; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.key:active, .key.press { background-color: var(--ink); color: var(--bg); box-shadow: none; }
.key.wide { flex: 1.5; background-color: var(--key-2); box-shadow: none; }
.key.ok { flex: 1.6; background-color: var(--ink); color: var(--bg); font-size: 15px; box-shadow: none; }
.key.space { flex: 3.2; font-size: 14px; font-weight: 500; color: var(--ink-2); }

/* ---------- STOP ---------- */
.stopbar { min-height: 60px; display: flex; align-items: stretch; }
.stopbar .btn { height: auto; min-height: 52px; }
.btn.stop.live { animation: rise .45s both, beat .7s .45s infinite; }
.track { height: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.track > i { display: block; height: 100%; background: var(--stop); transition: width .25s linear; }

/* ---------- Contagem e letra ---------- */
.count-n { font-size: 200px; font-weight: 800; line-height: 1; animation: pop .35s both; font-variant-numeric: tabular-nums; }
.letter-big { width: min(220px, 56vw); aspect-ratio: 1; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-size: min(170px, 44vw); font-weight: 800; animation: slam .6s both; }
.themes-list { align-self: stretch; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.themes-list span { padding: 12px 0; border-top: 1px solid var(--line); font-size: 22px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; animation: drop .3s both; }

/* ---------- Revelação ---------- */
.theme-title { font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: 1px; text-transform: uppercase; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card { min-height: 64px; padding: 8px 14px; display: flex; align-items: center; gap: 10px; transform-origin: top; animation: flip .4s both; }
.card .who { font-size: 13px; display: flex; align-items: center; gap: 5px; }
.card .word { font-size: 22px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; line-height: 1.1; overflow-wrap: anywhere; }
.card .pts { margin-left: auto; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.card .meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.v-rara { animation: rare .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.v-negada { box-shadow: inset 0 0 0 3px var(--negada); color: var(--negada); }
.v-negada .word, .v-negada .w { text-decoration: line-through; text-decoration-thickness: 3px; }
.v-branco { box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.card .act { height: 44px; padding: 0 12px; box-shadow: inset 0 0 0 3px var(--ink); color: var(--ink); background: var(--bg); font-size: 14px; font-weight: 800; letter-spacing: 1px; }
.progress { display: flex; gap: 6px; justify-content: center; }
.progress i { width: 16px; height: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.progress i.done { background: var(--ink); box-shadow: none; }
.progress i.cur { box-shadow: inset 0 0 0 4px var(--ink); }

/* ---------- Votação (tela escura) ---------- */
.night { background: var(--night); color: var(--night-ink); margin: -12px calc(-1 * var(--pad)) calc(-1 * max(16px, env(safe-area-inset-bottom))); padding: 24px var(--pad) max(20px, env(safe-area-inset-bottom)); flex: 1; display: flex; flex-direction: column; gap: 24px; }
.night .muted { color: var(--night-2); }
.night .vword { font-size: clamp(36px, 12vw, 60px); font-weight: 800; line-height: 1; letter-spacing: 1px; text-transform: uppercase; overflow-wrap: anywhere; }
.night .btn { background: var(--night-ink); color: var(--night); height: 72px; }
.night .btn.ghost { background: transparent; color: var(--night-ink); box-shadow: inset 0 0 0 3px var(--night-ink); }
.night .btn.picked { outline: 4px solid var(--night-ink); outline-offset: 3px; }
.night .track { box-shadow: inset 0 0 0 1px var(--night-2); }
.night .track > i { background: var(--night-ink); }
.stamp { align-self: center; padding: 10px 18px; font-size: 40px; font-weight: 800; letter-spacing: 3px; box-shadow: inset 0 0 0 5px currentColor; animation: stamp .4s both; transform: rotate(-4deg); }

/* ---------- Placar ---------- */
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar { min-height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 8px; }
.bar .t { width: 88px; flex: none; font-size: 12px; }
.bar .w { flex: 1; min-width: 0; font-size: 16px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .p { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.table { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.table .tr { min-height: 44px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); font-size: 16px; }
.table .tr.me { font-weight: 800; }
.table .tr .pos { width: 32px; flex: none; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.table .tr .nm { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; }
.table .tr .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .tr .pt { font-variant-numeric: tabular-nums; text-align: right; min-width: 44px; }
.share-card { padding: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 8px; }
.share-card .sl { display: flex; align-items: center; gap: 4px; }
.share-card .sl b { width: 20px; font-weight: 800; }
.share-card .sl i { width: 20px; height: 20px; box-shadow: inset 0 0 0 1px var(--ink); }
.winner { margin: -12px calc(-1 * var(--pad)) 0; padding: 18px var(--pad); background: var(--ink); color: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.winner .h1 { font-size: 36px; animation: slam .5s both; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; animation: fall 1.1s ease-in forwards; }

/* ---------- Lobby, ranking, regras ---------- */
.players { list-style: none; display: flex; flex-direction: column; }
.players li { min-height: 52px; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 800; }
.players li:last-child { border-bottom: 1px solid var(--line); }
.players li .dot { width: 16px; height: 16px; background: var(--ink); flex: none; }
.players li.wait { font-weight: 500; color: var(--ink-2); font-size: 16px; }
.players li.wait .dot { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.tabs { display: flex; gap: 8px; }
.tabs button { flex: 1; height: 48px; font-size: 16px; font-weight: 800; letter-spacing: 2px; box-shadow: inset 0 0 0 3px var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.mebar { margin: 0 calc(-1 * var(--pad)) calc(-1 * max(16px, env(safe-area-inset-bottom))); padding: 14px var(--pad) max(16px, env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); font-weight: 800; }
.rules { list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: r; }
.rules li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 16px; line-height: 1.35; counter-increment: r; }
.rules li::before { content: counter(r); font-weight: 800; }
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend div { height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; font-weight: 800; letter-spacing: 1px; }

/* ---------- Aviso ---------- */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 90vw; padding: 12px 16px; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; text-align: center; }
#toast.show { opacity: 1; }
.conn { position: fixed; top: env(safe-area-inset-top); left: 0; right: 0; padding: 6px; text-align: center; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 800; letter-spacing: 1px; z-index: 40; }

/* ---------- Animações ---------- */
@keyframes slam { 0% { transform: scale(4); opacity: 0 } 55% { transform: scale(.88); opacity: 1 } 75% { transform: scale(1.06) } 100% { transform: scale(1); opacity: 1 } }
@keyframes pop { 0% { transform: scale(.4) } 70% { transform: scale(1.3) } 100% { transform: scale(1) } }
@keyframes lock { 0% { transform: scale(1) } 40% { transform: scale(1.06) } 100% { transform: scale(1) } }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes rise { 0% { transform: translateY(80px); opacity: 0 } 70% { transform: translateY(-6px); opacity: 1 } 100% { transform: translateY(0); opacity: 1 } }
@keyframes beat { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.05) } }
@keyframes flash { 0% { opacity: 0 } 12% { opacity: 1 } 100% { opacity: 1 } }
@keyframes shake { 0%, 100% { transform: translateX(0) } 20% { transform: translateX(-10px) } 40% { transform: translateX(10px) } 60% { transform: translateX(-6px) } 80% { transform: translateX(6px) } }
@keyframes flip { 0% { transform: perspective(600px) rotateX(-90deg); opacity: 0 } 100% { transform: perspective(600px) rotateX(0); opacity: 1 } }
@keyframes rare { 0% { transform: perspective(600px) rotateX(-90deg) scale(1); opacity: 0 } 60% { transform: perspective(600px) rotateX(0) scale(1.08); opacity: 1 } 100% { transform: perspective(600px) rotateX(0) scale(1); opacity: 1 } }
@keyframes drop { 0% { transform: translateY(-14px); opacity: 0 } 100% { transform: translateY(0); opacity: 1 } }
@keyframes stamp { 0% { transform: rotate(-4deg) scale(1.8); opacity: 0 } 60% { transform: rotate(-4deg) scale(.95); opacity: 1 } 100% { transform: rotate(-4deg) scale(1); opacity: 1 } }
@keyframes blink { 50% { opacity: 0 } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
@media (min-height: 860px) { :root { --field: 46px; --keyh: 46px; } }

/* Telas baixas (iPhone SE, navegador do WhatsApp com barras): tudo cabe sem rolar. */
@media (max-height: 700px) {
  :root { --field: 30px; --keyh: 34px; --pad: 12px; }
  .screen { gap: 6px; padding-top: 6px; }
  .letter { width: 36px; height: 36px; font-size: 26px; }
  .timer { font-size: 20px; }
  .opp { height: 16px; font-size: 12px; }
  .sq i { width: 12px; height: 12px; }
  .opps { gap: 2px 12px; }
  .fields { row-gap: 3px; }
  .fields .flabel { font-size: 12px; }
  .field { font-size: 16px; }
  .stopbar { min-height: 44px; }
  .stopbar .btn { min-height: 44px; font-size: 15px; }
  .btn.stop { height: 48px; font-size: 22px; }
        .theme-title { font-size: 30px; }
  .card { min-height: 52px; }
  .card .word { font-size: 18px; }
  .brand { font-size: clamp(56px, 18vw, 80px); }
  .big { font-size: 56px; }
}
@media (max-height: 600px) {
  :root { --field: 27px; --keyh: 31px; }
  .opps.two .opp { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #app::before { content: 'Gire o celular para jogar em pé.'; position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 20px; text-align: center; }
}
.night button:focus-visible { outline-color: var(--night-ink); }
.link-box { position: fixed; inset: 0; z-index: 55; background: rgba(17, 17, 17, .6); display: flex; align-items: flex-end; }
.link-box > div { width: 100%; max-width: 480px; margin: 0 auto; background: var(--bg); padding: 16px var(--pad) max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.link-box textarea { -webkit-user-select: text; user-select: text; font-size: 16px; }

/* Dica no campo vazio, adversário na última palavra, placar que pula. */
.field.cur:empty::before, .field.cur[data-hint]:not([data-hint=""])::before { content: attr(data-hint); color: var(--ink-2); font-weight: 500; text-transform: none; letter-spacing: 0; }
.field.cur:not(:empty)::before { content: none; }
.opp.last .sq i:not(.on) { box-shadow: inset 0 0 0 2px var(--stop); animation: pulse .6s infinite; }
.pop { animation: pop .35s; }

/* ---------- Sala de espera ---------- */
.top-bar { align-items: flex-start; }
.room-card { padding: 16px; background: var(--paper); box-shadow: inset 0 0 0 3px var(--ink), 6px 6px 0 var(--stop); display: flex; flex-direction: column; gap: 4px; }
.room-card .code { font-size: 48px; font-weight: 800; letter-spacing: 6px; line-height: 1.05; }
.pulse-text { animation: pulse 1.2s infinite; }
.center.stack { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ---------- Teclado: posições do celular e balão da tecla ---------- */
.kbd { position: relative; }
.kbd .kr .gap { flex: 1.5; }
.kpop { position: absolute; z-index: 5; min-width: 46px; height: 58px; padding: 0 8px; transform: translate(-50%, -100%); display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); font-size: 30px; font-weight: 800; pointer-events: none; opacity: 0; }
.kpop.on { opacity: 1; }
.key.press { transform: scale(.94); }

/* ---------- STOP: acabou na hora ---------- */
.stop-screen { gap: 10px; }
.stop-screen.is-stop { background: var(--stop); color: #FFFFFF; animation: flash .2s both; }
.stop-screen.is-time { background: var(--ink); color: var(--bg); animation: flash .2s both; }
.stop-word { font-size: clamp(84px, 28vw, 120px); font-weight: 800; line-height: 1; letter-spacing: 2px; animation: slam .45s both; }
.stop-who { font-size: 20px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; animation: shake .5s .45s both; }
.stop-check { font-weight: 800; letter-spacing: 1px; }
.earlier-head { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---------- Vermelho de placa: uma cor só, nos momentos que dão gosto ----------
   O octógono da placa de PARE é o símbolo do jogo. Vermelho = emoção: STOP, raridade, vitória, toque. */
.oct { clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%); }
.brand-wrap { display: flex; flex-direction: column; gap: 10px; }
.brand { display: flex; align-items: center; gap: .06em; font-size: clamp(56px, 19vw, 88px); }
.brand .bang { flex: none; width: .78em; height: .78em; margin-left: .04em; background: var(--stop); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-size: 1em; animation: sign .7s .15s cubic-bezier(.2, 1.5, .4, 1) both; }
.brand .bang b { font-size: .62em; line-height: 1; }
.brand-wrap.sm .brand { font-size: 34px; letter-spacing: -1px; }
@keyframes sign { 0% { transform: rotate(-200deg) scale(0); } 100% { transform: rotate(0) scale(1); } }

/* Botão principal: sombra vermelha dura; o toque afunda. */
.btn { box-shadow: 4px 4px 0 var(--stop); transition: transform .06s, box-shadow .06s; }
.btn.ghost { box-shadow: inset 0 0 0 3px var(--ink); }
.btn.stop, .btn.stop:active, .btn:disabled:not(.ghost):not(.off) { box-shadow: none; }
.btn.off { box-shadow: inset 0 0 0 3px var(--line); }
.btn.stop.live { box-shadow: 4px 4px 0 var(--ink); }
.btn.stop.live:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:active:not(:disabled):not(.ghost):not(.stop) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--stop); }
.btn.ghost:active:not(:disabled) { background: var(--ink); color: var(--bg); }
.night .btn, .night .btn:active:not(:disabled) { box-shadow: none; transform: none; }
.night .btn.ghost, .night .btn.ghost:active:not(:disabled) { box-shadow: inset 0 0 0 3px var(--night-ink); }

/* Letra da rodada: uma placa de PARE com a letra. */
.letter { background: var(--stop); color: #FFFFFF; clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%); }
.letter-big { background: var(--stop); color: #FFFFFF; clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%); animation: signslam .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes signslam { 0% { transform: rotate(-90deg) scale(3); opacity: 0 } 60% { transform: rotate(6deg) scale(.92); opacity: 1 } 100% { transform: rotate(0) scale(1); opacity: 1 } }


/* Campo pronto ganha um selinho vermelho; o balão da tecla é vermelho. */
.field.done::after { content: ''; flex: none; width: 10px; height: 10px; margin-left: auto; padding-left: 0; background: var(--stop); clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%); }
.field.done { gap: 8px; }

/* Revelação: as palavras mantêm as cores de sempre (rara roxa, boa verde, comum amarela). */
.theme-title { position: relative; padding-bottom: 6px; }
.theme-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 64px; height: 6px; background: var(--stop); transform-origin: left; animation: wipe .35s .1s both; }
@keyframes wipe { 0% { transform: scaleX(0) } 100% { transform: scaleX(1) } }
.v-rara { background: var(--rara); color: #FFFFFF; position: relative; }
.v-boa { background: var(--boa); color: var(--ink); }
.v-comum, .v-extra, .v-valeu { background: var(--comum); color: var(--ink); }
.v-rara .act { box-shadow: inset 0 0 0 3px currentColor; background: transparent; color: inherit; }
.progress i.cur { background: var(--stop); box-shadow: none; }
.burst { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.burst i { position: absolute; width: 9px; height: 9px; background: var(--rara); animation: spark .7s cubic-bezier(.1, .8, .3, 1) forwards; }
@keyframes spark { 0% { transform: translate(0, 0) scale(1.3); opacity: 1 } 100% { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0 } }
.s-rara { background: var(--rara); } .s-boa { background: var(--boa); } .s-comum { background: var(--comum); }
.s-negada { box-shadow: inset 0 0 0 3px var(--negada) !important; } .s-branco { box-shadow: inset 0 0 0 1px var(--line) !important; }
.v-rara .act:focus-visible { outline-color: currentColor; outline-offset: -7px; }
.big { text-shadow: 6px 6px 0 var(--stop); animation: pop .35s both; }
.table .tr.me { box-shadow: inset 5px 0 0 var(--stop); padding-left: 10px; }

/* Lobby: você é a placa vermelha; os outros, placas pretas. */
.players li .dot { clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%); width: 18px; height: 18px; }
.players li.me .dot { background: var(--stop); }

/* Fim: quem venceu ganha a faixa vermelha e confete vermelho, preto e branco. */
.winner.won { background: var(--stop); color: #FFFFFF; }
.confetti i.oct { width: 12px; height: 12px; }
/* Sua linha no topo do placar ao vivo: em preto, com os quadradinhos vermelhos. */
.opp.me { color: var(--ink); font-weight: 800; }
.opp.me .sq i.on { background: var(--stop); }

/* ---------- Início da rodada: contagem na placa e roleta da letra ---------- */
.cd { gap: 18px; }
.cd-sign { width: min(240px, 62vw); aspect-ratio: 1; background: var(--ink); display: flex; align-items: center; justify-content: center; animation: cdin .42s cubic-bezier(.2, 1.5, .4, 1) both; }
.cd-in { width: calc(100% - 16px); height: calc(100% - 16px); background: var(--bg); display: flex; align-items: center; justify-content: center; }
.cd-n { font-size: min(150px, 40vw); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.cd-sign.s2 { transform: rotate(0); }
.cd-sign.s1, .cd-sign.s1 .cd-in { background: var(--stop); }
.cd-sign.s1 .cd-n { color: #FFFFFF; }
.cd-sign.s1 { animation-name: cdlast; }
@keyframes cdin { 0% { transform: rotate(-45deg) scale(1.7); opacity: 0 } 70% { transform: rotate(4deg) scale(.95); opacity: 1 } 100% { transform: rotate(0) scale(1); opacity: 1 } }
@keyframes cdlast { 0% { transform: scale(2.2); opacity: 0 } 55% { transform: scale(.9); opacity: 1 } 75% { transform: scale(1.08) } 100% { transform: scale(1); opacity: 1 } }
.cd-hint { animation: pulse 1s infinite; }

.letter-screen .sign-wrap { position: relative; display: flex; }
.letter-big .glyph { display: block; animation: reel .09s linear; }

.letter-big.spin .glyph { opacity: .9; }
@keyframes reel { 0% { transform: translateY(-38%); opacity: .2 } 100% { transform: translateY(0); opacity: 1 } }
.letter-big.landed { animation: land .5s cubic-bezier(.2, 1.7, .35, 1) both; }
.letter-big.landed .glyph { animation: none; }
@keyframes land { 0% { transform: scale(1.45) rotate(-8deg) } 45% { transform: scale(.88) rotate(2deg) } 100% { transform: scale(1) rotate(0) } }
.sign-wrap .ring { position: absolute; inset: 0; background: var(--stop); pointer-events: none; animation: ring .7s cubic-bezier(.1, .7, .3, 1) both; }
@keyframes ring { 0% { transform: scale(1); opacity: .55 } 100% { transform: scale(2.1); opacity: 0 } }
.letter-screen.jolt { animation: jolt .32s ease-out; }
@keyframes jolt { 0%, 100% { transform: translate(0, 0) } 20% { transform: translate(-7px, 4px) } 45% { transform: translate(6px, -4px) } 70% { transform: translate(-3px, 2px) } }
.themes-list.wait span { animation: none; opacity: 0; }
.themes-list span { animation: slidein .32s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes slidein { 0% { transform: translateX(-40px); opacity: 0 } 100% { transform: translateX(0); opacity: 1 } }
