/* ==========================================================================
   Wembuno — base styles (tokens, typography, buttons, site chrome, content pages)
   ========================================================================== */
:root {
  --ink: #2a2356;
  --ink-2: #4a4478;
  --muted: #5c5789;
  --paper: #fffaf0;
  --line: #e5e1f3;
  --sun: #ffd23f;
  --sun-2: #f5a800;
  --coral: #ff6b8b;
  --mint: #3ddc97;
  --mint-2: #1fb877;
  --grape: #8b5cf6;
  --grape-2: #6b3fd6;
  --sky: #5cc4ff;
  --tang: #ff9a3c;
  --ok: #138a55;
  --bad: #d9480f;
  --focus: #1d4ed8;
  --sky-top: #45b4ff;
  --sky-mid: #8fdcff;
  --sky-bottom: #e2f7ff;
  --sky-deco:
    radial-gradient(ellipse 110px 34px at 12% 16%, rgba(255,255,255,.9) 60%, transparent 62%),
    radial-gradient(ellipse 70px 30px at 17% 12%, rgba(255,255,255,.9) 60%, transparent 62%),
    radial-gradient(ellipse 140px 40px at 84% 30%, rgba(255,255,255,.75) 60%, transparent 62%),
    radial-gradient(ellipse 80px 32px at 90% 26%, rgba(255,255,255,.75) 60%, transparent 62%),
    radial-gradient(ellipse 120px 36px at 30% 78%, rgba(255,255,255,.55) 60%, transparent 62%);
  --r: 20px;
  --font: "Nunito", "Varela Round", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Baloo 2", "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="sunset"] { --sky-top: #7a5cff; --sky-mid: #ff8fb1; --sky-bottom: #ffe0b0; }
[data-theme="candy"] { --sky-top: #ff86cc; --sky-mid: #ffc6e6; --sky-bottom: #fff2c9; }
[data-theme="ocean"] { --sky-top: #1d7ed0; --sky-mid: #3cc6da; --sky-bottom: #c2f5ec; }
[data-theme="night"] {
  --sky-top: #131948; --sky-mid: #2b3789; --sky-bottom: #5b61c6;
  --sky-deco:
    radial-gradient(2px 2px at 10% 12%, #fff 98%, transparent), radial-gradient(2px 2px at 24% 40%, #fff 98%, transparent),
    radial-gradient(3px 3px at 44% 18%, #fff6b0 98%, transparent), radial-gradient(2px 2px at 66% 32%, #fff 98%, transparent),
    radial-gradient(3px 3px at 82% 10%, #fff 98%, transparent), radial-gradient(2px 2px at 90% 52%, #fff 98%, transparent),
    radial-gradient(2px 2px at 8% 70%, #fff 98%, transparent), radial-gradient(60px 60px at 88% 14%, #fff6c9 40%, transparent 42%);
}
[data-theme="aurora"] {
  --sky-top: #0b2240; --sky-mid: #13656f; --sky-bottom: #38c98f;
  --sky-deco:
    radial-gradient(ellipse 60% 18% at 30% 20%, rgba(61,220,151,.45), transparent 70%),
    radial-gradient(ellipse 50% 14% at 70% 34%, rgba(255,126,182,.35), transparent 70%),
    radial-gradient(2px 2px at 15% 10%, #fff 98%, transparent), radial-gradient(2px 2px at 55% 8%, #fff 98%, transparent),
    radial-gradient(2px 2px at 85% 16%, #fff 98%, transparent);
}

[data-theme="lavender"] { --sky-top: #8e7dff; --sky-mid: #c9b8ff; --sky-bottom: #f3ecff; }
[data-theme="jungle"] { --sky-top: #1f8a5b; --sky-mid: #6fd49a; --sky-bottom: #dcfce7; }
[data-theme="desert"] { --sky-top: #f59e0b; --sky-mid: #fcd9a0; --sky-bottom: #fff5e1; }
[data-theme="lava"] {
  --sky-top: #6e1a28; --sky-mid: #d9483a; --sky-bottom: #ffb37a;
  --sky-deco:
    radial-gradient(4px 4px at 14% 20%, #ffd23f 98%, transparent), radial-gradient(3px 3px at 36% 44%, #ff9a3c 98%, transparent),
    radial-gradient(4px 4px at 62% 16%, #ffe066 98%, transparent), radial-gradient(3px 3px at 84% 38%, #ff9a3c 98%, transparent),
    radial-gradient(ellipse 60% 20% at 50% 100%, rgba(255,210,63,.45), transparent 70%);
}
[data-theme="cosmos"] {
  --sky-top: #1b0b3a; --sky-mid: #4f2a86; --sky-bottom: #b04fa3;
  --sky-deco:
    radial-gradient(ellipse 40% 22% at 28% 30%, rgba(127,240,255,.28), transparent 70%),
    radial-gradient(ellipse 36% 20% at 72% 22%, rgba(255,126,182,.3), transparent 70%),
    radial-gradient(2px 2px at 10% 12%, #fff 98%, transparent), radial-gradient(2px 2px at 30% 60%, #fff 98%, transparent),
    radial-gradient(3px 3px at 52% 10%, #fff6b0 98%, transparent), radial-gradient(2px 2px at 76% 48%, #fff 98%, transparent),
    radial-gradient(2px 2px at 90% 16%, #fff 98%, transparent), radial-gradient(40px 40px at 84% 70%, #ffd6e7 38%, transparent 40%);
}
[data-theme="rainbow"] {
  --sky-top: #7fd6ff; --sky-mid: #ffd6f0; --sky-bottom: #fff6c9;
  --sky-deco:
    radial-gradient(circle at 50% 115%, transparent 40%, rgba(255,107,139,.45) 40% 43%, rgba(255,154,60,.45) 43% 46%, rgba(255,210,63,.45) 46% 49%, rgba(61,220,151,.45) 49% 52%, rgba(92,196,255,.45) 52% 55%, rgba(139,92,246,.4) 55% 58%, transparent 58%),
    radial-gradient(ellipse 110px 34px at 12% 16%, rgba(255,255,255,.9) 60%, transparent 62%),
    radial-gradient(ellipse 140px 40px at 84% 22%, rgba(255,255,255,.8) 60%, transparent 62%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--grape-2); }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.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: -80px; z-index: 2000; background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 12px; padding: .6rem 1rem; font-weight: 800;
}
.skip-link:focus { top: 12px; }
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.15em; flex: 0 0 auto; }

/* ── Buttons & chips ─────────────────────────────────────────────────── */
.btn {
  --bg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .6em 1.25em;
  border: 3px solid var(--ink); border-radius: 999px; background: var(--bg); color: var(--ink);
  font: 800 1.05rem/1.1 var(--font); text-decoration: none; text-align: center; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink); transition: transform .08s, box-shadow .08s, filter .15s;
  -webkit-tap-highlight-color: transparent; user-select: none; touch-action: manipulation;
}
@media (hover: hover) { .btn:hover { filter: brightness(1.05); } }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--ink); filter: grayscale(.4); }
.btn-primary { --bg: var(--sun); }
.btn-go { --bg: var(--mint); }
.btn-secondary { --bg: #fff; }
.btn-danger { --bg: var(--coral); }
.btn-small { min-height: 42px; padding: .45em .95em; font-size: .95rem; box-shadow: 0 4px 0 var(--ink); }
.btn-big { min-height: 60px; padding: .7em 1.6em; font-size: 1.25rem; }
.btn-huge { min-height: 74px; padding: .8em 2.2em; font-size: 1.55rem; box-shadow: 0 7px 0 var(--ink); }
.btn-ico { display: inline-flex; width: 1.3em; height: 1.3em; }
.btn-ico svg { width: 100%; height: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 52px; height: 52px; flex: 0 0 auto;
  border: 3px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink);
  box-shadow: 0 4px 0 var(--ink); cursor: pointer; text-decoration: none; padding: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.chip {
  display: inline-flex; align-items: center; gap: .3em; min-height: 42px;
  padding: .2em .75em .2em .3em; border: 3px solid var(--ink); border-radius: 999px;
  background: #fff; color: var(--ink); font-weight: 900; text-decoration: none; box-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
}
.chip-ico svg { width: 28px; height: 28px; display: block; }
.bar { position: relative; height: 14px; border: 3px solid var(--ink); border-radius: 999px; background: #efeaff; overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--mint), #86f2c6); border-radius: 999px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.bar-xp .bar-fill { background: linear-gradient(90deg, var(--grape), #c8adff); }
.bar-chest .bar-fill { background: linear-gradient(90deg, var(--tang), var(--sun)); }

/* ── Site header / footer ────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,250,240,.94); border-bottom: 3px solid var(--ink); }
@supports (backdrop-filter: blur(8px)) { .site-header { backdrop-filter: blur(8px); background: rgba(255,250,240,.86); } }
.site-header-inner { max-width: 1160px; margin: 0 auto; padding: .5rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.brand { display: inline-flex; align-items: center; gap: .45rem; font: 900 1.65rem/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand .logo-mark { width: 46px; height: 46px; }
.site-nav { flex: 1 1 auto; min-width: 0; }
.site-nav ul { display: flex; gap: .2rem; list-style: none; margin: 0; padding: 0; align-items: center; justify-content: flex-end; overflow-x: auto; scrollbar-width: none; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a { display: block; white-space: nowrap; padding: .5rem .8rem; border-radius: 999px; color: var(--ink); font-weight: 800; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: #fff; box-shadow: inset 0 0 0 3px var(--ink); }
.site-nav .nav-play { background: var(--mint); box-shadow: inset 0 0 0 3px var(--ink), 0 3px 0 var(--ink); }
.lang-switch { display: inline-flex; align-items: center; gap: .3rem; font-weight: 900; text-decoration: none; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: .3rem .7rem; background: #fff; }
.lang-switch svg { width: 20px; height: 20px; }
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; display: grid; gap: .15rem; min-width: 11rem; margin: 0; padding: .35rem; list-style: none; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 var(--ink); }
.lang-list a { display: block; padding: .5rem .85rem; border-radius: 12px; color: var(--ink); font-weight: 800; text-decoration: none; white-space: nowrap; }
.lang-list a:hover, .lang-list a:focus-visible { background: var(--sky-bottom); }
.lang-list a[aria-current="true"] { background: var(--sun); }
@media (max-width: 760px) {
  .site-header-inner { padding: .45rem .75rem; }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-nav ul { justify-content: flex-start; padding-bottom: 2px; }
  .site-header .lang-menu { margin-left: auto; }
}
.site-footer { margin-top: 4rem; background: var(--ink); color: #fff; padding: 2.5rem 1rem 2rem; }
.footer-inner { max-width: 1160px; margin: 0 auto; display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.site-footer h2 { font: 900 1.05rem/1.2 var(--font-display); margin: 0 0 .6rem; color: var(--sun); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer a { color: #fff; font-weight: 700; }
.footer-brand .brand { color: #fff; }
.footer-note { font-size: .92rem; opacity: .9; }
.footer-bottom { max-width: 1160px; margin: 1.8rem auto 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.2); font-size: .85rem; opacity: .85; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.privacy-pill { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.12); border-radius: 999px; padding: .3rem .8rem; font-weight: 800; }

/* ── Content pages ──────────────────────────────────────────────────── */
.page-hero {
  position: relative; overflow: hidden; border-bottom: 3px solid var(--ink);
  background: var(--sky-deco), linear-gradient(180deg, var(--sky-top), var(--sky-mid) 62%, var(--sky-bottom));
  padding: 2.2rem 1rem 2.6rem;
}
.page-hero-inner { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 1.5rem; }
.page-hero h1 {
  margin: .25em 0 .35em; font: 900 clamp(2.1rem, 5.4vw, 3.6rem)/1.04 var(--font-display); color: #fff; letter-spacing: -.01em;
  text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 0 6px 0 var(--ink);
}
.page-hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); font-weight: 700; background: rgba(255,255,255,.92); border: 3px solid var(--ink); border-radius: 20px; padding: .8rem 1rem; margin: 0 0 1rem; box-shadow: 0 5px 0 var(--ink); max-width: 60ch; }
.page-hero-art { display: grid; place-items: center; }
.pha-inner { position: relative; width: 100%; max-width: 380px; animation: float 7s ease-in-out infinite; }
.hero-mini-char { position: absolute; left: 30%; width: 40%; bottom: 44%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }

/* Root language chooser & 404 */
.lang-page { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: var(--sky-deco), linear-gradient(180deg, var(--sky-top), var(--sky-mid) 60%, var(--sky-bottom)); }
.lang-choose { width: 100%; max-width: 580px; display: grid; justify-items: center; gap: .7rem; text-align: center; }
.lang-art { position: relative; width: min(300px, 70vw); animation: float 6s ease-in-out infinite; }
.lang-logo { margin: 0; font: 900 clamp(3.2rem, 12vw, 5rem)/1 var(--font-display); color: #fff; text-shadow: 4px 4px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 0 8px 0 var(--ink); }
.lang-q { margin: 0; font-weight: 900; font-size: 1.15rem; background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: .35rem 1rem; }
.lang-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; width: 100%; margin-top: .6rem; }
.lang-option { display: grid; gap: .2rem; padding: 1rem 1.2rem; background: #fff; border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 7px 0 var(--ink); color: var(--ink); text-decoration: none; transition: transform .1s; }
.lang-option:hover { transform: translateY(-3px); }
.lang-option:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.lang-option.is-suggested { background: var(--mint); }
.lo-name { font: 900 2rem/1.1 var(--font-display); }
.lo-sub { font-weight: 800; }
.page-hero .btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .2rem .5rem; margin: 0; padding: 0; font-weight: 800; font-size: .9rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: .5rem; }
.breadcrumbs a { color: var(--ink); background: rgba(255,255,255,.8); border-radius: 999px; padding: .1rem .5rem; text-decoration: none; }
.breadcrumbs [aria-current] { background: rgba(255,255,255,.55); border-radius: 999px; padding: .1rem .5rem; }
@media (max-width: 760px) {
  .page-hero-inner { grid-template-columns: 1fr; }
  .page-hero-art { order: -1; max-width: 240px; margin: 0 auto; }
}

.content { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem 1rem; }
.content-wide { max-width: 1160px; }
.content h2 { font: 900 clamp(1.55rem, 3.4vw, 2.2rem)/1.15 var(--font-display); margin: 2.4rem 0 .8rem; }
.content h3 { font: 900 1.3rem/1.2 var(--font-display); margin: 1.6rem 0 .5rem; }
.content p, .content li { font-size: 1.1rem; line-height: 1.65; }
.content ul, .content ol { padding-left: 1.3rem; }
.content strong { font-weight: 900; }
.section-kicker { display: inline-block; font-weight: 900; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; padding: .15rem .7rem; }
.card { background: #fff; border: 3px solid var(--ink); border-radius: var(--r); box-shadow: 0 6px 0 var(--ink); padding: 1.2rem 1.4rem; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.notice { background: #e8fbf2; border: 3px solid var(--ink); border-radius: 18px; padding: 1rem 1.2rem; }
.notice-warn { background: #fff4e0; }

.feature-grid, .tip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.feature, .tip { background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); padding: 1.1rem 1.2rem; }
.feature h3, .tip h3 { margin: .4rem 0 .3rem; }
.feature p, .tip p { margin: 0; font-size: 1.02rem; }
.feature-ico, .tip-ico { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; border: 3px solid var(--ink); background: var(--c, #fff3b0); }
.feature-ico svg, .tip-ico svg { width: 40px; height: 40px; }
.feature:nth-child(2) { --c: #d4f7e4; }
.feature:nth-child(3) { --c: #e6dbff; }
.feature:nth-child(4) { --c: #ffd6e3; }

.table-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .8rem; list-style: none; margin: 1rem 0; padding: 0 !important; }
.table-tiles a {
  display: grid; place-items: center; align-content: center; gap: .1rem; aspect-ratio: 1; min-height: 96px;
  border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 6px 0 var(--ink);
  text-decoration: none; color: var(--ink); background: var(--tile, #fff); transition: transform .1s;
}
.table-tiles a:hover { transform: translateY(-3px) rotate(-2deg); }
.table-tiles .tile-n { font: 900 2.4rem/1 var(--font-display); }
.table-tiles .tile-l { font-weight: 800; font-size: .8rem; }
.table-tiles li:nth-child(6n+1) a { --tile: #ffe38a; }
.table-tiles li:nth-child(6n+2) a { --tile: #ffc4d8; }
.table-tiles li:nth-child(6n+3) a { --tile: #bfe8ff; }
.table-tiles li:nth-child(6n+4) a { --tile: #c9f5dd; }
.table-tiles li:nth-child(6n+5) a { --tile: #e2d6ff; }
.table-tiles li:nth-child(6n+6) a { --tile: #ffd8b8; }

.times-chart { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; list-style: none; padding: 0 !important; margin: 1rem 0; }
.times-chart li {
  display: flex; justify-content: space-between; align-items: center; gap: .4rem;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: .5rem .8rem;
  font: 900 1.45rem/1.1 var(--font-display); box-shadow: 0 4px 0 var(--ink);
}
.times-chart li:nth-child(odd) { background: #fff8dc; }
.times-chart .eq-op { color: var(--grape-2); }
.times-chart .eq-result { background: var(--sun); border: 2px solid var(--ink); border-radius: 10px; padding: .05em .45em; min-width: 2.4em; text-align: center; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0; }
.mult-grid { border-collapse: separate; border-spacing: 3px; font-weight: 800; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 4px; }
.mult-grid th, .mult-grid td { min-width: 2.6rem; height: 2.4rem; text-align: center; border-radius: 8px; font-size: 1rem; }
.mult-grid th { background: var(--sun); }
.mult-grid td { background: #f6f3ff; }
.mult-grid tr:nth-child(even) td { background: #eef9ff; }
.mult-grid td.is-square { background: #ffd6e3; }
.cta-band {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  margin: 2.5rem 0; padding: 1.3rem 1.5rem; border: 3px solid var(--ink); border-radius: 28px; box-shadow: 0 7px 0 var(--ink);
  background: linear-gradient(120deg, #fff1b8, #ffd9ea 60%, #d8f0ff);
}
.cta-band .cta-text { flex: 1 1 280px; }
.cta-band h2, .cta-band p { margin: 0; }
.cta-band h2 { font-size: 1.6rem; }
.cta-art { width: 110px; flex: 0 0 auto; }
.table-nav { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0 !important; }
.table-nav a { display: grid; place-items: center; min-width: 48px; min-height: 48px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font: 900 1.2rem var(--font-display); color: var(--ink); text-decoration: none; box-shadow: 0 3px 0 var(--ink); }
.table-nav a[aria-current="page"] { background: var(--sun); }
.faq details { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: .8rem 1rem; margin: .6rem 0; box-shadow: 0 4px 0 var(--ink); }
.faq summary { font-weight: 900; font-size: 1.1rem; cursor: pointer; }
.faq details p { margin: .6rem 0 0; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: .8rem; }
.steps li { counter-increment: step; position: relative; padding: .8rem 1rem .8rem 4rem; background: #fff; border: 3px solid var(--ink); border-radius: 18px; }
.steps li::before { content: counter(step); position: absolute; left: .9rem; top: .7rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; background: var(--grape); color: #fff; border: 3px solid var(--ink); border-radius: 50%; font-weight: 900; }
.mode-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; list-style: none; padding: 0 !important; }
.mode-list li { background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); padding: 1rem 1.1rem; display: grid; gap: .4rem; }
.mode-list h3 { display: flex; align-items: center; gap: .5rem; margin: 0; }
.mode-list h3 svg { width: 36px; height: 36px; }
.mode-list p { margin: 0; font-size: 1rem; }
.mode-list .btn { justify-self: start; margin-top: .3rem; }
.legal { max-width: 820px; }
.legal h2 { font-size: 1.6rem; }
.legal table { width: 100%; border-collapse: collapse; background: #fff; }
.legal th, .legal td { border: 2px solid var(--line); padding: .55rem .7rem; text-align: left; vertical-align: top; font-size: 1rem; }
.legal th { background: #f5f2ff; }
.updated { font-weight: 800; color: var(--muted); }

/* ── Mini quiz ───────────────────────────────────────────────────────── */
.miniquiz { background: #f4f0ff; border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); padding: 1.2rem 1.3rem; }
.miniquiz h2 { margin-top: 0 !important; }
.mq-count { font-weight: 900; margin: 0; color: var(--muted); }
.mq-question { font: 900 clamp(2rem, 7vw, 2.8rem)/1.1 var(--font-display) !important; margin: .3rem 0 .8rem; }
.mq-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; max-width: 460px; }
.mq-option { min-height: 68px; border: 3px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: 0 5px 0 var(--ink); font: 900 1.9rem/1 var(--font-display); cursor: pointer; color: var(--ink); }
.mq-option:disabled { cursor: default; }
.mq-option.is-correct { background: var(--mint); }
.mq-option.is-wrong { background: #ffc3a3; }
.mq-feedback { font-weight: 900; min-height: 1.6em; margin: .7rem 0 0; }
.mq-next { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }

/* ── Worksheet generator ─────────────────────────────────────────────── */
.ws-form { display: grid; gap: 1rem; background: #fff; border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 6px 0 var(--ink); padding: 1.2rem; }
.ws-tables { display: flex; flex-wrap: wrap; gap: .45rem; border: 0; padding: 0; margin: 0; }
.ws-tables legend { font-weight: 900; margin-bottom: .5rem; font-size: 1.1rem; }
.ws-check { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .35rem .75rem; border: 3px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 800; cursor: pointer; }
.ws-check input { width: 20px; height: 20px; accent-color: var(--grape); }
.ws-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; font-weight: 800; }
.ws-row select { padding: .45rem .7rem; border: 3px solid var(--ink); border-radius: 12px; min-height: 46px; background: #fff; font-weight: 700; }
.ws-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.ws-msg { margin: 0; font-weight: 900; color: #b42318; }
.ws-msg:empty { display: none; }
.ws-sheet { margin-top: 1.5rem; }
.ws-page { background: #fff; color: #000; border: 2px solid #d9d4ee; border-radius: 12px; padding: 1.6rem 1.8rem; margin-bottom: 1.5rem; }
.ws-head h2 { margin: .2rem 0 .6rem !important; font-size: 1.5rem !important; }
.ws-brand { margin: 0; font: 900 1rem var(--font-display); color: var(--grape-2); }
.ws-lines { font-weight: 700; margin: 0 0 1rem; white-space: pre-wrap; }
.ws-problems { columns: 2; column-gap: 2.5rem; font: 700 1.3rem/2.3 var(--font); padding-left: 2.2rem; margin: 0; }
.ws-answers { columns: 4; line-height: 1.9; }
@media (min-width: 760px) { .ws-problems { columns: 3; } .ws-answers { columns: 6; } }

/* ── Parent report ───────────────────────────────────────────────────── */
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .8rem; }
.report-card { display: flex; flex-direction: column; gap: .15rem; background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: .8rem .9rem; box-shadow: 0 4px 0 var(--ink); }
.rc-label { font-size: .9rem; font-weight: 800; color: var(--muted); }
.rc-value { font: 900 2rem/1.1 var(--font-display); }
.rc-note { font-size: .82rem; color: var(--muted); font-weight: 700; }
.report-section { margin-top: 2rem; }
.report-section h3 { margin-bottom: .6rem; }
.report-chart svg { width: 100%; max-width: 660px; height: auto; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: .4rem; }
.report-details summary { cursor: pointer; font-weight: 800; margin-top: .5rem; }
.report-table { border-collapse: collapse; width: 100%; min-width: 420px; background: #fff; border: 3px solid var(--ink); }
.report-table th, .report-table td { padding: .5rem .7rem; border-bottom: 2px solid var(--line); text-align: left; font-size: 1rem; }
.report-table thead th { background: #f5f2ff; }
.mini-bar { display: inline-block; width: 80px; height: 10px; border-radius: 9px; background: #e7e3f5; overflow: hidden; vertical-align: middle; }
.mini-bar span { display: block; height: 100%; background: var(--mint-2); }
.heatmap { border-collapse: separate; border-spacing: 3px; font-weight: 800; font-size: .85rem; }
.heatmap th { background: var(--sun); border-radius: 6px; padding: .3rem; min-width: 2.2rem; }
.hm { text-align: center; border-radius: 6px; padding: .35rem .2rem; min-width: 2.2rem; }
.hm-hi { background: #bdf0d5; }
.hm-mid { background: #ffe8a3; }
.hm-lo { background: #ffc0b0; }
.hm-none { background: #f1eff8; color: #77739c; }
.trouble-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0 !important; }
.trouble-list li { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: .3rem .7rem; font-size: 1rem; }
.report-note { color: var(--muted); font-weight: 700; font-size: .98rem !important; }
.report-tools { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.report-empty { background: #fff; border: 3px dashed var(--ink); border-radius: 20px; padding: 1.2rem; text-align: center; }

/* ── Ad slots: visibly separate from the game, clearly labelled ─────── */
.ad-slot { max-width: 970px; margin: 4.5rem auto 3rem; padding: 0 1rem; }
.ad-label { display: block; font: 700 .72rem/1 system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #6b6790; margin-bottom: .45rem; text-align: center; }
.ad-body { min-height: 90px; border-top: 1px solid #d8d4ea; border-bottom: 1px solid #d8d4ea; padding: .75rem 0; }
.ad-slot.is-preview .ad-body { min-height: 250px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #f3f1fa 0 12px, #fff 12px 24px); border: 2px dashed #b8b3d6; color: #6b6790; font: 700 .9rem system-ui, sans-serif; }

/* ── Dialogs & toasts ────────────────────────────────────────────────── */
dialog.modal { border: 0; padding: 0; background: transparent; width: 100%; max-width: min(560px, calc(100vw - 24px)); overflow: visible; color: var(--ink); }
dialog.modal::backdrop { background: rgba(26,20,64,.55); }
.modal-panel {
  background: #fff; border: 4px solid var(--ink); border-radius: 30px; box-shadow: 0 10px 0 var(--ink);
  padding: 1.5rem 1.4rem 1.3rem; max-height: calc(100dvh - 40px); overflow: auto;
  animation: pop-in .3s cubic-bezier(.2,1.35,.4,1);
}
.modal.is-closing .modal-panel { animation: pop-out .16s ease-in forwards; }
.modal-title { font: 900 1.75rem/1.1 var(--font-display); margin: 0 0 .9rem; text-align: center; }
.modal-body { font-weight: 700; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.2rem; }
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: .6rem; background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: .6rem .9rem; box-shadow: 0 5px 0 var(--ink); font-weight: 800; animation: toast-in .3s ease-out; transition: opacity .3s, transform .3s; }
.toast-bad { background: #ffe4dc; }
.toast-ico svg { width: 30px; height: 30px; display: block; }
.toast.is-leaving { opacity: 0; transform: translateY(-10px); }

/* ── Shared keyframes ────────────────────────────────────────────────── */
@keyframes pop-in { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-out { to { transform: scale(.85); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(-16px); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ── Motion preferences (content pages; the game uses html.reduce-motion) */
@media (prefers-reduced-motion: reduce) {
  html:not(.app-ready) *, html:not(.app-ready) *::before, html:not(.app-ready) *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important;
}

/* ── Print ───────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .ad-slot, .cta-band, .miniquiz, .no-print, .skip-link, .page-hero-art { display: none !important; }
  body { background: #fff; }
  .page-hero { background: none; border: 0; padding: 0; }
  .page-hero h1 { color: #000; text-shadow: none; }
  .card, .times-chart li, .feature, .tip { box-shadow: none; }
  .ws-page { border: 0; padding: 0; margin: 0; break-after: page; page-break-after: always; }
  .ws-page:last-child { break-after: auto; page-break-after: auto; }
  .ws-problems { columns: 3; }
}
