/* ==========================================================================
   Gamesupa — shared styles
   Tokens → base → layout → site chrome → home → pages → game shell → UI kit
   Games add their own styles in src/games/<id>/game.css, scoped to .<id>
   ========================================================================== */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage.woff2") format("woff2-variations"),
       url("../fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* The four Ludo colours are the brand. */
  --red: #E5484D;
  --green: #1FA97A;
  --yellow: #F2B630;
  --blue: #2F5BEA;

  --bg: #F2F3F7;
  --surface: #FFFFFF;
  --surface-2: #E7E9F1;
  --ink: #1A1D3A;
  --ink-2: #3A3E5E;
  --muted: #646882;
  --line: #DCDFE9;
  --accent: var(--blue);
  --on-accent: #FFFFFF;
  --focus: #2F5BEA;

  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;

  /* Type scale (1.25) */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5625rem;
  --t-2xl: 1.953rem;

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --pill: 999px;

  --gutter: 16px;
  --max: 1120px;
  --bar-h: 56px;

  --lift: 0 1px 0 rgb(26 29 58 / 0.05), 0 10px 30px -14px rgb(26 29 58 / 0.35);
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13152B;
    --surface: #1C1F3A;
    --surface-2: #262A4A;
    --ink: #ECEEF8;
    --ink-2: #C9CCE0;
    --muted: #9A9EBC;
    --line: #2C3052;
    --accent: #5C7CFF;
    --focus: #8EA4FF;
    --lift: 0 1px 0 rgb(0 0 0 / 0.2), 0 14px 34px -16px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13152B;
  --surface: #1C1F3A;
  --surface-2: #262A4A;
  --ink: #ECEEF8;
  --ink-2: #C9CCE0;
  --muted: #9A9EBC;
  --line: #2C3052;
  --accent: #5C7CFF;
  --focus: #8EA4FF;
  --lift: 0 1px 0 rgb(0 0 0 / 0.2), 0 14px 34px -16px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

@media (min-width: 720px) {
  :root { --gutter: 28px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.55;
  font-weight: 420;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
main { flex: 1 0 auto; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 680; letter-spacing: -0.02em; }
p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* ---------- Brand ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 720; font-size: 1.3125rem; letter-spacing: -0.03em;
}
.brand .logo-mark { width: 34px; height: 26px; flex: none; }
.brand--small { font-size: 1.0625rem; gap: 8px; }
.brand--small .logo-mark { width: 27px; height: 20px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--pill);
  background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none;
  transition: background-color .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn[hidden] { display: none; }

.sound-toggle .i-sound-off { display: none; }
.sound-toggle[aria-pressed="false"] .i-sound-on { display: none; }
.sound-toggle[aria-pressed="false"] .i-sound-off { display: block; }
.sound-toggle[aria-pressed="false"] { color: var(--muted); }

.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}

/* ---------- Site header ---------- */
.site-header { padding-top: env(safe-area-inset-top); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav > a {
  padding: 10px 14px; border-radius: var(--pill);
  text-decoration: none; font-weight: 560; color: var(--ink-2);
}
.header-nav > a:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.footer-row {
  display: grid; gap: 14px 24px; align-items: center;
  grid-template-columns: 1fr; padding-block: 28px 36px;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-nav a { text-decoration: none; color: var(--ink-2); font-weight: 520; padding: 6px 0; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.footer-note { color: var(--muted); font-size: var(--t-sm); }
.footer-games { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: var(--t-sm); grid-column: 1 / -1; }
.footer-games span { color: var(--muted); padding: 6px 0; }
.footer-games a { color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.footer-games a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 720px) {
  .footer-row { grid-template-columns: auto 1fr; }
  .footer-nav { justify-content: flex-end; }
  .footer-note { grid-column: 1 / -1; }
}

/* ---------- Home ---------- */
.hero { padding-block: 28px 36px; }
.hero h1 {
  font-size: clamp(2.6rem, 10.5vw, 5.25rem);
  line-height: 0.98;
  font-weight: 760;
  letter-spacing: -0.045em;
  max-width: 12ch;
}
.hero .lede {
  margin-top: 18px; max-width: 38ch;
  font-size: clamp(1.0625rem, 2.6vw, 1.25rem);
  color: var(--ink-2); line-height: 1.45;
}
@media (min-width: 900px) { .hero { padding-block: 48px 64px; } }

/* Game shelf */
.game-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 26px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.game-card { min-width: 0; }
.game-card > a { display: flex; flex-direction: column; height: 100%; gap: 12px; text-decoration: none; color: inherit; border-radius: var(--r-lg); }
.game-card > a:focus-visible { outline-offset: 6px; }
.cover {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  background: var(--c, var(--surface-2));
  isolation: isolate;
}
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.game-card > a:hover .cover img { transform: scale(1.035); }
.game-card > a:active .cover img { transform: scale(0.99); transition-duration: .1s; }

.card-meta { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 2px; align-items: baseline; padding-inline: 2px; }
.card-title { font-size: var(--t-lg); font-weight: 680; letter-spacing: -0.02em; line-height: 1.2; }
.card-line { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-sm); line-height: 1.4; }
.card-stat {
  grid-row: 1; grid-column: 2;
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.card-stat:empty { display: none; }

.game-card.is-featured { grid-column: 1 / -1; }
.game-card.is-featured .cover { aspect-ratio: 16 / 10; border-radius: var(--r-xl); }
.game-card.is-featured .card-title { font-size: var(--t-xl); }
.game-card.is-featured .card-line { font-size: var(--t-md); }

@media (min-width: 640px) {
  .game-grid { gap: 32px 20px; }
}
@media (min-width: 900px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; }
  /* With only a few games every card is the same size. */
  .game-card.is-featured { grid-column: auto; }
  .game-card.is-featured .cover { aspect-ratio: 1; border-radius: var(--r-lg); }
  .game-card.is-featured .card-title { font-size: var(--t-lg); }
  .game-card.is-featured .card-line { font-size: var(--t-sm); }
  /* Once the shelf has 5+ games, the featured one takes a 2 × 2 spot. */
  .game-grid.is-rich { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; }
  .game-grid.is-rich .game-card.is-featured { grid-column: span 2; grid-row: span 2; }
  .game-grid.is-rich .game-card.is-featured .cover { aspect-ratio: auto; flex: 1 1 0; min-height: 0; border-radius: var(--r-xl); }
  .game-grid.is-rich .game-card.is-featured .card-title { font-size: var(--t-2xl); }
  .game-grid.is-rich .game-card.is-featured .card-line { font-size: var(--t-md); }
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: var(--t-xl); }

/* ---------- Guides, FAQ, long-form content ---------- */
.page-head { padding-block: 24px 28px; }
.page-head h1 { font-size: clamp(2.2rem, 8vw, 3.5rem); font-weight: 750; letter-spacing: -0.04em; text-wrap: balance; }
.page-head .lede { margin-top: 14px; max-width: 52ch; font-size: var(--t-lg); color: var(--ink-2); line-height: 1.45; }
.page-head .lede a, .section-link { color: var(--accent); text-underline-offset: 3px; }
.section-link { font-weight: 600; text-decoration: none; }
.section-link:hover { text-decoration: underline; }

.guide-list { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.guide-item > a {
  display: grid; gap: 4px; padding: 18px 2px 20px;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.guide-item > a:hover .guide-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.guide-game {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--t-xs); font-weight: 650; color: var(--ink-2);
}
.guide-game::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.guide-title { font-size: var(--t-lg); font-weight: 680; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; }
.guide-desc { color: var(--muted); font-size: var(--t-sm); max-width: 70ch; }
.guide-meta { color: var(--muted); font-size: var(--t-xs); font-weight: 560; margin-top: 2px; }
@media (min-width: 900px) {
  .guide-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; border-top: 0; }
  .guide-item > a { border-top: 1px solid var(--line); border-bottom: 0; }
}

.home-guides, .home-about, .game-article, .game-faq, .game-guides, .guide-more { margin-top: 64px; }
.home-guides h2, .home-about h2, .game-faq h2, .game-guides h2, .guide-more h2 { font-size: var(--t-xl); }
.home-guides .section-head { margin-bottom: 14px; }
.game-faq h2, .game-guides h2, .guide-more h2 { margin-bottom: 14px; }
.home-about-cols { display: grid; gap: 14px; margin-top: 14px; color: var(--ink-2); max-width: 68ch; }
@media (min-width: 900px) { .home-about-cols { grid-template-columns: 1fr 1fr; max-width: none; gap: 40px; } }

.game-article { padding-top: 40px; border-top: 1px solid var(--line); }
.game-article .prose { padding-top: 0; }
.game-article .prose > h2:first-child { margin-top: 0; font-size: var(--t-xl); }

.faq-list { display: grid; max-width: 72ch; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 2px; font-weight: 620; font-size: var(--t-md);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.faq-item p { padding: 0 2px 18px; color: var(--ink-2); max-width: 64ch; }
.faq-item a { color: var(--accent); }
.faq-list--page { border-top: 0; }
.faq-group { font-size: var(--t-lg); margin: 32px 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.faq-group:first-child { margin-top: 0; }

/* Article page */
.guide { max-width: calc(68ch + var(--gutter) * 2); }
.guide-head { padding-block: 20px 8px; display: grid; gap: 12px; }
.guide-crumb { color: var(--accent); font-weight: 600; text-decoration: none; font-size: var(--t-sm); width: fit-content; }
.guide-crumb:hover { text-decoration: underline; }
.guide-head h1 { font-size: clamp(2rem, 7vw, 3rem); font-weight: 750; letter-spacing: -0.035em; line-height: 1.06; text-wrap: balance; }
.guide-lede { font-size: var(--t-lg); color: var(--ink-2); line-height: 1.45; }
.guide-byline { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: var(--t-sm); }
.guide-body { padding-top: 8px; }
.guide-body ol { padding-left: 1.3em; margin: 12px 0; }
.guide-body h3 { font-size: var(--t-md); margin: 24px 0 6px; }
.guide-body .tip {
  margin: 20px 0; padding: 14px 18px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink);
}

.play-card {
  margin-top: 40px; padding: 16px;
  display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 14px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
}
.play-card img { width: 72px; height: 72px; border-radius: var(--r-md); }
.play-card-title { font-weight: 700; font-size: var(--t-lg); letter-spacing: -0.02em; }
.play-card-line { color: var(--muted); font-size: var(--t-sm); }
.play-card .k-btn { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .play-card { grid-template-columns: 72px 1fr auto; }
  .play-card .k-btn { grid-column: auto; }
}

/* ---------- Text pages ---------- */
.prose { max-width: 68ch; padding-block: 24px 0; }
.prose h1 { font-size: clamp(2.1rem, 7vw, 3.25rem); font-weight: 740; letter-spacing: -0.04em; margin-bottom: 20px; }
.prose h2 { font-size: var(--t-lg); margin: 36px 0 10px; text-wrap: balance; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 14px; }
.prose ul { padding-left: 1.2em; margin: 12px 0; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose .updated { color: var(--muted); font-size: var(--t-sm); margin-bottom: 28px; }
.prose .lede { font-size: var(--t-lg); color: var(--ink); line-height: 1.45; }

.contact-card {
  margin-top: 28px; padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  display: grid; gap: 6px;
}
.contact-card a { font-size: var(--t-lg); font-weight: 640; text-decoration: none; color: var(--accent); word-break: break-all; }

.not-found { padding-block: 40px; }
.not-found h1 { font-size: clamp(2.4rem, 9vw, 4rem); letter-spacing: -0.04em; font-weight: 760; }
.not-found p { color: var(--ink-2); margin: 14px 0 24px; max-width: 40ch; }

/* ---------- Game page ---------- */
.gamebar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 6px;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
.gamebar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding-left: 2px; }
.gamebar-title h1 { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gamebar-stat { font-size: var(--t-xs); color: var(--muted); font-weight: 560; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gamebar-actions { display: flex; align-items: center; }

.game-stage {
  display: flex; justify-content: center;
  padding: 4px var(--gutter) 20px;
  min-height: calc(100svh - var(--bar-h) - env(safe-area-inset-top));
}
.game-root { position: relative; width: 100%; max-width: 560px; }
.game-stage:fullscreen { background: var(--bg); padding-top: 16px; align-items: center; overflow: auto; }

.game-info {
  display: grid; gap: 40px;
  padding-top: 28px; border-top: 1px solid var(--line);
}
.game-info h2 { font-size: var(--t-xl); margin-bottom: 14px; }
.howto { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.howto li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: var(--ink-2); }
.howto li::before {
  content: counter(s);
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink);
  font-size: var(--t-xs); font-weight: 700; margin-top: 1px;
}
.game-desc { margin-top: 22px; color: var(--muted); max-width: 60ch; }
.game-grid--more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.game-card.is-small .card-title { font-size: var(--t-md); }
@media (min-width: 900px) {
  .game-info { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; }
  .game-grid--more { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.noscript { padding: 40px 0; text-align: center; color: var(--muted); }

/* Ads: space is reserved so the page never jumps when an ad loads. */
.ad-slot { width: 100%; max-width: 728px; min-height: 100px; margin: 8px auto 32px; padding-inline: var(--gutter); }
.ad-slot ins { min-height: 100px; }

/* ---------- UI kit (use these in games) ---------- */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: var(--pill);
  background: var(--ink); color: var(--bg);
  font-weight: 640; font-size: var(--t-md); letter-spacing: -0.01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s var(--ease), background-color .15s, opacity .15s;
  touch-action: manipulation;
}
.k-btn:hover { background: var(--ink-2); }
.k-btn:active { transform: scale(0.97); }
.k-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.k-btn--accent { background: var(--c, var(--accent)); color: var(--on-c, #fff); }
.k-btn--accent:hover { background: var(--c, var(--accent)); filter: brightness(1.06); }
.k-btn--ghost { background: var(--surface-2); color: var(--ink); }
.k-btn--ghost:hover { background: var(--line); }
.k-btn--sm { min-height: 40px; padding: 0 16px; font-size: var(--t-sm); }
.k-btn--block { width: 100%; }

.k-seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; gap: 4px; border-radius: var(--pill);
  background: var(--surface-2);
}
.k-seg button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--pill);
  background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.k-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Modal panel that sits over the game */
.k-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: var(--r-lg);
  animation: k-fade .2s var(--ease);
}
.k-overlay[hidden] { display: none; }
.k-panel {
  width: min(100%, 380px);
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-xl); padding: 26px 22px 22px;
  box-shadow: var(--lift);
  display: grid; gap: 18px; text-align: center;
  animation: k-rise .28s var(--ease);
}
.k-panel h2 { font-size: var(--t-2xl); font-weight: 740; letter-spacing: -0.035em; }
.k-panel p { color: var(--ink-2); }
.k-panel .k-actions { display: grid; gap: 10px; }
.k-panel .k-field { display: grid; gap: 8px; text-align: left; }
.k-panel .k-label { font-size: var(--t-sm); font-weight: 620; color: var(--ink-2); }

/* Yes / no dialog over the whole page (Khelo.confirm) */
.k-modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: k-fade .18s var(--ease);
}

@keyframes k-fade { from { opacity: 0; } }
@keyframes k-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.k-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: var(--pill);
  font-weight: 600; font-size: var(--t-sm); white-space: nowrap;
  transition: opacity .2s, transform .25s var(--ease);
}
.k-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Score box used by score-based games */
.k-scores { display: flex; gap: 8px; }
.k-score {
  min-width: 76px; padding: 7px 14px 8px; border-radius: var(--r-md);
  background: var(--surface-2); text-align: center;
}
.k-score small { display: block; font-size: 0.6875rem; font-weight: 620; color: var(--muted); letter-spacing: 0.02em; }
.k-score b { display: block; font-size: 1.25rem; font-weight: 720; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* very small phones: keep the header on one line */
@media (max-width: 420px) {
  .header-nav { gap: 0; }
  .header-nav > a { padding-left: 9px; padding-right: 9px; }
  .brand { flex: none; }
  .gamebar-actions .icon-btn { width: 38px; }
}
@media (max-width: 372px) {
  .header-nav > a[href$="#games"] { display: none; }
}
@media (max-width: 340px) {
  .brand { font-size: 1.15rem; }
  .header-nav .icon-btn { width: 40px; }
  .gamebar { gap: 2px; }
  .gamebar-actions .icon-btn { width: 35px; }
  .gamebar-stat { display: none; }
  .k-panel { padding: 22px 12px 16px; }
}
@media (max-width: 359px) {
  .header-nav > a[href$="#games"] { display: none; }
  .brand { gap: 7px; }
}

/* screenshots in articles and guides */
.prose .shots { display: grid; gap: 14px; margin: 22px 0 6px; }
.prose .shots--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.prose .shot { margin: 22px 0 6px; }
.prose .shots .shot { margin: 0; }
.prose .shot img {
  display: block; width: 100%; max-width: 300px; height: auto;
  border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2);
}
.prose .shots .shot img { max-width: 100%; }
.prose .shot figcaption { margin-top: 8px; font-size: var(--t-xs); color: var(--muted); line-height: 1.45; max-width: 300px; }
@media (max-width: 420px) { .prose .shots--2 { gap: 10px; } }

.lang-note { margin-top: 12px; font-size: var(--t-sm); color: var(--muted); }
.lang-note a { color: var(--accent); text-underline-offset: 3px; }
html[lang="hi"] .prose p, html[lang="hi"] .prose li, html[lang="hi"] .faq-item p { line-height: 1.75; }
