/* CRB immersive layer — public pages only (never loaded in /admin).
   Presentation only: every block stays readable without JavaScript. */
:root {
    --crb-bg: #11131c; --crb-surface: #252938; --crb-coral: #f39a88; --crb-coral-hover: #ffc1ad; --crb-cream: #faf8f3;
    --crb-text: #eceef5; --crb-muted: #b3b6c6; --crb-border: #383b4c; --crb-lavender: #c7b7f6; --crb-ink: #202330;
    --crb-success: #176c4a; --crb-error: #a3243a; --crb-warning: #83550d;
    --crb-ease-out: cubic-bezier(.16, 1, .3, 1); --crb-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
/* ScrollTrigger and CSS smooth scrolling conflict (a refresh cancels a running smooth jump): the home page
   scrolls natively and immersive.js animates its in-page anchor links instead. */
html:has(> body[data-page="/"]) { scroll-behavior: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: var(--crb-ease-out); }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Header: sticky glass on reading pages (not on workspaces with a side menu) ---------- */
@media (min-width: 901px) {
    body:is([data-page="/"], [data-page^="/leaderboard/"], [data-page="/docs"], [data-page="/status"], [data-page="/legal"], [data-page="/privacy"], [data-page="/terms"]) > header {
        position: sticky; top: 0; z-index: 60; transition: background .3s, box-shadow .3s, border-color .3s;
    }
    body > header.is-scrolled { background: #161924cc; -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); border-color: #f39a8840; box-shadow: 0 10px 40px #0006; }
}
header nav a { position: relative; transition: color .2s; }
header nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--crb-coral); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--crb-ease-out); }
header nav a:hover::after, header nav a[aria-current]::after { transform: scaleX(1); }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--crb-coral); outline-offset: 3px; }

/* ---------- Energy gauge (replaces the plain reading bar) ---------- */
body:not([data-page^="/admin"]) .reading-progress {
    height: 4px; background: linear-gradient(90deg, #c7b7f6, #f39a88 70%, #ffc1ad);
    -webkit-mask: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 17px); mask: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 17px);
    filter: drop-shadow(0 0 6px #f39a88aa); z-index: 70;
}

/* ---------- Living backdrop ---------- */
.crb-backdrop { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: .9; }
body:has(.crb-backdrop) { isolation: isolate; }

/* ---------- Hero ---------- */
.crb-universe .hero-kicker { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; color: #e6ac9b; font-weight: 600; font-size: .95rem; }
.crb-emblem { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid #f39a8866; background: #252938; cursor: pointer; box-shadow: 0 0 0 0 #f39a8855; transition: box-shadow .4s, transform .4s var(--crb-ease-spring); }
.crb-emblem:hover { box-shadow: 0 0 0 8px #f39a881f; transform: rotate(-8deg) scale(1.05); }
.crb-emblem img { width: 34px; height: 34px; filter: drop-shadow(0 3px 4px #0008); }
.crb-universe h1 { position: relative; display: inline-block; }
.crb-universe h1 .split-line { display: inline-block; white-space: nowrap; }
.crb-universe h1 .char { display: inline-block; will-change: transform; }
.crb-universe h1 .char.space { width: .28em; }
.crb-universe h1::after {
    content: ""; position: absolute; inset: -4% -2%; pointer-events: none; mix-blend-mode: soft-light;
    background: linear-gradient(100deg, transparent 35%, #fff9 48%, #ffc1ad 52%, transparent 65%) no-repeat; background-size: 250% 100%; background-position: 130% 0; opacity: 0;
}
.crb-universe h1.is-sheening::after { animation: crb-sheen 1.4s var(--crb-ease-out) forwards; }
@keyframes crb-sheen { 0% { opacity: 1; background-position: 130% 0; } 100% { opacity: 0; background-position: -60% 0; } }
.crb-universe .hero-lead { font-size: clamp(1.02rem, 1.4vw, 1.2rem); line-height: 1.7; color: #d4d5e0; max-width: 46ch; margin: 0 0 28px; }
.hero-scroll { display: inline-flex; align-items: center; gap: 10px; margin-top: 34px; color: #d8cfe6; font-size: .9rem; text-decoration: none; }
.hero-scroll span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #c7b7f666; animation: crb-bob 2.4s ease-in-out infinite; }
.hero-scroll:hover { color: #fff; }
@keyframes crb-bob { 50% { transform: translateY(5px); } }
.hero-home-actions .btn { will-change: transform; }

/* ---------- Live counters ---------- */
.public-stats .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 16px; }
.public-stats .stat { position: relative; overflow: hidden; background: #1a1d29; color: var(--crb-text); border: 1px solid var(--crb-border); border-radius: 18px; padding: 20px 22px; box-shadow: inset 0 1px 0 #ffffff0d; }
.public-stats .stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--crb-coral), var(--crb-lavender)); }
.public-stats .stat span { color: var(--crb-muted); font-size: .85rem; }
.public-stats .stat strong { display: block; margin-top: 8px; color: var(--crb-cream); font-size: clamp(1.9rem, 3vw, 2.6rem); font-variant-numeric: tabular-nums; }

/* ---------- Guided tour of the five universes ---------- */
.crb-tour { padding: 64px 0 40px; border-top: 1px solid #3d3d50; }
.crb-tour .tour-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.crb-tour .eyebrow, .crb-labs .eyebrow { color: #e6ac9b; letter-spacing: .14em; font-size: .72rem; text-transform: uppercase; }
.tour-hint { color: var(--crb-muted); margin: 0; }
.tour-track { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 22px; }
.tour-scene {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 32px;
    padding: clamp(24px, 4vw, 56px); border-radius: 28px; overflow: hidden; isolation: isolate;
    background: radial-gradient(circle at 85% 20%, #f39a881f, transparent 45%), linear-gradient(160deg, #23263a, #171a26 70%);
    border: 1px solid #3a3d52; box-shadow: inset 0 1px 0 #ffffff12, 0 18px 50px #0005;
}
.tour-scene::before { content: ""; position: absolute; inset: 14px; border-radius: 20px; border: 1px dashed #c7b7f61f; pointer-events: none; z-index: -1; }
.scene-index { font: 700 .8rem Sora, sans-serif; letter-spacing: .3em; color: var(--crb-lavender); }
.tour-scene h3 { font-size: clamp(2rem, 4.2vw, 3.6rem); line-height: 1.02; margin: 10px 0 16px; color: var(--crb-cream); }
.tour-scene p { color: #cfd0dc; line-height: 1.75; max-width: 44ch; }
.tour-scene .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.scene-visual { position: relative; min-height: 280px; display: grid; place-items: center; }
.scene-coin { background: radial-gradient(circle at 80% 30%, #ffc1ad26, transparent 50%), linear-gradient(160deg, #2a2536, #171a26 70%); }
.scene-xp { background: radial-gradient(circle at 75% 70%, #c7b7f62b, transparent 50%), linear-gradient(160deg, #21263a, #171a26 70%); }
.scene-boards { background: radial-gradient(circle at 70% 30%, #faf8f31a, transparent 50%), linear-gradient(160deg, #262838, #171a26 70%); }
.scene-community { background: radial-gradient(circle at 70% 50%, #c7b7f633, transparent 55%), linear-gradient(160deg, #1f2338, #171a26 70%); }

/* Scene visuals (CSS/SVG only, decorative). */
.cartridges { display: grid; grid-template-columns: repeat(3, 96px); gap: 16px; rotate: -6deg; }
.cartridge { position: relative; height: 120px; border-radius: 14px 14px 8px 8px; background: linear-gradient(#faf8f3, #e9e3da); border: 1px solid #fff; box-shadow: 0 8px 0 #c9bfb2, 0 18px 30px #0006; display: grid; align-content: end; padding: 10px; }
.cartridge::before { content: ""; position: absolute; top: 10px; left: 12px; right: 12px; height: 46px; border-radius: 8px; background: linear-gradient(135deg, #f39a88, #c7b7f6); }
.cartridge:nth-child(2)::before { background: linear-gradient(135deg, #c7b7f6, #6f5a9e); }
.cartridge:nth-child(3)::before { background: linear-gradient(135deg, #ffc1ad, #f39a88); }
.cartridge:nth-child(4)::before { background: linear-gradient(135deg, #2b2f45, #f39a88); }
.cartridge:nth-child(5)::before { background: linear-gradient(135deg, #faf8f3, #c7b7f6); }
.cartridge:nth-child(4), .cartridge:nth-child(5) { translate: 56px 0; }
.cartridge b { position: relative; color: var(--crb-ink); font: 700 .78rem Sora, sans-serif; }
.cartridge i { position: absolute; bottom: -8px; left: 22px; right: 22px; height: 8px; background: repeating-linear-gradient(90deg, #b8a98f 0 4px, transparent 4px 8px); }
.coin-terminal { position: relative; width: min(100%, 340px); padding: 26px; border-radius: 20px; background: #10121a; border: 1px solid #f39a8855; box-shadow: 0 0 0 6px #252938, 0 24px 50px #0007; }
.coin { position: absolute; right: -26px; top: -40px; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #ffe1d6, #f39a88 55%, #b9604f); box-shadow: inset 0 -6px 0 #0003, 0 14px 30px #0007; }
.coin b { font: 800 2.4rem Sora, sans-serif; color: #5b2a22; }
.terminal-lines { display: grid; gap: 16px; }
.terminal-lines span { display: grid; gap: 6px; }
.terminal-lines b { font: 600 .78rem 'Open Sans', sans-serif; color: var(--crb-muted); letter-spacing: .08em; text-transform: uppercase; }
.terminal-lines i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, #f39a88, #ffc1ad); width: 62%; transform-origin: left; }
.terminal-lines span:nth-child(2) i { width: 84%; background: linear-gradient(90deg, #c7b7f6, #e9e1fb); }
.terminal-lines span:nth-child(3) i { width: 46%; background: linear-gradient(90deg, #faf8f3, #c7b7f6); }
.xp-path { position: relative; width: min(100%, 360px); aspect-ratio: 2 / 1; }
.xp-path svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.xp-path path { fill: none; stroke: #c7b7f6; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 8 10; }
.xp-node { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #faf8f3; color: var(--crb-ink); font: 700 .9rem Sora, sans-serif; box-shadow: 0 0 0 6px #252938, 0 10px 24px #0007; translate: -50% -50%; }
.xp-node:nth-of-type(1) { left: 3%; top: 87%; } .xp-node:nth-of-type(2) { left: 35%; top: 52%; }
.xp-node:nth-of-type(3) { left: 66%; top: 34%; } .xp-node:nth-of-type(4) { left: 97%; top: 13%; background: var(--crb-coral); }
.mini-podium { display: flex; align-items: end; gap: 12px; height: 230px; }
.mini-podium .step { width: 92px; display: grid; place-items: start center; padding-top: 14px; border-radius: 14px 14px 4px 4px; background: linear-gradient(#faf8f3, #ddd5ca); box-shadow: 0 10px 0 #a69b8e, 0 22px 40px #0007; }
.mini-podium .step b { font: 800 2rem Sora, sans-serif; color: var(--crb-ink); }
.mini-podium .step-1 { height: 200px; background: linear-gradient(#ffc1ad, #f39a88); box-shadow: 0 10px 0 #9c5446, 0 22px 40px #0007; }
.mini-podium .step-2 { height: 150px; } .mini-podium .step-3 { height: 112px; background: linear-gradient(#e9e1fb, #c7b7f6); box-shadow: 0 10px 0 #7e6ca8, 0 22px 40px #0007; }
.community-orbit { position: relative; width: 260px; height: 260px; border-radius: 50%; border: 1px dashed #c7b7f655; }
.community-orbit::after { content: ""; position: absolute; inset: 38px; border-radius: 50%; border: 1px solid #f39a8840; }
.community-orbit .infinity { position: absolute; inset: 0; display: grid; place-items: center; font: 800 5.4rem Sora, sans-serif; color: var(--crb-coral); text-shadow: 0 8px 30px #f39a8866; }
.orbit-dot { position: absolute; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #11131c; background: linear-gradient(135deg, #faf8f3, #c7b7f6); left: 50%; top: 50%; margin: -17px; --r: 130px; translate: calc(cos(var(--a) * 1deg) * var(--r)) calc(sin(var(--a) * 1deg) * var(--r)); }
.orbit-dot:nth-of-type(2) { --a: 0; } .orbit-dot:nth-of-type(3) { --a: 60; background: linear-gradient(135deg, #ffc1ad, #f39a88); } .orbit-dot:nth-of-type(4) { --a: 120; }
.orbit-dot:nth-of-type(5) { --a: 180; background: linear-gradient(135deg, #e9e1fb, #8f7bc4); } .orbit-dot:nth-of-type(6) { --a: 240; } .orbit-dot:nth-of-type(7) { --a: 300; background: linear-gradient(135deg, #ffc1ad, #c7b7f6); }
.community-orbit:not(.is-static) { animation: crb-orbit 40s linear infinite; }
.community-orbit:not(.is-static) .infinity { animation: crb-orbit 40s linear infinite reverse; }
@keyframes crb-orbit { to { rotate: 360deg; } }

/* Gauge: always usable as a scene menu; becomes the energy bar in horizontal mode. */
.tour-gauge { margin-top: 22px; }
.tour-gauge ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.tour-gauge a { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid #45485b; background: #1d2030; color: #d8d9e5; font-size: .85rem; text-decoration: none; transition: background .25s, color .25s, border-color .25s; }
.tour-gauge a:hover, .tour-gauge a[aria-current="step"] { background: var(--crb-coral); border-color: var(--crb-coral); color: #221818; }
.gauge-track { display: none; }

/* Horizontal mode (desktop, full motion; enabled by immersive.js only). */
/* The pinned stage fills exactly the visible area under the fixed header (--tour-top, measured by
   immersive.js), so the first universe is entirely readable before anything moves. */
.crb-tour.is-horizontal { box-sizing: border-box; height: calc(100vh - var(--tour-top, 0px)); height: calc(100svh - var(--tour-top, 0px)); display: flex; flex-direction: column; padding: clamp(14px, 3.2vh, 40px) 0 clamp(12px, 2.6vh, 28px); }
.crb-tour.is-horizontal .tour-viewport { flex: 1 1 auto; min-height: 0; overflow: hidden; border-radius: 28px; margin-top: clamp(12px, 2.2vh, 22px); }
.crb-tour.is-horizontal .tour-track { display: flex; gap: 0; width: max-content; height: 100%; margin: 0; will-change: transform; }
.crb-tour.is-horizontal .tour-scene { box-sizing: border-box; width: var(--tour-width, 100%); height: 100%; flex: 0 0 auto; margin-right: 24px; padding-block: clamp(20px, 4vh, 56px); }
.crb-tour.is-horizontal .tour-scene h3 { font-size: clamp(2rem, min(4.2vw, 6.4vh), 3.6rem); }
.crb-tour.is-horizontal .scene-visual { min-height: 0; max-height: 100%; }
.crb-tour.is-horizontal .tour-gauge { margin-top: clamp(10px, 2vh, 22px); }
.crb-tour.is-horizontal .tour-hint { display: block; }
.crb-tour.is-horizontal .tour-gauge { display: flex; align-items: center; gap: 18px; }
.crb-tour.is-horizontal .gauge-track { display: block; flex: 0 0 180px; height: 12px; padding: 2px; border-radius: 8px; border: 1px solid #f39a8866; background: #12141d; }
.crb-tour.is-horizontal .gauge-fill { display: block; height: 100%; border-radius: 5px; background: repeating-linear-gradient(90deg, #f39a88 0 10px, #ffc1ad 10px 12px); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 10px #f39a88aa; }

/* ---------- Premium podium ---------- */
body[data-page="/"] .home-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 18px; margin-top: 26px; }
body[data-page="/"] .home-podium .podium-card { position: relative; display: grid; grid-template-columns: 1fr; align-items: center; justify-items: center; text-align: center; gap: 10px; padding: 30px 20px 26px; text-decoration: none; overflow: hidden; transition: transform .35s var(--crb-ease-out), box-shadow .35s; }
body[data-page="/"] .podium-card:hover { transform: translateY(-8px); }
body[data-page="/"] .podium-card .podium-rank { position: absolute; top: 14px; left: 18px; font: 800 .85rem Sora, sans-serif; color: #5f566b; }
body[data-page="/"] .podium-card .podium-arrow { position: absolute; top: 14px; right: 18px; }
.podium-avatar { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #c7b7f6, #f39a88); box-shadow: 0 0 0 4px #faf8f3, 0 0 0 6px #d8d5d0; }
.podium-avatar img { width: 100%; height: 100%; object-fit: cover; }
.podium-avatar span { font: 800 1.5rem Sora, sans-serif; color: var(--crb-ink); }
body[data-page="/"] .podium-card h3 { margin: 4px 0 0; font-size: 1.15rem; overflow-wrap: anywhere; }
body[data-page="/"] .podium-card p { margin: 0; font-size: .82rem; }
body[data-page="/"] .podium-card strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.podium-plinth { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: #d8cbea; }
body[data-page="/"] .podium-place-1 { order: 2; padding-top: 58px; padding-bottom: 40px; background: linear-gradient(180deg, #fff4ee, #faf8f3 60%); box-shadow: 0 0 0 2px #f39a88, 0 24px 60px #f39a8833; }
body[data-page="/"] .podium-place-1 .podium-avatar { width: 96px; height: 96px; box-shadow: 0 0 0 4px #faf8f3, 0 0 0 7px #f39a88; }
body[data-page="/"] .podium-place-1 .podium-plinth { height: 10px; background: linear-gradient(90deg, #f39a88, #ffc1ad); }
body[data-page="/"] .podium-place-1::before { content: "★" / ""; position: absolute; top: 10px; left: 50%; translate: -50% 0; color: #f39a88; font-size: 1.4rem; }
body[data-page="/"] .podium-place-2 { order: 1; } body[data-page="/"] .podium-place-3 { order: 3; }

/* ---------- Mini-experiences ---------- */
.crb-labs { padding-block: 56px 24px; border-top: 1px solid #444052; }
.labs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 24px; align-items: start; }
.lab-card { position: relative; padding: clamp(22px, 3vw, 34px); border-radius: 24px; background: #faf8f3; color: var(--crb-ink); box-shadow: 0 9px 0 #080a14, 0 24px 50px #0004; overflow: hidden; }
.lab-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 22px solid #f39a8826; pointer-events: none; }
.lab-card h3 { margin: 6px 0 10px; font-size: clamp(1.4rem, 2.4vw, 1.9rem); color: var(--crb-ink); }
.lab-card p, .lab-card .caption { color: #555969; }
.lab-card .eyebrow { color: #8b5547; }
.savings-form { display: grid; gap: 12px; margin-top: 18px; }
.savings-form label[for] { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; color: #302c3c; }
.savings-form output { font-variant-numeric: tabular-nums; color: #8b4337; }
.savings-form input[type=range] { width: 100%; accent-color: #e3806c; min-height: 32px; }
.savings-form input[type=number] { max-width: 220px; padding: 12px 14px; border-radius: 12px; border: 1px solid #b7a9c8; background: #f4f0f8; color: #30243e; font: inherit; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 4px 0 0; }
.segmented legend { width: 100%; margin-bottom: 6px; font-weight: 600; color: #302c3c; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: inline-block; min-height: 44px; padding: 11px 16px; border-radius: 12px; border: 1px solid #c9c2ce; background: #f1edf5; color: #322f3d; font-weight: 600; }
.segmented input:checked + span { background: #2b2f45; border-color: #2b2f45; color: #faf8f3; box-shadow: 0 4px 0 #f39a88; }
.segmented input:focus-visible + span { outline: 3px solid #f39a88; outline-offset: 2px; }
.savings-result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 8px; padding: 18px; border-radius: 16px; background: #11131c; color: var(--crb-text); }
.savings-result span { display: block; font-size: .8rem; color: var(--crb-muted); }
.savings-result strong { display: block; margin-top: 4px; font: 700 clamp(1.2rem, 2.2vw, 1.6rem) Sora, sans-serif; color: var(--crb-cream); font-variant-numeric: tabular-nums; }
.savings-result div + div strong { color: #ffc1ad; }
.savings-chart { display: block; width: 100%; height: 90px; margin: 4px 0 6px; border-bottom: 1px solid #d8d0de; }
.savings-chart path { vector-effect: non-scaling-stroke; fill: none; stroke: #e3806c; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.player-quiz { margin-top: 18px; min-height: 280px; }
.quiz-progress { display: flex; gap: 6px; margin-bottom: 16px; }
.quiz-progress span { flex: 1; height: 8px; border-radius: 4px; background: #e3dce8; }
.quiz-progress span.is-done { background: linear-gradient(90deg, #f39a88, #ffc1ad); }
.quiz-progress span.is-current { background: #c7b7f6; }
.quiz-step h4 { margin: 0 0 14px; font-size: 1.15rem; color: var(--crb-ink); }
.quiz-answers { display: grid; gap: 10px; }
.quiz-answers button { text-align: left; min-height: 48px; padding: 12px 16px; border-radius: 14px; border: 1px solid #d8d0de; background: #fff; color: #2b2738; font: inherit; font-weight: 600; cursor: pointer; transition: transform .2s var(--crb-ease-out), border-color .2s, background .2s, box-shadow .2s; }
.quiz-answers button:hover { transform: translateX(6px); border-color: #f39a88; background: #fff6f2; box-shadow: -4px 0 0 #f39a88; }
.quiz-result { display: grid; gap: 12px; }
.player-card { position: relative; padding: 22px; border-radius: 20px; background: #11131c; color: var(--crb-text); overflow: hidden; }
.player-card::before { content: ""; position: absolute; inset: 8px; border-radius: 14px; border: 1px solid #f39a8855; pointer-events: none; }
.player-card .eyebrow { color: #c7b7f6; }
.player-card strong { display: block; font: 800 clamp(1.6rem, 3vw, 2.2rem) Sora, sans-serif; color: #f39a88; margin: 4px 0 8px; }
.player-card p { color: #cfd0dc !important; margin: 0; }
.quiz-result .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quiz-result .quiz-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.quiz-result .quiz-links a { color: #57447b; font-weight: 600; }

/* ---------- Header: scroll gauge around the brand emblem ---------- */
header.crb-masthead .brand { position: relative; }
/* Centred on the emblem itself, whatever its size: ring = emblem + 3 px on each side. */
header.crb-masthead .brand { --brand-emblem: 38px; }
header.crb-masthead .brand img { width: var(--brand-emblem); height: var(--brand-emblem); filter: drop-shadow(0 2px 4px #0008); }
@media (max-width: 360px) { header.crb-masthead .brand { --brand-emblem: 32px; } }
.brand-gauge { position: absolute; left: -3px; top: 50%; width: calc(var(--brand-emblem, 38px) + 6px); height: calc(var(--brand-emblem, 38px) + 6px); translate: 0 -50%; border-radius: 50%; pointer-events: none;
    background: conic-gradient(var(--crb-coral) calc(var(--scroll, 0) * 1turn), #ffffff14 0);
    -webkit-mask: radial-gradient(closest-side, transparent 86%, #000 88%); mask: radial-gradient(closest-side, transparent 86%, #000 88%); }

/* ---------- Velocity ribbons (speed and direction follow the scroll) ---------- */
.crb-ribbons { position: relative; height: clamp(150px, 18vw, 230px); margin: 18px 0 10px; overflow: hidden; pointer-events: none; }
.ribbon { position: absolute; left: -6%; width: 112%; padding: 12px 0; overflow: hidden; box-shadow: 0 14px 40px #0006; }
.ribbon-front { top: 40%; rotate: -3deg; background: var(--crb-coral); color: #2a1712; z-index: 1; }
.ribbon-back { top: 30%; rotate: 4deg; background: #a89bd0; color: #1d1830; }
.ribbon-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: crb-marquee 38s linear infinite; }
.ribbon-back .ribbon-track { animation-direction: reverse; animation-duration: 46s; }
.ribbon-track span { font: 800 clamp(1.5rem, 3.2vw, 2.6rem) Sora, sans-serif; text-transform: uppercase; letter-spacing: -.02em; white-space: nowrap; }
.ribbon-track img { width: clamp(26px, 2.6vw, 34px); height: auto; opacity: .85; }
@keyframes crb-marquee { to { transform: translateX(-50%); } }

/* ---------- Giant outlined word behind each universe ---------- */
.scene-word { position: absolute; right: -2%; bottom: -6%; z-index: -1; font: 800 clamp(6rem, 16vw, 15rem) Sora, sans-serif; line-height: .8; letter-spacing: -.06em; text-transform: uppercase;
    color: transparent; -webkit-text-stroke: 1.5px #c7b7f629; white-space: nowrap; pointer-events: none; user-select: none; }

/* ---------- XP ladder: the server's real titles ---------- */
.xp-ladder { padding-block: 64px 32px; border-top: 1px solid #3d3d50; }
.xp-ladder .eyebrow, .continue-menu .eyebrow { color: #e6ac9b; letter-spacing: .14em; font-size: .72rem; text-transform: uppercase; }
.ladder-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); margin-top: 28px; align-items: start; }
.ladder-meter { position: sticky; top: 110px; display: grid; gap: 8px; padding: 26px; border-radius: 24px; background: linear-gradient(160deg, #262a3d, #171a26); border: 1px solid #44475c; box-shadow: 0 18px 50px #0006; }
.xp-ladder:not(.is-live) .ladder-meter { display: none; }
.xp-ladder:not(.is-live) .ladder-layout { grid-template-columns: 1fr; }
.lm-level { font: 800 clamp(3.4rem, 7vw, 5.2rem) Sora, sans-serif; line-height: 1; color: var(--crb-cream); font-variant-numeric: tabular-nums; }
.lm-title { font: 700 1.1rem Sora, sans-serif; color: var(--crb-coral); }
.lm-bar { height: 12px; padding: 2px; border-radius: 8px; border: 1px solid #f39a8866; background: #12141d; }
.lm-bar i { display: block; height: 100%; border-radius: 5px; transform-origin: left; transform: scaleX(0); background: repeating-linear-gradient(90deg, #f39a88 0 10px, #ffc1ad 10px 12px); box-shadow: 0 0 10px #f39a88aa; }
.lm-xp { color: var(--crb-muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.ladder { --p: 1; position: relative; list-style: none; margin: 0; padding: 0 0 0 44px; display: grid; gap: clamp(28px, 6vh, 64px); }
.ladder::before, .ladder::after { content: ""; position: absolute; left: 13px; top: 18px; bottom: 18px; width: 4px; border-radius: 2px; background: #34374a; }
.ladder::after { background: linear-gradient(var(--crb-lavender), var(--crb-coral)); transform-origin: top; transform: scaleY(var(--p)); }
.tier { position: relative; padding: 22px 24px; border-radius: 20px; background: #1b1e2b; border: 1px solid #383b4c; transition: background .4s, border-color .4s, opacity .4s, transform .5s var(--crb-ease-out); }
.tier-dot { position: absolute; left: -40px; top: 26px; width: 24px; height: 24px; border-radius: 50%; background: #2a2d3d; border: 3px solid #11131c; box-shadow: 0 0 0 2px #4a4d60; z-index: 1; transition: background .4s, box-shadow .4s, transform .4s var(--crb-ease-spring); }
.tier-level { font: 700 .78rem Sora, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--crb-lavender); }
.tier h3 { margin: 6px 0 4px; font-size: clamp(1.3rem, 2.6vw, 1.9rem); color: var(--crb-cream); }
.tier p { margin: 4px 0 0; color: #cfd0dc; }
.tier .caption { color: var(--crb-muted); }
.xp-ladder.is-live .tier:not(.is-reached) { opacity: .6; }
.tier.is-reached .tier-dot { background: var(--crb-coral); box-shadow: 0 0 0 2px #f39a88, 0 0 18px #f39a88aa; }
.tier.is-current { background: #252938; border-color: #f39a8899; transform: translateX(8px); }
.tier.is-current .tier-dot { transform: scale(1.25); }

/* ---------- Treasure demo (/trésor odds) ---------- */
.lab-treasure { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px 40px; align-items: start; }
.lab-treasure > .lab-head, .lab-treasure > .caption, .lab-treasure > [role=status] { grid-column: 1 / -1; }
.treasure-play { position: relative; display: grid; gap: 12px; }
.treasure-play[hidden] { display: none; }
.treasure-stake { font-weight: 600; color: #302c3c; }
.treasure-stake-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.treasure-stake-row input { width: 130px; padding: 12px 14px; border-radius: 12px; border: 1px solid #b7a9c8; background: #f4f0f8; color: #30243e; font: inherit; }
.treasure-stake-row small { color: #555969; }
.chests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; perspective: 700px; }
.chest { position: relative; height: 150px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 16px; }
.chest:disabled { cursor: default; opacity: 1; }
.chest-body { position: absolute; left: 8%; right: 8%; bottom: 10px; height: 58%; border-radius: 8px 8px 14px 14px; background: linear-gradient(#2b2f45, #1a1d2b); border: 3px solid #11131c; box-shadow: 0 8px 0 #0b0d14, inset 0 0 0 3px #f39a8855; }
.chest-body i { position: absolute; left: 50%; top: 18%; width: 22px; height: 26px; margin-left: -11px; border-radius: 6px; background: linear-gradient(#ffc1ad, #f39a88); box-shadow: 0 2px 0 #9c5446; }
.chest-lid { position: absolute; left: 6%; right: 6%; top: 12%; height: 30%; border-radius: 40px 40px 6px 6px; background: linear-gradient(#3b3f58, #2b2f45); border: 3px solid #11131c; box-shadow: inset 0 0 0 3px #c7b7f655; transform-origin: 50% 100%; transition: transform .55s var(--crb-ease-spring); z-index: 2; }
.chest-glow { position: absolute; inset: 10% 0 0; border-radius: 50%; background: radial-gradient(circle, var(--prize-color, #f39a88) 0, transparent 65%); opacity: 0; transition: opacity .5s; }
.chest-prize { position: absolute; left: 50%; top: 2%; z-index: 3; padding: 5px 11px; border-radius: 999px; background: var(--prize-color, #f39a88); box-shadow: 0 6px 16px #0003; white-space: nowrap; font: 800 .85rem Sora, sans-serif; line-height: 1.2; color: #11131c; opacity: 0; transform: translate(-50%, 24px); transition: opacity .4s .25s, transform .5s .25s var(--crb-ease-spring); }
.chest:not(:disabled):hover .chest-lid, .chest:not(:disabled):focus-visible .chest-lid { transform: translateY(-6px) rotate(-3deg); }
.chest.is-shaking { animation: crb-shake .42s ease-in-out; }
.chest.is-open .chest-lid { transform: translateY(-34px) rotateX(70deg); }
.chest.is-open .chest-glow { opacity: .6; }
.chest.is-open .chest-prize { opacity: 1; transform: translate(-50%, 0); }
.chest.is-chosen { outline: 3px solid #e3806c; outline-offset: 4px; }
.chest.is-other { opacity: .62; }
.chest[data-kind=legendary] { --prize-color: #c7b7f6; } .chest[data-kind=precious] { --prize-color: #f39a88; } .chest[data-kind=small] { --prize-color: #ffc1ad; }
.chest[data-kind=empty] { --prize-color: #b3b6c6; } .chest[data-kind=trap] { --prize-color: #e0687c; }
@keyframes crb-shake { 20% { rotate: -4deg; } 40% { rotate: 4deg; } 60% { rotate: -3deg; } 80% { rotate: 2deg; } }
.lab-card .treasure-result { min-height: 3em; margin: 0; font-weight: 600; color: #302c3c; }
.treasure-again { justify-self: start; }
.coin-rain { position: absolute; left: 0; top: -40px; width: 100%; height: calc(100% + 40px); pointer-events: none; z-index: 4; }
.odds-wrap { overflow-x: auto; }
.odds { width: 100%; min-width: 0; border-collapse: collapse; font-size: .9rem; color: #2b2738; }
.odds caption { text-align: left; font-weight: 700; padding-bottom: 8px; color: #302c3c; }
.odds th, .odds td { padding: 10px 8px; border-bottom: 1px solid #e3dce8; text-align: left; white-space: normal; }
.odds thead th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #5f5470; }
.odds td:nth-child(3), .odds td:nth-child(4) { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Where next: menu board with live notes ---------- */
.continue-menu { padding-block: 56px 24px; border-top: 1px solid #444052; }
.menu-board { position: relative; list-style: none; margin: 26px 0 0; padding: clamp(22px, 4vw, 44px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 48px; border-radius: 24px; background: linear-gradient(170deg, #faf8f3, #f1ebe2); box-shadow: 0 9px 0 #080a14, 0 24px 50px #0004; }
.menu-board::before { content: ""; position: absolute; inset: 12px; border: 1px solid #d9cfc2; border-radius: 16px; pointer-events: none; }
.menu-board a { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: baseline; gap: 4px 12px; padding: 16px 6px; color: var(--crb-ink); text-decoration: none; border-bottom: 1px dashed #d4c8ba; }
.mb-num { font: 600 .8rem 'Open Sans', sans-serif; color: #6c5e7c; font-variant-numeric: tabular-nums; }
.mb-name { font: 800 clamp(1.15rem, 2vw, 1.45rem) Sora, sans-serif; color: var(--crb-ink); }
.mb-dots { align-self: end; margin-bottom: 7px; border-bottom: 2px dotted #c3b6a6; }
.mb-arrow { color: #8b4337; transition: transform .3s var(--crb-ease-spring); }
.mb-text { grid-column: 2 / -1; color: #555969; font-size: .92rem; }
.mb-live { grid-column: 2 / -1; color: #8b4337; font-weight: 700; font-style: italic; font-size: .9rem; }
.mb-live::before { content: ""; display: inline-block; width: 9px; height: 7px; margin: 0 7px 3px 1px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; border-bottom-left-radius: 3px; }
.mb-live[hidden] { display: none; }
.menu-board a:hover .mb-arrow, .menu-board a:focus-visible .mb-arrow { transform: translateX(6px); }
.menu-board a:hover .mb-name { color: #8b4337; }

/* ---------- Finale: the emblem ring fills as the visitor arrives ---------- */
.crb-finale { display: grid; justify-items: center; gap: 12px; padding: 80px 0 40px; margin-top: 40px; border-top: 1px solid #444052; text-align: center; }
.finale-emblem { position: relative; width: clamp(170px, 22vw, 220px); aspect-ratio: 1; display: grid; place-items: center; }
.finale-emblem svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; }
.finale-emblem circle { fill: none; stroke-width: 8; }
.ring-track { stroke: #2c2f40; }
.ring-fill { stroke: var(--crb-coral); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; filter: drop-shadow(0 0 8px #f39a88aa); }
.finale-emblem img { width: 56%; height: auto; filter: drop-shadow(0 14px 24px #000a); }
.crb-finale h2 { margin: 18px 0 0; font-size: clamp(1.9rem, 4.4vw, 3.2rem); color: var(--crb-cream); max-width: 18ch; }
.crb-finale p { color: #cfd0dc; max-width: 52ch; }
.crb-finale .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.copy-state:empty { display: none; }

/* ---------- Opening sequence: automatic entry after a short wait ---------- */
.crb-intro .intro-auto { width: 140px; height: 3px; border-radius: 2px; background: #ffffff1f; overflow: hidden; }
.crb-intro .intro-auto i { display: block; height: 100%; background: var(--crb-coral); transform-origin: left; animation: crb-intro-auto var(--intro-duration, 3600ms) linear forwards; }
@keyframes crb-intro-auto { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Opening sequence ---------- */
.crb-intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2a2436, #11131c 65%); color: var(--crb-text); overflow: hidden; }
.crb-intro[hidden] { display: none; }
.crb-intro .intro-grid { position: absolute; inset: -20%; background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px); background-size: 48px 48px; transform: perspective(600px) rotateX(55deg) translateY(10%); transform-origin: center 70%; }
.crb-intro .intro-core { position: relative; display: grid; justify-items: center; gap: 18px; padding: 24px; text-align: center; }
.crb-intro .intro-ring { position: absolute; top: 4px; width: 210px; height: 210px; border-radius: 50%; border: 2px solid #f39a8866; box-shadow: 0 0 60px #f39a8844, inset 0 0 40px #c7b7f633; }
.crb-intro .intro-emblem { position: relative; width: 150px; height: 150px; margin-top: 30px; filter: drop-shadow(0 18px 30px #000a); }
.crb-intro .intro-title { margin: 6px 0 0; font: 800 clamp(2.6rem, 8vw, 5.4rem) Sora, sans-serif; letter-spacing: -.05em; color: var(--crb-cream); line-height: 1; }
.crb-intro .intro-title .char { display: inline-block; }
.crb-intro .intro-title .space { width: .3em; }
.crb-intro .intro-sub { margin: 0; color: #cfc6dc; max-width: 34ch; }
.crb-intro .intro-spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #f39a88; box-shadow: 0 0 14px #f39a88; }
html.crb-intro-open { overflow: hidden; }

/* ---------- Easter eggs ---------- */
.crb-burst { position: fixed; inset: 0; z-index: 150; pointer-events: none; }

/* ---------- Experience preferences (footer) ---------- */
.experience-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; margin-top: 16px; padding-top: 16px; border-top: 1px solid #2c2f3f; }
.pref-toggle { min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid #4a4d60; background: #1f2231; color: #dcdde8; font: inherit; font-size: .85rem; cursor: pointer; }
.pref-toggle:hover { border-color: var(--crb-coral); color: #fff; }
.pref-toggle[aria-pressed="true"] { border-color: #f39a8899; }
.pref-volume { display: inline-flex; align-items: center; gap: 8px; color: #c9cad6; font-size: .85rem; }
.pref-volume[hidden] { display: none; }
.pref-volume input { accent-color: #f39a88; }

/* ---------- Reduced motion: OS setting or local preference ---------- */
:root[data-effects="off"] *, :root[data-effects="off"] *::before, :root[data-effects="off"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
    .ribbon-track, .crb-intro .intro-auto i { animation: none !important; }
    .hero-scroll span, .community-orbit, .community-orbit .infinity { animation: none !important; }
    .crb-backdrop { display: none; }
}
:root[data-effects="off"] .crb-backdrop { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 700px) { .labs-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .ladder-layout { grid-template-columns: 1fr; gap: 18px; }
    .ladder-meter { top: 8px; z-index: 5; grid-template-columns: auto 1fr; align-items: center; gap: 4px 16px; padding: 14px 18px; }
    .ladder-meter .eyebrow { grid-column: 1 / -1; }
    .lm-level { grid-row: span 3; font-size: 3rem; }
    .lab-treasure { grid-template-columns: 1fr; }
    .menu-board { grid-template-columns: 1fr; }
    .tour-scene { grid-template-columns: 1fr; gap: 12px; }
    .scene-visual { min-height: 220px; order: -1; }
    .cartridges { grid-template-columns: repeat(3, 76px); gap: 12px; }
    .cartridge { height: 96px; } .cartridge:nth-child(4), .cartridge:nth-child(5) { translate: 44px 0; }
}
@media (max-width: 700px) {
    body[data-page="/"] .home-podium { grid-template-columns: 1fr; }
    body[data-page="/"] .podium-place-1, body[data-page="/"] .podium-place-2, body[data-page="/"] .podium-place-3 { order: 0; }
    .savings-result { grid-template-columns: 1fr; }
    .community-orbit { width: 210px; height: 210px; } .orbit-dot { --r: 105px; }
    .mini-podium { height: 180px; } .mini-podium .step { width: 70px; } .mini-podium .step-1 { height: 160px; } .mini-podium .step-2 { height: 120px; } .mini-podium .step-3 { height: 90px; }
    .chest { height: 120px; }
    .odds { font-size: .8rem; } .odds th, .odds td { padding: 8px 5px; } .odds thead th { font-size: .68rem; letter-spacing: .04em; }
    .chest-prize { font-size: .74rem; padding: 4px 8px; }
    .crb-ribbons { height: 130px; }
    .ladder { padding-left: 36px; } .tier-dot { left: -34px; } .ladder::before, .ladder::after { left: 9px; }
    .experience-prefs { justify-content: flex-start; }
}
@media (max-width: 420px) { .cartridges { grid-template-columns: repeat(3, 64px); } .cartridge { height: 84px; } .cartridge b { font-size: .66rem; } }
@media (hover: none) { .quiz-answers button:hover { transform: none; } body[data-page="/"] .podium-card:hover { transform: none; } }
@media (forced-colors: active) { .crb-backdrop, .crb-burst { display: none; } .reading-progress { background: Highlight; -webkit-mask: none; mask: none; } }

/* ---------- Leaderboards: competitive presentation, same data ---------- */
body[data-page^="/leaderboard/"] .tabs { display: flex; flex-wrap: wrap; gap: 8px; }
body[data-page^="/leaderboard/"] .tabs a { border-radius: 12px; border: 1px solid #45485b; background: #1d2030; color: #d8d9e5; transition: background .25s, color .25s, transform .25s var(--crb-ease-out); }
body[data-page^="/leaderboard/"] .tabs a:hover { transform: translateY(-2px); color: #fff; }
body[data-page^="/leaderboard/"] .tabs a[aria-current] { background: var(--crb-coral); border-color: var(--crb-coral); color: #221818; box-shadow: 0 4px 0 #97544b; }
body[data-page^="/leaderboard/"] #board td.rank { font: 800 1rem Sora, sans-serif; }
body[data-page^="/leaderboard/"] #board td.rank:is([data-rank="1"], [data-rank="2"], [data-rank="3"])::before {
    content: attr(data-rank) / ""; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #ffc1ad, #f39a88); color: #3b1a14; box-shadow: 0 3px 0 #b9604f;
}
body[data-page^="/leaderboard/"] #board td.rank[data-rank="2"]::before { background: linear-gradient(135deg, #faf8f3, #ddd5ca); color: #2b2738; box-shadow: 0 3px 0 #a69b8e; }
body[data-page^="/leaderboard/"] #board td.rank[data-rank="3"]::before { background: linear-gradient(135deg, #e9e1fb, #c7b7f6); color: #2e2442; box-shadow: 0 3px 0 #7e6ca8; }
body[data-page^="/leaderboard/"] #board td.rank:is([data-rank="1"], [data-rank="2"], [data-rank="3"]) { font-size: 0; }
body[data-page^="/leaderboard/"] #board td.rank:is([data-rank="1"], [data-rank="2"], [data-rank="3"])::before { font-size: .95rem; }
body[data-page^="/leaderboard/"] #board tbody tr { animation: crb-row-in .5s var(--crb-ease-out) both; }
body[data-page^="/leaderboard/"] #board tbody tr:nth-child(2) { animation-delay: .04s; } body[data-page^="/leaderboard/"] #board tbody tr:nth-child(3) { animation-delay: .08s; }
body[data-page^="/leaderboard/"] #board tbody tr:nth-child(4) { animation-delay: .12s; } body[data-page^="/leaderboard/"] #board tbody tr:nth-child(n+5) { animation-delay: .16s; }
body[data-page^="/leaderboard/"] #board tbody tr:hover { background: #fff6f2; }
@keyframes crb-row-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { body[data-page^="/leaderboard/"] #board tbody tr { animation: none; } }
@media (max-width: 600px) {
    body[data-page^="/leaderboard/"] #board td.rank:is([data-rank="1"], [data-rank="2"], [data-rank="3"])::before { width: 22px; height: 22px; font-size: .72rem; box-shadow: 0 2px 0 #0003; }
}

/* ---------- Live community: voice presence and events ---------- */
.crb-live, .crb-events { padding-block: 56px 24px; border-top: 1px solid #3d3d50; }
.crb-live .eyebrow, .crb-events .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #e6ac9b; letter-spacing: .14em; font-size: .72rem; text-transform: uppercase; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #4cc38a; box-shadow: 0 0 0 0 #4cc38a88; animation: crb-live-pulse 2s ease-out infinite; }
@keyframes crb-live-pulse { 70% { box-shadow: 0 0 0 9px #4cc38a00; } 100% { box-shadow: 0 0 0 0 #4cc38a00; } }
.live-meta { margin: 0; color: var(--crb-muted); }
.live-meta strong { color: var(--crb-cream); font-variant-numeric: tabular-nums; }
.voice-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 22px; }
.voice-room { position: relative; padding: 18px; border-radius: 20px; border: 1px solid #3a3d52; background: radial-gradient(circle at 100% 0, #c7b7f61f, transparent 55%), #1a1d29; box-shadow: 0 14px 40px #0004; animation: crb-room-in .45s var(--crb-ease-out) both; }
@keyframes crb-room-in { from { opacity: 0; transform: translateY(10px); } }
.voice-room header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.voice-room h3 { margin: 0; font-size: 1.05rem; color: var(--crb-cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-count { padding: 2px 10px; border-radius: 999px; background: #f39a8822; border: 1px solid #f39a8866; color: #ffd2c7; font: 700 .82rem Sora, sans-serif; font-variant-numeric: tabular-nums; }
.voice-wave { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.voice-wave i { width: 4px; border-radius: 2px; background: var(--crb-coral); animation: crb-wave 1.1s ease-in-out infinite; }
.voice-wave i:nth-child(1) { height: 8px; } .voice-wave i:nth-child(2) { height: 16px; animation-delay: .2s; } .voice-wave i:nth-child(3) { height: 11px; animation-delay: .4s; }
@keyframes crb-wave { 50% { transform: scaleY(.45); } }
.voice-members { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; }
.voice-members li { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; position: relative; }
.voice-members li.is-new { animation: crb-member-in .5s var(--crb-ease-spring) both; }
@keyframes crb-member-in { from { opacity: 0; transform: scale(.6); } }
.voice-avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #c7b7f6, #f39a88); box-shadow: 0 0 0 3px #11131c, 0 0 0 5px #f39a88aa; }
.voice-avatar.is-muted { box-shadow: 0 0 0 3px #11131c, 0 0 0 5px #4a4d60; filter: saturate(.7); }
.voice-avatar img { width: 100%; height: 100%; object-fit: cover; }
.voice-avatar span { font: 800 1.2rem Sora, sans-serif; color: #2a1712; }
.voice-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d4d5e0; font-size: .82rem; }
.voice-flag { position: absolute; top: -4px; right: 10%; padding: 0 5px; border-radius: 6px; background: #a3243a; color: #fff; font: 800 .58rem Sora, sans-serif; }
.live-empty { display: grid; justify-items: start; gap: 6px; margin: 0; padding: 22px; border-radius: 18px; border: 1px dashed #4a4d60; background: #ffffff05; color: var(--crb-muted); grid-column: 1 / -1; }
.live-empty strong { color: var(--crb-cream); }
.event-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 22px; }
.event-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 20px; border: 1px solid #3a3d52; background: #1a1d29; box-shadow: 0 14px 40px #0004; transition: transform .3s var(--crb-ease-out), border-color .3s; }
.event-card:hover { transform: translateY(-4px); border-color: #f39a8866; }
.event-card.is-active { border-color: #4cc38a88; }
.event-cover { display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; object-fit: cover; }
.event-cover-empty { background: radial-gradient(circle at 20% 30%, #f39a8855, transparent 50%), radial-gradient(circle at 80% 70%, #c7b7f655, transparent 50%), #20232f; }
.event-body { display: grid; gap: 8px; align-content: start; padding: 16px 18px 18px; }
.event-body h3 { margin: 0; color: var(--crb-cream); font-size: 1.1rem; }
.event-when { margin: 0; color: #ffd2c7; font-size: .9rem; }
.event-when::first-letter { text-transform: uppercase; }
.event-text { margin: 0; color: #c9cbd7; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.event-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; color: var(--crb-muted); font-size: .85rem; }
.event-foot a { color: var(--crb-coral-hover); }
.cc-pill { justify-self: start; padding: 2px 10px; border-radius: 999px; border: 1px solid #c7b7f666; background: #c7b7f61a; color: #e3dafc; font: 700 .74rem Sora, sans-serif; }
.cc-pill.is-live { border-color: #4cc38a88; background: #4cc38a1f; color: #9be7c0; }
@media (prefers-reduced-motion: reduce) { .live-dot, .voice-wave i, .voice-room, .voice-members li.is-new { animation: none !important; } }
:root[data-effects="off"] :is(.live-dot, .voice-wave i) { animation: none !important; }
@media (max-width: 600px) { .voice-members { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); } .voice-avatar { width: 46px; height: 46px; } }
.voice-room > header { position: static; max-width: none; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; flex-wrap: nowrap; }

/* ======================================================================
   Premium finish (public site): stats, hero calls to action, live voice,
   mini-experiences and rankings on the night/slate/lavender/coral palette.
   ====================================================================== */

/* ---------- Server figures: full width, six digits always on one line ---------- */
.universe-community.public-stats { grid-template-columns: 1fr; gap: 20px; }
.universe-community.public-stats > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.universe-community.public-stats .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 0; }
.universe-community.public-stats .stat { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 132px; padding: 20px 22px 18px; }
.universe-community.public-stats .stat span { line-height: 1.35; }
.universe-community.public-stats .stat strong { margin: 0; white-space: nowrap; font-size: clamp(1.8rem, 2.5vw, 2.5rem); line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums lining-nums; }
@media (max-width: 1000px) { .universe-community.public-stats .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .universe-community.public-stats .stats { grid-template-columns: 1fr; gap: 10px; }
    .universe-community.public-stats .stat { min-height: 0; flex-direction: row; align-items: center; padding: 14px 18px; }
    .universe-community.public-stats .stat strong { font-size: 1.75rem; }
}

/* ---------- Hero calls to action: coral primary, slate/lavender secondary ---------- */
.hero-home-actions { gap: 14px; }
.hero-home-actions .btn { min-height: 54px; padding: 15px 24px; border-radius: 14px; font: 700 1rem Sora, sans-serif; letter-spacing: -.01em;
    border: 1px solid #ffc1ad; border-bottom: 2px solid #c8705f; background: linear-gradient(180deg, #f7ab99, #f39a88 55%, #ec8a77); color: #2a1712;
    box-shadow: 0 6px 0 #9c5446, 0 14px 28px #f39a8833, inset 0 1px 0 #ffffff66; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.hero-home-actions .btn:before { background: radial-gradient(120px circle at var(--pointer-x, 50%) var(--pointer-y, 20%), #ffffff59, transparent 65%); }
.hero-home-actions .btn:hover, .hero-home-actions .btn:focus-visible { background: linear-gradient(180deg, #ffc1ad, #f7ab99 60%, #f39a88); color: #2a1712; transform: translateY(-3px);
    box-shadow: 0 9px 0 #9c5446, 0 20px 34px #f39a8840, inset 0 1px 0 #ffffffa0; }
.hero-home-actions .btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #9c5446, 0 6px 14px #0004; }
.hero-home-actions .btn.secondary { border: 1px solid #c7b7f659; border-bottom: 2px solid #11131c; background: linear-gradient(180deg, #2d3144, #252938); color: #eceef5;
    box-shadow: 0 6px 0 #0b0d14, 0 14px 28px #0005, inset 0 1px 0 #ffffff1a; }
.hero-home-actions .btn.secondary:hover, .hero-home-actions .btn.secondary:focus-visible { background: linear-gradient(180deg, #353a52, #2b2f44); color: #fff; border-color: #c7b7f6aa;
    box-shadow: 0 9px 0 #0b0d14, 0 20px 34px #c7b7f61f, inset 0 1px 0 #ffffff26; }
.hero-home-actions .btn.secondary:active { box-shadow: 0 2px 0 #0b0d14, 0 6px 14px #0004; }
.hero-home-actions .btn:focus-visible { outline: 3px solid #c7b7f6; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .hero-home-actions .btn, .hero-home-actions .btn:hover { transition: none; transform: none; } }

/* ---------- Live voice: a short human summary beside the title ---------- */
.crb-live .live-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.live-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 14px; border-radius: 999px; background: #252938; border: 1px solid #383b4c; color: #b3b6c6; font-size: .9rem; white-space: nowrap; }
.live-chip[hidden] { display: none; }
.live-chip strong { color: #faf8f3; font-variant-numeric: tabular-nums; }
#voice-summary { border-color: #f39a8855; background: linear-gradient(180deg, #f39a881a, #252938); }

/* ---------- Mini-experiences: immersive slate cards instead of cream panels ---------- */
.lab-card { background: radial-gradient(120% 80% at 100% 0%, #f39a8814, transparent 45%), radial-gradient(90% 70% at 0% 100%, #c7b7f612, transparent 50%), linear-gradient(165deg, #23263a, #171a26 72%);
    color: var(--crb-text); border: 1px solid #383b4c; box-shadow: 0 18px 50px #0006, inset 0 1px 0 #ffffff10; }
.lab-card::after { border-color: #f39a881c; }
.lab-card h3, .lab-card .quiz-step h4 { color: #faf8f3; }
.lab-card p, .lab-card .caption, .treasure-stake-row small { color: #b3b6c6; }
.lab-card .eyebrow { color: #f3a08e; }
.savings-form label[for], .segmented legend, .treasure-stake, .lab-card .treasure-result { color: #eceef5; }
.savings-form output { color: #ffc1ad; }
.savings-form input[type=range] { accent-color: #f39a88; }
:is(.savings-form input[type=number], .treasure-stake-row input) { background: #11131c; border: 1px solid #4a4d60; color: #eceef5; box-shadow: inset 0 1px 0 #0006; transition: border-color .15s, box-shadow .15s; }
:is(.savings-form input[type=number], .treasure-stake-row input):focus { outline: none; border-color: #f39a88; box-shadow: 0 0 0 3px #f39a8838; }
.segmented span { background: #1a1d29; border-color: #383b4c; color: #d8d9e5; transition: background .15s, border-color .15s, color .15s; }
.segmented label:hover span { border-color: #c7b7f680; }
.segmented input:checked + span { background: #f39a88; border-color: #f39a88; color: #2a1712; box-shadow: 0 4px 14px #f39a8840; }
.savings-result { background: #11131c; border: 1px solid #383b4c; }
.savings-chart { border-bottom-color: #383b4c; }
.savings-chart path { stroke: #f39a88; filter: drop-shadow(0 4px 8px #f39a8855); }
.quiz-progress span { background: #2d3144; }
.quiz-answers button { background: #1a1d29; border-color: #383b4c; color: #eceef5; }
.quiz-answers button:hover { background: #2a2433; border-color: #f39a88; box-shadow: -4px 0 0 #f39a88; }
.quiz-answers button:focus-visible { outline: 3px solid #c7b7f6; outline-offset: 2px; }
.player-card { background: #11131c; border: 1px solid #383b4c; }
.quiz-result .quiz-links a { color: #c9b9ff; }
.chest.is-chosen { outline-color: #f39a88; }
.odds { color: #d8d9e5; }
.odds caption { color: #eceef5; }
.lab-card .odds :is(th, td) { background: transparent; border-bottom: 1px solid #2f3245; color: #d8d9e5; }
.lab-card .odds thead th { background: #11131c; color: #c9b9ff; }
.lab-card .odds tbody th { color: #faf8f3; }
.lab-card .odds tbody tr { transition: background .15s; }
.lab-card .odds tbody tr:hover { background: #ffffff08; }
.lab-card .btn:not(.secondary) { background: #f39a88; color: #2a1712; border-color: #f39a88; }
.lab-card .btn.secondary { background: #252938; color: #eceef5; border-color: #4a4d60; }

/* ---------- Surfaces: slate cards on the night background instead of cream panels ---------- */
:is(.card, .stat, .member-link, .guide-card, .podium-card, dialog) {
    --ink: #eceef5; --muted: #b3b6c6; --line: #383b4c; --soft: #1a1d29;
    color: #eceef5; background: linear-gradient(165deg, #22253a, #191c29 72%); border: 1px solid #383b4c; box-shadow: 0 18px 44px #0006, inset 0 1px 0 #ffffff0d;
}
.card .card, .card .stat { background: #1a1d29; box-shadow: none; }
:is(.card, .member-link, .guide-card, .podium-card, dialog) :is(h2, h3, h4) { color: #faf8f3; }
:is(.card, .stat, .member-link, .guide-card, .podium-card, dialog) strong { color: #faf8f3; }
:is(.card, .stat, .member-link, .guide-card, .podium-card, dialog) :is(p, li, dd, small, .caption, .muted) { color: #b3b6c6; }
.card .eyebrow { color: #f3a08e; }
.card a:not(.btn) { color: #ffc1ad; }
.card a:not(.btn):hover { color: #ffd9cc; }
:is(.card, dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) {
    background: #11131c; color: #eceef5; border: 1px solid #4a4d60; border-radius: 12px; }
:is(.card, dialog) :is(input, select, textarea)::placeholder { color: #8d90a3; }
:is(.card, dialog) :is(input, select, textarea):focus { outline: none; border-color: #f39a88; box-shadow: 0 0 0 3px #f39a8838; }
:is(.card, dialog, .pagination) .btn.secondary { background: #252938; color: #eceef5; border-color: #4a4d60; box-shadow: 0 4px 0 #0b0d14; }
:is(.card, dialog, .pagination) .btn.secondary:hover:not(:disabled) { background: #2d3144; border-color: #c7b7f680; }
:is(.card, dialog, .pagination) .btn.secondary:disabled { opacity: .45; }
.card .table-wrap { border: 1px solid #383b4c; border-radius: 16px; background: #141722; }
.card table { color: #d8d9e5; }
.card th { background: #11131c; color: #c9b9ff; border-color: #383b4c; }
.card td { border-color: #2c2f42; }
.card tbody tr { transition: background .15s; }
.card tbody tr:hover { background: #ffffff07; }
.card tr.highlight { background: #f39a8814; box-shadow: inset 3px 0 0 #f39a88; }

/* ---------- Rankings: structured rows, readable on slate ---------- */
.card .level-ring-track { stroke: #2d3144; }
.card .level-ring-fill { stroke: #f39a88; filter: drop-shadow(0 0 4px #f39a8866); }
.card .level-ring strong { color: #faf8f3 !important; }
.card td.rank:not([data-rank="1"]):not([data-rank="2"]):not([data-rank="3"]) { color: #b3b6c6; font-variant-numeric: tabular-nums; }
.card .member-cell :is(img, .avatar) { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #2d3144; }
.card .member-cell .avatar.small { background: linear-gradient(135deg, #c7b7f6, #f39a88); color: #2a1712; font: 800 .95rem Sora, sans-serif; }
.card .member-name { color: #faf8f3; font-weight: 600; }
.card td.amount { color: #ffc1ad; font-variant-numeric: tabular-nums; }
.card table :is(td, th) { padding-block: 14px; }
.tabs a { transition: background .15s, border-color .15s, color .15s; }
@media (forced-colors: active) { .card .level-ring-fill { filter: none; } }
body[data-page^="/leaderboard/"] .card th { background: #11131c; color: #c9b9ff; }
body[data-page^="/leaderboard/"] .card .table-wrap { border-color: #383b4c; }
body[data-page^="/leaderboard/"] .card tbody tr:hover { background: #ffffff07; }
body[data-page^="/leaderboard/"] #board tbody tr { border-bottom-color: #2c2f42; }
body[data-page^="/leaderboard/"] .tabs a[aria-current] { background: #f39a88; color: #2a1712; border-color: #f39a88; }
:is(.card, dialog) label { color: #eceef5; }

/* ---------- Footer: brand, links and preferences on one tidy line ---------- */
body > footer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 32px; }
body > footer > .brand { white-space: nowrap; font-size: 15px; }
body > footer > div:not(.experience-prefs) { justify-content: center; gap: 10px 20px; }
body > footer > div:not(.experience-prefs) a { color: #b3b6c6; text-decoration: none; transition: color .15s; }
body > footer > div:not(.experience-prefs) a:hover { color: #ffc1ad; }
body > footer .experience-prefs { width: auto; margin: 0; padding: 0; border: 0; justify-content: flex-end; flex-wrap: nowrap; }
body > footer .pref-toggle { min-height: 36px; padding: 6px 12px; border-color: #383b4c; background: transparent; color: #b3b6c6; font-size: .8rem; }
@media (max-width: 900px) {
    body > footer { grid-template-columns: 1fr; justify-items: start; }
    body > footer > div:not(.experience-prefs) { justify-content: flex-start; }
    body > footer .experience-prefs { flex-wrap: wrap; justify-content: flex-start; }
}

/* ---------- Music: one discreet control; the bars move only while it really plays ---------- */
.pref-music { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid #383b4c; background: transparent; color: #8d90a3; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.pref-music:hover { border-color: #f39a88; color: #ffc1ad; }
.pref-music:focus-visible { outline: 3px solid #c7b7f6; outline-offset: 2px; }
.pref-music.is-playing { color: #f39a88; border-color: #f39a8866; background: #f39a8812; }
.music-bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.music-bars i { width: 2px; height: 3px; border-radius: 1px; background: currentColor; }
.pref-music.is-playing .music-bars i { animation: crb-eq 1.1s ease-in-out infinite; }
.pref-music.is-playing .music-bars i:nth-child(2) { animation-delay: -.45s; } .pref-music.is-playing .music-bars i:nth-child(3) { animation-delay: -.8s; } .pref-music.is-playing .music-bars i:nth-child(4) { animation-delay: -.2s; }
@keyframes crb-eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@media (prefers-reduced-motion: reduce) { .pref-music.is-playing .music-bars i { animation: none; height: 9px; } .pref-music.is-playing .music-bars i:nth-child(odd) { height: 5px; } }
:root[data-effects="off"] .pref-music.is-playing .music-bars i { animation: none; height: 8px; }

/* ---------- Licences et ressources ---------- */
.licences-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.licence-card { padding: 22px 24px; border-radius: 18px; border: 1px solid #383b4c; background: linear-gradient(165deg, #22253a, #191c29 72%); }
.licence-head { margin-bottom: 12px; }
.licence-kind { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #c7b7f61f; color: #c9b9ff; font: 700 .68rem Sora, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.licence-card h2 { margin: 8px 0 0; font-size: 1.25rem; color: #faf8f3; }
.licence-card dl { display: grid; gap: 8px; margin: 0; }
.licence-card dl > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
.licence-card dt { color: #8d90a3; font-size: .82rem; }
.licence-card dd { margin: 0; color: #d8d9e5; font-size: .9rem; overflow-wrap: anywhere; }
.licence-card a { color: #ffc1ad; }
.licence-text { margin-top: 14px; border-top: 1px solid #2c2f42; padding-top: 10px; }
.licence-text summary { cursor: pointer; color: #eceef5; font-weight: 600; font-size: .9rem; }
.licence-text pre { max-height: 320px; overflow: auto; margin: 10px 0 0; padding: 14px; border-radius: 12px; background: #11131c; border: 1px solid #2c2f42; color: #b3b6c6; font: .78rem/1.55 ui-monospace, 'Cascadia Code', Consolas, monospace; white-space: pre-wrap; }
.licence-link { margin: 14px 0 0; font-weight: 600; font-size: .9rem; }
.licences-raw a { color: #ffc1ad; }
.licences-raw { margin-top: 20px; }

/* ---------- Bot status on slate ---------- */
.bot-runtime { color: #b3b6c6; }
.bot-runtime img { background: #11131c; }
.bot-metrics dt { color: #b3b6c6; }
.bot-metrics dd { color: #faf8f3; font-variant-numeric: tabular-nums; }
.bot-status { border-top: 3px solid #383b4c; }

/* ---------- Navigation states and messages on the dark palette ---------- */
:is(.docs-nav, #docs-nav) a[aria-current] { background: #f39a8822; color: #ffc1ad; border-color: #f39a8866; box-shadow: inset 3px 0 0 #f39a88; }
:is(.docs-nav, #docs-nav) a:hover { background: #ffffff08; color: #faf8f3; }
.error-state { background: #2a1820; color: #ffc3cc; border: 1px solid #8a3a4a; border-radius: 14px; }
.toast.error { background: #2a1820; color: #ffc3cc; border-color: #8a3a4a; }
.savings-form input[type=range] { background: transparent; }
.badge.operational { background: #12302a; color: #8ee6c4; border-color: #2f7a63; }
.badge.warning { background: #33270f; color: #ffd58a; border-color: #8a6a2c; }
.badge.incident { background: #2a1820; color: #ffc3cc; border-color: #8a3a4a; }
.module-symbol { background: #252938; color: #c9b9ff; }

/* ---------- Member area: tabs, wealth chart and period switch on slate ---------- */
.dashboard-tabs [aria-selected=true], .dashboard-tabs button[aria-selected=true] { background: #f39a88; color: #2a1712; border-color: #f39a88; border-bottom-color: #9c5446; }
.dashboard-tabs [aria-selected=true]:hover { background: #ffc1ad; color: #2a1712; }
.member-chart.card, .member-chart .chart-scroll, .member-chart .chart, .member-chart .stat { background: transparent; color: #eceef5; }
.member-chart.card { background: linear-gradient(165deg, #22253a, #191c29 72%); }
.member-chart .chart-axis line { stroke: #383b4c; }
.member-chart :is(.chart-axis text, text) { fill: #b3b6c6; }
.period-switch { background: #11131c; border-color: #383b4c; }
.period-switch button { color: #b3b6c6; }
.period-switch button[aria-pressed=true] { background: #f39a88; color: #2a1712; box-shadow: 0 3px 0 #9c5446; }
.period-switch button:focus-visible { outline-color: #c7b7f6; }
.profile-metrics .stat, .profile-insights .allocation, .career-card, .profile-account-state, .chart-scroll { background: #1a1d29; border: 1px solid #383b4c; box-shadow: none; color: #eceef5; }
.career-card { background: linear-gradient(160deg, #2a2433, #1a1d29 70%); border-color: #f39a8840; }
.profile-account-state { background: linear-gradient(160deg, #252038, #1a1d29 70%); border-color: #c7b7f640; }
:is(.profile-metrics .stat, .profile-insights .allocation, .career-card, .profile-account-state) :is(h3, h4, strong) { color: #faf8f3; }
:is(.profile-metrics .stat, .profile-insights .allocation, .career-card, .profile-account-state) :is(p, span, small, dt, dd, li) { color: #b3b6c6; }
.profile-metrics .stat strong { color: #faf8f3; }
.event-links { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; justify-content: flex-end; }

/* ---------- Rank change since yesterday ---------- */
.rank-change { display: inline-flex; align-items: center; margin-left: 10px; padding: 2px 8px; border-radius: 999px; font: 700 .74rem Sora, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; border: 1px solid transparent; }
.rank-change.is-up { color: #8ee6c4; background: #12302a; border-color: #2f7a6366; }
.rank-change.is-down { color: #ffb3bf; background: #2a1820; border-color: #8a3a4a66; }
.rank-change.is-same { color: #b3b6c6; background: #252938; }
.rank-change.is-new { color: #c9b9ff; background: #c7b7f61f; border-color: #c7b7f640; }

/* ---------- Next event and countdown ---------- */
.event-card.is-next { border-color: #f39a8866; box-shadow: 0 18px 44px #0006, 0 0 0 1px #f39a8833 inset; }
.event-next-label { display: block; padding: 8px 16px; background: linear-gradient(90deg, #f39a88, #ffc1ad); color: #2a1712; font: 700 .72rem Sora, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.event-countdown { margin: 6px 0 0; color: #b3b6c6; font-size: .9rem; }
.event-countdown strong { color: #ffc1ad; font: 700 1.05rem Sora, sans-serif; font-variant-numeric: tabular-nums; }

/* ---------- Podiums (CRB Coin in coral, XP in lavender): one design, two accents ---------- */
body[data-page="/"] .home-podium { --accent: #f39a88; --accent-soft: #ffc1ad; --accent-glow: #f39a8838; --accent-ink: #2a1712; }
body[data-page="/"] .home-podium--xp { --accent: #b9a4f2; --accent-soft: #ddd2fb; --accent-glow: #b9a4f238; --accent-ink: #1d1530; }
body[data-page="/"] .home-discovery--xp { border-top: 0; padding-top: 8px; }
body[data-page="/"] .home-podium .podium-card {
    position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; align-content: start; gap: 12px;
    padding: 34px 20px 30px; min-width: 0; text-align: center; color: #eceef5;
    background: linear-gradient(170deg, #252a40, #1a1d2b 78%); border: 1px solid #383b4c; border-radius: 22px;
    box-shadow: 0 18px 40px #0007, inset 0 1px 0 #ffffff0f;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s;
}
body[data-page="/"] .home-podium .podium-card:hover, body[data-page="/"] .home-podium .podium-card:focus-visible { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 24px 50px #0008, 0 0 0 1px var(--accent), 0 0 34px var(--accent-glow); }
body[data-page="/"] .home-podium .podium-card::before { content: none; }
body[data-page="/"] .home-podium .podium-rank {
    position: static; order: -1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    font: 800 .95rem Sora, sans-serif; color: #eceef5; background: #ffffff10; border: 1px solid #ffffff24;
}
body[data-page="/"] .home-podium .podium-avatar { width: 84px; height: 84px; background: linear-gradient(135deg, #c7b7f6, #f39a88); box-shadow: 0 0 0 3px #1a1d2b, 0 0 0 5px #ffffff26; }
body[data-page="/"] .home-podium .podium-avatar span { color: #1a1d2b; }
body[data-page="/"] .home-podium .podium-body { display: grid; justify-items: center; gap: 6px; min-width: 0; width: 100%; }
body[data-page="/"] .home-podium .podium-card h3 { margin: 0; max-width: 100%; color: #faf8f3; font-size: 1.12rem; line-height: 1.3; overflow-wrap: anywhere; }
body[data-page="/"] .home-podium .podium-value { color: #faf8f3; font: 800 1.3rem/1.2 Sora, sans-serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
body[data-page="/"] .home-podium .podium-value small { color: #b3b6c6; font: 600 .8rem system-ui, sans-serif; }
body[data-page="/"] .home-podium .podium-tag { padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--accent-soft); background: #ffffff0c; border: 1px solid #ffffff1c; }
body[data-page="/"] .home-podium .podium-plinth { position: absolute; inset: auto 0 0; height: 4px; background: #ffffff14; }
/* First place: a brighter slate card with a coral (or lavender) border and a soft light, never a pale card. */
body[data-page="/"] .home-podium .podium-place-1 {
    padding-top: 40px; padding-bottom: 40px; border-color: var(--accent);
    background: radial-gradient(120% 70% at 50% 0%, var(--accent-glow), transparent 62%), linear-gradient(170deg, #2d3350, #1e2232 80%);
    box-shadow: 0 0 0 1px var(--accent), 0 22px 56px #0009, 0 0 46px var(--accent-glow);
}
body[data-page="/"] .home-podium .podium-place-1 .podium-rank { width: 40px; height: 40px; font-size: 1.05rem; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent-soft), var(--accent)); border: 0; box-shadow: 0 0 18px var(--accent-glow); }
body[data-page="/"] .home-podium .podium-place-1 .podium-avatar { width: 104px; height: 104px; box-shadow: 0 0 0 3px #1e2232, 0 0 0 6px var(--accent), 0 0 30px var(--accent-glow); }
body[data-page="/"] .home-podium .podium-place-1 h3 { font-size: 1.3rem; }
body[data-page="/"] .home-podium .podium-place-1 .podium-value { font-size: 1.55rem; color: var(--accent-soft); }
body[data-page="/"] .home-podium .podium-place-1 .podium-plinth { height: 5px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
@media (prefers-reduced-motion: reduce) { body[data-page="/"] .home-podium .podium-card { transition: none; } body[data-page="/"] .home-podium .podium-card:hover { transform: none; } }
@media (max-width: 720px) {
    body[data-page="/"] .home-podium .podium-card { grid-template-columns: auto auto minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; padding: 16px 18px; gap: 14px; }
    body[data-page="/"] .home-podium .podium-place-1 { order: 0; padding: 20px 18px; }
    body[data-page="/"] .home-podium .podium-body { justify-items: start; }
    body[data-page="/"] .home-podium .podium-avatar, body[data-page="/"] .home-podium .podium-place-1 .podium-avatar { width: 56px; height: 56px; }
    body[data-page="/"] .home-podium .podium-place-1 .podium-avatar { width: 68px; height: 68px; }
}

/* Small phones: the main menu (five sections) stays on one line and scrolls within itself if needed. */
@media (max-width: 600px) {
    header > nav { gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 6px; }
    header > nav::-webkit-scrollbar { display: none; }
    header > nav a { flex: none; font-size: 12.5px; }
}

/* Simulators: a small "Mode simulation" label and a discreet toggle for the calculation details. */
.lab-mode { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .03em; color: #c7b7f6; background: #c7b7f614; border: 1px solid #c7b7f633; }
.lab-help { margin-top: 12px; font-size: .86rem; color: #b3b6c6; }
.lab-help summary { cursor: pointer; width: fit-content; color: #ffc1ad; font-weight: 600; }
.lab-help summary:focus-visible { outline: 2px solid #f39a88; outline-offset: 3px; border-radius: 4px; }
.lab-help p { margin: 8px 0 0; }
