body { margin: 0; }

/* Layout: single centered column, like a TV quiz board — six clue slots stacked, guess bar below, word progress above. */
:root {
  --bg: #EDF0FA;
  --surface: #FFFFFF;
  --ink: #141A33;
  --muted: #59628A;
  --line: #D4D9EE;
  --bulb: #FFC21A;
  --bulb-ink: #1A1400;
  --studio: #2B43D1;
  --studio-ink: #FFFFFF;
  --slot: #E1E5F5;
  --wa: #128C4A; --wa-ink: #FFFFFF; --bubble: #D9FDD3; --bubble-ink: #111B21; --chat: #EFEAE2;
  --good: #17895A;
  --bad: #C93A33;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1227; --surface: #161D3B; --ink: #EDF0FF; --muted: #9AA3CB; --line: #2A3462;
    --bulb: #FFC93D; --bulb-ink: #1A1400; --studio: #6C82FF; --studio-ink: #0D1227;
    --slot: #1D2550; --good: #3CC98A; --bad: #FF6B63; --wa: #25D366; --wa-ink: #0B141A; --bubble: #005C4B; --bubble-ink: #E9EDEF; --chat: #0B141A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1227; --surface: #161D3B; --ink: #EDF0FF; --muted: #9AA3CB; --line: #2A3462;
  --bulb: #FFC93D; --bulb-ink: #1A1400; --studio: #6C82FF; --studio-ink: #0D1227;
  --slot: #1D2550; --good: #3CC98A; --bad: #FF6B63; --wa: #25D366; --wa-ink: #0B141A; --bubble: #005C4B; --bubble-ink: #E9EDEF; --chat: #0B141A; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 40px;
}
.wrap { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 900; font-size: 2.6rem; line-height: .9; letter-spacing: .01em; text-transform: uppercase; }
.brand span { color: var(--studio); }
.meta { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; text-align: right; }

.how { font-size: .92rem; color: var(--muted); margin: -8px 0 0; max-width: 62ch; }

.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pip {
  height: 44px; border-radius: 6px; background: var(--slot); display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--muted);
  border: 2px solid transparent; font-variant-numeric: tabular-nums;
}
.lvl { color: var(--studio); }
button:disabled { opacity: .55; cursor: wait; }
.error { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; color: var(--bad); }
footer { font-size: .8rem; color: var(--muted); text-align: center; }
.pip.current { border-color: var(--studio); color: var(--ink); }
.pip.won { background: var(--good); color: #fff; }
.pip.lost { background: var(--bad); color: #fff; }

.board { display: flex; flex-direction: column; gap: 8px; }
.slot {
  display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 12px;
  min-height: 58px; padding: 0 16px; border-radius: 8px; background: var(--slot); color: var(--muted);
}
.slot .n { font-family: var(--display); font-weight: 800; font-size: 1rem; opacity: .7; }
.slot .w { font-family: var(--display); font-weight: 800; font-size: 1.75rem; text-transform: uppercase; letter-spacing: .03em; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.slot .p { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.slot.on { background: var(--bulb); color: var(--bulb-ink); box-shadow: inset 0 -4px 0 rgba(0,0,0,.14); }
.slot.on .n { opacity: .55; }
.slot.next { outline: 2px dashed var(--line); outline-offset: -2px; background: transparent; }
.slot.fresh { animation: flip .45s cubic-bezier(.2,.8,.3,1.2); }
@keyframes flip { from { transform: rotateX(90deg); opacity: .3; } to { transform: none; opacity: 1; } }

.guesses { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.guesses:empty { display: none; }
.chip { font-size: .85rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: line-through; text-decoration-color: var(--bad); }

form.guess { display: flex; gap: 8px; }
form.guess input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: 14px 16px; border-radius: 8px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
}
form.guess input:focus { outline: none; border-color: var(--studio); }
button {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 8px; border: 0; padding: 14px 18px;
  background: var(--studio); color: var(--studio-ink);
}
button:focus-visible, .ghost:focus-visible { outline: 3px solid var(--bulb); outline-offset: 2px; }
button:hover { filter: brightness(1.08); }
.ghost { background: transparent; color: var(--studio); border: 2px solid var(--line); padding: 10px 14px; font-size: .9rem; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.msg { font-size: .92rem; color: var(--muted); min-height: 1.4em; }
.msg.bad { color: var(--bad); }
.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

.result { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.result .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.result .label.won { color: var(--good); } .result .label.lost { color: var(--bad); }
.result .answer { font-family: var(--display); font-weight: 900; font-size: 2.6rem; text-transform: uppercase; line-height: 1; }

.final { display: flex; flex-direction: column; gap: 18px; }
.score { display: flex; align-items: baseline; gap: 10px; }
.score b { font-family: var(--display); font-weight: 900; font-size: 5rem; line-height: .9; color: var(--studio); font-variant-numeric: tabular-nums; }
.score span { color: var(--muted); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
td { padding: 10px 4px; border-bottom: 1px solid var(--line); }
td:first-child { font-family: var(--display); font-weight: 800; font-size: 1.3rem; text-transform: uppercase; }
td.r { text-align: right; color: var(--muted); font-size: .9rem; }
td.pts { text-align: right; font-weight: 700; width: 4.5rem; }
pre.share { margin: 0; font: inherit; white-space: pre-wrap; background: var(--slot); padding: 12px 14px; border-radius: 8px; }
.clock { font-family: var(--display); font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .slot.fresh, .shake { animation: none; } }
@media (max-width: 420px) { .slot .w { font-size: 1.45rem; } .brand { font-size: 2.2rem; } }

/* ---- jogo: dica mais recente colada na caixa de texto ---- */
.upcoming { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.upcoming .pill { border: 2px dashed var(--line); border-radius: 6px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.play { display: flex; flex-direction: column; gap: 10px; scroll-margin-bottom: 12px; }
#hint-btn { white-space: nowrap; }
@media (max-width: 480px) {
  .how { font-size: .85rem; }
  .slot { min-height: 48px; padding: 0 12px; gap: 10px; }
  .slot .w { font-size: 1.45rem; }
  .progress .pip { height: 36px; }
  .wrap { gap: 16px; }
}

/* ---- resultado / compartilhar ---- */
.verdict { font-family: var(--display); font-weight: 800; font-size: 1.6rem; text-transform: uppercase; }
.chat { background: var(--chat); border-radius: 12px; padding: 14px; }
.bubble {
  background: var(--bubble); color: var(--bubble-ink); border-radius: 10px 10px 10px 2px; padding: 10px 12px 8px;
  max-width: 320px; font-size: .95rem; line-height: 1.45; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.12); overflow-wrap: anywhere;
}
.bubble a { color: inherit; }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.share-actions > * { flex: 1 1 auto; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-wa { background: var(--wa); color: var(--wa-ink); border-radius: 8px; padding: 14px 18px; font-weight: 700; }
.btn-wa:focus-visible { outline: 3px solid var(--bulb); outline-offset: 2px; }
.btn-wa svg { width: 20px; height: 20px; fill: currentColor; }
