/* ==========================================================================
   Jogue em Grupo — tema PIXEL ART
   Bordas "dentadas" feitas com box-shadow (estilo console 8-bit), sem cantos arredondados.
   ========================================================================== */
:root {
  --bg: #1a1c2c;
  --surface: #262b44;
  --surface-2: #333c57;
  --surface-3: #44507a;
  --line: #0b0c16;
  --text: #f4f4f4;
  --muted: #a9c1d1;
  --faint: #8e9cc0;
  --accent: #ffcd75;
  --accent-2: #ef7d57;
  --ok: #38b764;
  --bad: #c42a33;
  --bad-text: #ff8a8f;
  --ok-text: #5ad685;
  --info: #41a6f6;
  --px: 4px;
  --font: 'Geist Pixel', ui-monospace, monospace;
  --display: 'Geist Pixel', ui-monospace, monospace;
  /* borda pixelada + sombra em degrau */
  --pxb: 0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line), calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line);
  --pxs: var(--px) calc(var(--px) * 2) 0 0 rgba(0, 0, 0, .45), calc(var(--px) * 2) var(--px) 0 0 rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; border-radius: 0 !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' shape-rendering='crispEdges'%3E%3Crect x='10' y='14' width='2' height='2' fill='%23ffffff' opacity='.35'/%3E%3Crect x='62' y='8' width='2' height='2' fill='%23ffcd75' opacity='.4'/%3E%3Crect x='40' y='52' width='2' height='2' fill='%23ffffff' opacity='.2'/%3E%3Crect x='84' y='70' width='2' height='2' fill='%2341a6f6' opacity='.4'/%3E%3Crect x='20' y='82' width='2' height='2' fill='%23ffffff' opacity='.25'/%3E%3Crect x='72' y='36' width='2' height='2' fill='%23ffffff' opacity='.15'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #29224a 0%, var(--bg) 45%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  font-synthesis: none;
}
/* scanlines bem suaves */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 4px);
}
body.noite { background-color: #07070f; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' shape-rendering='crispEdges'%3E%3Crect x='10' y='14' width='2' height='2' fill='%23ffffff' opacity='.6'/%3E%3Crect x='62' y='8' width='2' height='2' fill='%23ffffff' opacity='.5'/%3E%3Crect x='40' y='52' width='2' height='2' fill='%23ffffff' opacity='.4'/%3E%3Crect x='84' y='70' width='2' height='2' fill='%23ffffff' opacity='.6'/%3E%3C/svg%3E"); }
body.noite .topbar { opacity: .75; }

svg.spr, svg.ic { display: block; }
svg.ic { flex: none; }

#app { max-width: 560px; margin: 0 auto; padding: 0 20px calc(124px + env(safe-area-inset-bottom)); }
.loading { display: grid; place-items: center; min-height: 70vh; }
.loading::after {
  content: ''; width: 12px; height: 12px; background: var(--accent);
  box-shadow: 20px 0 0 var(--accent), 40px 0 0 var(--accent); transform: translateX(-20px);
  animation: blink 1s steps(3) infinite;
}
@keyframes blink { 0% { box-shadow: 20px 0 0 transparent, 40px 0 0 transparent; } 33% { box-shadow: 20px 0 0 var(--accent), 40px 0 0 transparent; } 66%, 100% { box-shadow: 20px 0 0 var(--accent), 40px 0 0 var(--accent); } }

/* ---------- tipografia ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 0 0 12px; letter-spacing: 0; }
h1 { font-size: 34px; text-shadow: 3px 3px 0 var(--line); }
h2 { font-size: 24px; text-shadow: 2px 2px 0 var(--line); }
h3 { font-size: 19px; }
p { margin: 0 0 10px; }
b, strong { font-weight: 400; color: #fff; }
.turncard b, .secret b, #toast b { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.center { text-align: center; }
.eyebrow { font-family: var(--display); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.row { display: flex; gap: 12px; align-items: center; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 16px; }
.spacer { height: 18px; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -20px 14px; padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: var(--surface);
  border-bottom: var(--px) solid var(--line);
  box-shadow: 0 var(--px) 0 0 rgba(0, 0, 0, .35);
}
.topbar .code { font-family: var(--display); font-size: 17px; letter-spacing: .1em; padding: 0 10px; color: var(--accent); }
.topbar .title { flex: 1; min-width: 0; font-family: var(--display); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; }
.topbar .title > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.topbar .title .gicon { --s: 28px; --i: 16px; }
.iconbtn {
  background: var(--surface-2); border: 0; color: var(--text);
  height: 36px; min-width: 36px; padding: 0 8px; margin: var(--px);
  font-family: var(--display); font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  box-shadow: var(--pxb), inset -3px -3px 0 0 rgba(0, 0, 0, .3);
}
.iconbtn:active { box-shadow: var(--pxb), inset 3px 3px 0 0 rgba(0, 0, 0, .3); transform: translateY(1px); }
.iconbtn .ic { width: 16px; height: 16px; }
.iconbtn.danger { color: var(--bad-text); }

/* ---------- caixas ---------- */
.card {
  background: var(--surface); padding: 18px; margin: var(--px);
  box-shadow: var(--pxb), var(--pxs), inset 0 var(--px) 0 0 rgba(255, 255, 255, .06);
}
.card + .card, .card + .btn, .btn + .card, .secret + .card, .card + .secret, .card + .list, .list + .card { margin-top: 22px; }
.card h3 { margin-bottom: 12px; }

.hero { text-align: center; padding: 30px 0 24px; }
.hero h1 { margin-top: 22px; }
.hero p { color: var(--muted); max-width: 380px; margin: 0 auto; }
.brand { width: 96px; height: 96px; margin: 0 auto; }
.brand svg { width: 100%; height: 100%; }
.hero-avatars { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.hero-avatars .avatar { --s: 38px; }
.hero-avatars .avatar:nth-child(odd) { animation: hop 1.2s steps(2) infinite; }
.hero-avatars .avatar:nth-child(even) { animation: hop 1.2s steps(2) .6s infinite; }
@keyframes hop { 50% { transform: translateY(-4px); } }

/* ---------- avatares ---------- */
.avatar {
  --s: 40px; --bc: var(--line);
  width: var(--s); height: var(--s); flex: none; overflow: hidden;
  display: inline-grid; place-items: center; background: var(--surface-3);
  font-size: calc(var(--s) * .6); line-height: 1; margin: 3px;
  box-shadow: 0 -3px 0 0 var(--bc), 0 3px 0 0 var(--bc), -3px 0 0 0 var(--bc), 3px 0 0 0 var(--bc);
}
.avatar svg { width: 100%; height: 100%; }

/* ícone de jogo */
.gicon {
  --s: 52px; --i: 28px; --g1: #7048e8; --g2: #4c2fb0;
  width: var(--s); height: var(--s); flex: none; margin: var(--px);
  display: grid; place-items: center; color: #fff; background: var(--g1);
  box-shadow: var(--pxb), inset -4px -4px 0 0 var(--g2), inset 4px 4px 0 0 rgba(255, 255, 255, .25);
}
.gicon .ic { width: var(--i); height: var(--i); filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .35)); }
.gicon.xl { --s: 96px; --i: 52px; }

/* ---------- botões ---------- */
.btn {
  --b: var(--accent); --bd: #d9963c; --ink: #2a1a00;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: calc(100% - var(--px) * 2); min-height: 58px; padding: 14px 18px; margin: var(--px);
  border: 0; cursor: pointer;
  font-family: var(--display); font-size: 18px; line-height: 1.3; text-transform: uppercase; letter-spacing: .04em;
  background: var(--b); color: var(--ink);
  box-shadow: var(--pxb), var(--pxs), inset -4px -4px 0 0 var(--bd), inset 4px 4px 0 0 rgba(255, 255, 255, .35);
}
.btn:active { transform: translate(2px, 2px); box-shadow: var(--pxb), inset 4px 4px 0 0 var(--bd); }
.btn .ic { width: 18px; height: 18px; }
.btn.sec { --b: var(--surface-2); --bd: #232a40; --ink: var(--text); }
.btn.ok { --b: var(--ok); --bd: #257a42; --ink: #0b2614; }
.btn.bad { --b: var(--bad); --bd: #8a1820; --ink: #fff; }
.btn.blue { --b: var(--info); --bd: #2370b0; --ink: #06223d; }
.btn.small { min-height: 46px; font-size: 15px; padding: 10px 14px; }
.btn.huge { min-height: 78px; font-size: 24px; }
.btn.huge .ic { width: 24px; height: 24px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn + .btn { margin-top: 18px; }
.row .btn { width: auto; }
.row .btn + .btn { margin-top: var(--px); }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 8px; display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 4px; }
.linkbtn:hover { color: var(--accent); }

/* ---------- formulários ---------- */
label { display: block; font-family: var(--display); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; color: var(--muted); line-height: 1.5; }
input[type=text], input[type=tel], select {
  width: calc(100% - 8px); height: 52px; margin: 4px; border: 0;
  background: #12131f; color: var(--text); padding: 0 14px; font: inherit; font-size: 20px;
  box-shadow: 0 -4px 0 0 var(--surface-3), 0 4px 0 0 var(--surface-3), -4px 0 0 0 var(--surface-3), 4px 0 0 0 var(--surface-3), inset 4px 4px 0 0 rgba(0, 0, 0, .4);
}
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffcd75' d='M0 0h14v2H0zM2 2h10v2H2zM4 4h6v2H4zM6 6h2v2H6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
select option { background: var(--surface); color: var(--text); }
input:focus, select:focus { outline: none; box-shadow: 0 -4px 0 0 var(--accent), 0 4px 0 0 var(--accent), -4px 0 0 0 var(--accent), 4px 0 0 0 var(--accent), inset 4px 4px 0 0 rgba(0, 0, 0, .4); }
input::placeholder { color: var(--faint); }
input.code-input { text-transform: uppercase; letter-spacing: .3em; font-family: var(--display); font-size: 30px; text-align: center; padding-left: calc(14px + .3em); height: 62px; }
.field + .field { margin-top: 22px; }
.check { display: flex; align-items: center; gap: 14px; font-family: var(--font); font-size: 18px; text-transform: none; color: var(--text); cursor: pointer; margin: 0; }
.check input {
  appearance: none; -webkit-appearance: none; width: 48px; height: 24px; flex: none; cursor: pointer; margin: 4px; position: relative;
  background: #12131f; box-shadow: 0 -4px 0 0 var(--surface-3), 0 4px 0 0 var(--surface-3), -4px 0 0 0 var(--surface-3), 4px 0 0 0 var(--surface-3);
}
.check input::after { content: ''; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; background: var(--muted); transition: transform .1s steps(2); }
.check input:checked { background: var(--ok); }
.check input:checked::after { transform: translateX(24px); background: #fff; }

.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.avatars button { aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; position: relative; }
.avatars button .avatar { --s: calc(100% - 6px); width: calc(100% - 6px); height: calc(100% - 6px); }
.avatars button.on .avatar { --bc: var(--accent); transform: translateY(-3px); }
.avatars button.on::after { content: ''; position: absolute; bottom: -8px; left: 50%; margin-left: -4px; width: 8px; height: 4px; background: var(--accent); }

.tabs { display: flex; gap: 10px; margin: 0 0 22px; }
.tabs button {
  flex: 1; border: 0; background: var(--surface-2); color: var(--muted); font-family: var(--display); font-size: 15px; text-transform: uppercase;
  padding: 14px 6px; cursor: pointer; margin: 4px; box-shadow: var(--pxb);
}
.tabs button.on { background: var(--accent); color: #2a1a00; box-shadow: var(--pxb), inset -4px -4px 0 0 #d9963c; }

/* ---------- jogadores ---------- */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 16px 8px; }
.player { text-align: center; position: relative; }
.player .avatar { --s: 60px; --bc: var(--pc, var(--line)); margin: 4px auto 8px; display: grid; }
.player .nm { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player.off { opacity: .6; }
.player .crown { position: absolute; top: -10px; left: 50%; margin-left: 18px; color: var(--accent); filter: drop-shadow(2px 2px 0 var(--line)); }
.player .you { display: block; font-family: var(--display); font-size: 12px; color: var(--accent); margin-top: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 2px 12px 2px 2px; margin: 4px;
  background: var(--surface-2); white-space: nowrap; font-size: 18px; box-shadow: var(--pxb);
}
.chip .avatar { --s: 28px; margin: 0; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.list { display: flex; flex-direction: column; gap: 14px; }
.li { display: flex; align-items: center; gap: 12px; background: var(--surface-2); padding: 10px 12px; margin: 0 4px; box-shadow: var(--pxb); }
.li .grow { flex: 1; min-width: 0; }
.li .avatar { --s: 40px; }
.li.off .avatar { opacity: .45; }
.li.off .grow { color: var(--muted); }
.li .rank { width: 34px; text-align: center; font-family: var(--display); font-size: 17px; color: var(--muted); }
.li .rank.m1 { color: #ffcd75; } .li .rank.m2 { color: #c6d4e1; } .li .rank.m3 { color: #e09a62; }
.li .pts { font-family: var(--display); font-size: 24px; min-width: 40px; text-align: center; }
.li .iconbtn { height: 32px; min-width: 32px; padding: 0; }
.li .tag { font-family: var(--display); font-size: 12px; color: var(--accent); vertical-align: middle; }

/* ---------- lobby ---------- */
.share-grid { display: flex; align-items: center; gap: 18px; }
.share-grid > div:first-child { flex: 1; min-width: 0; }
.share .bigcode { font-family: var(--display); font-size: 44px; letter-spacing: .15em; line-height: 1; margin: 6px 0 14px; color: var(--accent); text-shadow: 4px 4px 0 var(--line); }
.share .pin { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; background: #12131f; padding: 4px 10px; }
.qr { background: #fff; padding: 8px; flex: none; line-height: 0; margin: 4px; box-shadow: var(--pxb); }
.qr img, .qr canvas { display: block; width: 116px !important; height: 116px !important; image-rendering: pixelated; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 32px 4px 16px; }
.section-head h2 { margin: 0; }
.section-head .small { font-family: var(--display); font-size: 13px; }

.games { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.game {
  background: var(--surface); border: 0; padding: 16px 14px 14px; text-align: left; color: var(--text); margin: var(--px);
  cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--pxb), var(--pxs);
}
.game:hover { background: var(--surface-2); }
.game:active { transform: translate(2px, 2px); box-shadow: var(--pxb); }
.game .gicon { --s: 48px; --i: 26px; margin: 4px 4px 10px; }
.game .nm { font-family: var(--display); font-size: 18px; line-height: 1.2; }
.game .ds { font-size: 16px; color: var(--muted); line-height: 1.25; flex: 1; }
.game .pl { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--accent); margin-top: 8px; }
.game .pl .ic { width: 14px; height: 14px; }

.rules { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rules li { counter-increment: r; position: relative; padding-left: 42px; min-height: 28px; }
.rules li::before {
  content: counter(r); position: absolute; left: 4px; top: 0; width: 24px; height: 24px;
  background: var(--accent); color: #2a1a00; font-family: var(--display); font-size: 15px; display: grid; place-items: center;
  box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line);
}
.rules li + li { margin-top: 14px; }

/* ---------- carta secreta ---------- */
.secret { display: block; width: calc(100% - 8px); margin: 4px; border: 0; cursor: pointer; color: var(--text); font: inherit; padding: 0; background: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: var(--pxb), var(--pxs); }
.secret .cover, .secret .content { min-height: 240px; padding: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.secret .cover { background: repeating-conic-gradient(#333c57 0 25%, #2b3350 0 50%) 0 0 / 16px 16px; font-family: var(--display); font-size: 20px; line-height: 1.6; }
.secret .cover .lock { width: 68px; height: 68px; display: grid; place-items: center; background: var(--surface); color: var(--accent); margin: 4px 4px 10px; box-shadow: var(--pxb); }
.secret .cover .lock .ic { width: 36px; height: 36px; }
.secret .cover .small { font-family: var(--font); font-size: 16px; }
.secret .content { display: none; background: #f4f4f4; color: #1a1c2c; }
.secret.on .cover { display: none; }
.secret.on .content { display: flex; }
.secret .content.evil { background: var(--bad); color: #fff; }
.secret .lbl { font-family: var(--display); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.secret .word { font-family: var(--display); font-size: 40px; line-height: 1.15; }
.secret .word.q { font-size: 28px; line-height: 1.25; }
.secret .hint { font-size: 15px; opacity: .8; margin-top: 10px; }
.secret .role-big .ic { width: 64px; height: 64px; margin: 0 auto; }

/* ---------- carta da vez ---------- */
.turncard { background: #f4f4f4; color: #1a1c2c; padding: 24px; text-align: center; margin: 4px; box-shadow: var(--pxb), var(--pxs); }
.turncard .word { font-family: var(--display); font-size: 40px; line-height: 1.15; word-break: break-word; }
.turncard .cat { font-family: var(--display); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; margin-bottom: 10px; }
.turncard .forb { margin-top: 18px; padding-top: 16px; background: repeating-linear-gradient(90deg, #c2c3c7 0 8px, transparent 8px 16px) top / 100% 4px no-repeat; }
.turncard .forb div:not(.cat) { font-size: 26px; color: #c41e2a; line-height: 1.4; }

.timer { font-family: var(--display); font-size: 72px; text-align: center; line-height: 1; margin: 10px 0; text-shadow: 4px 4px 0 var(--line); }
.timer.low { color: var(--bad-text); animation: blinkt .5s steps(2) infinite; }
@keyframes blinkt { 50% { opacity: .55; } }

.score { display: flex; gap: 14px; }
.score .t { flex: 1; padding: 10px; text-align: center; background: var(--surface); margin: 4px; box-shadow: var(--pxb); }
.score .t.on { box-shadow: 0 -4px 0 0 currentColor, 0 4px 0 0 currentColor, -4px 0 0 0 currentColor, 4px 0 0 0 currentColor; }
.score .t .n { font-family: var(--display); font-size: 36px; line-height: 1.2; }
.score .t .nm { font-family: var(--display); font-size: 13px; text-transform: uppercase; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.sq { display: inline-block; width: 10px; height: 10px; background: currentColor; box-shadow: 2px 2px 0 var(--line); vertical-align: middle; }

.big-emoji { display: flex; justify-content: center; margin: 4px 0 12px; }
.big-emoji .ic { width: 64px; height: 64px; filter: drop-shadow(4px 4px 0 var(--line)); }
.big-avatar { display: flex; justify-content: center; margin: 12px 0; }
.big-avatar .avatar { --s: 96px; --bc: var(--accent); }
.banner { text-align: center; padding: 18px 8px; }
.banner h2 { font-size: 28px; }

.res-ok b { color: var(--ok-text); } .res-pulou { opacity: .75; } .res-proibida b, .res-tempo b { color: var(--bad-text); }
.li .res-ic .ic { width: 16px; height: 16px; }
.res-ok .res-ic { color: var(--ok-text); } .res-proibida .res-ic, .res-tempo .res-ic { color: var(--bad-text); } .res-pulou .res-ic { color: var(--muted); }

/* quem sou eu */
.who { display: flex; align-items: center; gap: 12px; background: var(--surface); padding: 12px 14px; margin: 4px; box-shadow: var(--pxb); }
.who .avatar { --s: 48px; }
.who .grow { flex: 1; min-width: 0; }
.who .nm { font-size: 16px; color: var(--muted); }
.who .it { font-family: var(--display); font-size: 22px; line-height: 1.2; margin-top: 2px; }
.who.me { background: #3a3220; box-shadow: 0 -4px 0 0 var(--accent), 0 4px 0 0 var(--accent), -4px 0 0 0 var(--accent), 4px 0 0 0 var(--accent); }
.who .pos { font-family: var(--display); font-size: 20px; color: var(--accent); }
.who.peek { cursor: pointer; user-select: none; -webkit-user-select: none; }
.who.peek .it-show { display: none; }
.who.peek.on .it-show { display: inline; }
.who.peek.on .it-hide { display: none; }
.who.peek .it-hide { color: var(--faint); }
.who .eye { width: 40px; height: 40px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); box-shadow: var(--pxb); margin: 4px; }
.who .eye .ic { width: 20px; height: 20px; }
.who.peek.on .eye { color: var(--accent); }

/* cidade dorme */
.night { text-align: center; padding: 40px 0 24px; }
.night .moon { width: 140px; height: 140px; margin: 0 auto 24px; filter: drop-shadow(0 0 24px rgba(255, 229, 154, .35)); }
.night .moon svg { width: 100%; height: 100%; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pick button {
  background: var(--surface-2); color: var(--text); border: 0; padding: 14px 8px; margin: 4px; font: inherit; font-size: 18px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: var(--pxb), var(--pxs);
}
.pick button:active { transform: translate(2px, 2px); box-shadow: var(--pxb); }
.pick button .avatar { --s: 52px; }
.role-big { display: flex; justify-content: center; }
.dead { opacity: .6; }
.dead .chip { text-decoration: line-through; }
.role-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.role-tag .ic { width: 16px; height: 16px; }

/* contagem */
.countdown { position: fixed; inset: 0; background: rgba(10, 10, 20, .92); display: grid; place-items: center; z-index: 50; pointer-events: none; }
.countdown div { font-family: var(--display); font-size: 180px; color: var(--accent); text-align: center; line-height: 1.2; padding: 0 20px; text-shadow: 8px 8px 0 var(--accent-2); animation: pop .3s steps(3); }
.countdown div.go { font-size: 48px; line-height: 1.6; text-shadow: 4px 4px 0 var(--accent-2); }
@keyframes pop { from { transform: scale(.4); } }
.question { font-family: var(--display); font-size: 28px; line-height: 1.3; text-align: center; padding: 32px 12px; text-shadow: 3px 3px 0 var(--line); }

/* ---------- barra do host ---------- */
.hostbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: var(--px) solid var(--line);
  box-shadow: 0 calc(var(--px) * -1) 0 0 rgba(255, 255, 255, .05);
}
.hostbar .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.hostbar .tag { font-family: var(--display); font-size: 12px; color: var(--accent); display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.hostbar .btn { min-height: 44px; font-size: 14px; padding: 8px 10px; gap: 8px; white-space: nowrap; box-shadow: var(--pxb), inset -3px -3px 0 0 var(--bd); }
.hostbar .btn + .btn { margin-top: var(--px); }
.hostbar .btn .ic { width: 14px; height: 14px; }
body.noite .hostbar { background: #0e0f1a; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 5, 12, .7); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  padding: 20px 20px calc(22px + env(safe-area-inset-bottom));
  border-top: var(--px) solid var(--line); box-shadow: inset 0 var(--px) 0 0 var(--surface-3);
}
.modal .sheet::before { content: ''; display: block; width: 48px; height: 6px; background: var(--surface-3); margin: 0 auto 18px; }

#toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 60;
  background: #f4f4f4; color: #1a1c2c; padding: 12px 18px; font-size: 18px;
  opacity: 0; pointer-events: none; max-width: 88vw; text-align: center;
  box-shadow: var(--pxb), var(--pxs); transition: opacity .15s steps(2);
}
#toast.on { opacity: 1; }

.hero .gicon { margin: 0 auto; }

@media (min-width: 600px) {
  h1 { font-size: 40px; }
}

/* em celular: no topo, só o ícone do jogo (o nome não cabe na fonte pixel) */
@media (max-width: 440px) {
  .topbar .title .gicon + span { display: none; }
}

/* ---------- STOP ---------- */
.sorteio { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.sorteio-l {
  width: 150px; height: 150px; display: grid; place-items: center; font-family: var(--display); font-size: 110px; line-height: 1;
  background: var(--accent); color: #2a1a00; box-shadow: var(--pxb), var(--pxs), inset -8px -8px 0 0 #d9963c;
}
.sorteio-t { font-family: var(--display); font-size: 24px; text-align: center; min-height: 120px; }
.sorteio-t b { color: var(--accent); }
.sorteio-t span { display: block; font-size: 88px; color: var(--accent); text-shadow: 6px 6px 0 var(--accent-2); margin-top: 10px; }

.stop-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stop-letra {
  width: 64px; height: 72px; flex: none; margin: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--accent); color: #2a1a00; font-family: var(--display); font-size: 40px; line-height: 1;
  box-shadow: var(--pxb), inset -4px -4px 0 0 #d9963c;
}
.stop-letra small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.stop-letra.sm { width: 52px; height: 58px; font-size: 30px; }
.stop-timer { flex: 1; font-size: 44px; margin: 0; }
.stop-btn {
  flex: none; width: 104px; height: 72px; margin: 4px; border: 0; cursor: pointer; color: #fff;
  font-family: var(--display); font-size: 26px; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: #6b2a33; opacity: .75; box-shadow: var(--pxb), inset -4px -4px 0 0 rgba(0, 0, 0, .3);
}
.stop-btn small { font-size: 12px; font-family: var(--font); }
.stop-btn.pronto { background: var(--bad); opacity: 1; box-shadow: var(--pxb), var(--pxs), inset -4px -4px 0 0 #8a1820, inset 4px 4px 0 0 rgba(255, 255, 255, .25); animation: blinkt 1s steps(2) infinite; }
.stop-btn:active { transform: translate(2px, 2px); }

.stop-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 4px 16px; }
.stop-cats button {
  width: 32px; height: 32px; border: 0; cursor: pointer; font-family: var(--display); font-size: 14px; color: var(--muted);
  background: var(--surface-2); box-shadow: inset -3px -3px 0 0 rgba(0, 0, 0, .3);
}
.stop-cats button.ok { background: var(--ok); color: #0b2614; }
.stop-cats button.on { box-shadow: 0 -3px 0 0 var(--accent), 0 3px 0 0 var(--accent), -3px 0 0 0 var(--accent), 3px 0 0 0 var(--accent); color: var(--text); }
.stop-cats button.ok.on { color: #0b2614; }

.stop-card h2 { font-size: 26px; margin-bottom: 14px; }
.stop-ans {
  min-height: 56px; padding: 12px 14px; margin: 4px 4px 10px; background: #12131f; font-family: var(--display); font-size: 28px; line-height: 1.2; word-break: break-word;
  box-shadow: 0 -4px 0 0 var(--accent), 0 4px 0 0 var(--accent), -4px 0 0 0 var(--accent), 4px 0 0 0 var(--accent), inset 4px 4px 0 0 rgba(0, 0, 0, .4);
}
.caret { display: inline-block; width: 12px; height: 26px; background: var(--accent); vertical-align: -3px; margin-left: 3px; animation: blinkt 1s steps(2) infinite; }
.stop-nav { margin-top: 14px; }

.kbd { margin-top: 14px; padding: 8px 4px; background: #12131f; box-shadow: var(--pxb); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.kr { display: flex; gap: 5px; justify-content: center; }
.kr + .kr { margin-top: 6px; }
.kbd button {
  flex: 1; max-width: 42px; height: 48px; border: 0; padding: 0; cursor: pointer; color: var(--text);
  font-family: var(--display); font-size: 20px; background: var(--surface-2);
  box-shadow: inset -3px -3px 0 0 rgba(0, 0, 0, .35), inset 3px 3px 0 0 rgba(255, 255, 255, .08);
}
.kbd button:active { background: var(--accent); color: #2a1a00; box-shadow: inset 3px 3px 0 0 rgba(0, 0, 0, .3); }
.kbd button.wide { max-width: 64px; flex: 1.5; }
.kbd button.space { max-width: none; flex: 1; font-size: 15px; text-transform: uppercase; letter-spacing: .1em; }

.stop-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.stop-resp { font-family: var(--display); font-size: 22px; line-height: 1.2; margin: 2px 0 4px; word-break: break-word; }
.li.anulada .stop-resp { text-decoration: line-through; color: var(--muted); }
.stop-tag { display: inline-block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; }
.stop-tag.ok { background: #1d4a2e; color: var(--ok-text); }
.stop-tag.rep { background: #4a3d1d; color: var(--accent); }
.stop-tag.bad { background: #4a1d22; color: var(--bad-text); }
.iconbtn.voto { font-size: 18px; min-width: 52px; }
.iconbtn.voto span { font-family: var(--display); font-size: 14px; }
.iconbtn.voto.on { background: var(--bad); color: #fff; }
.li.rev { opacity: 0; transform: translateY(6px); transition: opacity .2s steps(3), transform .2s steps(3); }
.li.rev.shown { opacity: 1; transform: none; }
/* Stop: tela de escrita cabe sem rolar no celular */
.stop-top { margin-bottom: 10px; }
.stop-cats { gap: 4px; margin-bottom: 12px; flex-wrap: nowrap; }
.stop-cats button { width: auto; flex: 1; max-width: 36px; height: 30px; font-size: 13px; }
.stop-card { padding: 14px; }
.stop-card h2 { font-size: 22px; margin-bottom: 10px; }
.stop-card .eyebrow { margin-bottom: 6px; }
.stop-ans { min-height: 50px; font-size: 26px; padding: 10px 12px; margin-bottom: 8px; }
.stop-nav { margin-top: 12px; }
.stop-nav .btn { min-height: 44px; }
.kbd { margin-top: 12px; }
.kbd button { height: 44px; }

/* ---------- pop-up de boas-vindas / cookies ---------- */
.consent-bg { position: fixed; inset: 0; z-index: 90; background: rgba(5, 5, 12, .8); display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.consent { width: 100%; max-width: 440px; margin: auto; }
.consent h2 { font-size: 24px; margin: 14px 0 10px; text-align: center; }
.consent > p:first-of-type { text-align: center; }
.consent-brand .brand { width: 64px; height: 64px; }
.consent-opts { background: #12131f; padding: 12px; margin: 4px 4px 18px; box-shadow: var(--pxb); }
.consent-opts .check + .check { margin-top: 12px; }
.consent-opts input:disabled { opacity: .7; cursor: default; }
.consent .btn { margin-top: 8px; }
.consent-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
.rodape { margin-top: 18px; color: var(--muted); }
/* aviso de cookies: Aceitar e Recusar com o mesmo peso visual (Guia da ANPD) */
.consent-box { background: #12131f; padding: 14px; margin: 4px 4px 18px; box-shadow: var(--pxb); }
.consent-box p:last-child { margin-bottom: 0; }
.consent-btns { display: flex; gap: 12px; }
.consent-btns .btn { flex: 1; width: auto; min-height: 54px; margin-top: 4px; }
.consent-btns .btn + .btn { margin-top: 4px; }
.consent-atual { color: var(--accent); }

/* ---------- aviso de privacidade (estrutura: logo, título, texto, "Mais opções" + "Aceitar e continuar", rodapé) ---------- */
.consent {
  width: 100%; max-width: 560px; margin: auto; padding: 24px 24px 18px;
  background: var(--surface); box-shadow: var(--pxb), var(--pxs);
}
.consent-logo { display: flex; align-items: center; gap: 12px; }
.consent-logo .brand { width: 44px; height: 44px; margin: 0; }
.consent-logo span { font-family: var(--display); font-size: 22px; line-height: 1; color: var(--accent); }
.consent h2 { font-size: 26px; text-align: left; margin: 20px 0 14px; }
.consent p { font-size: 15px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.consent p.center { text-align: center; }
.consent .consent-atual { color: var(--accent); }
.consent-btns { display: flex; gap: 14px; margin: 20px 0 6px; }
.cbtn {
  flex: 1; min-height: 52px; padding: 10px 14px; margin: 4px; border: 0; cursor: pointer;
  font-family: var(--display); font-size: 16px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent); color: #2a1a00;
  box-shadow: var(--pxb), inset -4px -4px 0 0 #d9963c, inset 4px 4px 0 0 rgba(255, 255, 255, .35);
}
.cbtn.sec { background: var(--surface-2); color: var(--text); box-shadow: var(--pxb), inset -4px -4px 0 0 #232a40; }
.cbtn:active { transform: translate(2px, 2px); }
.consent-foot { font-size: 13px !important; text-align: center; margin: 14px 0 0 !important; }
.consent-foot a, .consent p a { color: var(--accent); }
.consent-voltar { background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }

.consent-cat { background: #12131f; padding: 12px 14px; margin: 4px 4px 14px; box-shadow: var(--pxb); }
.consent-cat p { margin: 6px 0 0; font-size: 14px; }
.consent-cat-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; color: var(--text); cursor: pointer; margin: 0; text-transform: none; letter-spacing: 0; font-family: var(--font); }
.consent-sempre { font-size: 13px; color: var(--ok-text); }
.consent-switch { position: relative; flex: none; }
.consent-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent-switch i { display: block; width: 48px; height: 24px; margin: 4px; background: #262b44; position: relative;
  box-shadow: 0 -4px 0 0 var(--surface-3), 0 4px 0 0 var(--surface-3), -4px 0 0 0 var(--surface-3), 4px 0 0 0 var(--surface-3); }
.consent-switch i::after { content: ''; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; background: var(--muted); }
.consent-switch input:checked + i { background: var(--ok); }
.consent-switch input:checked + i::after { left: 28px; background: #fff; }
.consent-switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 6px; }

@media (max-width: 420px) {
  .consent { padding: 20px 16px 16px; }
  .consent h2 { font-size: 22px; }
  .consent-btns { flex-direction: column-reverse; gap: 10px; }
}
.consent > p:first-of-type { text-align: left; }
/* "Recusar" como texto, sem cara de botão */
.cbtn.link { flex: 0 0 auto; background: none; box-shadow: none; color: var(--muted); text-decoration: underline; text-underline-offset: 5px; padding: 10px 8px; }
.cbtn.link:hover { color: var(--text); }
.cbtn.link:active { transform: none; }
.consent-btns:has(.cbtn.link) { align-items: center; }
.consent-foot .consent-voltar { font-size: 13px; color: var(--accent); }
@media (max-width: 420px) { .consent-btns .cbtn:not(.link) { align-self: stretch; } }

/* ---------- Stop: topo e teclado fixos ---------- */
body.stop-escrevendo #app { padding-bottom: calc(var(--dock-h, 260px) + 24px); }
.stop-top {
  position: sticky; top: var(--topo-h, 64px); z-index: 9;
  margin: -14px -20px 10px; padding: 10px 20px; background: var(--bg);
  border-bottom: 4px solid var(--line);
}
.stop-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 4px solid var(--line);
  box-shadow: 0 -4px 0 0 rgba(255, 255, 255, .05);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.stop-dock-in { max-width: 560px; margin: 0 auto; }
.stop-dock .stop-nav { margin: 0 0 10px; }
.stop-dock .kbd { margin: 0; box-shadow: none; padding: 6px 0 0; background: none; }
.stop-dock .kbd button { height: 46px; }

/* STOP liberado: pisca forte, alternando vermelho e amarelo */
.stop-btn.pronto { animation: stop-pisca .5s steps(1) infinite; }
@keyframes stop-pisca {
  0%   { background: var(--bad); color: #fff; transform: scale(1); }
  50%  { background: var(--accent); color: #2a1a00; transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .stop-btn.pronto { animation-duration: 1.4s; } }

/* código da sala: nunca sai da caixa */
.share .bigcode { font-size: clamp(30px, 10vw, 44px); letter-spacing: .12em; white-space: nowrap; margin-right: -.12em; }
.share-grid > div:first-child { overflow: hidden; }
@media (max-width: 400px) {
  .share-grid { flex-direction: column; align-items: stretch; text-align: center; }
  .share-grid .qr { align-self: center; }
  .share .bigcode { font-size: 48px; }
}
.stop-dock .btn { white-space: nowrap; font-size: 14px; padding-left: 10px; padding-right: 10px; }
