/*
 * Quasar visual layer: a deep-space command deck. A live quasar (spinning accretion disk, core,
 * twin jets) anchors the home screen; everything else is dark glass, hairline borders and
 * cyan → violet → magenta light. Loaded after the inline styles in index.html so it can restyle them.
 *
 * <html data-fancy="low | medium | high"> (Config → Fanciness) scales the cost:
 *   low    – no blur, no motion, no star canvas, no glow filters. Same layout and colours.
 *   medium – glass blur, still starfield, slowly turning quasar, light hover motion.
 *   high   – warp starfield, live quasar with jets, aurora, horizon grid, cursor light,
 *            3D card tilt, staggered card entrances, library reveal transitions.
 */

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
    --bg-base: #02030a;
    --bg-panel: rgba(10, 13, 28, 0.58);
    --bg-card: #080a17;
    --glass: rgba(14, 18, 38, 0.55);
    --glass-strong: rgba(9, 12, 26, 0.86);
    --line: rgba(150, 190, 255, 0.11);
    --line-strong: rgba(150, 190, 255, 0.2);
    --border-subtle: var(--line);
    --border-focus: rgba(var(--accent-rgb), 0.6);
    --accent-cyan: #00f0ff;
    --accent-rgb: 0, 240, 255;
    --accent-soft: #a8f3ff;
    --bubble: linear-gradient(135deg, #0fd3e6, #6b5cff);
    --accent-blue: #4d7cff;
    --accent-violet: #9b5cff;
    --accent-pink: #ff3fd2;
    --accent-glow: rgba(var(--accent-rgb), 0.25);
    --text-main: #f2f5ff;
    --text-muted: #8a94b8;
    --text-dim: #5d6688;
    --grad-accent: linear-gradient(115deg, var(--accent-cyan) 0%, #4d7cff 45%, #9b5cff 75%, #ff3fd2 100%);
    --grad-text: linear-gradient(100deg, #ffffff 0%, #d6fbff 25%, var(--accent-cyan) 48%, #9b5cff 70%, #ffffff 100%);
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-display: 'Unbounded', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --shadow-float: 0 40px 100px rgba(0, 0, 0, calc(0.7 * var(--shadow-k, 1))), 0 0 0 1px rgba(var(--ink-rgb),  0.02);
    --blur-heavy: blur(26px) saturate(170%);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    /* Theme dials (the themes at the bottom of this file turn them). Most of Quasar's CSS was written for a
     * dark backdrop, so its hard-coded tints read these instead of fixed colours:
     *   --ink-rgb    the colour of faint tints, hover washes and hairlines (white on dark, ink on light)
     *   --shade-rgb  the colour of sunken surfaces like inputs (black on dark, white on light)
     *   --shadow-k   how strong drop shadows are
     *   --tx-dark    how far bright hard-coded text colours are darkened (so neon text reads on light themes)
     *   --bg-light   how far hard-coded near-black surfaces are lightened towards --paper
     *   --round      multiplies every corner radius (0 = square, 1.3 = extra round) */
    --ink-rgb: 255, 255, 255;
    --shade-rgb: 0, 0, 0;
    --shadow-k: 1;
    --tx-dark: 0%;
    --bg-light: 0%;
    --paper: #fff;
    --round: 1;
    --on-accent: #021016;
    /* the Terminal's background (social/terminal.js reads it, so the shell's colours follow the theme too) */
    --term-bg: color-mix(in oklab, var(--bg-base) 55%, #05070d);
}

html[data-fancy="medium"] { --blur-heavy: blur(14px) saturate(140%); }
html[data-fancy="low"] {
    --bg-panel: #0a0d1c;
    --glass: #0b0e1f;
    --glass-strong: #090b19;
    --blur-heavy: none;
    --shadow-float: 0 16px 40px rgba(0, 0, 0, calc(0.6 * var(--shadow-k, 1)));
}

body { background-color: var(--bg-base); font-family: var(--font-ui); }
body::before { display: none; }
html[data-fancy="low"] body::after { display: none; }
::selection { background: rgba(var(--accent-rgb), 0.3); }

/* ================= Launch screen ================= */

.launch {
    position: fixed; inset: 0; z-index: 9999; cursor: pointer;
    display: flex; align-items: center; justify-content: center; text-align: center;
    background: radial-gradient(ellipse at 50% 42%, rgba(77, 124, 255, 0.16), transparent 55%), var(--bg-base);
    color: var(--text-main); font-family: var(--font-ui);
}
.launch.hidden { display: none; }
.launch::after { /* the same light-on-glass hairline frame the modals use */
    content: ''; position: absolute; inset: 14px; border: 1px solid var(--line); border-radius: calc(22px * var(--round, 1)); pointer-events: none;
}
.launch-core {
    position: absolute; left: 50%; top: 42%; width: min(70vmin, 620px); aspect-ratio: 1; translate: -50% -50%;
    border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, #fff 0 4%, rgba(var(--accent-rgb), 0.85) 9%, transparent 30%),
        conic-gradient(from 0deg, var(--accent-cyan), var(--accent-violet), var(--accent-pink), var(--accent-cyan));
    -webkit-mask: radial-gradient(circle, #000 14%, transparent 15% 30%, #000 33% 52%, transparent 56%);
    mask: radial-gradient(circle, #000 14%, transparent 15% 30%, #000 33% 52%, transparent 56%);
    filter: drop-shadow(0 0 40px var(--accent-glow));
}
html:not([data-fancy="low"]) .launch-core { animation: diskSpin 14s linear infinite; }
.launch-text { position: relative; margin-top: 8vmin; }
.launch-text h1 {
    margin: 0; font: 900 clamp(2.6rem, 9vw, 5.6rem) var(--font-display); letter-spacing: 0.14em; padding-left: 0.14em;
    background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.launch-text p { margin: 14px 0 0; font: 500 0.82rem var(--font-mono); letter-spacing: 0.34em; text-transform: uppercase; color: var(--text-muted); }
html:not([data-fancy="low"]) .launch-text p { animation: launchPulse 2.4s ease-in-out infinite; }
@keyframes launchPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
/* A very small X, 10px down from the top edge and 10px in from the right edge. */
.launch-x {
    position: absolute; top: 10px; right: 10px; z-index: 1; width: 16px; height: 16px; padding: 0; margin: 0;
    display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer;
    font: 400 14px/1 var(--font-ui); color: var(--text-dim);
}
.launch-x:hover { color: var(--text-main); }

/* ================= Backdrop ================= */

#fx-stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
html[data-fancy="low"] #fx-stars { display: none; }

.fx-nebula { position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden;
    background: radial-gradient(ellipse at 50% 130%, rgba(70, 25, 140, 0.4) 0%, transparent 60%), var(--bg-base); }
.fx-nebula i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.fx-nebula i:nth-child(1) { width: 60vmax; height: 60vmax; left: -22vmax; top: -28vmax; background: radial-gradient(circle, rgba(0, 190, 255, 0.5), transparent 65%); }
.fx-nebula i:nth-child(2) { width: 55vmax; height: 55vmax; right: -24vmax; top: 2vmax; background: radial-gradient(circle, rgba(155, 92, 255, 0.45), transparent 65%); }
.fx-nebula i:nth-child(3) { width: 45vmax; height: 45vmax; left: 15vmax; bottom: -32vmax; background: radial-gradient(circle, rgba(255, 63, 210, 0.25), transparent 65%); }
html[data-fancy="high"] .fx-nebula i:nth-child(1) { animation: drift1 28s ease-in-out infinite alternate; }
html[data-fancy="high"] .fx-nebula i:nth-child(2) { animation: drift2 34s ease-in-out infinite alternate; }
html[data-fancy="high"] .fx-nebula i:nth-child(3) { animation: drift1 40s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vmax, 8vmax) scale(0.9); } }
html[data-fancy="low"] .fx-nebula i { display: none; }
html[data-fancy="low"] .fx-nebula { background: radial-gradient(circle at 50% 42%, rgba(0, 200, 255, 0.12), transparent 45%), radial-gradient(ellipse at 50% 120%, rgba(90, 40, 160, 0.28), transparent 60%), var(--bg-base); }

.fx-grid { display: none; }
html[data-fancy="high"] .fx-grid {
    display: block; position: fixed; left: -50%; right: -50%; bottom: -12vh; height: 42vh; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(var(--accent-rgb), 0.2) 1px, transparent 1px), linear-gradient(90deg, rgba(155, 92, 255, 0.2) 1px, transparent 1px);
    background-size: 64px 64px;
    transform: perspective(380px) rotateX(64deg); transform-origin: 50% 100%;
    -webkit-mask-image: linear-gradient(to top, #000, transparent 80%); mask-image: linear-gradient(to top, #000, transparent 80%);
    animation: gridRun 3.2s linear infinite;
}
@keyframes gridRun { to { background-position: 0 64px, 0 0; } }

/* A soft light that follows the cursor across the backdrop (high). */
.fx-spot { display: none; }
html[data-fancy="high"] .fx-spot {
    display: block; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(600px circle at var(--cx, 50%) var(--cy, 40%), rgba(var(--accent-rgb), 0.07), transparent 60%);
}

/* ================= Painted scenes (scenes.js) =================
 * Every theme but Nebula and Hacker, every season and every wallpaper is a landscape painted on #fx-scene.
 * Once it's painted (html[data-scene]) it covers the CSS backdrop, and the quasar stays Nebula's own. */
#fx-scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; opacity: 0; transition: opacity 0.5s ease; }
html[data-scene] #fx-scene.ready { opacity: 1; }
html[data-scene] .quasar, html[data-scene] .fx-grid { display: none !important; }
html:not([data-scene]) #fx-scene { display: none; }
/* (and before it's painted, other themes don't flash the quasar either) */
html[data-theme] .quasar, html[data-wall] .quasar { display: none !important; }

/* ================= The quasar ================= */

.quasar {
    position: fixed; left: 50%; top: 44%; width: min(118vmin, 1150px); aspect-ratio: 1; z-index: -1; pointer-events: none;
    transform: translate(-50%, -50%); perspective: 1400px;
}
.q-halo { position: absolute; inset: 18%; border-radius: 50%;
    background: radial-gradient(circle, rgba(120, 220, 255, 0.22) 0%, rgba(80, 90, 255, 0.12) 30%, rgba(155, 92, 255, 0.05) 55%, transparent 70%); }
.q-plane { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(76deg) rotateY(-8deg); }
.q-spin { position: absolute; inset: 0; animation: diskSpin 30s linear infinite; }
.q-spin.slow { animation-duration: 70s; animation-direction: reverse; }
.q-disk {
    position: absolute; inset: 14%; border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(var(--accent-rgb), 0.95), rgba(77, 124, 255, 0.35) 18%, rgba(155, 92, 255, 0.9) 34%, rgba(255, 63, 210, 0.45) 50%,
        rgba(var(--accent-rgb), 0.85) 66%, rgba(77, 124, 255, 0.25) 82%, rgba(var(--accent-rgb), 0.95));
    -webkit-mask: radial-gradient(circle, transparent 13%, #000 16%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.25) 52%, transparent 70%);
    mask: radial-gradient(circle, transparent 13%, #000 16%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.25) 52%, transparent 70%);
    filter: blur(3px) saturate(140%);
}
.q-disk.outer { inset: 0; opacity: 0.45; filter: blur(10px);
    -webkit-mask: radial-gradient(circle, transparent 28%, #000 36%, transparent 70%); mask: radial-gradient(circle, transparent 28%, #000 36%, transparent 70%); }
@keyframes diskSpin { to { transform: rotate(1turn); } }
.q-core {
    position: absolute; left: 50%; top: 50%; width: 9%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, #ffffff 0%, #c8f9ff 18%, rgba(var(--accent-rgb), 0.75) 38%, rgba(77, 124, 255, 0.25) 62%, transparent 72%);
    box-shadow: 0 0 60px 18px rgba(0, 220, 255, 0.35), 0 0 160px 50px rgba(120, 90, 255, 0.18);
}
.q-jet {
    position: absolute; left: 50%; width: 2.2%; height: 50%; transform: translateX(-50%);
    background: linear-gradient(to top, rgba(210, 252, 255, 0.95), rgba(var(--accent-rgb), 0.55) 25%, rgba(120, 100, 255, 0.18) 65%, transparent);
    filter: blur(5px); border-radius: 50%; opacity: 0.8;
}
.q-jet.up { bottom: 50%; }
/* Same beam flipped: bright end against the core. */
.q-jet.down { top: 50%; transform: translateX(-50%) rotate(180deg); }
html[data-fancy="high"] .q-core { animation: corePulse 4s ease-in-out infinite; }
html[data-fancy="high"] .q-jet { animation: jetFlicker 2.6s ease-in-out infinite; }
html[data-fancy="high"] .q-jet.down { animation-delay: -1.3s; }
html[data-fancy="high"] .q-halo { animation: halo 8s ease-in-out infinite; }
@keyframes corePulse { 50% { transform: translate(-50%, -50%) scale(1.18); filter: brightness(1.25); } }
@keyframes jetFlicker { 0%, 100% { opacity: 0.75; } 40% { opacity: 0.45; } 55% { opacity: 0.95; } }
@keyframes halo { 50% { transform: scale(1.08); opacity: 0.8; } }
/* Medium: the disk still turns (cheap: it's a rotated, pre-rasterised layer), nothing else moves. */
html[data-fancy="medium"] .q-spin { animation-duration: 60s; }
html[data-fancy="medium"] .q-spin.slow { animation: none; }
html[data-fancy="low"] .q-disk, html[data-fancy="low"] .q-jet { filter: none; }
html[data-fancy="low"] .q-disk.outer, html[data-fancy="low"] .q-core { box-shadow: none; }
html[data-fancy="low"] .q-disk.outer { display: none; }
.q-spin, .q-disk { will-change: transform; }
html[data-fancy="low"] .q-spin, html[data-fancy="low"] .q-disk { will-change: auto; }

/* ================= Top bar ================= */

.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 72px; padding: 0 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    background: linear-gradient(to bottom, color-mix(in oklab, rgba(2, 3, 10, 0.8), rgba(255, 255, 255, 0.8) var(--bg-light, 0%)), color-mix(in oklab, rgba(2, 3, 10, 0), rgba(255, 255, 255, 0) var(--bg-light, 0%)));
}
.brand { display: flex; align-items: center; gap: 12px; font: 700 0.95rem var(--font-display); letter-spacing: 0.32em; color: var(--text-main); }
.brand-mark {
    width: 26px; height: 26px; border-radius: 50%; position: relative;
    background: radial-gradient(circle, #fff 0 12%, rgba(var(--accent-rgb), 0.9) 24%, transparent 46%),
        conic-gradient(from 0deg, var(--accent-cyan), var(--accent-violet), var(--accent-pink), var(--accent-cyan));
    -webkit-mask: radial-gradient(circle, #000 30%, transparent 31% 44%, #000 46% 62%, transparent 64%);
    mask: radial-gradient(circle, #000 30%, transparent 31% 44%, #000 46% 62%, transparent 64%);
    filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.7));
}
html[data-fancy="high"] .brand-mark { animation: diskSpin 6s linear infinite; }

.top-controls {
    position: static; top: auto; z-index: auto; display: flex; gap: 2px; padding: 5px;
    background: var(--glass); border: 1px solid var(--line); border-radius: calc(100px * var(--round, 1));
    backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy);
    box-shadow: 0 10px 40px rgba(0, 0, 0, calc(0.45 * var(--shadow-k, 1))), inset 0 1px 0 rgba(var(--ink-rgb),  0.05);
}
.top-btn { position: relative; padding: 9px 18px 9px 15px; font: 500 0.84rem var(--font-ui); color: var(--text-muted); letter-spacing: 0.01em; }
.top-btn:hover { color: var(--text-main); background: rgba(var(--ink-rgb),  0.05); box-shadow: none; transform: none; }
.top-btn .material-symbols-outlined { font-size: 1.15rem; transition: color 0.3s, text-shadow 0.3s; }
.top-btn.active { color: var(--text-main); background: rgba(var(--accent-rgb), 0.09); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.28); }
.top-btn:hover .material-symbols-outlined, .top-btn.active .material-symbols-outlined { color: var(--accent-cyan); text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.9); }
/* Keep the bar balanced: an invisible twin of the brand on the right. */
.topbar::after { content: ''; width: 150px; }

/* ================= Hero ================= */

.container {
    background: none; border: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    max-width: 760px; padding: 40px 20px; position: relative;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

.hud-status {
    display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; padding: 7px 16px; border-radius: calc(100px * var(--round, 1));
    font: 500 0.7rem var(--font-mono); letter-spacing: 0.22em; color: var(--accent-soft); text-transform: uppercase;
    background: rgba(var(--accent-rgb), 0.06); border: 1px solid rgba(var(--accent-rgb), 0.22);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hud-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #3dffa8; box-shadow: 0 0 10px #3dffa8; }
html:not([data-fancy="low"]) .hud-status .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.7); } }
.hud-status .sep { opacity: 0.35; }

h1 {
    font-family: var(--font-display); font-weight: 900; font-size: clamp(3rem, 10vw, 7.2rem); line-height: 0.95;
    letter-spacing: 0.04em; margin-bottom: 18px;
    background: var(--grad-text); background-size: 230% 100%;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none;
}
/* Chromatic edge + bloom. */
html:not([data-fancy="low"]) h1 { filter: drop-shadow(-2px 0 0 rgba(var(--accent-rgb), 0.45)) drop-shadow(2px 0 0 rgba(255, 63, 210, 0.4)) drop-shadow(0 0 30px rgba(0, 200, 255, 0.35)); }
html[data-fancy="high"] h1 { animation: shimmer 7s linear infinite; }
@keyframes shimmer { from { background-position: 115% 0; } to { background-position: -115% 0; } }

.container .desc { font-size: 1.05rem; color: color-mix(in oklab, #aab3d4, #000 var(--tx-dark, 0%)); margin-bottom: 38px; letter-spacing: 0.02em; }

/* Command bar: one glass pill holding the input and the WARP button. */
#quasar-form {
    position: relative; gap: 6px; padding: 7px; border-radius: calc(100px * var(--round, 1)); isolation: isolate;
    background: var(--glass-strong); border: 1px solid var(--line-strong);
    box-shadow: 0 24px 60px rgba(0, 0, 0, calc(0.55 * var(--shadow-k, 1))), 0 0 0 6px rgba(var(--accent-rgb), 0.03), inset 0 1px 0 rgba(var(--ink-rgb),  0.06);
    backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy);
    transition: box-shadow 0.4s var(--ease), border-color 0.4s;
}
#quasar-form:focus-within { border-color: rgba(var(--accent-rgb), 0.45); box-shadow: 0 24px 60px rgba(0, 0, 0, calc(0.55 * var(--shadow-k, 1))), 0 0 0 6px rgba(var(--accent-rgb), 0.07), 0 0 50px rgba(var(--accent-rgb), 0.22); }
/* Rotating light round the bar's edge (high). */
html[data-fancy="high"] #quasar-form::before {
    content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1; pointer-events: none;
    background: conic-gradient(from var(--spin), transparent 0 62%, var(--accent-cyan) 74%, var(--accent-violet) 84%, var(--accent-pink) 90%, transparent 98%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    animation: edgeSpin 5s linear infinite;
}
@keyframes edgeSpin { to { --spin: 360deg; } }
#quasar-form input[type="text"] {
    background: transparent; border: none; box-shadow: none; border-radius: calc(100px * var(--round, 1)); padding: 17px 18px 17px 52px; font-size: 1.05rem;
}
#quasar-form input[type="text"]:focus { background: transparent; box-shadow: none; }
#quasar-form .input-wrapper .material-symbols-outlined { left: 22px; }
#quasar-form button[type="submit"] { border-radius: calc(100px * var(--round, 1)); padding: 0 30px; }

button[type="submit"], .btn-solid {
    background: var(--grad-accent); background-size: 160% 100%; color: var(--on-accent); font-weight: 700; letter-spacing: 0.08em;
    font-family: var(--font-display); font-size: 0.85rem;
    box-shadow: 0 8px 28px rgba(0, 200, 255, 0.3), inset 0 1px 0 rgba(var(--ink-rgb),  0.45);
    transition: background-position 0.6s var(--ease), box-shadow 0.4s, transform 0.4s var(--ease);
}
button[type="submit"]:hover, .btn-solid:hover {
    background: var(--grad-accent); background-size: 160% 100%; background-position: 100% 0; transform: translateY(-1px);
    box-shadow: 0 12px 36px rgba(120, 100, 255, 0.45), inset 0 1px 0 rgba(var(--ink-rgb),  0.5);
}

.quick-launch { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; }
.quick-launch button {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: calc(100px * var(--round, 1)); cursor: pointer;
    font: 500 0.82rem var(--font-ui); color: color-mix(in oklab, #b9c2e3, #000 var(--tx-dark, 0%)); background: color-mix(in oklab, rgba(14, 18, 38, 0.5), rgba(255, 255, 255, 0.5) var(--bg-light, 0%)); border: 1px solid var(--line);
    transition: 0.3s var(--ease);
}
.quick-launch button .material-symbols-outlined { font-size: 1.05rem; color: var(--accent-cyan); }
.quick-launch button:hover { color: #fff; border-color: rgba(var(--accent-rgb), 0.4); background: rgba(var(--accent-rgb), 0.08); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.15); }
.quick-launch .hint { margin-left: 8px; font: 500 0.75rem var(--font-mono); color: var(--text-dim); }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; margin-right: 4px; border-radius: calc(6px * var(--round, 1)); font: 600 0.72rem var(--font-mono); color: color-mix(in oklab, #cfe9ff, #000 var(--tx-dark, 0%)); background: rgba(var(--ink-rgb),  0.06); border: 1px solid var(--line-strong); border-bottom-width: 2px; text-align: center; }

#quasar-error { margin-top: 18px; }

/* ================= Libraries ================= */

.library-ui {
    background: radial-gradient(1200px 500px at 50% -10%, rgba(0, 200, 255, 0.1), transparent 60%), color-mix(in oklab, rgba(2, 3, 10, 0.86), rgba(255, 255, 255, 0.86) var(--bg-light, 0%));
    padding-top: 110px;
}
html[data-fancy="low"] .library-ui { background: var(--bg-base); }
html[data-fancy="high"] .library-ui { animation: libIn 0.6s var(--ease) backwards; }
@keyframes libIn { from { clip-path: circle(0% at 50% 36px); } to { clip-path: circle(150% at 50% 36px); } }
html[data-fancy="medium"] .library-ui { animation: fadeIn 0.3s ease both; }

.library-header { padding-bottom: 24px; border-bottom: 1px solid var(--line); position: relative; margin-bottom: 34px; }
.library-header::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 160px; height: 2px; background: var(--grad-accent); box-shadow: 0 0 14px var(--accent-cyan); }
.library-header h2 {
    font: 700 clamp(1.5rem, 3vw, 2.1rem) var(--font-display); letter-spacing: 0.06em;
    background: var(--grad-text); background-size: 230% 100%;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.library-header h2 .material-symbols-outlined { -webkit-text-fill-color: var(--accent-cyan); color: var(--accent-cyan) !important; text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.7); }
.library-search { background: var(--glass-strong); border-color: var(--line-strong); border-radius: calc(100px * var(--round, 1)); }
.library-search:focus { border-color: var(--border-focus); box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.15); }
.btn-outline { border-color: var(--line-strong); background: var(--glass); border-radius: calc(100px * var(--round, 1)); color: color-mix(in oklab, #d5dcf5, #000 var(--tx-dark, 0%)); }
.btn-outline:hover { border-color: var(--border-focus); background: rgba(var(--accent-rgb), 0.08); box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.14); }

.grid-container, .media-grid-container { gap: 22px; }

/* ================= Cards ================= */

.card { border-radius: calc(18px * var(--round, 1)); border: 1px solid var(--line); background: var(--bg-card); }
html[data-fancy="high"] .card:hover { transform-style: preserve-3d; }
/* The game list has ~2000 cards: the browser skips drawing the ones that are off screen. */
#games-grid > .game-card { content-visibility: auto; contain-intrinsic-size: auto 220px auto 260px; }
.card::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: 4; pointer-events: none;
    background: var(--grad-accent); opacity: 0; transition: opacity 0.35s;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: transparent; box-shadow: 0 26px 60px rgba(0, 0, 0, calc(0.65 * var(--shadow-k, 1))), 0 0 34px rgba(var(--accent-rgb), 0.16), 0 0 70px rgba(155, 92, 255, 0.12); }
html[data-fancy="high"] .card:hover {
    transform: perspective(900px) translateY(-8px) scale(1.03) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.12s ease-out, box-shadow 0.4s, border-color 0.4s;
}
html[data-fancy="high"] .card .info { transform: translateZ(30px); }
.card .fx-glow { display: none; }
html[data-fancy="high"] .card .fx-glow {
    display: block; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.3s; mix-blend-mode: screen;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), 0.2), transparent 60%);
}
html[data-fancy="high"] .card:hover .fx-glow { opacity: 1; }
/* Cards drift in one after another (fx.js numbers them as they're added). */
/* (only the first cards of a list, and only the first time they're shown: fx.js adds and takes away .fx-in) */
html:not([data-fancy="low"]) .card.fx-in { animation: cardIn 0.6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 32ms); }
html[data-fancy="medium"] .card.fx-in { animation-delay: 0s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
html[data-fancy="low"] .card:hover { transform: none; }
html[data-fancy="low"] .card::after { display: none; }
html[data-fancy="low"] .card:hover img { transform: none; }
/* Low: flat cards (no shadows, outline glow or hover zoom), no blur anywhere, and no fading or sliding. */
html[data-fancy="low"] .card { box-shadow: none; transition: none; }
html[data-fancy="low"] .card::before { display: none; }
html[data-fancy="low"] .card:hover { box-shadow: none; border-color: var(--line-strong); }
html[data-fancy="low"] .card img { transition: none; }
html[data-fancy="low"] *, html[data-fancy="low"] *::before, html[data-fancy="low"] *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; text-shadow: none !important; }
html[data-fancy="low"] .library-ui, html[data-fancy="low"] .window-ui, html[data-fancy="low"] .modal-overlay { animation: none !important; }
html[data-fancy="low"] h1, html[data-fancy="low"] .library-header h2 .material-symbols-outlined { filter: none; }
/* While a game, a site or a movie covers the page, the backdrop behind it isn't drawn at all. */
html.q-covered .fx-nebula, html.q-covered #fx-stars, html.q-covered .fx-grid, html.q-covered .fx-spot { display: none; }

.card.media-card .rating { background: rgba(4, 6, 16, 0.72); border-color: rgba(var(--accent-rgb), 0.28); border-radius: calc(100px * var(--round, 1)); font-family: var(--font-mono); backdrop-filter: blur(8px); }
.card.media-card .title, .card.music-card .title { font-family: var(--font-ui); font-weight: 600; }
.card.game-card .info, .card.app-card .info { font-weight: 600; letter-spacing: 0.01em; }

/* ================= Windows, player, modals ================= */

.window-chrome { background: color-mix(in oklab, rgba(5, 7, 18, 0.96), rgba(255, 255, 255, 0.96) var(--bg-light, 0%)); border-bottom: 1px solid rgba(var(--accent-rgb), 0.16); box-shadow: 0 1px 30px rgba(var(--accent-rgb), 0.07); }
/* Auto-hiding bar: it floats over the frame, which gets the full window. See setupAutoHideChrome. */
.window-ui .window-chrome { position: absolute; top: 0; left: 0; right: 0; z-index: 6; transition: transform 0.15s ease-out; }
.window-ui.chrome-hidden .window-chrome { transform: translateY(-100%); box-shadow: none; }
.chrome-zone { position: absolute; right: 0; z-index: 5; }
.chrome-zone-corner { top: 0; width: 5px; height: 5px; }
/* Only there while the bar is showing: reaching the bottom edge hides it. */
.chrome-zone-bottom { left: 0; bottom: 0; height: 40px; }
.window-ui.chrome-hidden .chrome-zone-bottom { display: none; }
.chrome-tab { display: none; position: absolute; top: 0; right: 12px; z-index: 5; width: 44px; height: 24px; padding: 0; align-items: center; justify-content: center;
    background: color-mix(in oklab, rgba(5, 7, 18, 0.45), rgba(255, 255, 255, 0.45) var(--bg-light, 0%)); border: none; border-radius: 0 0 calc(10px * var(--round, 1)) calc(10px * var(--round, 1)); color: var(--text-muted); opacity: 0.6; }
@media (hover: none) {
    .chrome-zone { display: none; }
    .chrome-tab { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .window-ui .window-chrome { transition: none; } }
#player-title { font: 600 0.82rem var(--font-display) !important; letter-spacing: 0.22em !important; color: var(--accent-soft) !important; }
.chrome-omnibox input { border-radius: calc(100px * var(--round, 1)); }

.music-player-bar { border-color: rgba(var(--accent-rgb), 0.18); border-radius: calc(26px * var(--round, 1)); background: var(--glass-strong);
    box-shadow: 0 24px 60px rgba(0, 0, 0, calc(0.7 * var(--shadow-k, 1))), 0 0 50px rgba(var(--accent-rgb), 0.08), inset 0 1px 0 rgba(var(--ink-rgb),  0.06); }
.mp-btn.main-play { background: var(--grad-accent); color: var(--on-accent); }

/* A window taller than the screen (Config on a phone) scrolls instead of being cut off at the top and
   bottom: the auto margins centre it when it fits, and stop centring (so it scrolls from the top) when it doesn't. */
.modal-overlay {
    background: color-mix(in oklab, rgba(2, 3, 10, 0.72), rgba(255, 255, 255, 0.72) var(--bg-light, 0%)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
}
.modal-content { margin: auto; flex: none; }
.modal-content { position: relative; max-width: 450px; border-radius: calc(26px * var(--round, 1)); background: var(--glass-strong); border-color: var(--line-strong); backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy); }
.modal-content::before { content: ''; position: absolute; left: 34px; right: 34px; top: -1px; height: 2px; border-radius: calc(2px * var(--round, 1)); background: var(--grad-accent); box-shadow: 0 0 16px var(--accent-cyan); }
.modal-content h2 { font: 700 1.25rem var(--font-display); letter-spacing: 0.06em; }
.modal-content h2 .material-symbols-outlined { color: var(--accent-cyan); }
html[data-fancy="high"] .modal-content { animation: modalIn 0.45s var(--ease) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
html[data-fancy="low"] .modal-overlay { backdrop-filter: none; background: rgba(var(--shade-rgb), 0.88); }

.config-section { text-align: left; margin-bottom: 26px; }
.config-section h3 { font: 500 0.72rem var(--font-mono); letter-spacing: 0.24em; color: var(--accent-soft); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.config-section h3 .material-symbols-outlined { font-size: 1.1rem; }
.config-section .desc { text-align: left; margin-bottom: 12px !important; font-size: 0.85rem !important; }
.fancy-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: calc(18px * var(--round, 1)); background: color-mix(in oklab, rgba(2, 4, 12, 0.6), rgba(255, 255, 255, 0.6) var(--bg-light, 0%)); border: 1px solid var(--line-strong); }
.fancy-picker button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: calc(13px * var(--round, 1)); border: 1px solid transparent;
    background: transparent; color: var(--text-muted); font: 600 0.85rem var(--font-ui); cursor: pointer; transition: 0.25s;
}
.fancy-picker button small { font-weight: 500; font-size: 0.68rem; opacity: 0.75; }
.fancy-picker button:hover { color: var(--text-main); background: rgba(var(--ink-rgb),  0.04); }
.fancy-picker.two { grid-template-columns: repeat(2, 1fr); }
.fancy-picker button.on { color: var(--on-accent); background: var(--grad-accent); box-shadow: 0 4px 20px rgba(0, 220, 255, 0.3); }

footer { color: rgba(170, 190, 240, 0.32); font: 500 0.72rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
footer a { color: rgba(var(--accent-rgb), 0.6); }

::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.35), rgba(155, 92, 255, 0.35)); }

/* ================= Low: nothing moves ================= */

html[data-fancy="low"] *, html[data-fancy="low"] *::before, html[data-fancy="low"] *::after {
    animation: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html[data-fancy="low"] h1, html[data-fancy="low"] .brand-mark { filter: none; }

/* A section is open over the home screen (fx.js): the backdrop behind it holds still. */
html.covered .quasar, html.covered .quasar *, html.covered .fx-nebula i, html.covered .fx-grid { animation-play-state: paused !important; }

/* ================= Small screens ================= */

@media (max-width: 860px) {
    .topbar { justify-content: center; padding: 0 12px; }
    .brand, .topbar::after { display: none; }
}
@media (max-width: 760px) {
    /* 8 buttons share the bar evenly, each a full 44px tall (easy to hit with a thumb) */
    .top-controls { max-width: calc(100vw - 24px); gap: 2px; padding: 4px; }
    .top-btn { font-size: 0; padding: 10px 0; gap: 0; flex: 1 1 0; min-width: 40px; min-height: 44px; justify-content: center; }
    .top-btn .material-symbols-outlined { font-size: 1.3rem; }
    /* Two cards per row (one per row made a poster fill the whole screen, and 75 games an endless scroll) */
    .grid-container, .media-grid-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .card { border-radius: calc(16px * var(--round, 1)); }
    .card.game-card .info, .card.app-card .info { padding: 28px 8px 10px; font-size: 0.86rem; line-height: 1.2; }
    .card.media-card .info { padding: 36px 10px 10px; }
    .card.media-card .title { font-size: 0.88rem; }
    .card.media-card .date { font-size: 0.75rem; }
    .card.media-card .rating { top: 8px; right: 8px; padding: 3px 7px; font-size: 0.7rem; }
    .card.media-card .rating .material-symbols-outlined { font-size: 0.85rem; }
    .games-heading { font-size: 0.75rem; letter-spacing: 0.16em; }
}
/* Touch screens: a tapped card doesn't stay lifted and zoomed (phones keep :hover after a tap). */
@media (hover: none) {
    .card:hover, html[data-fancy="high"] .card:hover { transform: none; }
    .card:hover img { transform: none; opacity: 1; }
    .card:hover::after { left: -100%; }
    .container { padding: 30px 16px; }
    #quasar-form { border-radius: calc(26px * var(--round, 1)); flex-direction: column; }
    #quasar-form button[type="submit"] { justify-content: center; padding: 15px; border-radius: calc(20px * var(--round, 1)); }
    .quick-launch .hint { display: none; }
    .library-ui { padding: 90px 16px 120px; }
    .library-search { width: 100%; }
}

/* Section titles inside the games grid */
.games-heading { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin: 6px 0 -6px; font: 600 0.85rem var(--font-display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); }
.games-heading::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.games-heading:not(:first-child) { margin-top: 22px; }
.card.homemade { border-color: rgba(var(--accent-rgb), 0.28); }

/* Sorting the games: Category / A-Z / Supply / Visits (tap the one that's on to turn it around) */
.games-sort {
    display: flex; align-items: center; gap: 8px; margin: -8px 0 26px; overflow-x: auto; scrollbar-width: none;
    padding: 2px; -webkit-overflow-scrolling: touch;
}
.games-sort::-webkit-scrollbar { display: none; }
.games-sort-label { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-right: 2px; color: var(--text-muted); font: 600 0.72rem var(--font-display); letter-spacing: 0.18em; text-transform: uppercase; }
.games-sort-label .material-symbols-outlined { font-size: 1.05rem; }
.games-sort button {
    flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 12px;
    border: 1px solid var(--line-strong, rgba(var(--ink-rgb), 0.14)); border-radius: calc(99px * var(--round, 1));
    background: rgba(var(--ink-rgb), 0.04); color: var(--text-muted); font: 600 0.86rem var(--font-ui); cursor: pointer;
    transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.15s;
}
.games-sort button .material-symbols-outlined { font-size: 1.1rem; }
.games-sort button:hover { color: var(--text-main); background: rgba(var(--ink-rgb), 0.08); }
.games-sort button:active { transform: scale(0.96); }
.games-sort button:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.games-sort button .dir { width: 0; margin-left: -6px; opacity: 0; overflow: hidden; transition: width 0.25s, margin 0.25s, opacity 0.25s, transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
.games-sort button.on { color: var(--on-accent); background: var(--accent-cyan); border-color: transparent; box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.3); }
.games-sort button.on .dir { width: 1.1rem; margin-left: 0; opacity: 1; }
.games-sort button.on.rev .dir { transform: rotate(180deg); }
@media (max-width: 760px) {
    /* phones: all four on one row (no label or icons, just the words) */
    .games-sort { gap: 6px; margin: -6px 0 20px; overflow: visible; }
    .games-sort-label, .games-sort button > .material-symbols-outlined:first-child { display: none; }
    .games-sort button { flex: 1 1 0; min-width: 0; justify-content: center; gap: 2px; padding: 0 6px; font-size: 0.82rem; }
}

/* 1,400+ cards: the browser skips drawing the ones off screen (cards are square, so they keep their size) */
#games-grid > .card.game-card { content-visibility: auto; contain-intrinsic-size: auto 256px; aspect-ratio: 1 / 1; }
/* No cover picture: the game's icon on a soft accent background (gameTile). */
.card.game-card.no-cover { background: radial-gradient(circle at 50% 38%, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.06) 70%); }
.card.game-card .no-cover-icon { position: absolute; inset: 0 0 25% 0; display: flex; align-items: center; justify-content: center; font-size: 56px; color: rgba(var(--accent-rgb), 0.85); pointer-events: none; }

/* A section's count, and how many times a game was played (shown while sorting by visits) */
.games-heading-n { flex: none; padding: 2px 9px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--ink-rgb), 0.07); font: 600 0.72rem var(--font-ui); letter-spacing: 0.04em; color: var(--text-muted); }
.games-heading::after { order: 1; }
.games-heading-n { order: 2; }
.visits-badge {
    position: absolute; top: 8px; left: 8px; z-index: 4; display: none; align-items: center; gap: 3px; padding: 3px 8px 3px 6px;
    border-radius: calc(99px * var(--round, 1)); background: color-mix(in oklab, rgba(4, 6, 16, 0.7), rgba(255, 255, 255, 0.75) var(--bg-light, 0%));
    border: 1px solid rgba(var(--ink-rgb), 0.12); color: var(--text-main); font: 700 0.74rem var(--font-ui); pointer-events: none;
}
.visits-badge .material-symbols-outlined { font-size: 0.95rem; color: #ff8a3d; font-variation-settings: "FILL" 1; }
.by-visits > .card .visits-badge { display: inline-flex; }

/* The player's "Use proxy" button (Truffled and Lumin games) */
.chrome-btn.proxy-btn { gap: 6px; padding: 8px 12px; font: 600 0.82rem var(--font-ui); border: 1px solid rgba(var(--accent-rgb), 0.35); color: var(--text-main); }
.chrome-btn.proxy-btn[hidden] { display: none; }
@media (max-width: 760px) { .proxy-btn-text { display: none; } .chrome-btn.proxy-btn { padding: 8px; } }

/* ---------- the Quasar app (app.js): install button, install card, offline note ---------- */
.app-btn { width: 100%; justify-content: center; margin-top: 10px; }
.app-small { margin-top: 8px; font-size: 0.78rem; opacity: 0.85; }
.app-steps { margin: 10px 0 0 20px; padding: 0; color: var(--text-muted); font-size: 0.86rem; line-height: 1.7; text-align: left; }
.app-steps b { color: var(--text-main); }
.install-card {
    position: fixed; z-index: 9000; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    width: min(400px, calc(100vw - 24px)); padding: 22px 20px 18px; border-radius: calc(22px * var(--round, 1)); text-align: center;
    background: color-mix(in oklab, rgba(12, 14, 28, 0.97), rgba(255, 255, 255, 0.97) var(--bg-light, 0%)); border: 1px solid rgba(var(--accent-rgb), 0.35); box-shadow: 0 24px 60px rgba(0, 0, 0, calc(0.7 * var(--shadow-k, 1))), 0 0 40px rgba(var(--accent-rgb), 0.12);
    animation: appIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.install-card img { border-radius: calc(14px * var(--round, 1)); }
.install-card h3 { margin: 8px 0 6px; font: 700 1.1rem var(--font-ui); }
.install-card .desc { color: var(--text-muted); font-size: 0.86rem; line-height: 1.5; }
.install-card-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border: none; border-radius: 50%; background: rgba(var(--ink-rgb),  0.06); color: var(--text-muted); cursor: pointer; }
@keyframes appIn { from { opacity: 0; transform: translate(-50%, 30px); } }
.app-offline {
    position: fixed; z-index: 8000; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 24px); padding: 8px 8px 8px 14px; border-radius: calc(16px * var(--round, 1));
    background: color-mix(in oklab, rgba(40, 30, 6, 0.96), rgba(255, 255, 255, 0.96) var(--bg-light, 0%)); border: 1px solid rgba(255, 196, 0, 0.45); color: color-mix(in oklab, #ffe9a8, #000 var(--tx-dark, 0%)); font: 500 0.82rem/1.35 var(--font-ui); box-shadow: 0 10px 30px rgba(0, 0, 0, calc(0.5 * var(--shadow-k, 1)));
}
.app-offline > .material-symbols-outlined { color: color-mix(in oklab, #ffd34d, #000 var(--tx-dark, 0%)); }
.app-offline button { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: none; border-radius: 50%; background: none; color: inherit; cursor: pointer; }

/* ================= Phones on their side (landscape): little height, so everything up top is slimmer ================= */
@media (max-height: 500px) and (orientation: landscape) {
    .topbar { height: 52px; justify-content: center; padding: 0 12px; }
    .brand, .topbar::after { display: none; }
    .top-controls { padding: 3px; }
    .top-btn { font-size: 0; padding: 7px 14px; gap: 0; }
    .top-btn .material-symbols-outlined { font-size: 1.25rem; }
    .library-ui { padding: 64px 24px 90px; }
    .container { padding-top: 64px; padding-bottom: 24px; }
    .install-card { bottom: 10px; padding: 14px 16px 12px; }
    .install-card img { width: 40px; height: 40px; }
}
.app-update { background: color-mix(in oklab, rgba(6, 26, 34, 0.97), rgba(255, 255, 255, 0.97) var(--bg-light, 0%)); border-color: rgba(var(--accent-rgb), 0.45); color: color-mix(in oklab, #c9f7ff, #000 var(--tx-dark, 0%)); }
.app-update > .material-symbols-outlined { color: var(--accent-cyan); }
.app-update .app-update-go { width: auto; height: 30px; padding: 0 14px; border-radius: calc(99px * var(--round, 1)); background: var(--accent-cyan); color: var(--on-accent); font: 700 0.8rem var(--font-ui); }

/* ================= Your games, Continue watching, search suggestions, player help ================= */

/* Swipeable rows (Recently played, Favorites, Continue watching) */
.game-strip {
    grid-column: 1 / -1; display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; padding: 4px 2px 10px; margin: 0 -2px; scrollbar-width: thin;
}
.game-strip > .card { flex: 0 0 clamp(132px, 34vw, 200px); scroll-snap-align: start; }
.media-strip > .card { flex-basis: clamp(120px, 30vw, 170px); }
/* Apps → Your sites: a chip per website, with × to forget it */
.sites-row { gap: 10px; }
.site-chip { flex: 0 0 auto; display: flex; align-items: center; border: 1px solid var(--line); border-radius: calc(100px * var(--round, 1)); background: var(--bg-card); }
.site-chip:hover { border-color: rgba(var(--accent-rgb), 0.45); }
.site-open { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 14px; background: none; border: 0; color: var(--text-main); font: 500 0.9rem inherit; cursor: pointer; }
.site-open img { width: 22px; height: 22px; border-radius: 5px; object-fit: contain; }
.site-x { display: grid; place-items: center; width: 32px; height: 32px; margin-right: 6px; border-radius: 50%; background: none; border: 0; color: var(--text-muted); cursor: pointer; }
.site-x:hover, .site-x:focus-visible { background: rgba(var(--accent-rgb), 0.14); color: var(--text-main); }
.site-x .material-symbols-outlined { font-size: 18px; }
.media-loading { grid-column: 1 / -1; text-align: center; color: var(--accent-cyan); padding: 30px 0; }
.games-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 10px; color: var(--text-muted); text-align: center; }
.games-empty .btn-outline { min-height: 44px; }

/* The star on a game card */
.fav-btn {
    position: absolute; top: 8px; right: 8px; z-index: 4; width: 38px; height: 38px; display: grid; place-items: center;
    border: 1px solid rgba(var(--ink-rgb),  0.14); border-radius: 50%; background: color-mix(in oklab, rgba(4, 6, 16, 0.62), rgba(255, 255, 255, 0.62) var(--bg-light, 0%)); color: rgba(var(--ink-rgb),  0.8);
    cursor: pointer; padding: 0; opacity: 0; transition: opacity 0.2s, transform 0.2s, color 0.2s;
}
.fav-btn .material-symbols-outlined { font-size: 1.25rem; }
.card:hover .fav-btn, .card:focus-within .fav-btn, .fav-btn.on, .fav-btn:focus-visible { opacity: 1; }
.fav-btn.on { color: color-mix(in oklab, #ffd34d, #000 var(--tx-dark, 0%)); border-color: rgba(255, 211, 77, 0.5); }
.fav-btn.on .material-symbols-outlined { font-variation-settings: "FILL" 1; }
.fav-btn:active { transform: scale(0.9); }
@media (hover: none) { .fav-btn { opacity: 1; } } /* phones: always there (no hover) */

/* Continue watching: remove button and "last watched" marks */
.cw-x {
    position: absolute; top: 8px; right: 8px; z-index: 4; width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
    border: 1px solid rgba(var(--ink-rgb),  0.14); border-radius: 50%; background: color-mix(in oklab, rgba(4, 6, 16, 0.7), rgba(255, 255, 255, 0.7) var(--bg-light, 0%)); color: #fff; cursor: pointer;
}
.cw-x .material-symbols-outlined { font-size: 1.1rem; }
.card.media-card .rating.cw-badge { color: var(--on-accent); background: var(--accent-cyan); border-color: transparent; }

/* Home search suggestions */
.home-suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 40; text-align: left;
    max-height: 380px; overflow-y: auto; overscroll-behavior: contain;
    padding: 6px; border-radius: calc(22px * var(--round, 1)); background: color-mix(in oklab, #080a16, var(--paper, #fff) var(--bg-light, 0%)); border: 1px solid var(--line-strong);
    box-shadow: 0 24px 60px rgba(0, 0, 0, calc(0.7 * var(--shadow-k, 1)));
}
.home-suggest[hidden] { display: none; }
.hs-item {
    width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border: none; border-radius: calc(14px * var(--round, 1));
    background: transparent; color: var(--text-main); font: 500 0.95rem var(--font-ui); cursor: pointer; text-align: left;
}
.hs-item:hover, .hs-item.on { background: rgba(var(--accent-rgb), 0.09); }
.hs-item img { width: 36px; height: 36px; border-radius: calc(9px * var(--round, 1)); object-fit: cover; flex: none; background: color-mix(in oklab, #111, var(--paper, #fff) var(--bg-light, 0%)); }
.hs-item > .material-symbols-outlined { width: 36px; text-align: center; color: var(--accent-cyan); flex: none; }
.hs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-item small { color: var(--text-muted); font-size: 0.72rem; flex: none; }
@media (max-width: 760px) {
    .home-suggest { top: 72px; } /* right under the text box, over the WARP button */
    .library-controls { flex-wrap: wrap; width: 100%; }
    .library-controls .library-search-wrapper { flex: 1 1 220px; }
}

/* Player: "not playing yet?" help, and a message when the player couldn't start */
.player-tip {
    position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
    display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 24px); padding: 10px 10px 10px 14px;
    border-radius: calc(18px * var(--round, 1)); background: color-mix(in oklab, rgba(10, 12, 26, 0.96), rgba(255, 255, 255, 0.96) var(--bg-light, 0%)); border: 1px solid rgba(var(--accent-rgb), 0.35); color: color-mix(in oklab, #d7f8ff, #000 var(--tx-dark, 0%));
    font: 500 0.85rem/1.35 var(--font-ui); box-shadow: 0 16px 40px rgba(0, 0, 0, calc(0.6 * var(--shadow-k, 1)));
}
.player-tip[hidden] { display: none; }
.player-tip > .material-symbols-outlined { color: var(--accent-cyan); flex: none; }
.player-tip-go { flex: none; min-height: 36px; padding: 0 14px; border: none; border-radius: calc(99px * var(--round, 1)); background: var(--accent-cyan); color: var(--on-accent); font: 700 0.8rem var(--font-ui); cursor: pointer; }
.player-tip-x { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: none; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
body.mu-has-bar .player-tip { bottom: 112px; }
@media (max-width: 760px) { body.mu-has-bar .player-tip { bottom: calc(84px + env(safe-area-inset-bottom)); } }
/* Downloading what's playing: a bubble with the progress (above everything, the player included) */
.dl-pill {
    position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9000;
    display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 24px); padding: 8px 8px 8px 14px;
    border-radius: calc(18px * var(--round, 1)); background: color-mix(in oklab, rgba(10, 12, 26, 0.97), rgba(255, 255, 255, 0.97) var(--bg-light, 0%)); border: 1px solid rgba(var(--accent-rgb), 0.35); color: color-mix(in oklab, #d7f8ff, #000 var(--tx-dark, 0%));
    font: 500 0.85rem/1.35 var(--font-ui); box-shadow: 0 16px 40px rgba(0, 0, 0, calc(0.6 * var(--shadow-k, 1)));
}
.dl-pill[hidden] { display: none; }
.dl-pill > .material-symbols-outlined { color: var(--accent-cyan); flex: none; }
.dl-pill .dl-bar { display: block; height: 4px; margin-top: 5px; border-radius: calc(4px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.12); overflow: hidden; }
.dl-pill .dl-bar[hidden] { display: none; }
.dl-pill .dl-bar i { display: block; height: 100%; width: 0; background: var(--accent-cyan); transition: width 0.3s; }
.dl-pill .dl-x { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: none; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
body.mu-has-bar .dl-pill { bottom: 112px; }
@media (max-width: 760px) { body.mu-has-bar .dl-pill { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.chrome-btn.busy { color: var(--accent-cyan); }
.player-msg { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; color: var(--text-muted); }
.player-msg .material-symbols-outlined { font-size: 2.4rem; color: var(--accent-cyan); }
.player-msg b { color: var(--text-main); font-size: 1.05rem; }
.request-note { margin: -10px 0 16px !important; color: color-mix(in oklab, #ffd38a, #000 var(--tx-dark, 0%)) !important; }

/* Phones: everything on the browser's and the player's top bars fits on screen (the player's Exit Feed
   shows just its icon, and the title shortens with "..."). */
@media (max-width: 560px) {
    .window-ui .window-chrome { padding: 8px 10px; gap: 6px; }
    .window-ui .chrome-controls { gap: 0; flex: none; }
    #btn-close-player { padding: 8px 10px !important; font-size: 0 !important; gap: 0; }
    #player-title { min-width: 0; display: block !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; letter-spacing: 0.5px !important; font-size: 0.8rem !important; }
}

/* ================= Themes (Config → Theme) =================
 * <html data-theme> picks a whole look; an accent colour (set as --accent-* on <html> by the script in
 * index.html's <head>) and a wallpaper (<html data-wall>) can go on top of any of them. Everything else
 * reads these variables, so a theme recolours the whole of Quasar. Nebula is the default (no attribute). */

/* Liquid Glass: frosted, lighter panels and an icy white accent. */
html[data-theme="glass"] {
    --bg-base: #070b18;
    --bg-card: #0d1326;
    --bg-panel: rgba(255, 255, 255, 0.06);
    --glass: rgba(255, 255, 255, 0.07);
    --glass-strong: rgba(24, 30, 52, 0.66);
    --line: rgba(255, 255, 255, 0.13);
    --line-strong: rgba(255, 255, 255, 0.26);
    --accent-cyan: #a9ecff;
    --accent-rgb: 169, 236, 255;
    --accent-soft: #dff7ff;
    --text-muted: #a4adc8;
    --text-dim: #6f7896;
    --blur-heavy: blur(36px) saturate(200%);
    --grad-accent: linear-gradient(115deg, #ffffff 0%, #a9ecff 45%, #c9b8ff 100%);
    --grad-text: linear-gradient(100deg, #ffffff 0%, #e6f9ff 35%, #a9ecff 60%, #d9ccff 80%, #ffffff 100%);
    --bubble: linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(190, 220, 255, 0.18));
}
html[data-theme="glass"] .fx-nebula i { opacity: 0.75; filter: blur(70px); }
html[data-theme="glass"] .fx-nebula i:nth-child(1) { background: radial-gradient(circle, rgba(110, 200, 255, 0.6), transparent 65%); }
html[data-theme="glass"] .fx-nebula i:nth-child(2) { background: radial-gradient(circle, rgba(190, 150, 255, 0.5), transparent 65%); }
html[data-theme="glass"] .fx-nebula i:nth-child(3) { background: radial-gradient(circle, rgba(120, 255, 220, 0.3), transparent 65%); }
html[data-theme="glass"] .qs-drawer, html[data-theme="glass"] .qs-modal-card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-float); }

/* Retro: an 80s synthwave sunset, hot pink and orange, a grid floor and chunky monospace headings. */
html[data-theme="retro"] {
    --bg-base: #0d0221;
    --bg-card: #160634;
    --bg-panel: rgba(32, 8, 64, 0.6);
    --glass: rgba(34, 8, 66, 0.6);
    --glass-strong: rgba(20, 4, 44, 0.92);
    --line: rgba(255, 79, 216, 0.17);
    --line-strong: rgba(255, 79, 216, 0.32);
    --accent-cyan: #ff4fd8;
    --accent-rgb: 255, 79, 216;
    --accent-soft: #ffb8f1;
    --accent-pink: #ffb347;
    --text-muted: #b99bd6;
    --text-dim: #7f66a0;
    --font-display: 'JetBrains Mono', ui-monospace, monospace;
    --grad-accent: linear-gradient(115deg, #ff4fd8 0%, #ff7a59 50%, #ffd23f 100%);
    --grad-text: linear-gradient(100deg, #ffffff 0%, #ffb8f1 30%, #ff4fd8 55%, #ffd23f 80%, #ffffff 100%);
    --bubble: linear-gradient(135deg, #ff4fd8, #ff7a59);
}
html[data-theme="retro"] .fx-nebula { background: linear-gradient(to bottom, #0d0221 0%, #1d0640 45%, #4a0f5c 68%, #a3236a 84%, #ff7a59 100%); }
html[data-theme="retro"] .fx-nebula i { display: none; }
html[data-theme="retro"] .fx-nebula::after {
    content: ''; position: absolute; left: 50%; bottom: 14vh; width: 44vmin; height: 44vmin; transform: translateX(-50%); border-radius: 50%;
    background: linear-gradient(to bottom, #ffe066 0%, #ff9a3d 45%, #ff4fd8 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 55% 59%, #000 59% 68%, transparent 68% 73%, #000 73% 81%, transparent 81% 87%, #000 87%); mask-image: linear-gradient(to bottom, #000 55%, transparent 55% 59%, #000 59% 68%, transparent 68% 73%, #000 73% 81%, transparent 81% 87%, #000 87%);
    box-shadow: 0 0 80px rgba(255, 79, 216, 0.45); opacity: 0.85;
}
html[data-theme="retro"]:not([data-fancy="low"]) .fx-grid {
    display: block; position: fixed; left: -50%; right: -50%; bottom: -12vh; height: 42vh; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(255, 79, 216, 0.55) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 79, 216, 0.45) 1px, transparent 1px);
    background-size: 64px 64px; background-color: rgba(13, 2, 33, 0.92);
    transform: perspective(380px) rotateX(64deg); transform-origin: 50% 100%;
    -webkit-mask-image: linear-gradient(to top, #000, transparent 85%); mask-image: linear-gradient(to top, #000, transparent 85%);
}
html[data-theme="retro"][data-fancy="high"] .fx-grid { animation: gridRun 3.2s linear infinite; }
html[data-theme="retro"][data-fancy="low"] .fx-nebula::after { display: none; }

/* OLED black: pure black everywhere, no glow or blur (saves battery on phones with OLED screens). */
html[data-theme="oled"] {
    --bg-base: #000;
    --bg-card: #000;
    --bg-panel: #000;
    --glass: #050506;
    --glass-strong: #000;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.2);
    --blur-heavy: none;
    --shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
html[data-theme="oled"] .fx-nebula { background: #000 !important; }
html[data-theme="oled"] .fx-nebula i, html[data-theme="oled"] .fx-grid, html[data-theme="oled"] .fx-spot { display: none !important; }
html[data-theme="oled"] .qs-drawer::before { display: none; }

/* Wallpapers: replace the theme's backdrop (the stars stay on top, except on Low). */
html[data-wall] .fx-nebula i, html[data-wall] .fx-nebula::after { display: none !important; }
html[data-wall="aurora"] .fx-nebula { background: radial-gradient(ellipse at 20% 10%, rgba(40, 255, 190, 0.28), transparent 50%), radial-gradient(ellipse at 80% 30%, rgba(80, 120, 255, 0.3), transparent 55%), linear-gradient(170deg, #020a14 0%, #04203a 55%, #063d3a 100%) !important; }
html[data-wall="sunset"] .fx-nebula { background: linear-gradient(180deg, #120724 0%, #3d1450 40%, #a33a5c 75%, #f08a4b 100%) !important; }
html[data-wall="ocean"] .fx-nebula { background: radial-gradient(ellipse at 50% 120%, rgba(0, 170, 255, 0.35), transparent 60%), linear-gradient(180deg, #01060f 0%, #03203f 55%, #064a73 100%) !important; }
html[data-wall="forest"] .fx-nebula { background: radial-gradient(ellipse at 30% 0%, rgba(140, 255, 150, 0.14), transparent 55%), linear-gradient(170deg, #030a06 0%, #0b2416 55%, #17442a 100%) !important; }
html[data-wall="candy"] .fx-nebula { background: radial-gradient(circle at 15% 20%, rgba(255, 140, 220, 0.4), transparent 45%), radial-gradient(circle at 85% 75%, rgba(140, 200, 255, 0.35), transparent 45%), linear-gradient(135deg, #2a0b40 0%, #4d1a6e 50%, #6b2a7a 100%) !important; }
html[data-wall="ember"] .fx-nebula { background: radial-gradient(ellipse at 50% 115%, rgba(255, 90, 40, 0.5), transparent 60%), linear-gradient(180deg, #080202 0%, #1f0705 60%, #3a0d06 100%) !important; }
html[data-wall="midnight"] .fx-nebula { background: radial-gradient(ellipse at 50% -10%, #1d2748 0%, #070912 60%, #020205 100%) !important; }
html[data-wall="mono"] .fx-nebula { background: linear-gradient(180deg, #0c0c0d 0%, #18181b 100%) !important; }

html[data-wall] .fx-nebula::before { display: none !important; }
html[data-wall="galaxy"] .fx-nebula { background: radial-gradient(ellipse at 30% 40%, rgba(120, 80, 255, 0.45), transparent 50%), radial-gradient(ellipse at 70% 60%, rgba(255, 70, 190, 0.3), transparent 45%), radial-gradient(circle at 50% 50%, #1a1040 0%, #05030f 70%) !important; }
html[data-wall="dusk"] .fx-nebula { background: linear-gradient(180deg, #1b1537 0%, #4b3a7a 45%, #c27aa0 78%, #f4b183 100%) !important; }
html[data-wall="lava"] .fx-nebula { background: radial-gradient(ellipse at 30% 110%, rgba(255, 120, 0, 0.55), transparent 55%), radial-gradient(ellipse at 80% 100%, rgba(255, 40, 60, 0.45), transparent 50%), linear-gradient(180deg, #0c0202, #2a0605) !important; }
html[data-wall="storm"] .fx-nebula { background: radial-gradient(ellipse at 60% -10%, rgba(160, 190, 230, 0.25), transparent 55%), linear-gradient(180deg, #11161f 0%, #1f2836 55%, #2c3748 100%) !important; }
html[data-wall="paper"] .fx-nebula { background: radial-gradient(ellipse at 50% 0%, #fffdf7, transparent 70%), linear-gradient(180deg, #f6f1e7, #ece3d2) !important; }
html[data-wall="cloud"] .fx-nebula { background: radial-gradient(ellipse at 20% 20%, #ffffff, transparent 55%), radial-gradient(ellipse at 80% 70%, #dfefff, transparent 55%), linear-gradient(180deg, #e9f3ff, #cfe3fb) !important; }
html[data-wall="peach"] .fx-nebula { background: radial-gradient(ellipse at 80% 10%, #fff3e6, transparent 55%), linear-gradient(160deg, #ffe1d1 0%, #ffc7c2 55%, #f6b6d2 100%) !important; }
html[data-wall="meadow"] .fx-nebula { background: radial-gradient(ellipse at 50% -10%, #fbfff2, transparent 60%), linear-gradient(180deg, #e6f6dc 0%, #c8eab8 60%, #a9d99a 100%) !important; }

/* ================= Light tone (Daylight, Pastel) =================
 * The dials from :root turned the other way: tints become ink, sunken surfaces become white, shadows soften,
 * neon text darkens and near-black surfaces turn to paper. */
html[data-tone="light"] {
    color-scheme: light;
    --ink-rgb: 22, 26, 48;
    --shade-rgb: 255, 255, 255;
    --shadow-k: 0.22;
    --tx-dark: 50%;
    --bg-light: 94%;
    --paper: #fff;
    --on-accent: #fff;
    --bubble-text: #fff;
    --term-bg: #fbfcfe;
}
html[data-tone="light"] #fx-stars { mix-blend-mode: multiply; }
html[data-tone="light"]:not([data-fancy="low"]) h1 { filter: none; }
html[data-tone="light"] .fx-grid { display: none !important; }
html[data-tone="light"] .quasar { opacity: 0.55; mix-blend-mode: multiply; filter: saturate(1.3); }
html[data-tone="light"] body::after { opacity: 0.5; }
html[data-tone="light"] select.library-search { background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>'); }
html[data-tone="light"] .card.game-card .info, html[data-tone="light"] .card.app-card .info, html[data-tone="light"] .card.media-card .info { color: #fff; }
html[data-tone="light"] ::selection { background: rgba(var(--accent-rgb), 0.22); }

/* Daylight: crisp, airy and white, like a phone's light mode. */
html[data-theme="light"] {
    --bg-base: #eef2f9;
    --bg-card: #ffffff;
    --bg-panel: rgba(255, 255, 255, 0.74);
    --glass: rgba(255, 255, 255, 0.72);
    --glass-strong: rgba(255, 255, 255, 0.94);
    --line: rgba(22, 26, 48, 0.1);
    --line-strong: rgba(22, 26, 48, 0.18);
    --accent-cyan: #0a72f0;
    --accent-rgb: 10, 114, 240;
    --accent-soft: #0757b8;
    --accent-blue: #2f6bff;
    --accent-violet: #7b4dff;
    --accent-pink: #e0338a;
    --text-main: #111827;
    --text-muted: #4b5568;
    --text-dim: #7b8498;
    --grad-accent: linear-gradient(115deg, #0a72f0 0%, #5b5cff 55%, #c13aa0 100%);
    --grad-text: linear-gradient(100deg, #0f172a 0%, #1d3a8a 35%, var(--accent-cyan) 60%, #6a3df0 85%, #0f172a 100%);
    --bubble: linear-gradient(135deg, #0a72f0, #4f8dff);
    --shadow-float: 0 24px 60px rgba(30, 40, 80, 0.13), 0 0 0 1px rgba(22, 26, 48, 0.05);
    --blur-heavy: blur(24px) saturate(180%);
}
html[data-theme="light"] .fx-nebula { background: linear-gradient(180deg, #f6f8fc 0%, #e8eef8 100%); }
html[data-theme="light"] .fx-nebula i { opacity: 0.55; filter: blur(80px); }
html[data-theme="light"] .fx-nebula i:nth-child(1) { background: radial-gradient(circle, rgba(120, 180, 255, 0.55), transparent 65%); }
html[data-theme="light"] .fx-nebula i:nth-child(2) { background: radial-gradient(circle, rgba(190, 160, 255, 0.45), transparent 65%); }
html[data-theme="light"] .fx-nebula i:nth-child(3) { background: radial-gradient(circle, rgba(255, 190, 220, 0.4), transparent 65%); }

/* Pastel: soft pink, lilac and mint, round and bubbly. */
html[data-theme="pastel"] {
    --bg-base: #fff1f7;
    --bg-card: #ffffff;
    --bg-panel: rgba(255, 255, 255, 0.7);
    --glass: rgba(255, 255, 255, 0.68);
    --glass-strong: rgba(255, 250, 253, 0.94);
    --line: rgba(150, 70, 130, 0.13);
    --line-strong: rgba(150, 70, 130, 0.24);
    --ink-rgb: 90, 40, 90;
    --accent-cyan: #e2468f;
    --accent-rgb: 226, 70, 143;
    --accent-soft: #b8326f;
    --accent-blue: #6f9cff;
    --accent-violet: #a678ff;
    --accent-pink: #ff8fb8;
    --text-main: #3d2340;
    --text-muted: #85638a;
    --text-dim: #b096b4;
    --font-ui: 'Nunito', 'Inter', system-ui, sans-serif;
    --font-display: 'Fredoka', 'Nunito', sans-serif;
    --round: 1.4;
    --grad-accent: linear-gradient(115deg, #ff8fb8 0%, #c79bff 50%, #7fd6c2 100%);
    --grad-text: linear-gradient(100deg, #e2468f 0%, #b06cff 45%, #48b5a0 80%, #e2468f 100%);
    --bubble: linear-gradient(135deg, #ff8fb8, #c79bff);
    --shadow-float: 0 22px 50px rgba(226, 70, 143, 0.16), 0 0 0 1px rgba(150, 70, 130, 0.05);
    --blur-heavy: blur(22px) saturate(160%);
}
html[data-theme="pastel"] .fx-nebula { background: linear-gradient(160deg, #fff4f9 0%, #fbeaff 50%, #e9fbf5 100%); }
html[data-theme="pastel"] .fx-nebula i { opacity: 0.6; filter: blur(70px); }
html[data-theme="pastel"] .fx-nebula i:nth-child(1) { background: radial-gradient(circle, rgba(255, 170, 205, 0.7), transparent 65%); }
html[data-theme="pastel"] .fx-nebula i:nth-child(2) { background: radial-gradient(circle, rgba(200, 170, 255, 0.6), transparent 65%); }
html[data-theme="pastel"] .fx-nebula i:nth-child(3) { background: radial-gradient(circle, rgba(150, 235, 210, 0.55), transparent 65%); }
html[data-theme="pastel"]:not([data-fancy="low"]) .card:hover, html[data-theme="pastel"]:not([data-fancy="low"]) .top-btn:hover { transition-timing-function: cubic-bezier(0.34, 1.7, 0.5, 1); }
html[data-theme="pastel"] h1, html[data-theme="pastel"] h2, html[data-theme="pastel"] h3 { letter-spacing: 0.02em; }

/* ================= Dark themes ================= */

/* Hacker: green phosphor on black, square corners, monospace everything, scanlines and digital rain. */
html[data-theme="hacker"] {
    --bg-base: #000a03;
    --bg-card: #021006;
    --bg-panel: rgba(0, 18, 7, 0.84);
    --glass: rgba(0, 20, 8, 0.8);
    --glass-strong: rgba(0, 12, 4, 0.96);
    --line: rgba(0, 255, 102, 0.16);
    --line-strong: rgba(0, 255, 102, 0.34);
    --ink-rgb: 120, 255, 160;
    --accent-cyan: #00ff66;
    --accent-rgb: 0, 255, 102;
    --accent-soft: #9dffc0;
    --accent-blue: #00e676;
    --accent-violet: #00c853;
    --accent-pink: #b9ff5c;
    --text-main: #c8ffd8;
    --text-muted: #52d681;
    --text-dim: #2d8f50;
    --font-ui: 'JetBrains Mono', ui-monospace, monospace;
    --font-display: 'VT323', 'JetBrains Mono', monospace;
    --round: 0;
    --grad-accent: linear-gradient(115deg, #00ff66 0%, #00c853 100%);
    --grad-text: linear-gradient(100deg, #e0ffe9 0%, #00ff66 50%, #9dffc0 100%);
    --bubble: linear-gradient(135deg, #00c853, #008f3a);
    --bubble-text: #001a08;
    --on-accent: #001a08;
    --shadow-float: 0 0 0 1px rgba(0, 255, 102, 0.22), 0 0 40px rgba(0, 255, 102, 0.08);
    --blur-heavy: blur(6px);
}
html[data-theme="hacker"] .fx-nebula { background: radial-gradient(ellipse at 50% 40%, rgba(0, 90, 30, 0.35), transparent 60%), #000a03; }
html[data-theme="hacker"] .fx-nebula i, html[data-theme="hacker"] .fx-grid, html[data-theme="hacker"] .quasar { display: none !important; }
html[data-theme="hacker"] body::after { background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px); opacity: 1; z-index: 9998; }
html[data-theme="hacker"]:not([data-fancy="low"]) h1 { filter: none; text-shadow: 0 0 18px rgba(0, 255, 102, 0.55); }
html[data-theme="hacker"] h1, html[data-theme="hacker"] .launch-text h1 { font-weight: 400; letter-spacing: 0.12em; }
html[data-theme="hacker"] h1 { font-size: clamp(3.6rem, 13vw, 7.5rem); }
html[data-theme="hacker"] .desc::after { content: "_"; margin-left: 2px; animation: hkBlink 1s steps(1) infinite; color: var(--accent-cyan); }
html[data-theme="hacker"] .top-btn, html[data-theme="hacker"] .btn-outline, html[data-theme="hacker"] button[type="submit"] { text-transform: uppercase; letter-spacing: 0.08em; }
@keyframes hkBlink { 50% { opacity: 0; } }

/* Cozy: a warm cabin at night. Wood, cream and lamplight, serif headings and drifting fireflies. */
html[data-theme="cozy"] {
    --bg-base: #17100c;
    --bg-card: #21170f;
    --bg-panel: rgba(42, 28, 19, 0.74);
    --glass: rgba(46, 31, 21, 0.7);
    --glass-strong: rgba(30, 20, 14, 0.95);
    --line: rgba(255, 205, 160, 0.12);
    --line-strong: rgba(255, 205, 160, 0.23);
    --ink-rgb: 255, 232, 205;
    --accent-cyan: #ffb15c;
    --accent-rgb: 255, 177, 92;
    --accent-soft: #ffd9ae;
    --accent-blue: #8fbf8f;
    --accent-violet: #c9a26b;
    --accent-pink: #e07a5f;
    --text-main: #f7ecdd;
    --text-muted: #c6ab8f;
    --text-dim: #8d755f;
    --font-ui: 'Nunito', 'Inter', system-ui, sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
    --round: 1.15;
    --grad-accent: linear-gradient(115deg, #ffcf8a 0%, #ffb15c 45%, #e07a5f 100%);
    --grad-text: linear-gradient(100deg, #fff4e3 0%, #ffd9ae 40%, #ffb15c 70%, #fff4e3 100%);
    --bubble: linear-gradient(135deg, #e8975a, #b8613f);
    --bubble-text: #fff8ef;
    --on-accent: #2a1606;
    --shadow-float: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 205, 160, 0.04);
}
html[data-theme="cozy"] .fx-nebula { background: radial-gradient(ellipse at 50% 115%, rgba(255, 150, 60, 0.28), transparent 55%), radial-gradient(ellipse at 15% 10%, rgba(255, 210, 150, 0.08), transparent 45%), linear-gradient(180deg, #120c09 0%, #1d130d 60%, #24170e 100%); }
html[data-theme="cozy"] .fx-nebula i { opacity: 0.35; }
html[data-theme="cozy"] .fx-nebula i:nth-child(1) { background: radial-gradient(circle, rgba(255, 170, 80, 0.45), transparent 65%); }
html[data-theme="cozy"] .fx-nebula i:nth-child(2) { background: radial-gradient(circle, rgba(200, 120, 70, 0.4), transparent 65%); }
html[data-theme="cozy"] .fx-nebula i:nth-child(3) { background: radial-gradient(circle, rgba(140, 180, 120, 0.2), transparent 65%); }
html[data-theme="cozy"] .fx-grid { display: none !important; }
html[data-theme="cozy"] .quasar { filter: sepia(0.6) saturate(1.4) hue-rotate(-12deg); opacity: 0.8; }
html[data-theme="cozy"]:not([data-fancy="low"]) h1 { filter: drop-shadow(0 0 28px rgba(255, 160, 70, 0.35)); }
html[data-theme="cozy"] h1 { font-weight: 800; letter-spacing: 0.06em; }

/* Deep Ocean: deep blue water, light rays from the surface and rising bubbles. */
html[data-theme="ocean"] {
    --bg-base: #010d18;
    --bg-card: #04192a;
    --bg-panel: rgba(3, 28, 46, 0.6);
    --glass: rgba(4, 32, 52, 0.56);
    --glass-strong: rgba(2, 20, 34, 0.9);
    --line: rgba(120, 220, 255, 0.12);
    --line-strong: rgba(120, 220, 255, 0.23);
    --accent-cyan: #2ee6d6;
    --accent-rgb: 46, 230, 214;
    --accent-soft: #a8fff6;
    --accent-blue: #3d8bff;
    --accent-violet: #2b6bff;
    --accent-pink: #4fc3ff;
    --text-main: #e4f7ff;
    --text-muted: #80b5cc;
    --text-dim: #4d7c91;
    --grad-accent: linear-gradient(115deg, #2ee6d6 0%, #3d8bff 60%, #2b5bff 100%);
    --grad-text: linear-gradient(100deg, #ffffff 0%, #c8fbff 30%, #2ee6d6 60%, #3d8bff 85%, #ffffff 100%);
    --bubble: linear-gradient(135deg, #18b6c9, #2f6fe0);
}
html[data-theme="ocean"] .fx-nebula { background: linear-gradient(180deg, #06395a 0%, #032540 30%, #011526 65%, #000a14 100%); }
html[data-theme="ocean"] .fx-nebula i { display: none; }
html[data-theme="ocean"] .fx-grid { display: none !important; }
/* light rays from the surface */
html[data-theme="ocean"] .fx-nebula::before {
    content: ""; position: absolute; left: -20%; right: -20%; top: -10%; height: 90%;
    background: repeating-conic-gradient(from 168deg at 50% -8%, rgba(160, 240, 255, 0.11) 0deg 2.2deg, transparent 2.2deg 7deg);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%); mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
    transform-origin: 50% 0;
}
html[data-theme="ocean"][data-fancy="high"] .fx-nebula::before { animation: oceanSway 14s ease-in-out infinite alternate; }
html[data-theme="ocean"] .fx-nebula::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% -10%, rgba(120, 230, 255, 0.28), transparent 50%);
}
html[data-theme="ocean"] .quasar { filter: hue-rotate(-20deg) saturate(1.2); }
@keyframes oceanSway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* ================= Seasons: one theme, six times of year (picked by hand in Config) ================= */
html[data-theme="seasons"] {
    --font-display: 'Fraunces', Georgia, serif;
    --round: 1.1;
}
html[data-theme="seasons"] h1 { font-weight: 800; letter-spacing: 0.06em; }
html[data-theme="seasons"] .fx-grid { display: none !important; }
html[data-theme="seasons"] .fx-nebula i { display: none; }
html[data-theme="seasons"] .fx-nebula::before, html[data-theme="seasons"] .fx-nebula::after { content: ""; position: absolute; pointer-events: none; }

/* Winter: a snowy night, icy blue. */
html[data-season="winter"] {
    --bg-base: #0a1322; --bg-card: #0f1b2e; --bg-panel: rgba(16, 30, 52, 0.62); --glass: rgba(18, 34, 58, 0.58); --glass-strong: rgba(10, 20, 36, 0.92);
    --line: rgba(190, 225, 255, 0.13); --line-strong: rgba(190, 225, 255, 0.24);
    --accent-cyan: #9fd8ff; --accent-rgb: 159, 216, 255; --accent-soft: #e1f4ff; --accent-pink: #c6b6ff; --accent-violet: #8aa8ff; --accent-blue: #6fb6ff;
    --text-main: #eef6ff; --text-muted: #93a9c4; --text-dim: #5e7590;
    --grad-accent: linear-gradient(115deg, #e1f4ff 0%, #9fd8ff 50%, #c6b6ff 100%);
    --grad-text: linear-gradient(100deg, #ffffff 0%, #e1f4ff 40%, #9fd8ff 70%, #ffffff 100%);
    --bubble: linear-gradient(135deg, #6fb6ff, #8a8cff);
}
html[data-season="winter"] .fx-nebula { background: linear-gradient(180deg, #050b16 0%, #0b1a30 55%, #1b3150 100%); }
html[data-season="winter"] .fx-nebula::after { left: -10%; right: -10%; bottom: 0; height: 26vh;
    background: radial-gradient(ellipse at 25% 100%, #dfeeff 0 38%, transparent 39%), radial-gradient(ellipse at 75% 100%, #cfe2fa 0 42%, transparent 43%); opacity: 0.16; }

/* Spring: a lavender evening and falling blossom. */
html[data-season="spring"] {
    --bg-base: #161023; --bg-card: #1e1630; --bg-panel: rgba(36, 26, 56, 0.62); --glass: rgba(40, 28, 60, 0.58); --glass-strong: rgba(24, 16, 38, 0.93);
    --line: rgba(255, 190, 225, 0.13); --line-strong: rgba(255, 190, 225, 0.25);
    --accent-cyan: #ffa6c9; --accent-rgb: 255, 166, 201; --accent-soft: #ffe0ec; --accent-pink: #9be37a; --accent-violet: #c9a6ff; --accent-blue: #8fd0ff;
    --text-main: #fff2f8; --text-muted: #c4a9c8; --text-dim: #85698c;
    --grad-accent: linear-gradient(115deg, #ffd1e3 0%, #ffa6c9 45%, #9be37a 100%);
    --grad-text: linear-gradient(100deg, #ffffff 0%, #ffd1e3 40%, #ffa6c9 65%, #c9f5b0 90%);
    --bubble: linear-gradient(135deg, #f58bb6, #b07ae8); --on-accent: #2a0d1c;
}
html[data-season="spring"] .fx-nebula { background: radial-gradient(ellipse at 50% 120%, rgba(255, 170, 200, 0.35), transparent 60%), linear-gradient(180deg, #120c1f 0%, #241838 55%, #3d2550 100%); }

/* Summer: a warm sunset over the sea, with fireflies. */
html[data-season="summer"] {
    --bg-base: #1a0d14; --bg-card: #24121b; --bg-panel: rgba(48, 22, 32, 0.6); --glass: rgba(52, 24, 34, 0.56); --glass-strong: rgba(30, 14, 20, 0.93);
    --line: rgba(255, 205, 150, 0.13); --line-strong: rgba(255, 205, 150, 0.25);
    --accent-cyan: #ffcc4d; --accent-rgb: 255, 204, 77; --accent-soft: #ffe9b0; --accent-pink: #ff6b6b; --accent-violet: #ff8f5a; --accent-blue: #4fc3ff;
    --text-main: #fff4e6; --text-muted: #d3a99a; --text-dim: #93695e;
    --grad-accent: linear-gradient(115deg, #ffe066 0%, #ff9f43 50%, #ff6b6b 100%);
    --grad-text: linear-gradient(100deg, #ffffff 0%, #ffe9b0 35%, #ffcc4d 60%, #ff8f5a 85%);
    --bubble: linear-gradient(135deg, #ff9f43, #ff6b6b); --on-accent: #2a1200;
}
html[data-season="summer"] .fx-nebula { background: linear-gradient(180deg, #1a0b1e 0%, #4a1630 40%, #b0413e 68%, #f39c4a 82%, #0f2a44 82.3%, #081726 100%); }
html[data-season="summer"] .fx-nebula::after { left: 50%; top: 82%; width: 34vmin; height: 34vmin; transform: translate(-50%, -50%); border-radius: 50%;
    background: radial-gradient(circle, #ffe08a 0 45%, rgba(255, 190, 90, 0.4) 55%, transparent 70%);
    -webkit-mask-image: linear-gradient(#000 50%, transparent 50%); mask-image: linear-gradient(#000 50%, transparent 50%); }

/* Autumn: amber dusk and falling leaves. */
html[data-season="autumn"] {
    --bg-base: #160c06; --bg-card: #20120a; --bg-panel: rgba(44, 24, 12, 0.66); --glass: rgba(48, 26, 13, 0.6); --glass-strong: rgba(28, 15, 8, 0.94);
    --line: rgba(255, 180, 120, 0.13); --line-strong: rgba(255, 180, 120, 0.25);
    --accent-cyan: #ff8a3d; --accent-rgb: 255, 138, 61; --accent-soft: #ffcca8; --accent-pink: #d9452b; --accent-violet: #c9a227; --accent-blue: #b5c94a;
    --text-main: #fbeee0; --text-muted: #c69c7a; --text-dim: #8a6648;
    --grad-accent: linear-gradient(115deg, #ffc145 0%, #ff8a3d 50%, #d9452b 100%);
    --grad-text: linear-gradient(100deg, #fff6ea 0%, #ffd08a 35%, #ff8a3d 65%, #d9452b 90%);
    --bubble: linear-gradient(135deg, #e5782f, #b5401f); --on-accent: #2a0f00;
}
html[data-season="autumn"] .fx-nebula { background: radial-gradient(ellipse at 50% 120%, rgba(255, 120, 40, 0.3), transparent 60%), linear-gradient(180deg, #0f0804 0%, #241207 60%, #3a1a08 100%); }

/* Spooky: a purple night, a huge moon and fog. */
html[data-season="spooky"] {
    --bg-base: #0d0716; --bg-card: #150b22; --bg-panel: rgba(28, 14, 44, 0.66); --glass: rgba(30, 15, 48, 0.6); --glass-strong: rgba(16, 8, 28, 0.94);
    --line: rgba(200, 150, 255, 0.13); --line-strong: rgba(200, 150, 255, 0.25);
    --accent-cyan: #ff7a1a; --accent-rgb: 255, 122, 26; --accent-soft: #ffc28f; --accent-pink: #9b5cff; --accent-violet: #6b3bd6; --accent-blue: #7dff6a;
    --text-main: #f3e8ff; --text-muted: #a690c2; --text-dim: #6c5788;
    --grad-accent: linear-gradient(115deg, #ffb347 0%, #ff7a1a 50%, #9b5cff 100%);
    --grad-text: linear-gradient(100deg, #fff1e0 0%, #ffb347 35%, #ff7a1a 60%, #b98cff 90%);
    --bubble: linear-gradient(135deg, #ff7a1a, #9b3bd6); --on-accent: #1a0800;
}
html[data-season="spooky"] .fx-nebula { background: radial-gradient(circle at 78% 22%, rgba(255, 240, 210, 0.9) 0 7vmin, rgba(255, 200, 120, 0.25) 9vmin, transparent 22vmin), linear-gradient(180deg, #07030e 0%, #1a0b2e 60%, #2a1240 100%); }
html[data-season="spooky"] .fx-nebula::after { left: -20%; right: -20%; bottom: -5vh; height: 40vh; filter: blur(30px);
    background: radial-gradient(ellipse at 30% 70%, rgba(190, 160, 230, 0.22), transparent 60%), radial-gradient(ellipse at 75% 80%, rgba(190, 160, 230, 0.18), transparent 60%); }
html[data-season="spooky"][data-fancy="high"] .fx-nebula::after { animation: fogDrift 22s ease-in-out infinite alternate; }
@keyframes fogDrift { to { transform: translateX(8vw); } }

/* Festive: deep pine green and berry red, snow and twinkling lights. */
html[data-season="festive"] {
    --bg-base: #0b1610; --bg-card: #102018; --bg-panel: rgba(18, 40, 28, 0.64); --glass: rgba(20, 44, 30, 0.58); --glass-strong: rgba(10, 24, 16, 0.94);
    --line: rgba(255, 215, 150, 0.13); --line-strong: rgba(255, 215, 150, 0.25);
    --accent-cyan: #ff4d5e; --accent-rgb: 255, 77, 94; --accent-soft: #ffc0c7; --accent-pink: #3ddc84; --accent-violet: #ffd76b; --accent-blue: #3ddc84;
    --text-main: #fff6f0; --text-muted: #b6c9b9; --text-dim: #6f8a76;
    --grad-accent: linear-gradient(115deg, #ff4d5e 0%, #ffd76b 50%, #3ddc84 100%);
    --grad-text: linear-gradient(100deg, #ffffff 0%, #ffd76b 35%, #ff4d5e 60%, #3ddc84 90%);
    --bubble: linear-gradient(135deg, #e63946, #b5172b); --on-accent: #fff;
}
html[data-season="festive"] .fx-nebula { background: radial-gradient(ellipse at 50% 120%, rgba(255, 80, 90, 0.22), transparent 60%), linear-gradient(180deg, #06100a 0%, #0d2216 60%, #14301f 100%); }
/* a string of lights across the top */
html[data-season="festive"] .fx-nebula::after { left: 0; right: 0; top: 0; height: 40px;
    background: radial-gradient(circle at 50% 70%, var(--bulb, #ff4d5e) 0 4px, transparent 9px) 0 0 / 46px 40px,
                radial-gradient(circle at 50% 70%, #ffd76b 0 4px, transparent 9px) 23px 6px / 46px 40px;
    background-repeat: repeat-x; filter: drop-shadow(0 0 6px rgba(255, 210, 120, 0.8)); }
html[data-season="festive"][data-fancy="high"] .fx-nebula::after { animation: bulbs 1.6s steps(2) infinite; }
@keyframes bulbs { 50% { --bulb: #3ddc84; opacity: 0.75; } }

/* ================= The Theme section in Config ================= */
.theme-sub { margin: 16px 0 8px; font: 500 0.66rem var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.theme-sub .theme-now { margin-left: auto; letter-spacing: 0.06em; text-transform: none; font: 600 0.74rem var(--font-ui); color: var(--text-main); }
.theme-tools { display: flex; gap: 8px; margin: 2px 0 12px; }
.theme-tools button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb), 0.04); color: var(--text-main); font: 600 0.8rem var(--font-ui); cursor: pointer; transition: background 0.15s, transform 0.15s; }
.theme-tools button:hover { background: rgba(var(--ink-rgb), 0.09); }
.theme-tools button:active { transform: scale(0.97); }
.theme-tools .material-symbols-outlined { font-size: 1.1rem; }

.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.theme-picker button { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 6px 9px; border-radius: calc(16px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb), 0.03); color: var(--text-main); font: 700 0.82rem var(--font-ui); text-align: left; cursor: pointer; transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s; }
.theme-picker button:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), 0.5); }
.theme-picker button small { display: block; padding: 0 4px; font-weight: 500; font-size: 0.68rem; color: var(--text-muted); }
.theme-picker button > span.theme-name { padding: 2px 4px 0; display: flex; align-items: center; gap: 6px; }
.theme-picker button.on { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.35); }
.theme-picker button.on .theme-name::after { content: "check_circle"; font-family: "Material Symbols Outlined"; font-size: 1rem; margin-left: auto; color: var(--accent-cyan); font-variation-settings: "FILL" 1; }
/* a tiny Quasar window in the theme's own colours (set as variables on the button by fx.js) */
.theme-mini { position: relative; display: block; width: 100%; height: 84px; border-radius: calc(11px * var(--round, 1)); overflow: hidden; background: var(--m-bg); border: 1px solid rgba(var(--ink-rgb), 0.08); }
.theme-mini .m-win { position: absolute; left: 12%; right: 12%; top: 22%; bottom: 14%; border-radius: var(--m-r); background: var(--m-panel); border: 1px solid var(--m-line); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.theme-mini .m-title { font: 800 0.8rem var(--m-font); color: var(--m-text); letter-spacing: 0.12em; line-height: 1; }
.theme-mini .m-row { display: flex; gap: 4px; align-items: center; }
.theme-mini .m-bar { width: 44px; height: 7px; border-radius: var(--m-r); background: var(--m-line); }
.theme-mini .m-btn { width: 18px; height: 7px; border-radius: var(--m-r); background: var(--m-accent); box-shadow: 0 0 8px var(--m-accent); }
.theme-mini .m-top { position: absolute; left: 0; right: 0; top: 0; height: 13%; display: flex; gap: 3px; padding: 4px 6px; }
.theme-mini .m-top i { width: 4px; height: 4px; border-radius: 50%; background: var(--m-muted); opacity: 0.7; }
.theme-mini .m-fx { position: absolute; inset: 0; pointer-events: none; }
.theme-mini .m-fx b { position: absolute; width: var(--s, 3px); height: var(--s, 3px); border-radius: 50%; background: var(--m-fx); opacity: 0.85; }
html:not([data-fancy="low"]) .theme-picker button:hover .m-fx b, html:not([data-fancy="low"]) .theme-picker button.on .m-fx b { animation: miniFall 2.4s linear infinite; animation-delay: var(--d, 0s); }
@keyframes miniFall { from { transform: translateY(-14px); opacity: 0; } 20% { opacity: 0.9; } to { transform: translateY(70px); opacity: 0; } }
.theme-mini.rise .m-fx b { top: auto !important; bottom: -4px; }
html:not([data-fancy="low"]) .theme-picker button:hover .theme-mini.rise .m-fx b, html:not([data-fancy="low"]) .theme-picker button.on .theme-mini.rise .m-fx b { animation-name: miniRise; }
@keyframes miniRise { from { transform: translateY(0); opacity: 0; } 20% { opacity: 0.9; } to { transform: translateY(-80px); opacity: 0; } }
.theme-new { position: absolute; top: 10px; right: 10px; z-index: 1; padding: 2px 7px; border-radius: 99px; background: var(--accent-cyan); color: var(--on-accent); font: 800 0.56rem var(--font-ui); letter-spacing: 0.08em; }

.season-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.season-picker[hidden] { display: none; }
.season-picker button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: calc(99px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb), 0.04); color: var(--text-main); font: 600 0.78rem var(--font-ui); cursor: pointer; }
.season-picker button .material-symbols-outlined { font-size: 1.05rem; }
.season-picker button.on { border-color: var(--accent-cyan); background: rgba(var(--accent-rgb), 0.16); }

.accent-picker, .wall-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-picker button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.15); transition: transform 0.15s; }
.accent-picker button:hover { transform: scale(1.12); }
.accent-picker button.auto { background: conic-gradient(#00f0ff, #9b5cff, #ff3fd2, #ffd76b, #3dffa8, #00f0ff); }
.accent-picker button.on { border-color: var(--text-main); box-shadow: 0 0 0 3px rgba(var(--ink-rgb), 0.18); }
.wall-picker button { width: 64px; height: 44px; border-radius: calc(10px * var(--round, 1)); border: 2px solid transparent; cursor: pointer; background: var(--sw); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); font: 600 0.62rem var(--font-ui); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.12); transition: transform 0.15s; }
.wall-picker button.light { color: #1d2233; text-shadow: none; }
.wall-picker button:hover { transform: translateY(-2px); }
.wall-picker button.on { border-color: var(--accent-cyan); }
@media (max-width: 520px) {
    .theme-picker { grid-template-columns: 1fr 1fr; gap: 8px; }
    .theme-mini { height: 62px; }
    .theme-mini .m-title { font-size: 0.6rem; }
    .theme-mini .m-bar { width: 30px; }
    .theme-picker button small { font-size: 0.64rem; }
}
html[data-theme="hacker"] button[type="submit"] { font-family: var(--font-ui); }

/* How many games there are, next to the Games title */
.games-count { align-self: center; padding: 4px 12px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.35); color: var(--accent-cyan); font: 700 0.95rem var(--font-ui); letter-spacing: 0.02em; white-space: nowrap; }
.games-count[hidden] { display: none; }
@media (max-width: 760px) { .games-count { font-size: 0.75rem; padding: 3px 9px; } }

/* Config → Instant Play */
.instant-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 0.9rem; }

/* ================= Config: a tabbed window ================= */
.modal-content.config-shell { width: min(820px, 100%); max-width: 820px; height: min(720px, calc(100dvh - 32px)); padding: 0; overflow: hidden; text-align: left; align-content: stretch; justify-content: stretch; }
.config-shell .cfg-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px 26px; border-bottom: 1px solid var(--line); }
.config-shell .cfg-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.cfg-x { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text-muted); cursor: pointer; }
.cfg-x:hover { color: var(--text-main); border-color: var(--line-strong); }
.config-shell { display: grid !important; grid-template: "head head" auto "tabs body" minmax(0, 1fr) "tabs foot" auto / 190px minmax(0, 1fr); }
.config-shell .cfg-head { grid-area: head; }
.cfg-tabs { grid-area: tabs; display: flex; flex-direction: column; gap: 4px; padding: 14px 10px; border-right: 1px solid var(--line); overflow-y: auto; }
.cfg-tabs button { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: calc(14px * var(--round, 1)); border: 1px solid transparent; background: transparent; color: var(--text-muted); font: 600 0.92rem var(--font-ui); cursor: pointer; text-align: left; transition: background 0.2s, color 0.2s; }
.cfg-tabs button .material-symbols-outlined { font-size: 1.25rem; }
.cfg-tabs button:hover { color: var(--text-main); background: rgba(var(--ink-rgb), 0.05); }
.cfg-tabs button.on { color: var(--text-main); background: rgba(var(--accent-rgb), 0.14); border-color: rgba(var(--accent-rgb), 0.35); }
.cfg-tabs button.on .material-symbols-outlined { color: var(--accent-cyan); }
.cfg-body { grid-area: body; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px 8px; }
.cfg-panel > .config-section, .cfg-panel #hw-config > .config-section { padding: 18px 18px 16px; margin-bottom: 14px; border-radius: calc(20px * var(--round, 1)); border: 1px solid var(--line); background: rgba(var(--ink-rgb), 0.025); }
.cfg-panel .config-section h3 { margin-bottom: 8px; }
.cfg-foot { grid-area: foot; display: flex; justify-content: flex-end; padding: 12px 24px 18px; border-top: 1px solid var(--line); }
.cfg-foot .btn-solid { width: auto; min-width: 140px; margin: 0; }
.cfg-panel .btn-danger { width: 100%; justify-content: center; }
@media (max-width: 760px) {
    #settings-modal { padding: 0; }
    .modal-content.config-shell { width: 100%; height: 100dvh; max-height: none; border-radius: 0; grid-template: "head" auto "tabs" auto "body" minmax(0, 1fr) "foot" auto / minmax(0, 1fr); }
    .config-shell .cfg-head { padding: max(14px, env(safe-area-inset-top)) 16px 10px; }
    .cfg-tabs { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; scrollbar-width: none; }
    .cfg-tabs::-webkit-scrollbar { display: none; }
    .cfg-tabs button { flex: none; padding: 9px 13px; font-size: 0.85rem; gap: 7px; }
    .cfg-body { padding: 14px 12px 4px; }
    .cfg-panel > .config-section, .cfg-panel #hw-config > .config-section { padding: 14px 14px 12px; }
    .cfg-foot { padding: 10px 14px max(14px, env(safe-area-inset-bottom)); }
    .cfg-foot .btn-solid { width: 100%; }
}

/* ================= Layouts (layout.js; Config → Look → Layout) ================= */
.layout-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.layout-picker button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px; border-radius: calc(14px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb), 0.03); color: var(--text-main); font: 600 0.85rem var(--font-ui); cursor: pointer; text-align: left; transition: 0.2s; }
.layout-picker button small { color: var(--text-muted); font-weight: 500; font-size: 0.7rem; }
.layout-picker button:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.layout-picker button.on { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.35); }
.lp-mini { position: relative; display: block; width: 100%; height: 54px; margin-bottom: 7px; border-radius: 8px; background: rgba(var(--ink-rgb), 0.07); overflow: hidden; }
.lp-mini i { position: absolute; display: block; border-radius: 3px; background: rgba(var(--accent-rgb), 0.8); }
.lp-mini i:nth-child(n+2) { background: rgba(var(--ink-rgb), 0.18); }
.lp-mini.classic i:nth-child(1) { left: 22%; right: 22%; top: 5px; height: 7px; border-radius: 9px; }
.lp-mini.classic i:nth-child(2) { left: 30%; right: 30%; top: 22px; height: 6px; } .lp-mini.classic i:nth-child(3) { left: 20%; right: 20%; top: 34px; height: 7px; } .lp-mini.classic i:nth-child(4) { display: none; }
.lp-mini.bookmarks i:nth-child(1) { left: 5px; right: 5px; top: 4px; height: 8px; background: repeating-linear-gradient(90deg, rgba(var(--accent-rgb), 0.8) 0 16%, transparent 16% 20%); }
.lp-mini.bookmarks i:nth-child(2) { left: 25%; right: 25%; top: 24px; height: 8px; border-radius: 9px; } .lp-mini.bookmarks i:nth-child(3), .lp-mini.bookmarks i:nth-child(4) { display: none; }
.lp-mini.sidebar i:nth-child(1) { left: 4px; top: 4px; bottom: 4px; width: 10px; background: repeating-linear-gradient(rgba(var(--accent-rgb), 0.8) 0 7px, transparent 7px 11px); }
.lp-mini.sidebar i:nth-child(2) { left: 30%; right: 12%; top: 16px; height: 7px; } .lp-mini.sidebar i:nth-child(3) { left: 30%; right: 25%; top: 28px; height: 6px; } .lp-mini.sidebar i:nth-child(4) { display: none; }
.lp-mini.dock i:nth-child(1) { left: 24%; right: 24%; bottom: 4px; height: 10px; border-radius: 6px; background: repeating-linear-gradient(90deg, rgba(var(--accent-rgb), 0.8) 0 9px, transparent 9px 13px); }
.lp-mini.dock i:nth-child(2) { left: 30%; right: 30%; top: 10px; height: 7px; } .lp-mini.dock i:nth-child(3) { left: 20%; right: 20%; top: 22px; height: 7px; } .lp-mini.dock i:nth-child(4) { display: none; }
@media (max-width: 760px) { .layout-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Bookmarks: a browser's bookmarks bar along the top */
html[data-layout="bookmarks"] .topbar { height: auto; min-height: 54px; padding: 8px 16px; justify-content: flex-start; gap: 16px; border-bottom: 1px solid var(--line);
    background: color-mix(in oklab, rgb(8, 10, 22), rgb(255, 255, 255) var(--bg-light, 0%)); }
html[data-layout="bookmarks"] .topbar::after { display: none; }
html[data-layout="bookmarks"] .brand { flex: none; font-size: 0.78rem; letter-spacing: 0.22em; }
html[data-layout="bookmarks"] .top-controls { flex: 1; min-width: 0; max-width: none; flex-wrap: nowrap; gap: 4px; padding: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-layout="bookmarks"] .top-controls::-webkit-scrollbar { display: none; }
html[data-layout="bookmarks"] .top-btn { display: inline-flex; align-items: center; flex: none; gap: 6px; min-width: 0; min-height: 0; padding: 6px 12px 6px 9px; border-radius: calc(8px * var(--round, 1)); font-size: 0.8rem; background: rgba(var(--ink-rgb), 0.04); user-select: none; -webkit-user-select: none; touch-action: pan-x; }
html[data-layout="bookmarks"] .top-btn .material-symbols-outlined { font-size: 1.05rem; }
html[data-layout="bookmarks"] .top-btn:hover { background: rgba(var(--ink-rgb), 0.09); }
.bm-site img { width: 16px; height: 16px; border-radius: 3px; object-fit: contain; }
.bm-sep { flex: none; align-self: center; width: 1px; height: 22px; margin: 0 4px; background: var(--line-strong); }
.bm-x { display: none; align-items: center; margin: 0 -4px 0 2px; padding: 1px; border-radius: 50%; color: var(--text-muted); }
.bm-x .material-symbols-outlined { font-size: 0.95rem !important; }
.bm-x:hover { background: rgba(var(--ink-rgb), 0.12); color: var(--text-main); }
.bm-site:hover .bm-x, .bm-site:focus-visible .bm-x { display: inline-flex; }
@media (hover: none) { .bm-site .bm-x { display: inline-flex; } }
html[data-layout="bookmarks"] .bm-add { padding: 6px 8px; }
.bm-drag { opacity: 0.8; outline: 2px dashed var(--accent-cyan); cursor: grabbing; }
.bm-lift { transform: scale(1.06); }
html[data-layout="bookmarks"] .library-ui { padding-top: 84px; }
html[data-layout="bookmarks"] #main-ui .quick-launch { display: none; }

/* ---- Sidebar: a column of icons down the left */
@media (min-width: 761px) {
    html[data-layout="sidebar"] .topbar { right: auto; bottom: 0; width: 84px; height: auto; flex-direction: column; justify-content: flex-start; padding: 18px 0; gap: 18px;
        background: color-mix(in oklab, rgba(8, 10, 22, 0.7), rgba(255, 255, 255, 0.7) var(--bg-light, 0%)); border-right: 1px solid var(--line); backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy); }
    html[data-layout="sidebar"] .topbar::after { display: none; }
    html[data-layout="sidebar"] .brand { font-size: 0; gap: 0; letter-spacing: 0; }
    html[data-layout="sidebar"] .top-controls { flex-direction: column; padding: 6px; gap: 4px; border-radius: calc(24px * var(--round, 1)); max-height: calc(100vh - 90px); overflow-y: auto; scrollbar-width: none; }
    html[data-layout="sidebar"] .top-btn { display: flex; justify-content: center; align-items: center; width: 56px; height: 52px; padding: 0; gap: 0; font-size: 0; border-radius: calc(16px * var(--round, 1)); }
    html[data-layout="sidebar"] .top-btn .material-symbols-outlined { font-size: 1.45rem; }
    html[data-layout="sidebar"] .library-ui { left: 84px; padding-top: 48px; }
    html[data-layout="sidebar"] #main-ui { padding-left: 100px !important; }
    html[data-layout="sidebar"] .music-player-bar.mu-bar { left: 96px; }
}

/* ---- Dock: big icons in a floating dock at the bottom */
@media (min-width: 761px) {
    html[data-layout="dock"] .topbar { top: auto; bottom: 14px; left: 50%; right: auto; height: auto; padding: 0; transform: translateX(-50%); background: none; transition: bottom 0.3s var(--ease); }
    html[data-layout="dock"] .brand, html[data-layout="dock"] .topbar::after { display: none; }
    html[data-layout="dock"] .top-controls { gap: 6px; padding: 8px; border-radius: calc(26px * var(--round, 1)); }
    html[data-layout="dock"] .top-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 66px; padding: 9px 10px 7px; font-size: 0.68rem; border-radius: calc(18px * var(--round, 1)); transition: transform 0.2s var(--ease), background 0.2s; }
    html[data-layout="dock"] .top-btn .material-symbols-outlined { font-size: 1.65rem; }
    html[data-layout="dock"]:not([data-fancy="low"]) .top-btn:hover { transform: translateY(-6px) scale(1.08); }
    html[data-layout="dock"] body.mu-has-bar .topbar { bottom: 110px; }
    html[data-layout="dock"] .library-ui { padding-top: 40px; padding-bottom: 150px; }
    html[data-layout="dock"] #main-ui { padding-bottom: 130px !important; }
}

/* (the dock and the phone's tab bar float over the home screen's widgets, under the music bar and pop-ups) */
html[data-layout="dock"] .topbar, html[data-layout="sidebar"] .topbar { z-index: 900; }

/* ---- Sidebar and Dock on a phone: a tab bar along the bottom, where a thumb is */
@media (max-width: 760px) {
    html[data-layout="sidebar"] .topbar, html[data-layout="dock"] .topbar { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: auto; transform: none; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: color-mix(in oklab, rgb(8, 10, 22), rgb(255, 255, 255) var(--bg-light, 0%)); border-top: 1px solid var(--line); backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy); }
    html[data-layout="sidebar"] .top-controls, html[data-layout="dock"] .top-controls { width: 100%; max-width: none; background: none; border: 0; box-shadow: none; padding: 0; }
    html[data-layout="sidebar"] .top-btn, html[data-layout="dock"] .top-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.56rem; min-height: 50px; padding: 6px 0; }
    html[data-layout="sidebar"] .top-btn .material-symbols-outlined, html[data-layout="dock"] .top-btn .material-symbols-outlined { font-size: 1.35rem; }
    html[data-layout="sidebar"] .library-ui, html[data-layout="dock"] .library-ui { padding-top: 24px; padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
    html[data-layout="sidebar"] #main-ui, html[data-layout="dock"] #main-ui { padding-top: 40px !important; padding-bottom: 110px !important; }
    html[data-layout="sidebar"] .music-player-bar.mu-bar, html[data-layout="dock"] .music-player-bar.mu-bar { bottom: calc(74px + env(safe-area-inset-bottom)) !important; }
    html[data-layout="bookmarks"] .top-btn { font-size: 0.78rem; padding: 7px 11px 7px 9px; min-height: 0; flex: none; }
    html[data-layout="bookmarks"] .library-ui { padding-top: 72px; }
}

/* ================= Customize (Config → Customize, custom.js; applied in index.html's <head>) ================= */
/* Fade the background: a veil of the background colour over the picture (under the stars and the quasar). */
html[data-custom]::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg-base); opacity: var(--scene-dim, 0); }
/* Plain colour, no picture */
html[data-plain] #fx-scene, html[data-plain] .fx-nebula i, html[data-plain] .quasar, html[data-plain] .fx-grid, html[data-plain] .fx-spot { display: none !important; }
html[data-plain] .fx-nebula { background: var(--bg-base) !important; }
html[data-plain] .fx-nebula::before, html[data-plain] .fx-nebula::after { display: none !important; }

.cu-body.off { opacity: 0.45; }
.cu-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.92rem; user-select: none; }
.cu-switch.small { font-size: 0.86rem; margin-top: 6px; }
.cu-switch b { font-weight: 600; }
.cu-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cu-track { position: relative; width: 40px; height: 22px; border-radius: 99px; background: rgba(var(--ink-rgb), 0.14); transition: background 0.2s; flex: none; }
.cu-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.2s var(--ease); }
.cu-switch input:checked + .cu-track { background: var(--accent-cyan); }
.cu-switch input:checked + .cu-track::after { transform: translateX(18px); }
.cu-switch input:focus-visible + .cu-track { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

.cu-sample { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; margin-bottom: 12px; border-radius: calc(14px * var(--round, 1)); border: 1px solid var(--line); background: rgba(var(--ink-rgb), 0.03); }
.cu-sample-h { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.04em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cu-sample-t { color: var(--text-muted); font-size: 0.92rem; }
.cu-label { margin: 10px 0 6px; font: 600 0.78rem var(--font-ui); color: var(--text-muted); }
.cu-fonts { display: flex; flex-wrap: wrap; gap: 6px; max-height: 128px; overflow-y: auto; padding: 2px; }
.cu-fonts button { padding: 7px 12px; border-radius: calc(99px * var(--round, 1)); border: 1px solid var(--line-strong); background: transparent; color: var(--text-main); font-size: 0.9rem; cursor: pointer; transition: 0.15s; }
.cu-fonts button:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.cu-fonts button.on { border-color: transparent; background: var(--grad-accent); color: var(--on-accent); }

.cu-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.cu-color { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: calc(14px * var(--round, 1)); border: 1px solid var(--line); background: rgba(var(--ink-rgb), 0.03); }
.cu-color.set { border-color: rgba(var(--accent-rgb), 0.45); }
.cu-color label { position: relative; flex: none; width: 38px; height: 38px; cursor: pointer; }
.cu-color label i { position: absolute; inset: 0; border-radius: calc(10px * var(--round, 1)); border: 1px solid rgba(var(--ink-rgb), 0.25); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15); }
.cu-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.cu-color span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cu-color b { font-size: 0.88rem; }
.cu-color small { color: var(--text-muted); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-clear { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; visibility: hidden; }
.cu-color.set .cu-clear { visibility: visible; }
.cu-clear:hover { background: rgba(var(--ink-rgb), 0.08); color: var(--text-main); }
.cu-clear .material-symbols-outlined { font-size: 1.1rem; }

.cu-slider { display: grid; gap: 4px; margin-bottom: 10px; font-size: 0.88rem; }
.cu-slider small { color: var(--text-muted); margin-left: 6px; }
.cu-slider input { width: 100%; accent-color: var(--accent-cyan); }
.cu-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cu-tools button { flex: 1 1 150px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb), 0.04); color: var(--text-main); font: 600 0.84rem var(--font-ui); cursor: pointer; }
.cu-tools button:hover { background: rgba(var(--ink-rgb), 0.09); }
.cu-tools .material-symbols-outlined { font-size: 1.1rem; }
.cu-note { margin: 10px 0 0; font-size: 0.85rem; color: var(--accent-soft); }

/* ================= Downloaded games (downloads.js) ================= */
.dl-games { display: grid; gap: 6px; margin-top: 10px; }
.dl-game { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line); background: rgba(var(--ink-rgb), 0.03); }
.dl-game > .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.2rem; }
.dl-game b { flex: 1; min-width: 0; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-game small { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
#btn-download-player.on { color: var(--accent-cyan); }
#btn-download-player.busy .material-symbols-outlined { animation: dlPulse 1.2s ease-in-out infinite; }
@keyframes dlPulse { 50% { opacity: 0.35; } }
/* a downloaded game's card: a small mark in the corner */
.game-card .dl-mark { display: none; position: absolute; left: 8px; top: 8px; z-index: 5; width: 24px; height: 24px; place-items: center; border-radius: 50%;
    font-size: 16px; color: var(--on-accent); background: var(--accent-cyan); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); pointer-events: none; }
.game-card.downloaded .dl-mark { display: grid; }

/* ================= Clips (clips.js): the player's Clips button and the note it shows ================= */
.clip-toggle { display: inline-flex; align-items: center; gap: 6px; width: auto !important; padding: 0 12px !important; font: 600 0.8rem var(--font-ui); }
.clip-toggle .material-symbols-outlined { font-size: 1.05rem; color: var(--text-muted); }
.clip-toggle.rec .material-symbols-outlined { color: #ff4d5e; animation: clipRec 1.8s ease-in-out infinite; }
.clip-toggle.busy { opacity: 0.6; }
@keyframes clipRec { 50% { opacity: 0.45; } }
#btn-clip-save.busy .material-symbols-outlined { animation: dlPulse 0.8s ease-in-out infinite; }
.clip-pill { position: absolute; left: 16px; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100% - 32px)); padding: 8px 8px 8px 10px;
    border-radius: calc(16px * var(--round, 1)); background: var(--glass-strong); border: 1px solid var(--line-strong); color: var(--text-main); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy); font: 500 0.85rem var(--font-ui); animation: clipIn 0.25s var(--ease); }
.clip-pill.out { opacity: 0; transform: translateY(8px); transition: 0.25s; }
@keyframes clipIn { from { opacity: 0; transform: translateY(10px); } }
.clip-pill img { width: 72px; height: 42px; object-fit: cover; border-radius: 8px; background: #000; }
.clip-pill > .material-symbols-outlined { color: var(--accent-cyan); }
.clip-pill .clip-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.clip-pill .clip-text small { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-pill .clip-text .material-symbols-outlined { font-size: 1rem; vertical-align: -3px; color: #ff4d5e; }
.clip-pill button { display: inline-flex; align-items: center; gap: 4px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb), 0.06); color: var(--text-main); font: 600 0.8rem var(--font-ui); cursor: pointer; white-space: nowrap; }
.clip-pill button:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.clip-pill button[data-clip-act="post"] { background: var(--grad-accent); color: var(--on-accent); border-color: transparent; }
.clip-pill button .material-symbols-outlined { font-size: 1rem; }
.clip-pill .clip-x { padding: 6px; border: 0; background: none; }
@media (max-width: 760px) { .clip-toggle .clip-label { display: none; } .clip-pill { left: 8px; right: 8px; bottom: 8px; max-width: none; } }
.chrome-btn[hidden] { display: none !important; } /* (the player bar's buttons are flex: [hidden] has to win) */

/* ================= Title pages (title.js): Movies and Shows ================= */
.tp { position: fixed; inset: 0; z-index: 3000; overflow-y: auto; background: #05060c; color: #eef0f7; overscroll-behavior: contain; animation: tpIn 0.22s ease; }
@keyframes tpIn { from { opacity: 0; transform: scale(0.985); } }
.tp .material-symbols-outlined { vertical-align: -0.2em; }
.tp-load { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 12px; color: #9aa3b8; }
.tp-load.small { min-height: 120px; }
.tp-spin { font-size: 2rem; animation: tpSpin 1s linear infinite; }
@keyframes tpSpin { to { transform: rotate(360deg); } }
.tp-hero { position: relative; min-height: min(78vh, 640px); background: #0b0d16 center 20% / cover no-repeat; display: flex; align-items: flex-end; }
.tp-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 6, 12, 0.96) 0%, rgba(5, 6, 12, 0.72) 42%, rgba(5, 6, 12, 0.15) 100%), linear-gradient(0deg, #05060c 0%, rgba(5, 6, 12, 0) 45%); }
.tp-x { position: absolute; top: 16px; left: 16px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(5, 6, 12, 0.6); color: #fff; cursor: pointer; }
.tp-x:hover { background: rgba(255, 255, 255, 0.12); }
.tp-head { position: relative; z-index: 1; display: flex; gap: 28px; align-items: flex-end; padding: 80px clamp(18px, 5vw, 64px) 34px; max-width: 1200px; }
.tp-poster { width: 190px; border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); flex: none; }
.tp-info { min-width: 0; max-width: 720px; }
.tp-info h1 { margin: 0 0 10px; font: 800 clamp(1.9rem, 4.4vw, 3.4rem)/1.05 var(--font-display, system-ui); background: none; -webkit-text-fill-color: #fff; filter: none !important; animation: none !important; letter-spacing: 0.01em; }
.tp-info h1::before, .tp-info h1::after { content: none !important; }
.tp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #c9cede; font-size: 0.95rem; }
.tp-dot { width: 4px; height: 4px; border-radius: 50%; background: #6c7489; display: inline-block; }
.tp-cert { padding: 0 6px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 4px; font-size: 0.8rem; }
.tp-score { color: #46d39a; font-weight: 700; margin-left: 6px; }
.tp-score .material-symbols-outlined { font-size: 1rem; font-variation-settings: "FILL" 1; }
.tp-tag { margin: 12px 0 0; color: #9aa3b8; font-style: italic; }
.tp-desc { margin: 10px 0 0; color: #dde1ec; line-height: 1.55; font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tp-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tp-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); color: #fff; font: 700 1rem system-ui, sans-serif; cursor: pointer; }
.tp-btn:hover { background: rgba(255, 255, 255, 0.2); }
.tp-btn.primary { background: #fff; color: #05060c; border-color: #fff; }
.tp-btn.primary:hover { background: #dfe3ee; }
.tp-btn .material-symbols-outlined { font-size: 1.4rem; font-variation-settings: "FILL" 1; }
.tp-crew { margin: 16px 0 0; color: #9aa3b8; font-size: 0.9rem; }
.tp-crew b { color: #c9cede; margin-right: 6px; }
.tp-body { padding: 4px clamp(18px, 5vw, 64px) 60px; max-width: 1200px; }
.tp-sec { margin-top: 30px; }
.tp-sec h2 { margin: 0 0 14px; font: 700 1.3rem system-ui, sans-serif; color: #fff; background: none; -webkit-text-fill-color: currentColor; filter: none !important; }
.tp-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tp-sec-h h2 { margin: 0; }
.tp-season { padding: 9px 14px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25); background: #12141f; color: #fff; font: 600 0.95rem system-ui, sans-serif; }
.tp-eps { display: grid; }
.tp-ep { display: grid; grid-template-columns: 34px 200px 1fr; gap: 18px; align-items: center; padding: 16px 12px; border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.tp-ep:hover { background: rgba(255, 255, 255, 0.06); }
.tp-ep.here { background: rgba(var(--accent-rgb, 34, 211, 238), 0.1); }
.tp-epn { font-size: 1.5rem; color: #9aa3b8; text-align: center; }
.tp-still { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #12141f; }
.tp-still img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-playico { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; background: rgba(0, 0, 0, 0.35); transition: opacity 0.15s; }
.tp-playico .material-symbols-outlined { font-size: 2.6rem; font-variation-settings: "FILL" 1; }
.tp-ep:hover .tp-playico { opacity: 1; }
.tp-eptext b { display: block; font-size: 1rem; }
.tp-eptext small { display: block; color: #9aa3b8; font-size: 0.82rem; margin: 2px 0 6px; }
.tp-epdesc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #c9cede; font-size: 0.9rem; line-height: 1.45; }
.tp-cast { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.tp-person { flex: none; width: 108px; text-align: center; }
.tp-person img, .tp-noface { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 8px; background: #12141f; }
.tp-noface { display: grid; place-items: center; color: #6c7489; }
.tp-person b { display: block; font-size: 0.85rem; }
.tp-person small { display: block; color: #9aa3b8; font-size: 0.76rem; }
.tp-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.tp-card { border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.tp-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; display: block; transition: transform 0.15s; }
.tp-card:hover img { transform: scale(1.04); }
.tp-card b { display: block; margin-top: 6px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-card small { color: #9aa3b8; font-size: 0.75rem; }
.tp-dim { color: #9aa3b8; }
@media (max-width: 720px) {
    .tp-head { flex-direction: column; align-items: flex-start; padding-top: 72px; gap: 16px; }
    .tp-poster { width: 120px; }
    .tp-ep { grid-template-columns: 120px 1fr; gap: 12px; }
    .tp-epn { display: none; }
    .tp-epdesc { -webkit-line-clamp: 2; }
}

/* The game list behind a game (index.js parks it there): kept, but not drawn and not in the way. */
.library-ui.parked { content-visibility: hidden; opacity: 0; pointer-events: none; animation: none !important; }

/* A block of the game list that isn't drawn yet (index.js draws it as you scroll near). */
.games-block { grid-column: 1 / -1; }

/* Low (2 GB Chromebooks): nothing moves. Animations and transitions jump straight to the end (they still
   finish, so code waiting for them carries on), spinners stand still, and scrolling doesn't glide. */
html[data-fancy="low"] *, html[data-fancy="low"] *::before, html[data-fancy="low"] *::after {
    animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
html[data-fancy="low"] .card:hover img, html[data-fancy="low"] .card:hover { transform: none !important; }
/* (and nothing under it is drawn or animated either: the quasar, the painted wallpaper, the top bar and the
   other sections stop while a game runs on the same thread) */
html.q-covered .quasar, html.q-covered #fx-scene { display: none !important; }
html.q-covered .topbar, html.q-covered #main-ui, html.q-covered .library-ui:not(#music-ui) { content-visibility: hidden; }

/* ================= Secret (↑ ↑ ↓ on the home screen) ================= */

.goat-btn {
    position: fixed; right: 10px; bottom: 10px; z-index: 50; width: 15px; height: 15px; padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%; cursor: pointer;
    background: radial-gradient(circle, #fff 0 20%, var(--accent, #22d3ee) 60%);
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.7);
}
.goat-btn[hidden] { display: none; }
.goat-btn:hover { transform: scale(1.25); }
.goat-screen {
    position: fixed; inset: 0; z-index: 10000; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: radial-gradient(ellipse at 50% 45%, rgba(168, 85, 247, 0.28), transparent 60%), var(--bg-base, #03040a);
    color: var(--text-main, #fff); animation: goatIn 0.35s ease-out;
}
.goat-screen h1 {
    position: relative; margin: 0; padding: 0 16px; font: 900 clamp(1.8rem, 7vw, 6rem) var(--font-display); white-space: nowrap;
    letter-spacing: 0.06em; background: var(--grad-text, linear-gradient(90deg, #22d3ee, #a855f7, #f472b6));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 24px rgba(168, 85, 247, 0.55));
}
.goat-emoji { position: relative; font-size: clamp(4rem, 16vw, 9rem); line-height: 1; margin-bottom: 12px; animation: goatBob 1.6s ease-in-out infinite; }
.goat-x {
    position: absolute; top: 14px; right: 18px; z-index: 1; border: 0; background: none; cursor: pointer;
    color: var(--text-muted, #aaa); font-size: 2.2rem; line-height: 1;
}
.goat-x:hover { color: var(--text-main, #fff); }
.goat-bit {
    position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; opacity: 0.9;
    animation: goatFall linear infinite;
}
@keyframes goatIn { from { opacity: 0; transform: scale(1.04); } }
@keyframes goatBob { 50% { transform: translateY(-12px) rotate(-6deg); } }
@keyframes goatFall { to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); } }
html[data-fancy="low"] .goat-screen h1 { filter: none; }

/* Ads: the vignette before a game (index.js, end of file) */
.q-ad {
    position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px;
    background: rgba(3, 4, 10, 0.82); backdrop-filter: blur(6px); animation: qAdIn 0.2s ease-out;
}
.q-ad-card {
    display: grid; gap: 10px; justify-items: center; max-width: 100%; padding: 14px 16px 12px;
    border-radius: calc(18px * var(--round, 1)); border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--bg-panel, #0b0e1a); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.q-ad-tag { color: var(--text-muted, #9aa); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.q-ad-slot { max-width: calc(100vw - 64px); overflow: hidden; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.q-ad-slot iframe { display: block; border: 0; }
.q-ad-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.q-ad-next { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted, #9aa); font-size: 0.85rem; }
.q-ad-skip {
    padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer; font: 700 0.85rem var(--font-body, inherit);
    background: var(--accent-cyan, #22d3ee); color: #001018;
}
.q-ad-skip:disabled { cursor: default; background: rgba(255, 255, 255, 0.1); color: var(--text-muted, #9aa); }
@keyframes qAdIn { from { opacity: 0; } }
html[data-fancy="low"] .q-ad { backdrop-filter: none; animation: none; }

/* The "Quasar is moving" notice on the old address (index.js, end of file) */
.q-move { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 16px; background: rgba(3, 4, 10, 0.8); }
.q-move-card {
    max-width: 440px; padding: 26px 24px 18px; text-align: center; border-radius: calc(20px * var(--round, 1));
    border: 1px solid rgba(255, 255, 255, 0.12); background: var(--bg-panel, #0b0e1a); color: var(--text-main, #fff); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.q-move-icon { font-size: 3rem; line-height: 1; }
.q-move-card h2 { margin: 10px 0 8px; font: 800 1.5rem var(--font-display, inherit); }
.q-move-card p { margin: 0 0 10px; line-height: 1.45; }
.q-move-card b { color: var(--accent-cyan, #22d3ee); word-break: break-all; }
.q-move-note { color: var(--text-muted, #9aa); font-size: 0.88rem; }
.q-move-row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.q-move-row button { padding: 10px 16px; border: 0; border-radius: 999px; cursor: pointer; font: 700 0.9rem var(--font-body, inherit); background: rgba(255, 255, 255, 0.08); color: inherit; }
.q-move-row .q-move-go { background: var(--accent-cyan, #22d3ee); color: #001018; }
