/* Badiyaa design system: tokens, the shared top bar and footer, buttons, cards, meters and the site pages (home, games,
   stories, story reading). Used by badiyaa.com and by the lore pages that omnillm renders on the same domain.
   The Spatial theme: a violet-black night, aurora glows and frosted glass (light mode too). 8-point spacing, 44px targets.
   Reward animations live in css/rewards.css, loaded after the first paint. */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/wordplaya/site/fonts/plus-jakarta-sans.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url(/wordplaya/site/fonts/jetbrains-mono.woff2) format('woff2'); }
/* Plus Jakarta Sans fallback: Arial scaled to its width and line box (fontTools on the Latin file: size-adjust 106.05%). */
@font-face { font-family: 'Plus Jakarta Sans Fallback'; src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans'), local('Helvetica'), local('Roboto'), local('Roboto-Regular'); size-adjust: 106.05%; ascent-override: 97.88%; descent-override: 20.93%; line-gap-override: 0%; }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(/wordplaya/site/fonts/lora.woff2) format('woff2'); }

/* Spatial theme (8 Nov 2026, from the "Apple HIG spatial glass" design): a deep violet-black night with soft aurora glows,
   frosted glass cards and a floating glass top bar. Dark is the default for everyone; Settings can pick Light, or Match my
   phone (data-mode="system"). Games and home run the warm "dopamine" palette (rose, coral, amber); the Stories section
   switches to the calm "serotonin" palette (cyan, teal). tests/contrast.test.mjs checks every text pair in all four sets. */
:root {
  --cw-bg: #0a0512; --cw-bg-2: #140c22; --cw-card: #16111f; --cw-card-2: #1d1629;
  --cw-ink: #f8fafc; --cw-ink-2: #a9a3bd; --cw-line: #2b2438;
  --cw-green: #e11d48; --cw-green-2: #fb7185; --cw-green-soft: #2a1420; --cw-green-ink: #fcd34d;
  --cw-fill: #e0063f; --cw-fill-2: #e11d48;   /* surfaces that carry white text: coral, 4.7:1 or better */
  --cw-red: #fb7185; --cw-red-2: #fda4af; --cw-red-soft: #3a1420;
  --cw-gold: #fbbf24; --cw-gold-2: #fcd34d; --cw-gold-ink: #451a03; --cw-gold-soft: #2e2410;
  --cw-common: #a9a3bd; --cw-rare: #67e8f9; --cw-epic: #d8b4fe; --cw-legendary: #fcd34d; --cw-legendary-ink: #fcd34d;
  --cw-cyan: #67e8f9; --cw-teal: #5eead4; --cw-violet: #c4b5fd; --cw-amber: #fcd34d; --cw-rose: #fb7185;
  --cw-glass: rgba(255, 255, 255, .04); --cw-glass-2: rgba(255, 255, 255, .07); --cw-glass-line: rgba(255, 255, 255, .12); --cw-glass-hi: rgba(255, 255, 255, .15);
  --cw-bar: rgba(20, 12, 34, .72); --cw-bar-ink: #ffffff; --cw-bar-ink-2: #94a3b8; --cw-bar-well: rgba(0, 0, 0, .5);
  --cw-aurora-1: rgba(225, 29, 72, .30); --cw-aurora-1b: rgba(249, 115, 22, .16);
  --cw-aurora-2: rgba(147, 51, 234, .26); --cw-aurora-2b: rgba(219, 39, 119, .15);
  --cw-aurora-3: rgba(79, 70, 229, .20); --cw-aurora-3b: rgba(225, 29, 72, .10);
  --cw-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  --cw-shadow-lg: 0 25px 60px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
  --cw-play-1: #e0063f; --cw-play-2: #e11d48;   /* the Play button: the design's coral, deepened just enough for white text (4.7:1) */
  --cw-r: 24px; --cw-r-sm: 16px; --cw-pill: 999px;
  --cw-s1: 8px; --cw-s2: 16px; --cw-s3: 24px; --cw-s4: 32px; --cw-s5: 48px;
  --cw-display: 'Plus Jakarta Sans', 'Plus Jakarta Sans Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cw-text: 'Plus Jakarta Sans', 'Plus Jakarta Sans Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cw-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --cw-read: 'Lora', Georgia, serif;
  --cw-top-h: 78px;   /* the design's header: 12px above a 66px glass bar */
  color-scheme: dark;
}
/* Stories: the calm serotonin palette (cyan and teal on a deep ocean night) */
:root:has(.cw-nav a[href="/"][aria-current="page"]) {
  --cw-bg: #050d1a; --cw-bg-2: #0a1628; --cw-card: #0d1726; --cw-card-2: #12203a; --cw-line: #1e2f45;
  --cw-green-ink: #67e8f9; --cw-green-soft: #0f2a33;
  --cw-aurora-1: rgba(8, 145, 178, .30); --cw-aurora-1b: rgba(20, 184, 166, .16);
  --cw-aurora-2: rgba(37, 99, 235, .24); --cw-aurora-2b: rgba(79, 70, 229, .15);
  --cw-aurora-3: rgba(20, 184, 166, .18); --cw-aurora-3b: rgba(16, 185, 129, .10);
}
:root[data-mode="light"] {
  --cw-bg: #f7f4fb; --cw-bg-2: #efe9f7; --cw-card: #ffffff; --cw-card-2: #faf7fd;
  --cw-ink: #1a1033; --cw-ink-2: #5b5374; --cw-line: #e6dff0;
  --cw-green: #e11d48; --cw-green-2: #f43f5e; --cw-green-soft: #ffe4e9; --cw-green-ink: #be123c;
  --cw-red: #be123c; --cw-red-2: #e11d48; --cw-red-soft: #ffe4e9;
  --cw-gold: #d97706; --cw-gold-2: #fbbf24; --cw-gold-ink: #451a03; --cw-gold-soft: #fef3c7;
  --cw-common: #64748b; --cw-rare: #0e7490; --cw-epic: #7e22ce; --cw-legendary: #b45309; --cw-legendary-ink: #92400e;
  --cw-cyan: #0e7490; --cw-teal: #0f766e; --cw-violet: #6d28d9; --cw-amber: #b45309; --cw-rose: #be123c;
  --cw-glass: rgba(255, 255, 255, .72); --cw-glass-2: rgba(255, 255, 255, .9); --cw-glass-line: rgba(26, 16, 51, .09); --cw-glass-hi: rgba(255, 255, 255, .9);
  --cw-bar: rgba(255, 255, 255, .78); --cw-bar-ink: #1a1033; --cw-bar-ink-2: #5b5374; --cw-bar-well: rgba(26, 16, 51, .06);
  --cw-aurora-1: rgba(244, 63, 94, .16); --cw-aurora-1b: rgba(251, 146, 60, .10);
  --cw-aurora-2: rgba(168, 85, 247, .14); --cw-aurora-2b: rgba(236, 72, 153, .08);
  --cw-aurora-3: rgba(99, 102, 241, .10); --cw-aurora-3b: rgba(244, 63, 94, .06);
  --cw-shadow: 0 12px 32px rgba(26, 16, 51, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
  --cw-shadow-lg: 0 18px 44px rgba(26, 16, 51, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  color-scheme: light;
}
:root[data-mode="light"]:has(.cw-nav a[href="/"][aria-current="page"]) {
  --cw-bg: #f2f8fb; --cw-bg-2: #e6f2f7; --cw-card: #ffffff; --cw-card-2: #f7fbfd; --cw-line: #d9e9f0;
  --cw-green-ink: #0e7490; --cw-green-soft: #e0f7fa;
  --cw-aurora-1: rgba(6, 182, 212, .14); --cw-aurora-1b: rgba(20, 184, 166, .08);
  --cw-aurora-2: rgba(59, 130, 246, .12); --cw-aurora-2b: rgba(99, 102, 241, .07);
  --cw-aurora-3: rgba(20, 184, 166, .10); --cw-aurora-3b: rgba(16, 185, 129, .05);
}
@media (prefers-color-scheme: light) {
  :root[data-mode="system"] {
    --cw-bg: #f7f4fb; --cw-bg-2: #efe9f7; --cw-card: #ffffff; --cw-card-2: #faf7fd;
    --cw-ink: #1a1033; --cw-ink-2: #5b5374; --cw-line: #e6dff0;
    --cw-green: #e11d48; --cw-green-2: #f43f5e; --cw-green-soft: #ffe4e9; --cw-green-ink: #be123c;
    --cw-red: #be123c; --cw-red-2: #e11d48; --cw-red-soft: #ffe4e9;
    --cw-gold: #d97706; --cw-gold-2: #fbbf24; --cw-gold-ink: #451a03; --cw-gold-soft: #fef3c7;
    --cw-common: #64748b; --cw-rare: #0e7490; --cw-epic: #7e22ce; --cw-legendary: #b45309; --cw-legendary-ink: #92400e;
    --cw-cyan: #0e7490; --cw-teal: #0f766e; --cw-violet: #6d28d9; --cw-amber: #b45309; --cw-rose: #be123c;
    --cw-glass: rgba(255, 255, 255, .72); --cw-glass-2: rgba(255, 255, 255, .9); --cw-glass-line: rgba(26, 16, 51, .09); --cw-glass-hi: rgba(255, 255, 255, .9);
    --cw-bar: rgba(255, 255, 255, .78); --cw-bar-ink: #1a1033; --cw-bar-ink-2: #5b5374; --cw-bar-well: rgba(26, 16, 51, .06);
    --cw-aurora-1: rgba(244, 63, 94, .16); --cw-aurora-1b: rgba(251, 146, 60, .10);
    --cw-aurora-2: rgba(168, 85, 247, .14); --cw-aurora-2b: rgba(236, 72, 153, .08);
    --cw-aurora-3: rgba(99, 102, 241, .10); --cw-aurora-3b: rgba(244, 63, 94, .06);
    --cw-shadow: 0 12px 32px rgba(26, 16, 51, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
    --cw-shadow-lg: 0 18px 44px rgba(26, 16, 51, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
    color-scheme: light;
  }
  :root[data-mode="system"]:has(.cw-nav a[href="/"][aria-current="page"]) {
    --cw-bg: #f2f8fb; --cw-bg-2: #e6f2f7; --cw-card: #ffffff; --cw-card-2: #f7fbfd; --cw-line: #d9e9f0;
    --cw-green-ink: #0e7490; --cw-green-soft: #e0f7fa;
    --cw-aurora-1: rgba(6, 182, 212, .14); --cw-aurora-1b: rgba(20, 184, 166, .08);
    --cw-aurora-2: rgba(59, 130, 246, .12); --cw-aurora-2b: rgba(99, 102, 241, .07);
    --cw-aurora-3: rgba(20, 184, 166, .10); --cw-aurora-3b: rgba(16, 185, 129, .05);
  }
}

/* ---------- base (site pages carry body.cw-site; the game page keeps its own base and uses only the components) ---------- */
.cw-site, .cw-site * { box-sizing: border-box; }
html:has(body.cw-site) { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--cw-top-h) + 16px); }
body.cw-site { margin: 0; background: var(--cw-bg); color: var(--cw-ink); font-family: var(--cw-text); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
.cw-site main { flex: 1; width: 100%; }
:where(.cw-site) a { color: var(--cw-green-ink); }   /* zero class weight, so every component's own link colour wins */
[hidden] { display: none !important; }
.cw-site img { max-width: 100%; height: auto; display: block; }
.cw-site h1, .cw-site h2, .cw-site h3 { font-family: var(--cw-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: .005em; text-wrap: balance; }
.cw-site h1 { font-size: clamp(1.9rem, 6.2vw, 2.9rem); }
.cw-site h2 { font-size: clamp(1.3rem, 4vw, 1.6rem); }
.cw-site h3 { font-size: 1.1rem; }
.cw-site p { margin: 0 0 1em; }
.cw-wrap { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; }
.cw-narrow { width: min(720px, 100%); margin: 0 auto; padding: 0 16px; }
.cw-muted { color: var(--cw-ink-2); }
.cw-eyebrow { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cw-ink-2); margin-bottom: 6px; }
.cw-skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--cw-card); color: var(--cw-ink); padding: 8px 16px; border-radius: var(--cw-pill); }
.cw-skip:focus { left: 8px; }
:where(.cw-site, .cw-top, .cw-foot) :focus-visible { outline: 3px solid var(--cw-gold-2); outline-offset: 2px; border-radius: 6px; }
.cw-section { padding: var(--cw-s4) 0 0; }
.cw-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cw-section-head a { font-weight: 800; text-decoration: none; white-space: nowrap; }

/* ---------- buttons, chips, meters ---------- */
.cw-btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--cw-pill); text-decoration: none; background: var(--cw-card); color: var(--cw-ink); box-shadow: inset 0 0 0 2px var(--cw-line); transition: transform .12s ease, filter .12s ease; }
.cw-btn:active { transform: translateY(1px) scale(.98); }
.cw-btn[disabled] { opacity: .5; cursor: not-allowed; }
.cw-btn-primary { background: linear-gradient(180deg, var(--cw-fill-2), var(--cw-fill)); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--cw-fill) 70%, #000), 0 8px 18px rgba(15, 92, 60, .25); }
.cw-btn-red { background: linear-gradient(180deg, var(--cw-red-2), var(--cw-red)); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--cw-red) 70%, #000), 0 8px 18px rgba(193, 18, 31, .25); }
.cw-btn-gold { background: linear-gradient(180deg, var(--cw-gold-2), var(--cw-gold)); color: var(--cw-gold-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--cw-gold) 70%, #000); }
.cw-btn-danger { background: transparent; color: var(--cw-red); box-shadow: inset 0 0 0 2px var(--cw-red); }
.cw-btn-big { min-height: 60px; font-size: 1.15rem; padding: 0 28px; }
.cw-linkbtn, .rw-linkbtn { appearance: none; background: none; border: 0; padding: 4px 2px; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; cursor: pointer; }
.cw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--cw-pill); background: var(--cw-green-soft); color: var(--cw-green-ink); font-weight: 800; font-size: .82rem; }
.cw-chip.gold { background: var(--cw-gold-soft); color: var(--cw-gold-ink); }
.cw-chip.red { background: var(--cw-red-soft); color: var(--cw-red); }
.cw-meter { height: 10px; border-radius: var(--cw-pill); background: var(--cw-bg-2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.cw-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cw-green-2), var(--cw-gold-2)); transition: width .6s cubic-bezier(.16, 1, .3, 1); }

/* ---------- cards ---------- */
.cw-card { position: relative; display: flex; flex-direction: column; background: var(--cw-card); border-radius: var(--cw-r); box-shadow: var(--cw-shadow); overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.cw-card:hover { transform: translateY(-2px); box-shadow: var(--cw-shadow-lg); }
.cw-card-img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--cw-bg-2); }
.cw-card-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cw-card-body strong { font-family: var(--cw-display); font-size: 1.08rem; line-height: 1.25; }
.cw-card-body span { color: var(--cw-ink-2); font-size: .9rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cw-card-tag { position: absolute; top: 10px; left: 10px; background: rgba(10, 24, 18, .78); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--cw-pill); }
.cw-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .cw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cw-grid.three { grid-template-columns: repeat(3, 1fr); } }
.cw-rail { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 300px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 12px; margin: 0 -16px; scrollbar-width: thin; }
.cw-rail > * { scroll-snap-align: start; }
@media (min-width: 900px) { .cw-rail { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 4px 0 12px; } }

/* ---------- home: the daily ritual ---------- */
.home-hero { background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--cw-green-2) 90%, #fff) 0%, var(--cw-green) 55%, color-mix(in srgb, var(--cw-green) 70%, #000) 100%); color: #fff; padding: 20px 0 28px; }
.ritual { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .ritual { grid-template-columns: 1.25fr 1fr; align-items: stretch; } }
.ritual-main { display: flex; flex-direction: column; gap: 16px; }
.streak-line { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.streak-line .flame { width: 56px; height: 56px; flex: none; }
.streak-line.is-cold .flame { filter: grayscale(.9); opacity: .7; }
.streak-line.is-pending .flame { animation: cw-flicker 1.6s ease-in-out infinite; }
.streak-line strong { display: block; font-family: var(--cw-display); font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.05; }
.streak-line span { display: block; color: rgba(255, 255, 255, .86); font-weight: 700; font-size: .98rem; min-height: 1.5em; }
.daily-btn { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; padding: 12px 20px 12px 22px; border-radius: 20px; background: linear-gradient(180deg, var(--cw-gold-2), var(--cw-gold)); color: var(--cw-gold-ink); text-decoration: none; box-shadow: 0 4px 0 #9a6f06, 0 14px 28px rgba(0, 0, 0, .25); }
.daily-btn::after { content: ''; position: absolute; inset: -4px; border-radius: 24px; border: 3px solid rgba(255, 223, 120, .7); animation: cw-pulse 2.2s ease-out infinite; pointer-events: none; }
.daily-btn strong { font-family: var(--cw-display); font-size: 1.45rem; display: block; line-height: 1.1; }
.daily-btn small { display: block; font-weight: 800; font-size: .9rem; opacity: .85; min-height: 1.3em; }
.daily-btn .go { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--cw-fill); color: #fff; }
.daily-btn.is-done::after { display: none; }
@keyframes cw-pulse { 0% { opacity: .9; transform: scale(.98); } 70% { opacity: 0; transform: scale(1.06); } 100% { opacity: 0; } }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-stat { appearance: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 10px 12px; min-height: 64px; display: flex; flex-direction: column; justify-content: center; }
a.hero-stat { text-decoration: none; }
.hero-stat b { font-family: var(--cw-display); font-size: 1.25rem; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stat span { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.chest-card { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; background: rgba(255, 255, 255, .1); border-radius: 20px; padding: 16px; min-height: 132px; }
.chest-card .chest-ico { width: 96px; height: 80px; }
.chest-card.is-locked .chest-ico { filter: grayscale(.5) brightness(.9); }
.chest-card.is-ready .chest-ico { animation: cw-wobble 2.4s ease-in-out infinite; }
.chest-card strong { display: block; font-family: var(--cw-display); font-size: 1.2rem; }
.chest-card p { margin: 2px 0 8px; color: rgba(255, 255, 255, .86); font-size: .92rem; min-height: 2.6em; }
.chest-card .cw-btn { min-height: 40px; padding: 0 16px; font-size: .92rem; }
@keyframes cw-wobble { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-6deg); } 88% { transform: rotate(5deg); } 92% { transform: rotate(-3deg); } 96% { transform: rotate(2deg); } }
.rank-card { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .1); border-radius: 20px; padding: 14px 16px; min-height: 84px; appearance: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.rank-card svg { width: 44px; height: 50px; flex: none; }
.rank-card div { flex: 1; min-width: 0; }
.rank-card strong { font-family: var(--cw-display); font-size: 1.1rem; display: block; }
.rank-card small { display: block; opacity: .85; font-weight: 700; margin-bottom: 6px; }
.rank-card .cw-meter { background: rgba(255, 255, 255, .18); }
.ritual-side { display: flex; flex-direction: column; gap: 16px; }
.week-pack { display: flex; gap: 12px; align-items: center; background: var(--cw-gold-soft); color: var(--cw-gold-ink); border-radius: var(--cw-r); padding: 14px 16px; text-decoration: none; margin-top: 16px; }
.week-pack .cw-chip { flex: none; white-space: nowrap; }   /* a solid gold label in both modes (11:1 contrast) */
.week-pack strong { font-family: var(--cw-display); font-size: 1.05rem; display: block; }
.week-pack span { font-size: .9rem; font-weight: 700; opacity: .85; }
.week-pack .cw-badge-svg { width: 48px; height: 54px; flex: none; }
.friend-news { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--cw-r); background: var(--cw-red-soft); color: var(--cw-ink); margin-top: 16px; }
.friend-news a { margin-left: auto; white-space: nowrap; }
.unlocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; min-height: 188px; }
.games-pillars { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .games-pillars { grid-template-columns: 1fr 1fr; } }
.pillar { display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; padding: 20px; border-radius: 20px; color: #fff; text-decoration: none; background-size: cover; background-position: center; position: relative; overflow: hidden; box-shadow: var(--cw-shadow); }
.pillar::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 20, 14, .1) 0%, rgba(5, 20, 14, .82) 100%); }
.pillar > * { position: relative; }
.pillar strong { font-family: var(--cw-display); font-size: 1.6rem; }
.pillar span { font-weight: 700; opacity: .9; }

/* ---------- hubs (games, stories) ---------- */
.hub-head { padding: 24px 0 8px; }
.hub-head p { color: var(--cw-ink-2); font-size: 1.05rem; max-width: 60ch; }
.crumbs { font-size: .88rem; color: var(--cw-ink-2); margin: 0 0 8px; }
.crumbs a { color: var(--cw-ink-2); }
.flagship { display: grid; grid-template-columns: 1fr; gap: 0; background: var(--cw-card); border-radius: 24px; box-shadow: var(--cw-shadow-lg); overflow: hidden; }
@media (min-width: 820px) { .flagship { grid-template-columns: 1.1fr 1fr; } }
.flagship-art { min-height: 220px; background: linear-gradient(160deg, var(--cw-green-2), var(--cw-green) 60%, #08301f); display: grid; place-items: center; padding: 24px; }
.flagship-art svg { width: min(320px, 90%); height: auto; }
.flagship-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.flagship-body .row { display: flex; flex-wrap: wrap; gap: 10px; }
.feature-list { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list li::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: .5em; border-radius: 50%; background: var(--cw-gold); box-shadow: 0 0 0 3px var(--cw-gold-soft); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cw-tile { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--cw-r); background: var(--cw-card); box-shadow: var(--cw-shadow); text-decoration: none; color: inherit; min-height: 150px; }
.cw-tile strong { font-family: var(--cw-display); font-size: 1.15rem; }
.cw-tile span { color: var(--cw-ink-2); font-size: .94rem; }
.cw-tile .cw-meter { margin-top: auto; }
.tabs { display: flex; gap: 8px; border-bottom: 2px solid var(--cw-line); margin: 8px 0 20px; position: sticky; top: var(--cw-top-h); background: var(--cw-bg); z-index: 5; }
.tabs button, .tabs a { appearance: none; border: 0; background: none; font: inherit; font-family: var(--cw-display); font-weight: 700; font-size: 1.1rem; color: var(--cw-ink-2); padding: 12px 8px; min-height: 48px; cursor: pointer; text-decoration: none; margin-bottom: -2px; border-bottom: 3px solid transparent; }
.tabs [aria-selected="true"] { color: var(--cw-ink); border-bottom-color: var(--cw-red); }
.tabs .count { font-family: var(--cw-text); font-size: .8rem; font-weight: 800; background: var(--cw-bg-2); border-radius: var(--cw-pill); padding: 2px 8px; margin-left: 6px; color: var(--cw-ink-2); }
[role="tabpanel"][hidden] { display: none; }
.hub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--cw-pill); background: var(--cw-card); box-shadow: inset 0 0 0 2px var(--cw-line); color: var(--cw-ink); text-decoration: none; font-weight: 800; font-size: .92rem; }
.hub-chips a small { color: var(--cw-ink-2); font-weight: 700; }
.list-more { display: flex; justify-content: center; padding: 20px 0 0; }

/* ---------- story reading ---------- */
.cw-read { position: fixed; left: 0; right: 0; top: calc(var(--cw-top-h) + env(safe-area-inset-top, 0px)); height: 4px; z-index: 39; pointer-events: none; }
.cw-read i { display: block; height: 100%; background: linear-gradient(90deg, var(--cw-red), var(--cw-gold-2)); transform-origin: 0 50%; transform: scaleX(0); }
.cw-article { padding-top: 16px; padding-bottom: 8px; }   /* top and bottom only: the side gutter comes from .cw-narrow */
.cw-article h1 { margin: 8px 0 12px; }
.cw-article .stand { font-size: 1.15rem; color: var(--cw-ink-2); font-weight: 700; margin-bottom: 12px; }
.cw-article .by { font-size: .9rem; color: var(--cw-ink-2); margin-bottom: 16px; }
.cw-article figure { margin: 0 -16px 20px; }
.cw-article figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--cw-bg-2); }
.cw-article figcaption, .lore-credit { padding: 6px 16px 0; font-size: .8rem; color: var(--cw-ink-2); }
@media (min-width: 760px) { .cw-article figure { margin: 0 0 24px; } .cw-article figure img { border-radius: var(--cw-r); } .cw-article figcaption { padding: 6px 2px 0; } }
.cw-article article { font-size: 1.08rem; line-height: 1.75; }
.cw-article article h2 { margin: 32px 0 8px; color: var(--cw-green); }
.cw-article article p { margin: 0 0 1.1em; }
.cw-article blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--cw-gold); font-family: var(--cw-read); font-style: italic; color: var(--cw-ink-2); }
.cw-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--cw-green-ink); background: var(--cw-green-soft); border-radius: var(--cw-pill); padding: 4px 12px; }
.lore-embed { position: relative; padding-top: 56.25%; margin: 20px 0; background: #000; border-radius: var(--cw-r); overflow: hidden; }
.lore-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lore-src { font-size: .88rem; color: var(--cw-ink-2); border-top: 1px solid var(--cw-line); margin-top: 24px; padding-top: 12px; }
.lore-src a { word-break: break-word; }
.lore-anecdote { margin: 24px 0; padding: 16px 20px; background: var(--cw-card); border-left: 4px solid var(--cw-green); border-radius: var(--cw-r-sm); box-shadow: var(--cw-shadow); }
.lore-anecdote h2 { margin-top: 0; font-size: 1.25rem; }
.cw-story-end { display: grid; gap: 20px; margin: 28px 0 8px; }
.cw-story-reward { padding: 14px 18px; border-radius: var(--cw-r); background: var(--cw-gold-soft); color: var(--cw-ink); }
.cw-story-reward p { margin: 0; }
.cw-next-card { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center; padding: 10px; border-radius: var(--cw-r); background: var(--cw-card); box-shadow: var(--cw-shadow); text-decoration: none; color: inherit; }
.cw-next-card img { width: 132px; height: 88px; object-fit: cover; border-radius: 10px; background: var(--cw-bg-2); }
.cw-next-card strong { display: block; font-family: var(--cw-display); font-size: 1.05rem; line-height: 1.25; }
.cw-next-card em { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-style: normal; color: var(--cw-ink-2); font-size: .9rem; }
.cw-next-go { display: inline-block; margin-top: 6px; color: var(--cw-red); font-weight: 800; }
.cw-related-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cw-cta { margin: 32px 0 8px; padding: 20px; border-radius: 20px; background: var(--cw-fill); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.cw-cta strong { font-family: var(--cw-display); font-size: 1.3rem; display: block; }
.cw-cta p { margin: 0; opacity: .9; }

/* almanac cards also appear on site pages (related cards, today's unlocks) */
.rw-card { position: relative; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--cw-card); box-shadow: 0 0 0 2px var(--rar, var(--cw-common)), var(--cw-shadow); min-height: 176px; }
.rw-card-art { height: 84px; background: linear-gradient(135deg, color-mix(in srgb, var(--rar, var(--cw-common)) 70%, #fff), var(--rar, var(--cw-common))) center / cover; }
.rw-card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.rw-card-body strong { font-family: var(--cw-display); font-size: 1.05rem; letter-spacing: .04em; }
.rw-card-rar { font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--rar, var(--cw-common)); }
.rw-r-legendary .rw-card-rar { color: var(--cw-legendary-ink); }
.rw-card-ref { font-size: .8rem; color: var(--cw-ink-2); line-height: 1.3; }
.rw-card p { font-size: .9rem; margin: 6px 0 0; }
.rw-r-common { --rar: var(--cw-common); } .rw-r-rare { --rar: var(--cw-rare); } .rw-r-epic { --rar: var(--cw-epic); } .rw-r-legendary { --rar: var(--cw-legendary); }
.rw-card.rw-locked .rw-card-art { filter: grayscale(1) brightness(.55); }
.rw-card.rw-locked strong { color: var(--cw-ink-2); letter-spacing: .12em; }
.rw-r-legendary.rw-card { box-shadow: 0 0 0 2px var(--cw-legendary), 0 0 18px color-mix(in srgb, var(--cw-legendary) 40%, transparent), var(--cw-shadow); }

/* ---------- footer ---------- */
.cw-foot { margin-top: var(--cw-s5); background: var(--cw-bg-2); color: var(--cw-ink-2); font-size: .92rem; padding: 24px 0 calc(24px + env(safe-area-inset-bottom, 0px)); }
.cw-foot-in { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; }
.cw-foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.cw-foot a { color: var(--cw-ink); font-weight: 700; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.cw-foot a:hover { text-decoration: underline; }
.cw-foot p { margin: 0 0 8px; }
.cw-fine { font-size: .8rem; }

@media (prefers-reduced-motion: reduce) {
  .daily-btn::after, .chest-card.is-ready .chest-ico, .cw-streak.is-pending svg, .streak-line.is-pending .flame { animation: none; }
  .cw-card, .cw-meter i { transition: none; }
}
:root[data-motion="reduce"] .daily-btn::after { animation: none; }
@media (forced-colors: active) { .cw-btn, .cw-streak, .cw-xp, .cw-play { border: 2px solid ButtonText; } .cw-meter i { background: Highlight; } }

/* home details */
.home-h1 { font-family: var(--cw-text); font-size: .78rem !important; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .78); margin: 0 0 12px !important; }
button.streak-line { appearance: none; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0; width: 100%; }
.cw-card-read { position: absolute; top: 10px; right: 10px; background: var(--cw-fill); color: #fff; font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: var(--cw-pill); }
[data-feed="latest"] { min-height: 300px; }
#cw-long:empty, #cw-drops:empty, #cw-anecdotes:empty { min-height: 280px; }
.hub-chips { min-height: 48px; }
/* Stories page, phones: one row of hub chips that scrolls sideways, so the chips are the same height whichever font is showing (re-wrapping
   them when Nunito arrived pushed the Stories page down by two rows of chips: CLS 0.097). */
@media (max-width: 720px) {
  #cw-hubs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px; scroll-padding-inline: 16px; }
  #cw-hubs::-webkit-scrollbar { display: none; }
  #cw-hubs a { flex: none; white-space: nowrap; }
}
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.legal { padding: 24px 0 8px; }
.legal h1 { margin-bottom: 12px; }
.legal h2 { margin: 28px 0 8px; }

/* a story without its own picture gets a designed face, never a stock photo standing in for it */
.cw-card-face { display: block; aspect-ratio: 16 / 9; background:
  radial-gradient(circle at 78% 30%, rgba(244, 197, 66, .35) 0 18%, transparent 19%),
  radial-gradient(circle at 78% 30%, #c1121f 0 14%, transparent 14.5%),
  repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 12px, transparent 12px 24px),
  linear-gradient(160deg, var(--cw-green-2), var(--cw-green) 55%, #08301f); }
/* neighbours never share a face: white ball on red, pink ball under lights, red ball on a mown pitch */
.cw-card:nth-child(4n+2) .cw-card-face { background:
  radial-gradient(circle at 26% 66%, rgba(255, 255, 255, .22) 0 17%, transparent 18%),
  radial-gradient(circle at 26% 66%, #f6f1e4 0 13%, transparent 13.5%),
  repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 12px, transparent 12px 24px),
  linear-gradient(160deg, #c1121f, #8d0d17 55%, #4a060c); }
.cw-card:nth-child(4n+3) .cw-card-face { background:
  radial-gradient(circle at 70% 64%, rgba(255, 95, 162, .3) 0 18%, transparent 19%),
  radial-gradient(circle at 70% 64%, #ff5fa2 0 13%, transparent 13.5%),
  radial-gradient(ellipse at 12% 0%, rgba(255, 244, 200, .35), transparent 45%),
  linear-gradient(170deg, #17324d, #0b1d30 60%, #050e18); }
.cw-card:nth-child(4n) .cw-card-face { background:
  radial-gradient(circle at 32% 34%, rgba(255, 255, 255, .25) 0 17%, transparent 18%),
  radial-gradient(circle at 32% 34%, #c1121f 0 13%, transparent 13.5%),
  repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 22px, transparent 22px 44px),
  linear-gradient(180deg, #d9b45a, #b38a2e 60%, #7c5d17); }

/* progress backup (Settings) */
.rw-code { width: 100%; box-sizing: border-box; margin: 8px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--cw-line); background: var(--cw-bg-2); color: var(--cw-ink); font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; resize: vertical; }
.rw-file { display: block; margin: 4px 0 8px; font-size: .92rem; color: var(--cw-ink-2); }
.rw-file input { display: block; margin-top: 6px; max-width: 100%; }

/* ========== Spatial theme: components (after the base rules, so these win at equal weight) ========== */
/* the night sky: three aurora glows and a faint dot grid, fixed behind every page (gradients only: no blur filters to paint) */
body.cw-site { font-size: 16px; position: relative; }
body.cw-site::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42vmax 42vmax at 6% 4%, var(--cw-aurora-1), var(--cw-aurora-1b) 38%, transparent 68%),
    radial-gradient(40vmax 40vmax at 98% 42%, var(--cw-aurora-2), var(--cw-aurora-2b) 38%, transparent 68%),
    radial-gradient(36vmax 36vmax at 38% 104%, var(--cw-aurora-3), var(--cw-aurora-3b) 40%, transparent 70%); }
body.cw-site::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .03;
  background-image: radial-gradient(rgba(255, 255, 255, .8) 1px, transparent 1px); background-size: 32px 32px; }
:root[data-mode="light"] body.cw-site::after { opacity: 0; }
.cw-site h1, .cw-site h2, .cw-site h3 { font-weight: 800; letter-spacing: -.02em; }
.cw-site h1 { font-weight: 900; }
.cw-eyebrow { font-family: var(--cw-mono); font-size: .68rem; font-weight: 600; letter-spacing: .12em; }
.cw-section-head h2 { font-size: clamp(1.35rem, 4vw, 1.6rem); }
.cw-section-head a { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 800; padding: 8px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--cw-violet) 12%, transparent); border: 1px solid color-mix(in srgb, var(--cw-violet) 25%, transparent); color: var(--cw-violet); }
.cw-section-head a svg { width: 14px; height: 14px; }

/* buttons and chips */
.cw-btn { border-radius: var(--cw-r-sm); font-weight: 800; background: var(--cw-glass-2); color: var(--cw-ink); box-shadow: inset 0 0 0 1px var(--cw-glass-line); }
.cw-btn-primary { background: linear-gradient(90deg, var(--cw-fill), var(--cw-fill-2)); color: #fff; box-shadow: 0 0 25px rgba(255, 8, 68, .45); }
.cw-btn-red { background: linear-gradient(90deg, var(--cw-play-1), var(--cw-play-2)); color: #fff; box-shadow: 0 0 25px rgba(255, 8, 68, .45); }
.cw-btn-gold { background: #fbbf24; color: #451a03; box-shadow: 0 0 25px rgba(251, 191, 36, .45); }
.cw-btn-gold:hover { background: #fcd34d; }
.cw-chip { font-family: var(--cw-mono); font-size: .7rem; font-weight: 700; letter-spacing: .06em; border-radius: var(--cw-pill); }
.cw-chip.gold { background: linear-gradient(90deg, #fbbf24, #f97316); color: #451a03; text-transform: uppercase; font-family: var(--cw-text); font-weight: 900; letter-spacing: .08em; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.cw-meter { background: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1px var(--cw-glass-line); padding: 2px; height: 12px; }
:root[data-mode="light"] .cw-meter { background: var(--cw-bg-2); }
.cw-meter i { background: linear-gradient(90deg, #22d3ee, #2dd4bf, #34d399); box-shadow: 0 0 12px rgba(45, 212, 191, .7); }

/* glass cards */
.cw-card, .chest-card, .rank-card, .hero-stat, .cw-tile, .flagship, .cw-cta, .cw-next-card, .cw-story-reward, .friend-news, .cw-related-row > * {
  background: var(--cw-glass); border: 1px solid var(--cw-glass-line); box-shadow: var(--cw-shadow); border-radius: var(--cw-r); }
.cw-card { transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s, border-color .3s; }
a.cw-card:hover, .cw-tile:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, .25); box-shadow: var(--cw-shadow-lg); }
.cw-card-body strong { font-family: var(--cw-display); font-weight: 800; color: var(--cw-ink); letter-spacing: -.01em; }
.cw-card-body span { color: var(--cw-ink-2); }
.cw-card-tag { font-family: var(--cw-mono); font-weight: 700; letter-spacing: .08em; background: rgba(10, 5, 18, .7); border: 1px solid rgba(255, 255, 255, .15); }
.cw-card-img { border-bottom: 1px solid var(--cw-glass-line); }
.cw-card:nth-child(4n+1) .cw-card-face { background:
  radial-gradient(circle at 78% 30%, rgba(251, 191, 36, .45) 0 18%, transparent 19%), radial-gradient(circle at 78% 30%, #fcd34d 0 13%, transparent 13.5%),
  repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 12px, transparent 12px 24px), linear-gradient(160deg, #be123c, #7f1d1d 55%, #1c0a12); }
.cw-card:nth-child(4n+2) .cw-card-face { background:
  radial-gradient(circle at 26% 66%, rgba(255, 255, 255, .25) 0 17%, transparent 18%), radial-gradient(circle at 26% 66%, #f8fafc 0 13%, transparent 13.5%),
  repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 12px, transparent 12px 24px), linear-gradient(160deg, #7c3aed, #4c1d95 55%, #140a28); }
.cw-card:nth-child(4n+3) .cw-card-face { background:
  radial-gradient(circle at 70% 64%, rgba(251, 113, 133, .4) 0 18%, transparent 19%), radial-gradient(circle at 70% 64%, #fb7185 0 13%, transparent 13.5%),
  radial-gradient(ellipse at 12% 0%, rgba(103, 232, 249, .3), transparent 45%), linear-gradient(170deg, #0e7490, #164e63 60%, #06121c); }
.cw-card:nth-child(4n) .cw-card-face { background:
  radial-gradient(circle at 30% 34%, rgba(252, 211, 77, .35) 0 18%, transparent 19%), radial-gradient(circle at 30% 34%, #fcd34d 0 13%, transparent 13.5%),
  repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 12px, transparent 12px 24px), linear-gradient(160deg, #ea580c, #9a3412 55%, #1f0d06); }
.cw-card-read { background: linear-gradient(90deg, var(--cw-fill), var(--cw-fill-2)); }

/* home: the daily match hero (a big glass card) beside the stat tiles, rank and chest */
.home-hero { background: none; color: var(--cw-ink); padding: 20px 0 8px; }
@media (min-width: 900px) { .ritual { grid-template-columns: 2fr 1fr; gap: 24px; } }
.hero-card { position: relative; overflow: hidden; padding: 24px; border-radius: 28px; background: var(--cw-glass); border: 1px solid rgba(251, 113, 133, .3); box-shadow: var(--cw-shadow); display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.hero-card::before { content: ''; position: absolute; top: -128px; right: -128px; width: 384px; height: 384px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(244, 63, 94, .28), rgba(245, 158, 11, .18) 45%, transparent 70%); }
.hero-card > * { position: relative; }
@media (min-width: 640px) { .hero-card { padding: 32px; } }
.hero-pills { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.hero-pill { display: inline-flex; align-items: center; gap: 6px; margin: 0 !important; padding: 5px 12px; border-radius: var(--cw-pill); font-family: var(--cw-mono) !important; font-size: .7rem !important; font-weight: 700 !important; letter-spacing: .1em !important; text-transform: uppercase; line-height: 1.3 !important;
  color: #fbbf24; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .2); }
.hero-pill svg { width: 14px; height: 14px; flex: none; }
.hero-pill .spin { animation: cw-spin 8s linear infinite; }
.hero-pill-time { color: var(--cw-ink-2); background: var(--cw-glass); border-color: var(--cw-glass-line); text-transform: none; letter-spacing: 0 !important; }
.hero-pill-time svg { color: #fb7185; }
.hero-pill-time strong { color: var(--cw-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
:root[data-mode="light"] .hero-pill { color: #92400e; background: #fef3c7; border-color: #fde68a; }
:root[data-mode="light"] .hero-pill-time { color: var(--cw-ink-2); background: var(--cw-glass-2); border-color: var(--cw-glass-line); }
@keyframes cw-spin { to { transform: rotate(360deg); } }
.hero-day { margin-top: 4px; }
.hero-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 8px !important; font-family: var(--cw-display); font-size: clamp(2.25rem, 9vw, 3rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.05; color: var(--cw-ink); }
.hero-board { font-family: var(--cw-text); font-size: .78rem; font-weight: 800; letter-spacing: 0; padding: 5px 12px; border-radius: var(--cw-pill); color: #fda4af; background: rgba(244, 63, 94, .2); border: 1px solid rgba(251, 113, 133, .3); }
:root[data-mode="light"] .hero-board { color: #9f1239; background: #ffe4e9; border-color: #fecdd3; }
.hero-sub { max-width: 36rem; margin: 0 !important; color: var(--cw-ink-2); font-size: .98rem; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid var(--cw-glass-line); }
.daily-btn { min-height: 60px; padding: 14px 24px; border-radius: 18px; gap: 12px; justify-content: center; width: 100%; color: #451a03; font-weight: 900; font-size: 1rem;
  background: linear-gradient(90deg, #fbbf24, #f97316 55%, #f43f5e); box-shadow: 0 0 35px rgba(245, 158, 11, .5); transition: filter .2s, transform .15s; }
.daily-btn:hover { filter: brightness(1.1); }
.daily-btn:active { transform: scale(.97); }
@media (min-width: 640px) { .daily-btn { width: auto; } }
.daily-btn::after { inset: -4px; border-radius: 22px; border-color: rgba(252, 211, 77, .6); }
.daily-btn .go { width: 28px; height: 28px; background: #451a03; color: #fcd34d; transition: transform .2s; }
.daily-btn .go svg { width: 14px; height: 14px; }
.daily-btn:hover .go { transform: scale(1.1); }
.daily-btn .arrow { width: 20px; height: 20px; flex: none; transition: transform .2s; }
.daily-btn:hover .arrow { transform: translateX(4px); }
.daily-label { white-space: nowrap; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 auto; padding: 0; list-style: none; font-family: var(--cw-mono); font-size: .74rem; color: var(--cw-ink-2); }
@media (min-width: 640px) { .hero-facts { margin: 0; } }
.hero-facts li { display: flex; align-items: center; gap: 6px; }
.hero-facts svg { width: 16px; height: 16px; flex: none; }
.hero-facts .ok { color: #34d399; } .hero-facts .zap { color: #fbbf24; }
.ritual-side { gap: 20px; }
.hero-stats { gap: 12px; }
.hero-stat { flex-direction: column-reverse; justify-content: center; align-items: center; text-align: center; min-height: 76px; padding: 12px 8px; border-radius: 18px; color: var(--cw-ink); }
.hero-stat span { font-family: var(--cw-mono); font-size: .62rem; font-weight: 600; letter-spacing: .08em; opacity: 1; color: var(--cw-ink-2); }
.hero-stat b { font-family: var(--cw-mono); font-size: 1.3rem; font-weight: 800; margin-top: 2px; }
.hero-stat:nth-child(1) { border-color: rgba(245, 158, 11, .25); } .hero-stat:nth-child(1) b { color: #fcd34d; }
.hero-stat:nth-child(2) { border-color: rgba(6, 182, 212, .25); } .hero-stat:nth-child(2) b { color: #67e8f9; }
.hero-stat:nth-child(3) { border-color: rgba(168, 85, 247, .25); } .hero-stat:nth-child(3) b { color: #d8b4fe; }
:root[data-mode="light"] .hero-stat:nth-child(1) b { color: #b45309; } :root[data-mode="light"] .hero-stat:nth-child(2) b { color: #0e7490; } :root[data-mode="light"] .hero-stat:nth-child(3) b { color: #7e22ce; }
.rank-card { padding: 20px; color: var(--cw-ink); gap: 14px; transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.rank-card:hover { transform: translateY(-4px); }
.rank-card #h-rank-badge { flex: none; width: 48px; height: 48px; border-radius: 16px; padding: 1px; display: grid; place-items: center; background: linear-gradient(45deg, #06b6d4, #2dd4bf); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.rank-card #h-rank-badge svg { width: 30px; height: 34px; }
.rank-card .cw-eyebrow { margin-bottom: 2px; font-size: .62rem; }
.rank-card strong { font-size: 1.12rem; font-weight: 800; }
.rank-card small { font-family: var(--cw-mono); color: #67e8f9; font-size: .74rem; }
:root[data-mode="light"] .rank-card small { color: #0e7490; }
.rank-card .cw-meter { margin-top: 10px; background: rgba(0, 0, 0, .4); }
:root[data-mode="light"] .rank-card .cw-meter { background: var(--cw-bg-2); }
.chest-card { grid-template-columns: 1fr 64px; padding: 20px; color: var(--cw-ink); border-color: rgba(245, 158, 11, .3); }
.chest-card > div { order: -1; }
.chest-card .chest-ico { width: 64px; height: 64px; padding: 8px; border-radius: 16px; background: rgba(245, 158, 11, .1); border: 1px solid rgba(251, 191, 36, .3); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25); }
.chest-card.is-locked .chest-ico { filter: none; opacity: .9; animation: cw-bob 3s ease-in-out infinite; }
@keyframes cw-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.chest-card strong { font-size: 1.05rem; font-weight: 800; }
.chest-card p { color: var(--cw-ink-2); font-size: .82rem; }
.chest-card .cw-linkbtn { color: #fcd34d; font-weight: 800; text-underline-offset: 4px; font-size: .8rem; }
:root[data-mode="light"] .chest-card .cw-linkbtn { color: #92400e; }

/* this week's pack: a gold-sheened glass banner */
.week-pack { position: relative; overflow: hidden; flex-direction: column; align-items: stretch; gap: 16px; margin-top: 24px; padding: 24px; border-radius: 28px; color: var(--cw-ink);
  background: linear-gradient(90deg, rgba(69, 26, 3, .3), rgba(76, 5, 25, .2), rgba(59, 7, 100, .3)); border: 1px solid rgba(245, 158, 11, .4); box-shadow: var(--cw-shadow); transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
:root[data-mode="light"] .week-pack { background: linear-gradient(90deg, #fff7e6, #fff1f2, #f5f3ff); }
.week-pack:hover { transform: translateY(-4px); }
.week-pack::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(252, 211, 77, .1), transparent); transform: translateX(-100%) skewX(-12deg); animation: cw-shimmer 2.5s linear infinite; pointer-events: none; }
@keyframes cw-shimmer { to { transform: translateX(100%) skewX(-12deg); } }
@media (min-width: 760px) { .week-pack { flex-direction: row; align-items: center; justify-content: space-between; padding: 32px; } }
.week-pack > * { position: relative; }
.wp-main { display: flex; flex-direction: column; gap: 8px; max-width: 42rem; }
.wp-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wp-time { display: inline-flex; align-items: center; gap: 4px; font-family: var(--cw-mono); font-size: .74rem; color: #fcd34d; opacity: 1 !important; font-weight: 600 !important; }
:root[data-mode="light"] .wp-time { color: #92400e; }
.wp-time svg { width: 14px; height: 14px; }
.week-pack .wp-title { font-family: var(--cw-display); font-size: clamp(1.5rem, 5vw, 1.9rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.15; color: var(--cw-ink); }
.week-pack .wp-desc { color: var(--cw-ink-2); font-size: .9rem; line-height: 1.6; font-weight: 500; opacity: 1; }
.wp-cta { flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 18px; background: #fbbf24; color: #451a03 !important; font-weight: 900 !important; font-size: .9rem !important; opacity: 1 !important; box-shadow: 0 0 25px rgba(251, 191, 36, .5); }
.wp-cta svg { width: 16px; height: 16px; }
@media (min-width: 760px) { .wp-cta { align-self: center; } }

/* today's unlocks: collectible cards tinted by rarity */
.rw-card { border-radius: 20px; border: 1px solid color-mix(in srgb, var(--rar, var(--cw-common)) 40%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rar, var(--cw-common)) 15%, transparent), rgba(46, 16, 101, .4) 45%, rgba(15, 23, 42, .8)); box-shadow: var(--cw-shadow); }
:root[data-mode="light"] .rw-card { background: linear-gradient(180deg, color-mix(in srgb, var(--rar, var(--cw-common)) 12%, #fff), #fff 55%); }
.rw-r-legendary.rw-card { box-shadow: 0 0 22px color-mix(in srgb, var(--cw-legendary) 30%, transparent), var(--cw-shadow); }
.rw-card-art { border-radius: 14px; margin: 12px 12px 0; height: 88px; border: 1px solid color-mix(in srgb, var(--rar, var(--cw-common)) 30%, transparent); }
.rw-card.rw-locked .rw-card-art { filter: saturate(1.05); }
.rw-card.rw-r-legendary .rw-card-art { background: linear-gradient(135deg, rgba(249, 115, 22, .35), rgba(245, 158, 11, .35)); }
.rw-card.rw-r-epic .rw-card-art { background: linear-gradient(135deg, rgba(168, 85, 247, .35), rgba(99, 102, 241, .35)); }
.rw-card.rw-r-rare .rw-card-art { background: linear-gradient(135deg, rgba(6, 182, 212, .35), rgba(59, 130, 246, .35)); }
.rw-card.rw-r-common .rw-card-art { background: linear-gradient(135deg, rgba(148, 163, 184, .3), rgba(100, 116, 139, .3)); }
.rw-card-rar { font-family: var(--cw-mono); font-weight: 800; letter-spacing: .12em; }
.rw-card-body strong { color: var(--cw-ink); }
.rw-card p { font-family: var(--cw-mono); color: var(--cw-ink-2); }

/* hubs, stories, reading */
.flagship { overflow: hidden; }
.flagship-art { background: linear-gradient(160deg, rgba(225, 29, 72, .35), rgba(124, 58, 237, .3)); }
.cw-tile { color: var(--cw-ink); transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s, border-color .3s; }
.cw-tile .cw-eyebrow { color: var(--cw-amber); }
.pillar { border-radius: var(--cw-r); border: 1px solid var(--cw-glass-line); box-shadow: var(--cw-shadow); }
.pillar::before { background: linear-gradient(180deg, rgba(10, 5, 18, .1) 0%, rgba(10, 5, 18, .88) 100%); }
.hub-chips a { background: var(--cw-glass-2); box-shadow: inset 0 0 0 1px var(--cw-glass-line); color: var(--cw-ink); font-weight: 700; }
.hub-chips a:hover { box-shadow: inset 0 0 0 1px var(--cw-green-ink); }
.tabs { background: color-mix(in srgb, var(--cw-bg) 85%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom-color: var(--cw-glass-line); }
.tabs [aria-selected="true"] { color: var(--cw-green-ink); box-shadow: inset 0 -3px 0 var(--cw-green-ink); }
.cw-article article p { color: color-mix(in srgb, var(--cw-ink) 88%, var(--cw-bg)); }
.cw-article blockquote { border-left-color: var(--cw-green-ink); }
.crumbs a, .cw-foot a:hover { color: var(--cw-green-ink); }
.cw-foot { background: transparent; border-top: 1px solid var(--cw-glass-line); }
.cw-foot a { color: var(--cw-ink-2); }
:root .rw-toast { color: #fff; background: rgba(20, 12, 34, .92); border: 1px solid rgba(251, 191, 36, .35); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
@media (prefers-reduced-motion: reduce) { .cw-play::before, .week-pack::before, .hero-pill .spin, .chest-card.is-locked .chest-ico { animation: none; } }
:root[data-motion="reduce"] .cw-play::before, :root[data-motion="reduce"] .week-pack::before, :root[data-motion="reduce"] .hero-pill .spin, :root[data-motion="reduce"] .chest-card.is-locked .chest-ico { animation: none; }
@media (forced-colors: active) { .cw-top-in, .hero-card, .week-pack { border: 1px solid CanvasText; } body.cw-site::before, body.cw-site::after { display: none; } }
/* the cookie banner on site pages (the game styles its own in css/style.css) */
:is(body.cw-site, body.tw-page) .consent-bar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 90; max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 20px;
  background: color-mix(in srgb, var(--cw-card) 92%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: var(--cw-ink); border: 1px solid var(--cw-glass-line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); transform: translate3d(0, calc(100% + 30px), 0); transition: transform .26s cubic-bezier(.16, 1, .3, 1); font-size: .86rem; }
:is(body.cw-site, body.tw-page) .consent-bar.show { transform: none; }
:is(body.cw-site, body.tw-page) .consent-bar p { margin: 0 0 10px; line-height: 1.5; color: var(--cw-ink-2); }
:is(body.cw-site, body.tw-page) .consent-bar a { color: var(--cw-green-ink); }
:is(body.cw-site, body.tw-page) .consent-row { display: flex; gap: 8px; }
:is(body.cw-site, body.tw-page) .consent-row .btn { flex: 1; min-height: 44px; padding: 9px 10px; border: 0; border-radius: 14px; font: inherit; font-weight: 800; cursor: pointer; background: var(--cw-glass-2); color: var(--cw-ink); box-shadow: inset 0 0 0 1px var(--cw-glass-line); }
:is(body.cw-site, body.tw-page) .consent-row .btn.primary { background: linear-gradient(90deg, var(--cw-fill), var(--cw-fill-2)); color: #fff; box-shadow: none; }

/* ---------- the design's pages (home and Stories carry body.tw-page; its own styles are css/design.css) ---------- */
body.tw-page { margin: 0; min-height: 100vh; position: relative; }
html[data-app] .cw-strip, body.cs-cw .cw-strip { display: none; }   /* the games keep their full screen */
.cw-skip { z-index: 60; }
#h-unlocks:empty { min-height: 320px; }
.tw .flip-card:focus-visible { outline: 3px solid #fcd34d; outline-offset: 4px; border-radius: 1.25rem; }
@media (prefers-reduced-motion: reduce) { .tw .animate-ping, .tw .animate-pulse, .tw .animate-bounce, .tw .animate-spin, .tw .animate-shimmer { animation: none !important; } .tw .flip-card-inner { transition: none; } }
:root[data-motion="reduce"] .tw .animate-ping, :root[data-motion="reduce"] .tw .animate-pulse, :root[data-motion="reduce"] .tw .animate-bounce, :root[data-motion="reduce"] .tw .animate-spin, :root[data-motion="reduce"] .tw .animate-shimmer { animation: none !important; }
/* the Scroll flagship on the Games page: Word Master's twin, in Scroll's night-blue and violet */
.flagship-cs { margin-top: 32px; }
.flagship-cs .flagship-art { background: radial-gradient(70% 70% at 30% 20%, rgba(34, 211, 238, .28), transparent 60%), linear-gradient(160deg, rgba(124, 58, 237, .4), rgba(14, 116, 144, .35) 60%, rgba(10, 5, 18, .6)); }
/* site pages lay their body out as a flex column: the design's centred header must still span the page */
body.cw-site .cw-top, body.cw-site .cw-strip { width: 100%; }
/* Word Master runs its own light theme: the design's glass bar keeps the design's dark night behind it there */
html[data-app] .cw-top #navbar { background: rgba(10, 5, 18, .9); }

/* ================= Phones and tablets: the design, made to fit (desktop is untouched) ================= */
/* home and Stories sit outside the site base, so their footer and banners need the same box sizing */
body.tw-page *, body.tw-page *::before, body.tw-page *::after { box-sizing: border-box; }
/* the header: one row on every phone. Logo, Games / Stories, streak and XP, Play */
@media (max-width: 1023px) {
  .tw #tab-games-btn > span:last-child, .tw #tab-stories-btn > span:last-child { display: none !important; }   /* the (Play) / (Learn) tags */
  .tw .cw-brand .text-\[9px\] { display: none; }   /* the tagline under the name */
}
@media (max-width: 639px) {
  :root { --cw-top-h: 58px; }
  .tw header.cw-top { padding: 8px 8px 0; }
  .tw #navbar { padding: 6px 6px 6px 8px; gap: 5px; }
  .tw .cw-brand > div:last-child { display: none; }   /* the wordmark: the logo carries the brand on a phone */
  .tw .cw-brand > div:first-child { width: 34px; height: 34px; }
  .tw .cw-nav { padding: 3px; }
  .tw .cw-nav > a { padding: 7px 10px; font-size: 13px; }
  .tw #navbar .cw-streak, .tw #navbar .cw-xp { padding: 4px 7px; }
  .tw #navbar .cw-streak > * + *, .tw #navbar .cw-xp > * + * { margin-left: 4px !important; }
  .tw #navbar > div:last-child { gap: 5px; }
  .tw #navbar > div:last-child > * + * { margin-left: 0 !important; }
  .tw .cw-play > div { padding: 7px 12px; }
}
@media (max-width: 479px) {   /* words, not icons, in the tabs and on Play */
  .tw .cw-nav > a svg, .tw .cw-play svg { display: none; }
  .tw .cw-nav > a > span, .tw .cw-play span { margin-left: 0 !important; }
}
@media (max-width: 374px) {
  .tw .cw-nav > a { padding: 7px 8px; }
  .tw #navbar .cw-streak, .tw #navbar .cw-xp { padding: 4px 6px; }
}
@media (max-width: 339px) {
  .tw #navbar { gap: 3px; padding: 5px 5px 5px 6px; }
  .tw #navbar > div:last-child { gap: 3px; }
  .tw .cw-brand > div:first-child { width: 30px; height: 30px; }
  .tw .cw-nav > a { padding: 6px 6px; font-size: 12px; }
  .tw #navbar .cw-streak, .tw #navbar .cw-xp { padding: 3px 4px; }
  .tw .cw-play > div { padding: 6px 9px; }
}
/* home on a phone: tighter type, the unlock cards as a swipeable row */
@media (max-width: 639px) {
  .tw #h-unl-head { flex-wrap: wrap; gap: 12px; align-items: flex-end; }
  .tw #h-unl-head h2 { font-size: 1.375rem; }
  .tw #h-unlocks { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin: 0 -16px; padding: 4px 16px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tw #h-unlocks::-webkit-scrollbar { display: none; }
  .tw #h-unlocks > .flip-card { flex: 0 0 82%; scroll-snap-align: center; }
  .tw #h-unlocks:empty { min-height: 320px; }
}
/* home on a tablet: stats across the top, rank and chest side by side under the hero */
@media (min-width: 640px) and (max-width: 1023px) {
  .tw #h-side { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .tw #h-side > * { margin-top: 0 !important; }
  .tw #h-side > :first-child { grid-column: 1 / -1; }
}
/* legal and about pages: images never wider than the screen (the about logo is 320px wide) */
.doc img { max-width: 100%; height: auto; }
/* the moment page: its column sits in a flex body, so it must claim the width or it grows to its widest row */
body.page .doc { width: 100%; }
/* the moment page's status-image maker: its column may shrink, its style tabs wrap, the file picker fits */
body.page .status-grid > * { min-width: 0; }
body.page .status-controls .tabs { flex-wrap: wrap; position: static; overflow: visible; }
body.page .status-controls input[type=file] { max-width: 100%; }

/* ---------- the design theme a player picks: Neural (the design's dopamine palette) or Heart (its serotonin palette) ----------
   The head script sets html[data-palette] from Settings before the first paint; these mirror the design's setPaletteMode. */
html[data-palette="dopamine"] body.tw-page { background-color: #0A0512 !important; }
html[data-palette="serotonin"] body.tw-page { background-color: #050D1A !important; }
html[data-palette="dopamine"] .tw #aurora-1 { background-image: linear-gradient(to top right, rgba(225, 29, 72, .3), rgba(249, 115, 22, .2), rgba(251, 191, 36, .25)); }
html[data-palette="dopamine"] .tw #aurora-2 { background-image: linear-gradient(to bottom right, rgba(147, 51, 234, .25), rgba(219, 39, 119, .2), rgba(245, 158, 11, .15)); }
html[data-palette="serotonin"] .tw #aurora-1 { background-image: linear-gradient(to top right, rgba(8, 145, 178, .3), rgba(20, 184, 166, .2), rgba(52, 211, 153, .25)); }
html[data-palette="serotonin"] .tw #aurora-2 { background-image: linear-gradient(to bottom right, rgba(37, 99, 235, .25), rgba(79, 70, 229, .2), rgba(20, 184, 166, .15)); }
html[data-palette="dopamine"] .tw #logo-accent { background-image: linear-gradient(to right, #fcd34d, #fda4af, #fdba74); }
html[data-palette="serotonin"] .tw #logo-accent { background-image: linear-gradient(to right, #67e8f9, #99f6e4, #6ee7b7); }
.cw-theme-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cw-theme-toggle { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); }
.cw-theme-toggle button { appearance: none; border: 0; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; min-height: 32px; padding: 4px 12px; border-radius: 7px; background: transparent; color: #94a3b8; }
.cw-theme-toggle button:hover { color: #f8fafc; }
.cw-theme-toggle [data-cw-palette="dopamine"][aria-pressed="true"] { background: rgba(244, 63, 94, .3); color: #fecdd3; }
.cw-theme-toggle [data-cw-palette="serotonin"][aria-pressed="true"] { background: rgba(6, 182, 212, .3); color: #a5f3fc; }
/* touch screens: a tap flips a card (and flips it back); the design's hover flip only where a mouse can hover */
@media (hover: none) { .tw .flip-card:hover:not(.flipped) .flip-card-inner { transform: none; } }

/* ---------- 8 Nov 2026: story pictures. The subject's Wikimedia Commons photo on the card (credited) and in the article;
   portraits stand whole in the article; a designed face where no free photo exists. ---------- */
.tw .cw-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 1rem; overflow: hidden; border: 1px solid rgba(103, 232, 249, .16);
  background: radial-gradient(120% 90% at 20% 0%, rgba(34, 211, 238, .28), transparent 60%), linear-gradient(135deg, rgba(8, 145, 178, .32), rgba(15, 23, 42, .65)); }
.tw .cw-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.tw .cw-thumb-credit { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 10px 6px; font: 500 9.5px/1.3 'JetBrains Mono', ui-monospace, monospace;
  color: rgba(226, 232, 240, .9); background: linear-gradient(rgba(2, 6, 23, 0), rgba(2, 6, 23, .82)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw .cw-thumb-none { display: grid; place-items: center; color: rgba(165, 243, 252, .5); }
.tw .glass-card-hover:hover .cw-thumb img { transform: scale(1.03); transition: transform .5s ease; }
@media (prefers-reduced-motion: reduce) { .tw .glass-card-hover:hover .cw-thumb img { transform: none; } }
.cw-card-img { object-position: 50% 22%; }
.cw-article figure img { object-position: 50% 22%; }
.cw-article figure.lore-fig-tall img { aspect-ratio: auto; width: auto; max-width: 100%; max-height: min(70vh, 560px); margin: 0 auto; object-fit: contain; }

/* ---------- 8 Nov 2026: phones and tablets draw the design's glass without live blur ----------
   A live backdrop-filter on every card, over three fixed glows blurred at 130 px, made scrolling and taps lag on iPhones
   (WebKit re-blurs what sits behind each visible card on every frame; Stories has about 45 cards). Same colours: cards get
   a fixed dark-glass fill, the glows a soft radial mask instead of a blur. Desktop keeps the full effect. :root outranks
   design.css, which loads after this file. */
@media (hover: none), (max-width: 1023px) {
  :root .tw .glass-card, :root .tw .glass-pill, :root .tw .backdrop-blur-md, :root .tw .modal-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root .tw .glass-card { background-color: rgba(14, 10, 28, .74); }
  :root .tw .glass-pill { background-color: rgba(20, 14, 36, .82); }
  :root .tw #streak-popover, :root .tw #xp-popover { background-color: rgba(14, 10, 28, .97); }   /* no blur behind them: keep their text readable */
  :root .tw #navbar { background-color: rgba(12, 8, 24, .9); }
  :root .tw .aurora-orb, :root .tw .blur-3xl { filter: none; -webkit-mask-image: radial-gradient(closest-side, #000, rgba(0, 0, 0, .45) 55%, transparent); mask-image: radial-gradient(closest-side, #000, rgba(0, 0, 0, .45) 55%, transparent); }
  :root .tw .aurora-orb { opacity: .55; }
  :root .tw .glass-card-hover:hover { transform: none; }
  .consent-bar, .rw-toast, .tabs { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* tablets: the side column is two across; Scroll and the stat row each take the full width */

/* ---------- 9 Nov 2026: the Scroll masthead, the hero game on Home and Games. Three real cards from the game, fanned.
   Every rule starts ".cs-hero " so it beats design.css's scoped resets (.tw h1, .tw a: loaded later, same weight).
   No blur filter or backdrop-filter (phones stay smooth); the float runs only for a desktop mouse. ---------- */
.cs-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px;
  padding: 26px 22px 0; border-radius: 28px; border: 1px solid rgba(34, 211, 238, .28); color: #f8fafc; text-align: left;
  background: radial-gradient(70% 60% at 90% 78%, rgba(249, 115, 22, .34), transparent 70%), radial-gradient(70% 60% at 0% 0%, rgba(34, 211, 238, .2), transparent 70%),
    linear-gradient(165deg, #170b31 0%, #0c1229 55%, #08202b 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08); }
.cs-hero .cs-hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.cs-hero .cs-hero-kicker { margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(34, 211, 238, .12);
  border: 1px solid rgba(34, 211, 238, .32); color: #a5f3fc; font: 700 11px/1.2 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }
.cs-hero .cs-hero-dot { width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 10px #22d3ee; }
.cs-hero .cs-hero-title { margin: 2px 0 0; font-size: clamp(52px, 16vw, 104px); line-height: .92; font-weight: 900; letter-spacing: -.045em; color: #fff; }
.cs-hero .cs-hero-title span { background: linear-gradient(90deg, #fdba74, #f97316 45%, #fb7185); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cs-hero .cs-hero-tag { margin: 0; font-size: clamp(20px, 5.6vw, 30px); line-height: 1.15; font-weight: 800; letter-spacing: -.01em; color: #fde68a; }
.cs-hero .cs-hero-desc { margin: 0; max-width: 34rem; font-size: 15px; line-height: 1.6; color: rgba(226, 232, 240, .88); }
.cs-hero .cs-hero-list { margin: 0; padding: 0 0 0 18px; max-width: 36rem; display: grid; gap: 6px; list-style: disc; font-size: 14px; line-height: 1.5; color: rgba(226, 232, 240, .82); }
.cs-hero .cs-hero-list li::marker { color: #f97316; }
.cs-hero .cs-hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: 6px; }
.cs-hero .cs-hero-play { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px; border-radius: 18px;
  background: linear-gradient(90deg, #f97316, #f43f5e); color: #fff; font-size: 17px; font-weight: 900; text-decoration: none;
  box-shadow: 0 12px 32px rgba(244, 63, 94, .42), inset 0 1px 0 rgba(255, 255, 255, .3); transition: transform .15s ease, filter .15s ease; }
.cs-hero .cs-hero-play:hover { filter: brightness(1.08); }
.cs-hero .cs-hero-play:active { transform: scale(.97); }
.cs-hero .cs-hero-play svg { width: 20px; height: 20px; }
.cs-hero .cs-hero-play:focus-visible, .cs-hero .cs-hero-art:focus-visible { outline: 3px solid #fde68a; outline-offset: 3px; }
.cs-hero .cs-hero-facts { margin: 0; padding: 0; list-style: none; display: flex; gap: 20px; color: rgba(203, 213, 225, .85); font: 600 11px/1.25 'JetBrains Mono', ui-monospace, monospace; }
.cs-hero .cs-hero-facts strong { display: block; font-size: 20px; font-weight: 900; color: #fff; font-family: inherit; }
.cs-hero .cs-hero-art { position: relative; z-index: 1; display: block; height: 300px; margin: 0 -22px; }
.cs-hero .cs-shot { position: absolute; left: 50%; bottom: -44px; width: 168px; max-width: none; height: auto; border-radius: 22px; transform-origin: 50% 100%;
  border: 2px solid rgba(255, 255, 255, .16); box-shadow: 0 22px 48px rgba(0, 0, 0, .6); transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.cs-hero .cs-shot-l { z-index: 1; transform: translateX(-112%) rotate(-11deg); }
.cs-hero .cs-shot-r { z-index: 2; transform: translateX(12%) rotate(11deg); }
.cs-hero .cs-shot-f { z-index: 3; width: 186px; transform: translateX(-50%); border-color: rgba(253, 224, 71, .55); }
@media (min-width: 640px) {
  .cs-hero { padding: 34px 36px 0; }
  .cs-hero .cs-hero-art { height: 360px; margin: 0 -36px; }
  .cs-hero .cs-shot { width: 200px; bottom: -50px; }
  .cs-hero .cs-shot-f { width: 222px; }
}
@media (min-width: 1024px) {
  .cs-hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 20px; min-height: 500px; padding: 0 0 0 56px; }
  .cs-hero .cs-hero-copy { align-self: center; padding: 52px 0; gap: 14px; }
  .cs-hero .cs-hero-title { font-size: clamp(76px, 7.4vw, 104px); }
  .cs-hero .cs-hero-desc { font-size: 16px; }
  .cs-hero .cs-hero-art { height: auto; min-height: 500px; margin: 0; }
  .cs-hero .cs-shot { left: 47%; width: 190px; bottom: -64px; }
  .cs-hero .cs-shot-f { width: 218px; }
  .cs-hero .cs-shot-l { transform: translateX(-108%) rotate(-10deg); }
  .cs-hero .cs-shot-r { transform: translateX(8%) rotate(10deg); }
}
@media (min-width: 1200px) {
  .cs-hero .cs-shot { width: 214px; }
  .cs-hero .cs-shot-f { width: 246px; }
}
@media (hover: hover) and (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .cs-hero .cs-shot-f { animation: cs-hero-float 6s ease-in-out infinite; }
  .cs-hero .cs-hero-art:hover .cs-shot-l { transform: translateX(-116%) rotate(-14deg); }
  .cs-hero .cs-hero-art:hover .cs-shot-r { transform: translateX(16%) rotate(14deg); }
  @keyframes cs-hero-float { 50% { transform: translateX(-50%) translateY(-12px); } }
}
/* Games page: the masthead sits in the light .cw-wrap column, so it keeps its own spacing. */
.cw-wrap .cs-hero { margin: 0 0 28px; }

/* ---------- 9 Nov 2026: the Word Master masthead: the Scroll build in the game's dusk indigo, sunset amber and floodlight aqua (green dropped 10 Nov 2026).
   ".cs-hero.wm-hero" outweighs every ".cs-hero ..." base rule, so the order of the two blocks does not matter. ---------- */
.cs-hero.wm-hero { border-color: rgba(251, 191, 36, .32);
  background: radial-gradient(70% 60% at 90% 80%, rgba(245, 158, 11, .3), transparent 70%), radial-gradient(70% 60% at 0% 0%, rgba(34, 211, 238, .24), transparent 70%),
    linear-gradient(165deg, #1b1240 0%, #2a1550 50%, #3d1747 100%); }
.cs-hero.wm-hero .cs-hero-kicker { color: #fde68a; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .34); }
.cs-hero.wm-hero .cs-hero-dot { background: #22d3ee; box-shadow: 0 0 10px #22d3ee; }
.cs-hero.wm-hero .cs-hero-title { font-size: clamp(38px, 12.6vw, 64px); }
.cs-hero.wm-hero .cs-hero-title span { display: table; }   /* phones: "Cric" over "WordMaster", as big as Scroll's title */
@media (min-width: 640px) { .cs-hero.wm-hero .cs-hero-title { font-size: clamp(56px, 10.4vw, 82px); } .cs-hero.wm-hero .cs-hero-title span { display: inline; } }
.cs-hero.wm-hero .cs-hero-title span { background: linear-gradient(90deg, #fde68a, #f59e0b 50%, #fb7185); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cs-hero.wm-hero .cs-hero-tag { color: #a5f3fc; }
.cs-hero.wm-hero .cs-hero-play { background: linear-gradient(90deg, #fbbf24, #f97316); color: #3a1a00; box-shadow: 0 12px 32px rgba(245, 158, 11, .42), inset 0 1px 0 rgba(255, 255, 255, .4); }
.cs-hero.wm-hero .cs-hero-play.is-done { background: linear-gradient(90deg, #67e8f9, #06b6d4); color: #052a33; }
.cs-hero.wm-hero .cs-hero-note { margin: 0; font: 600 12px/1.4 'JetBrains Mono', ui-monospace, monospace; color: rgba(203, 213, 225, .8); }
.cs-hero.wm-hero .cs-hero-note strong { color: #fde68a; font-weight: 800; }
.cs-hero.wm-hero .cs-hero-list li::marker { color: #22d3ee; }
.cs-hero.wm-hero .cs-shot-f { border-color: rgba(34, 211, 238, .6); }
@media (min-width: 1024px) { .cs-hero.wm-hero .cs-hero-title { font-size: clamp(56px, 5.6vw, 80px); } }
/* your stats, rank and chest under the masthead: three across on a desktop (the tablet grid above still applies) */
@media (min-width: 1024px) {
  .tw #h-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
  .tw #h-side > * { margin-top: 0 !important; }
  .tw #h-side > :first-child > * { display: flex; flex-direction: column; justify-content: center; }   /* the three stat tiles fill the row's height evenly */
}
