/* ---------- Self-hosted fonts (SIL OFL 1.1, see /fonts/LICENSE-*.txt) ---------- */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/fredoka-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/fredoka-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/fredoka-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-700-normal.woff2') format('woff2');
}

/* ==========================================================================
   VerbaPop — styles
   Mobile-first. Light/dark via prefers-color-scheme. Respects reduced motion.
   ========================================================================== */

:root {
  --bg: #f5f2ea;
  --bg-2: #ebe6d8;
  --surface: #fffdf8;
  --ink: #1d1b24;
  --ink-2: #5a5665;
  --line: #d9d2c1;
  --dot: #e2dccd;
  --focus: #3563ff;
  --hit: #13804a;
  --miss: #1d1b24;
  --danger: #b42318;

  --reveal-s: 88%;
  --reveal-l: 74%;
  --reveal-ink-l: 19%;
  --rank-l: 32%;

  --radius: 16px;
  --shadow: 0 1px 0 rgb(0 0 0 / .03), 0 12px 32px -14px rgb(50 36 10 / .28);
  --font-display: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bubble-min: 88px;
  --bubble-max: clamp(118px, 31vw, 168px);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15141b;
    --bg-2: #22212b;
    --surface: #1f1e28;
    --ink: #f3f1ea;
    --ink-2: #aba7b6;
    --line: #363443;
    --dot: #25242f;
    --focus: #8ea8ff;
    --hit: #2f9e63;
    --miss: #3a3847;
    --danger: #ff8a80;
    --reveal-s: 78%;
    --reveal-l: 66%;
    --reveal-ink-l: 12%;
    --rank-l: 80%;
    --shadow: 0 12px 32px -14px rgb(0 0 0 / .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Top bar ---------- */

.topbar {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -.01em;
}
.brand__mark { width: 34px; height: 34px; }
.brand__word b { font-weight: 700; color: #e03e3e; }
@media (prefers-color-scheme: dark) { .brand__word b { color: #ff7a7a; } }

.topbar__actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  transition: background-color .15s;
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn svg { width: 24px; height: 24px; }

#btn-sound .icon-off { display: none; }
#btn-sound[aria-pressed="false"] .icon-on { display: none; }
#btn-sound[aria-pressed="false"] .icon-off { display: block; }

.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px 0 8px;
  margin-right: 4px;
  border-radius: 999px;
  background: var(--bg-2);
  font-weight: 700;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.streak svg { width: 18px; height: 18px; color: #f76707; }
.streak.is-zero svg { color: var(--ink-2); }

/* ---------- Stage ---------- */

.stage {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 4px 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modes {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-2);
  margin: 4px 0 14px;
}
.modes__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 700;
  font-size: .95rem;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.modes__tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.modes__num { font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; }
.modes__check { color: var(--hit); font-weight: 700; }

/* ---------- Prompt card ---------- */

.prompt-card {
  width: 100%;
  text-align: center;
  margin-bottom: 6px;
}
.prompt-card__eyebrow {
  margin: 0;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.prompt-card__word {
  margin: 2px 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: .01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.prompt-card__meta {
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
.progress {
  width: min(260px, 70%);
  height: 6px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}
.progress__bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6b6b, #ffa94d, #ffd43b, #51cf66, #4dabf7, #845ef7);
  background-size: 260px 100%;
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Board & bubbles ---------- */

.board {
  list-style: none;
  width: 100%;
  margin: 0;
  padding: 18px 0 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 2.4vw, 16px);
}

.board__message {
  max-width: 440px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.board__message code {
  font-family: var(--font-mono);
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 6px;
}

.bubble {
  --d: calc(var(--bubble-min) + (var(--bubble-max) - var(--bubble-min)) * var(--s, .5));
  position: relative;
  width: var(--d);
  aspect-ratio: 1;
  flex: none;
  container-type: inline-size;
  animation: float var(--float-dur, 5s) ease-in-out var(--float-delay, 0s) infinite;
}

.bubble__body {
  position: absolute;
  inset: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10%;
  border-radius: 50%;
  text-align: center;
  border: 2px solid hsl(var(--hue) 70% 58% / .55);
  background:
    radial-gradient(circle at 30% 27%, rgb(255 255 255 / .95) 0 6%, rgb(255 255 255 / 0) 13%),
    radial-gradient(circle at 70% 78%, rgb(255 255 255 / .35) 0 4%, rgb(255 255 255 / 0) 9%),
    radial-gradient(circle at 50% 50%,
      hsl(var(--hue) 95% 88% / .25) 0%,
      hsl(var(--hue) 90% 76% / .45) 62%,
      hsl(var(--hue) 85% 62% / .75) 100%);
  box-shadow:
    inset 0 -10px 22px hsl(var(--hue) 80% 50% / .18),
    0 10px 24px -14px hsl(var(--hue) 70% 35% / .55);
  transition: transform .2s ease, box-shadow .2s ease;
}
.bubble__body:hover { transform: scale(1.03); }
.bubble.is-revealed .bubble__body:hover { transform: none; }
@media (prefers-color-scheme: dark) {
  .bubble__body {
    border-color: hsl(var(--hue) 80% 70% / .45);
    background:
      radial-gradient(circle at 30% 27%, rgb(255 255 255 / .8) 0 6%, rgb(255 255 255 / 0) 13%),
      radial-gradient(circle at 50% 50%,
        hsl(var(--hue) 80% 60% / .08) 0%,
        hsl(var(--hue) 80% 60% / .22) 62%,
        hsl(var(--hue) 80% 62% / .5) 100%);
  }
}

/* Hidden state: anchor in position + one blank per missing letter */
.bubble__pattern {
  max-width: 100%;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(9px, calc(118cqi / var(--len, 6)), 22px);
  line-height: 1.25;
  letter-spacing: .08em;
  color: var(--ink-2);
  overflow-wrap: normal;
  word-break: keep-all;
}
.bubble__pattern b {
  font-weight: 800;
  color: hsl(var(--hue) 60% var(--rank-l));
}
.bubble__pattern .is-shown {
  color: var(--ink);
  font-weight: 800;
}

.bubble__count {
  margin-top: 5%;
  font-size: clamp(8px, 10cqi, 12px);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.bubble__mark {
  position: absolute;
  top: 9%;
  right: 13%;
  width: clamp(14px, 16cqi, 22px);
  height: clamp(14px, 16cqi, 22px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffd43b;
  color: #1d1b24;
  font-size: clamp(9px, 10cqi, 13px);
  font-weight: 800;
  line-height: 1;
}
.bubble__mark:empty,
.bubble.is-revealed .bubble__mark { display: none; }

.bubble__word { display: none; }

/* Selected (hint target) */
.bubble.is-selected:not(.is-revealed) .bubble__body {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 6px var(--ink),
    0 10px 24px -14px hsl(var(--hue) 70% 35% / .55);
}

/* Revealed */
.bubble.is-revealed .bubble__body {
  cursor: default;
  border-color: transparent;
  color: hsl(var(--hue) 60% var(--reveal-ink-l));
  background:
    radial-gradient(circle at 30% 25%, rgb(255 255 255 / .55) 0 5%, rgb(255 255 255 / 0) 14%),
    radial-gradient(circle at 50% 45%,
      hsl(var(--hue) var(--reveal-s) calc(var(--reveal-l) + 10%)) 0%,
      hsl(var(--hue) var(--reveal-s) var(--reveal-l)) 60%,
      hsl(var(--hue) calc(var(--reveal-s) - 8%) calc(var(--reveal-l) - 9%)) 100%);
  box-shadow: 0 12px 26px -12px hsl(var(--hue) 70% 35% / .6);
}
.bubble.is-revealed .bubble__pattern,
.bubble.is-revealed .bubble__count { display: none; }
.bubble.is-revealed .bubble__word {
  display: block;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(9px, min(19cqi, calc(92cqi / var(--len, 6))), 30px);
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: normal;
  word-break: keep-all;
}
.bubble__word .is-anchor { opacity: .55; }

/* Pop sequence */
.bubble.is-popping { animation: none; }
.bubble.is-popping .bubble__body { animation: pop .22s ease-in forwards; }
.bubble.is-fresh .bubble__body { animation: settle .55s cubic-bezier(.34, 1.56, .64, 1); }

.bubble__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid hsl(var(--hue) 85% 60%);
  pointer-events: none;
  animation: ring .5s ease-out forwards;
}
.bubble__spark {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--sz, 8px); height: var(--sz, 8px);
  margin: calc(var(--sz, 8px) / -2);
  border-radius: 50%;
  background: hsl(var(--hue) 90% 62%);
  pointer-events: none;
  animation: spark .6s cubic-bezier(.2, .7, .3, 1) forwards;
}

.bubble.is-nudge .bubble__body { animation: wobble .45s ease; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  55% { transform: scale(1.16); opacity: 1; }
  100% { transform: scale(.15); opacity: 0; }
}
@keyframes settle {
  0% { transform: scale(.35); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes ring {
  from { transform: scale(.85); opacity: .9; }
  to { transform: scale(1.65); opacity: 0; }
}
@keyframes spark {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}
@keyframes wobble {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.07, .94); }
  60% { transform: scale(.96, 1.04); }
}

/* ---------- Misses ---------- */

.misses-wrap { width: 100%; }
.misses {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 8px;
}
.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: .88rem;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.chip.is-new { animation: chip-in .3s ease; }
@keyframes chip-in {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- Dock (guess input) ---------- */

.dock {
  position: sticky;
  bottom: 0;
  z-index: 10;
  width: 100%;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 22px);
}

.guess,
.done-bar {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}
.guess.is-shake { animation: shake .4s ease; }

.guess__input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 17px; /* >=16px prevents iOS zoom-on-focus */
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.guess__input::placeholder { color: var(--ink-2); opacity: .8; }
.guess__input:focus { outline: none; border-color: var(--ink); }
.guess__input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 18px;
  border: 2px solid transparent;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  transition: transform .1s, background-color .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-2); }
.btn--block { width: 100%; }
.btn--danger { color: var(--danger); }
.btn--danger.is-armed { background: var(--danger); border-color: var(--danger); color: #fff; }

.done-bar { align-items: center; }
.done-bar__label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}
.done-bar__label::before { content: '✓ '; color: var(--hit); }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* ---------- Sub-navigation (today's slots / back to today) ---------- */

.subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.subnav__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.subnav__btn:hover { border-color: var(--ink-2); }
.subnav__btn[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.subnav__btn .is-done { color: var(--hit); }
.subnav__btn[aria-current="true"] .is-done { color: inherit; }

.board__message .btn { margin-top: 14px; }
.board__message p { margin: 0; }

.browse__status.is-today { color: var(--ink); }

/* ---------- About / FAQ (below the board) ---------- */

.about {
  width: 100%;
  max-width: 620px;
  margin: 40px auto 8px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: .98rem;
}
.about h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
}
.about h2:not(:first-child) { margin-top: 28px; }
.about h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--ink);
}
.about p { margin: 0 0 10px; }
.about b { color: var(--ink); }
.about a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.about__games {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.about__games > div {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
@media (min-width: 560px) { .about__games { grid-template-columns: 1fr 1fr; } }
.about details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.about summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}
.about details p { margin: 8px 0 0; }

/* ---------- Site footer (game page + content pages) ---------- */

.site-foot {
  width: 100%;
  max-width: 960px;
  margin: 48px auto 0;
  padding: 20px 0 8px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 20px;
  font-size: .88rem;
  color: var(--ink-2);
}
.site-foot p { margin: 0; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--ink-2); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--ink); }
.stage > .site-foot { max-width: 620px; margin-top: 16px; border-top: 0; }
.is-typing .site-foot { display: none !important; }

/* ---------- Mobile typing mode ----------
   While the on-screen keyboard is up, pin the game to the visible viewport
   (above the keyboard) and shrink the chrome so every bubble stays in view. */

body.is-typing {
  position: fixed;
  top: var(--vv-top, 0px);
  left: 0;
  right: 0;
  height: var(--vv-h, 100dvh);
  min-height: 0;
  overflow: hidden;
}
.is-typing .skip-link,
.is-typing .topbar,
.is-typing .modes,
.is-typing .prompt-card__eyebrow,
.is-typing .prompt-card__meta,
.is-typing .subnav,
.is-typing .misses-wrap,
.is-typing .about { display: none !important; }

.is-typing .stage {
  flex: 1 1 auto;
  min-height: 0;
  padding-top: calc(6px + env(safe-area-inset-top));
  padding-bottom: 0;
  overflow: hidden;
}
.is-typing .prompt-card { flex: none; margin-bottom: 0; }
.is-typing .prompt-card__word { margin: 0; font-size: clamp(1.5rem, 7vw, 2rem); }
.is-typing .progress { margin-top: 6px; height: 4px; }
.is-typing .board {
  flex: 1 1 auto;
  min-height: 0;
  align-content: center;
  gap: 8px;
  padding: 8px 0;
}
.is-typing .bubble { width: var(--compact-d, 72px); }
.is-typing .board.is-tight .bubble__count { display: none; }
.is-typing .dock {
  position: static;
  flex: none;
  padding-top: 6px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.is-typing .clue { margin-bottom: 6px; padding: 6px 12px; font-size: .88rem; }
.is-typing .toast {
  top: auto;
  bottom: var(--toast-bottom, 140px);
  transform: translate(-50%, 8px);
}
.is-typing .toast.is-show { transform: translate(-50%, 0); }

/* ---------- Clue bar ---------- */

.clue {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: .95rem;
}
.clue__label {
  flex: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .06em;
  color: var(--ink-2);
}
.clue__text { font-weight: 500; }
.clue.is-new { animation: chip-in .3s ease; }

/* ---------- Help example ---------- */

.example {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: .95rem;
  letter-spacing: .06em;
}
.example__anchor {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: .04em;
}
.example__pair { color: var(--ink-2); }
.example__pair b { color: var(--ink); }
.example__pair i { font-style: normal; margin: 0 6px; }
.example__pair em { font-style: normal; font-weight: 700; color: #e03e3e; }
@media (prefers-color-scheme: dark) { .example__pair em { color: #ff7a7a; } }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--vv-top, 0px) + 14px + env(safe-area-inset-top));
  z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--miss);
  color: #fff;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast--hit { background: var(--hit); }
.toast--info { background: #5a5665; }

/* ---------- Dialogs ---------- */

.dlg {
  width: min(calc(100vw - 32px), 440px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .45);
}
.dlg[open] { animation: dlg-in .28s cubic-bezier(.22, 1, .36, 1); }
.dlg::backdrop { background: rgb(18 16 26 / .55); backdrop-filter: blur(3px); }
@keyframes dlg-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.dlg__inner { position: relative; padding: 26px 22px 22px; }
.dlg__close { position: absolute; top: 10px; right: 10px; }
.dlg__eyebrow {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.dlg__title {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1.1;
}
.dlg__sub { margin: 0 0 16px; color: var(--ink-2); }
.dlg__actions { display: grid; gap: 10px; margin-top: 18px; }
.dlg__actions form { margin: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
}
.stats div {
  padding: 10px 4px;
  border-radius: 14px;
  background: var(--bg-2);
  text-align: center;
}
.stats dt {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.countdown {
  margin: 14px 0 0;
  text-align: center;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.countdown strong { color: var(--ink); }

.rules {
  margin: 8px 0 14px;
  padding-left: 1.3em;
  display: grid;
  gap: 8px;
}

.browse {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 52vh;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}
.browse__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--bg-2);
  text-align: left;
}
.browse__item:hover { border-color: var(--line); }
.browse__item[aria-current="true"] { border-color: var(--ink); }
.browse__name { flex: 1; font-weight: 700; }
.browse__cat { display: block; font-weight: 500; font-size: .82rem; color: var(--ink-2); }
.browse__status {
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.browse__status.is-done { color: var(--hit); }

/* ---------- Confetti & misc ---------- */

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  pointer-events: none;
}

.noscript { text-align: center; padding: 24px; }

@media (min-width: 640px) {
  .stage { padding-top: 12px; }
  .board { padding: 26px 0 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
