/* Kit dos jogos novos do Gamezi (Emojizi, Contazi, Memorizi): mesmas cores, fonte e peças do Topzi e do Gamezi
   (vermelho, preto e creme; ver brand.html). As telas são montadas por gamezi-kit.js; cada jogo põe o resto no style.css dele. */
:root {
  --accent: #FF4D3D; --accent-ink: #D93A2B; --accent-soft: #FFE1D4; --on-accent: #171717;
  --bad: #B8261A; --good: #1F8A4C; --duck: #FFC93C;
  --bg: #FFF4DE; --surface: #F7E7C8; --fg: #171717; --muted: #6B6151; --line: #E8D5B0;
  --r: 16px; --r-sm: 11px;
  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-ink: #FF6B5D; --accent-soft: #3B1F1A; --bad: #FF8A7F; --good: #5FD48E;
    --bg: #171717; --surface: #232120; --fg: #FFF4DE; --muted: #B5AA93; --line: #38342F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent-ink: #FF6B5D; --accent-soft: #3B1F1A; --bad: #FF8A7F; --good: #5FD48E;
  --bg: #171717; --surface: #232120; --fg: #FFF4DE; --muted: #B5AA93; --line: #38342F;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Nada passa da largura da tela no celular (nem animação de entrada), senão o navegador afasta o zoom. */
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); line-height: 1.45; min-height: 100vh; transition: background-color .25s, color .25s; }
main { max-width: 640px; margin: 0 auto; padding: 0 16px 80px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-stretch: 75%; font-weight: 800; letter-spacing: -0.01em; line-height: 1; }
h2 { font-size: 2.2rem; margin: 24px 0 12px; }
h3 { font-size: 1.5rem; margin: 32px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: inherit; }

/* ── topo ── */
.topbar { max-width: 800px; margin: 0 auto; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topbar-actions { display: flex; gap: 6px; align-items: center; }
.logo-btn { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; }
.logo { height: 34px; width: auto; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: inline !important; }
  :root:not([data-theme="light"]) .home-symbol.logo-dark { display: block !important; }
}
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: inline !important; }
:root[data-theme="dark"] .home-symbol.logo-dark { display: block !important; }
.lang-select {
  appearance: none; font: inherit; font-weight: 700; font-size: .85rem; color: var(--fg);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: .45rem .8rem; min-height: 40px; cursor: pointer;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  color: var(--fg); background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
}
.ui-ico { width: 20px; height: 20px; }
.lang-select:hover, .icon-btn:hover { border-color: var(--fg); }
.lang-select:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) {
  .logo { height: 25px; }
  .topbar-actions { gap: 4px; }
  .icon-btn { width: 36px; height: 36px; }
  .lang-select { min-height: 36px; padding: .35rem .6rem; }
}

/* ── botões ── */
button { font: inherit; cursor: pointer; color: inherit; }
.btn { border: 0; border-radius: 999px; padding: 12px 24px; font-weight: 700; background: var(--accent); color: var(--on-accent); transition: filter .12s, transform .08s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; filter: none; transform: none; }
.btn.big { font-size: 1.1rem; padding: 16px 44px; }
.btn.small { padding: 8px 16px; font-size: .88rem; }
.btn.ghost { background: var(--surface); color: var(--fg); }
.btn.ghost:hover { filter: none; background: var(--line); }
.btn.dark { background: var(--fg); color: var(--bg); }
.text-btn { border: 0; background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: .85rem; font-weight: 700; }
.text-btn:hover { background: var(--line); }
.link-btn { background: none; border: 0; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.link-btn:hover { color: var(--fg); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; align-items: center; }
.actions.end { justify-content: flex-end; }
.actions.center { justify-content: center; }
.feedback { min-height: 1.2em; margin: 10px 0 0; font-weight: 700; font-size: .9rem; }

.dialog {
  border: 0; padding: 0; border-radius: 22px; background: var(--bg); color: var(--fg);
  width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.dialog::backdrop { background: rgba(10, 10, 10, .6); }
.dialog-inner { padding: 20px; display: grid; gap: 12px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; }
.dialog-head h2 { margin: 0; font-size: 1.8rem; }
.help-body p { margin: 0 0 10px; }
.help-body h3 { margin: 18px 0 8px; font-size: 1.3rem; }
.help-steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.help-steps li { counter-increment: s; position: relative; background: var(--surface); border-radius: var(--r); padding: 10px 12px 10px 48px; }
.help-steps li::before { content: counter(s); position: absolute; left: 12px; top: 9px; width: 26px; font-stretch: 75%; font-weight: 800; font-size: 1.6rem; line-height: 1; color: var(--accent-ink); text-align: center; }

/* ── início simples (no jeito do Contexto e do Termo): uma coluna, o jogo do dia e dois botões ── */
.home { max-width: 460px; margin: 0 auto; padding-top: 8px; display: grid; gap: 12px; }
.home-head { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 6px 0 4px; }
.home-symbol { display: block; width: 68px; height: auto; }
.home-tag { margin: 0; font-stretch: 100%; font-size: 1.1rem; font-weight: 600; line-height: 1.35; letter-spacing: 0; text-transform: none; max-width: 28ch; }
.home-account { display: flex; justify-content: center; }
.home-card { background: var(--surface); border-radius: var(--r); padding: 14px 16px; }
.home-row { display: flex; align-items: center; gap: 12px; }
.home-row > div { flex: 1; display: grid; gap: 2px; }
.home-row b, .daily-name { font-stretch: 75%; font-weight: 800; font-size: 1.4rem; line-height: 1.05; }
.home-row span { color: var(--muted); font-size: .85rem; }
.daily { border: 2px solid var(--accent); display: grid; gap: 12px; }
.daily-top { display: flex; align-items: center; gap: 10px; }
.daily-date { margin-right: auto; color: var(--muted); font-size: .9rem; font-weight: 600; }
.daily-status { margin: 0; font-size: .88rem; color: var(--muted); text-align: center; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .day {
  display: grid; justify-items: center; padding: 6px 0; cursor: pointer;
  font: inherit; color: var(--fg); background: var(--bg); border: 0; border-radius: 10px;
}
.week .day small { font-size: .68rem; font-weight: 700; color: var(--muted); }
.week .day b { font-size: 1.05rem; }
.week .day.done { background: var(--accent); color: var(--on-accent); }
.week .day.done small { color: inherit; opacity: .8; }
.week .day.today { box-shadow: inset 0 0 0 2px var(--fg); }
.week .day:disabled { background: transparent; opacity: .45; cursor: default; }
.home-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px; margin-top: 4px; }
.home-links .link-btn, .home-links a { font-size: .95rem; font-weight: 700; color: var(--fg); text-decoration: none; padding: 6px 0; }
.home-links a:hover, .home-links .link-btn:hover { color: var(--accent-ink); }
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 20px; margin-top: 8px; font-size: .78rem; }
.site-foot a { color: var(--muted); font-weight: 600; text-underline-offset: 3px; }
.site-foot a:hover { color: var(--fg); }
.site-foot span { color: var(--muted); }

/* ── configurações ── */
.settings-dialog { width: min(400px, calc(100vw - 24px)); }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1.5px solid var(--line); font-weight: 700; }
.setting-row:last-child { border-bottom: 0; }

/* ── voltar para o Gamezi (seta à esquerda do logo, na tela inicial do jogo) ── */
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gamezi-back { flex: none; text-decoration: none; }
body[data-screen]:not([data-screen="home"]) .gamezi-back { display: none; }

.game-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; }
.game-head b { flex: 1; min-width: 0; font-stretch: 75%; font-weight: 800; font-size: 1.4rem; line-height: 1.05; }
.game-score { font-weight: 800; color: var(--muted); white-space: nowrap; }
  width: 100%; min-height: 36px; padding: 6px; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700;
  color: var(--accent-ink); background: transparent; border: 2px dashed var(--accent); border-radius: var(--r-sm);
}
.game-round { font-weight: 800; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; background: var(--fg); color: var(--bg); border-radius: 999px; padding: 3px 10px; font-size: .85rem; }
.timer.pouco { background: var(--accent); color: var(--on-accent); }

  display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px 18px; text-align: left; cursor: pointer;
  font: inherit; color: var(--bg); background: var(--fg); border: 0; border-radius: var(--r); transition: transform .08s, filter .12s;
}

  flex: 1; min-width: 0; font: inherit; font-weight: 800; font-size: 1.6rem; text-align: center; letter-spacing: .08em;
  color: var(--fg); background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 8px 16px;
  appearance: textfield; -moz-appearance: textfield;
}

/* ── online: quem já respondeu e quem pontuou ── */
.sent { text-align: center; font-weight: 700; color: var(--muted); margin: 0; }
.players { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.player { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: .82rem; font-weight: 700; }
.player small { color: var(--muted); font-weight: 600; }
.player.ok small { color: var(--good); }
.player.ganhou { background: var(--good); color: #fff; }
.player.ganhou small { color: #fff; opacity: .9; }
.player.away { opacity: .5; }
.player .pts { background: var(--fg); color: var(--bg); border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.player.ganhou .pts { background: #fff; color: var(--good); }

/* ── resultado ── */
.result-head { text-align: center; padding: 16px 0 4px; }
.kicker { margin: 0; font-weight: 800; color: var(--accent-ink); }
.result-score { margin: 4px 0; font-stretch: 75%; font-weight: 800; font-size: clamp(2.8rem, 14vw, 4.6rem); line-height: 1; }
.result-head .muted { margin: 0; }


/* ── modos de jogo (partida livre e sala) ── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; background: var(--bg); color: var(--fg); font: inherit; font-weight: 700; font-size: .82rem; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.chip.active { background: var(--fg); color: var(--bg); }
.chip:disabled { cursor: default; }
.home-card .chips { margin-top: 12px; }
.home-card > .card-label + .chips { margin-top: 0; }

/* ── online e sala ── */
.narrow { max-width: 560px; margin: 0 auto; }
.nick { display: grid; gap: 4px; margin-top: 16px; }
.nick span { font-size: .78rem; color: var(--muted); font-weight: 700; }
.nick input, .code-input { font: inherit; font-weight: 700; width: 100%; min-width: 0; color: var(--fg); background: var(--bg); border: 2px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.nick input:focus, .code-input:focus { outline: none; border-color: var(--fg); }
.code-input { text-transform: uppercase; letter-spacing: .2em; font-size: 1.3rem; text-align: center; }
.online-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.online-box { display: grid; gap: 10px; align-content: start; margin: 0; }
.online-box .card-label, .online-box p { margin: 0; }
.card-label { font-weight: 800; margin: 0 0 8px; }
@media (max-width: 560px) { .online-grid { grid-template-columns: 1fr; } }
.lobby-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.lobby-top p { margin: 0; }
.room-code { font-stretch: 75%; font-weight: 800; font-size: clamp(3rem, 16vw, 5rem); letter-spacing: .12em; line-height: 1; color: var(--accent-ink); }
.lobby-players { display: grid; gap: 6px; margin-bottom: 16px; }
.lobby-player { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r); padding: 8px 8px 8px 12px; min-height: 44px; }
.lobby-player b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-player b small { color: var(--muted); font-weight: 600; }
.lobby-player i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.lobby-player.here i { background: var(--good); }

/* ── resultado: placar online e lista de rodadas ── */
.ranking { list-style: none; margin: 16px auto; padding: 0; display: grid; gap: 4px; max-width: 520px; }
.ranking li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-radius: var(--r-sm); font-weight: 700; }
.ranking li.first { box-shadow: inset 0 0 0 2px var(--accent); }
.ranking li .pos { font-stretch: 75%; font-weight: 800; font-size: 1.2rem; color: var(--muted); width: 2em; }
.ranking li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Ranking do dia (../gamezi-ranking.js): posição, nome, tempo (desempate) e pontos */
.leaderboard { max-width: 520px; margin: 24px auto; }
.leaderboard h3 { margin: 0 0 10px; }
.lb-pos { margin: 0 0 10px; font-weight: 800; font-size: 1.1rem; color: var(--accent-ink); }
.lb-row { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 11px; }
.lb-row:nth-child(odd) { background: var(--surface); }
.lb-row.me { box-shadow: inset 0 0 0 2px var(--accent); }
.lb-row span { font-stretch: 75%; font-weight: 800; font-size: 1.2rem; color: var(--muted); text-align: center; }
.lb-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row em { font-style: normal; font-stretch: 75%; font-weight: 800; font-size: 1.3rem; color: var(--accent-ink); }
.lb-time { font-style: normal; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-note { margin: 8px 0 0; text-align: center; }
.lb-form { display: flex; gap: 8px; }
.lb-input { flex: 1; min-width: 0; font: inherit; color: var(--fg); background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 16px; }
.lb-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── skins no online (../gamezi-skins.js) ── */
.player .gz-face { width: 22px; height: 22px; margin-left: -6px; }
.lobby-player .gz-face { width: 30px; height: 30px; }
.ranking li .gz-face { width: 28px; height: 28px; }
.skin-mini { flex: none; border: 2px solid var(--line); background: var(--bg); border-radius: 50%; padding: 0; line-height: 0; cursor: pointer; }
.skin-mini:hover { border-color: var(--fg); }

/* ── partida (gamezi-kit.js): placar no alto, barra do tempo, a rodada do jogo e o resultado da rodada ── */
.hud { display: flex; align-items: center; gap: 10px; margin: 8px 0 8px; min-height: 36px; }
.hud b { flex: 1; min-width: 0; font-stretch: 75%; font-weight: 800; font-size: 1.4rem; line-height: 1.05; }
.hud .lives { display: flex; gap: 2px; align-items: center; }
.hud .heart svg { width: 20px; height: 20px; fill: var(--accent); }
.hud .heart.lost svg { fill: var(--line); }
.timebar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 0 0 14px; }
.timebar i { display: block; height: 100%; background: var(--fg); transform-origin: left; }
.timebar.low i { background: var(--accent); }
.round { display: grid; gap: 12px; }
.feedback-box { margin-top: 14px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.verdict { margin: 0; font-stretch: 75%; font-weight: 800; font-size: 1.8rem; line-height: 1; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.verdict-sub { margin: 0; font-weight: 700; color: var(--muted); }
.rounds { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rounds li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-radius: var(--r-sm); }
.rounds li span { flex: 1; min-width: 0; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.rounds li em { display: block; font-style: normal; font-size: .85rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.rounds li b { font-stretch: 75%; font-weight: 800; font-size: 1.3rem; color: var(--accent-ink); white-space: nowrap; }
.rounds li.no b { color: var(--muted); }

/* ── skins no online (../gamezi-skins.js) ── */
.player .gz-face { width: 22px; height: 22px; margin-left: -6px; }
.lobby-player .gz-face { width: 30px; height: 30px; }
.ranking li .gz-face { width: 28px; height: 28px; }
.skin-mini { flex: none; border: 2px solid var(--line); background: var(--bg); border-radius: 50%; padding: 0; line-height: 0; cursor: pointer; }
.skin-mini:hover { border-color: var(--fg); }
