/* Blink ? warm paper, sharp ink, and one quick flash of green. */

:root {
    --bg: #F7F4EF;
    --bg-deep: #ECE8E0;
    --paper: #FFFCF7;
    --ink: #171A20;
    --ink-soft: #343841;
    --mute: #686E75;
    --line: rgba(23, 26, 32, 0.11);
    --line-strong: rgba(23, 26, 32, 0.24);
    --accent: #0D9F6E;
    --accent-dark: #076B4A;
    --accent-soft: #DDEFE7;
    --radius: 16px;
    --radius-sm: 11px;
    --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-soft: cubic-bezier(0.33, 0.1, 0.2, 1);
    --fast: 240ms;
    --panel-time: 300ms;
    --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
    --max: 1240px;
    --stamp: rgba(26, 28, 34, 0.045);
    --star: #2A2E36;
    --star-mid: #1F232B;
    --star-tiny: #3A3F49;
    --glow-a: rgba(13, 159, 110, 0.09);
    --glow-b: rgba(204, 118, 88, 0.055);
    --theme-meta: #F7F4EF;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    position: relative;
    isolation: isolate;
    min-width: 280px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 8% -12%, var(--glow-a), transparent 64%),
        radial-gradient(760px 380px at 98% 0%, var(--glow-b), transparent 68%),
        var(--bg);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    height: 4px;
    background: var(--accent);
    content: "";
    pointer-events: none;
}

body.is-library,
body.is-settings,
body.is-play {
    overflow: hidden;
}

body.is-play::before {
    display: none;
}

[hidden] {
    display: none !important;
}

button,
input {
    color: inherit;
    font: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible,
.skip-link:focus-visible {
    outline: 3px solid rgba(13, 159, 110, 0.34);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    padding: 10px 14px;
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: var(--paper);
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform var(--fast) var(--ease);
}

.skip-link:focus {
    transform: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app {
    position: relative;
    z-index: 1;
    width: min(100%, calc(var(--max) + 64px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 34px 32px 84px;
    pointer-events: auto;
}

/* Brand masthead */
.top {
    display: grid;
    grid-template-areas:
        "brand actions"
        "brand search";
    grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
    gap: 18px 48px;
    align-items: end;
    margin-bottom: 28px;
    padding: 6px 0 30px;
    border-bottom: 1px solid var(--line-strong);
}

.brand-lockup {
    grid-area: brand;
    min-width: 0;
    align-self: center;
    animation: mastIn 640ms var(--ease-out) backwards;
}

.brand {
    display: flex;
    align-items: flex-end;
    gap: 0.18em;
    margin: 0;
    font-size: clamp(4.6rem, 8.5vw, 7.4rem);
    font-weight: 800;
    letter-spacing: -0.075em;
    line-height: 0.78;
}

.brand-word {
    display: block;
}

.brand-stop {
    color: var(--accent);
}

.brand-year {
    position: relative;
    top: -0.015em;
    display: inline-block;
    /* Two identical cycles so 0% → 100% is a true seamless loop */
    background-image: linear-gradient(
        105deg,
        var(--accent-dark) 0%,
        var(--accent) 12.5%,
        color-mix(in srgb, var(--accent) 58%, #fff) 25%,
        var(--accent) 37.5%,
        var(--accent-dark) 50%,
        var(--accent) 62.5%,
        color-mix(in srgb, var(--accent) 58%, #fff) 75%,
        var(--accent) 87.5%,
        var(--accent-dark) 100%
    );
    background-size: 200% 100%;
    background-position: 0% 50%;
    color: transparent;
    font-size: 0.132em;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.045em;
    line-height: 1;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brandYearFlow 9s linear infinite;
    will-change: background-position;
}

@keyframes brandYearFlow {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

@keyframes mastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-year {
        animation: none;
        will-change: auto;
        background-position: 28% 50%;
    }
}

.brand-line {
    max-width: 34rem;
    margin: 24px 0 0 5px;
    color: var(--mute);
    font-size: clamp(0.96rem, 1.5vw, 1.1rem);
    font-weight: 500;
    line-height: 1.45;
}

.top-actions {
    grid-area: actions;
    display: flex;
    gap: 9px;
    align-self: start;
    justify-self: end;
    animation: mastIn 640ms var(--ease-out) 80ms backwards;
}

.home-search-wrap {
    grid-area: search;
    animation: mastIn 640ms var(--ease-out) 120ms backwards;
}

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-ico {
    position: absolute;
    left: 16px;
    z-index: 1;
    color: var(--mute);
    pointer-events: none;
}

.search {
    width: 100%;
    height: 48px;
    padding: 0 50px 0 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    outline: none;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    font-size: 0.96rem;
    transition:
        border-color var(--fast) var(--ease),
        background-color var(--fast) var(--ease),
        box-shadow var(--fast) var(--ease);
}

.home-search-wrap .search {
    border-radius: 999px;
}

.search::placeholder {
    color: var(--mute);
    opacity: 1;
}

.search:hover {
    border-color: var(--ink-soft);
}

.search:focus {
    border-color: var(--line);
    background: var(--paper);
    box-shadow: inset 0 -2px var(--accent);
}

.search:focus-visible {
    outline: none;
}

.search-key {
    position: absolute;
    right: 13px;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid var(--line);
    border-bottom-color: var(--line-strong);
    border-radius: 7px;
    color: var(--mute);
    background: var(--bg);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    transition: opacity var(--fast) var(--ease);
    pointer-events: none;
}

.search-wrap:focus-within .search-key,
.search:not(:placeholder-shown) + .search-key {
    opacity: 0;
}

.search-clear {
    position: absolute;
    right: 10px;
    z-index: 2;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 8px;
    color: var(--mute);
}

.search-clear:hover {
    color: var(--ink);
    background: var(--bg-deep);
}

.btn {
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: var(--paper);
    font-size: 0.92rem;
    font-weight: 700;
    transition:
        transform 220ms var(--ease-out),
        border-color 240ms var(--ease),
        background-color 240ms var(--ease),
        color 240ms var(--ease),
        box-shadow 280ms var(--ease-soft);
}

.btn:hover {
    border-color: var(--ink);
    background: #FFF;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(23, 26, 32, 0.08);
}

.btn:active {
    transform: translateY(1px) scale(0.985);
}

.btn-fill {
    border-color: var(--accent);
    color: #FFF;
    background: var(--accent);
}

.btn-fill:hover {
    border-color: var(--accent-dark);
    color: #FFF;
    background: var(--accent-dark);
}

.btn-icon {
    display: grid;
    width: 44px;
    padding: 0;
    place-items: center;
}

/* Home controls */
.section-head {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-kicker {
    margin: 0 0 6px;
    color: var(--mute);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
}

.section-title {
    margin: 0;
    font-size: clamp(1.85rem, 3.2vw, 2.55rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
}

.section-meta,
.panel-meta {
    margin: 0 0 4px;
    color: var(--mute);
    font-size: 0.82rem;
    font-weight: 600;
}

.toolbar {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding: 10px 0 18px;
    border-bottom: 1px solid var(--line);
}

.home-section .toolbar {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--paper) 55%, transparent);
}

.tags {
    display: flex;
    gap: 2px;
    align-items: center;
    min-width: 0;
}

.tag {
    position: relative;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 9px;
    color: var(--mute);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    transition:
        color 240ms var(--ease),
        background-color 260ms var(--ease-soft),
        transform 220ms var(--ease-out);
}

.tag::after {
    display: none;
}

.tag:hover {
    color: var(--ink);
    background: rgba(23, 26, 32, 0.05);
    transform: translateY(-1px);
}

.tag.is-on {
    color: var(--ink);
    background: color-mix(in srgb, var(--accent-soft) 80%, var(--paper));
}

.tag.is-on::after {
    display: none;
}

.sort {
    display: inline-flex;
    flex: none;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-deep);
}

.sort-btn {
    min-height: 30px;
    padding: 0 12px;
    border-radius: 7px;
    color: var(--mute);
    font-size: 0.76rem;
    font-weight: 700;
    transition:
        color 240ms var(--ease),
        background-color 260ms var(--ease-soft),
        transform 200ms var(--ease-out);
}

.sort-btn.is-on {
    color: var(--ink);
    background: var(--paper);
}

/* Game deck */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.card {
    --wash: #EAE6DF;
    --wash-2: #DCD7CE;
    --cat-ink: #555A62;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    background: var(--paper);
    content-visibility: auto;
    contain-intrinsic-size: 220px 255px;
    transform: translateZ(0);
    transition:
        transform 320ms var(--ease-out),
        border-color 280ms var(--ease),
        background-color 280ms var(--ease),
        box-shadow 320ms var(--ease-soft);
    animation: cardIn 520ms var(--ease-out) backwards;
    animation-delay: calc(min(var(--card-i, 0), 10) * 40ms);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card:hover {
    border-color: var(--line-strong);
    transform: translateY(-6px);
    box-shadow: 0 18px 34px rgba(23, 26, 32, 0.1);
}

.card:has(.card-play:focus-visible) {
    border-color: var(--accent);
}

.card:active {
    transform: translateY(-2px) scale(0.985);
    transition-duration: 120ms;
}

.card-play {
    display: flex;
    width: 100%;
    min-height: 100%;
    flex-direction: column;
    padding: 0;
    text-align: left;
}

.card-play:focus-visible {
    border-radius: calc(var(--radius) + 2px);
    outline: 3px solid rgba(13, 159, 110, 0.42);
    outline-offset: -3px;
}

.card-art {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 11;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(90% 80% at 12% 88%, color-mix(in srgb, var(--cat-ink) 14%, transparent), transparent 58%),
        linear-gradient(152deg, var(--wash), var(--wash-2));
    transition: transform 480ms var(--ease-out);
}

.card:hover .card-art {
    transform: scale(1.045);
}

.card-art::before {
    position: absolute;
    top: -46%;
    right: -28%;
    width: 82%;
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--cat-ink) 18%, transparent);
    border-radius: 50%;
    content: "";
    opacity: 0.85;
    transition: transform 560ms var(--ease-out), opacity 320ms var(--ease);
}

.card:hover .card-art::before {
    opacity: 1;
    transform: translate(-4%, 3%) scale(1.04);
}

.card-art::after {
    position: absolute;
    top: -22%;
    left: 34%;
    width: 1px;
    height: 150%;
    background: color-mix(in srgb, var(--cat-ink) 14%, transparent);
    content: "";
    transform: rotate(29deg);
    transform-origin: center;
    transition: opacity 320ms var(--ease);
}

.card:hover .card-art::after {
    opacity: 0.55;
}

.card-mono {
    position: absolute;
    bottom: 14px;
    left: 16px;
    z-index: 1;
    color: var(--cat-ink);
    font-size: clamp(2.35rem, 3.6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.07em;
    line-height: 0.78;
    opacity: 0.92;
    transition: transform 420ms var(--ease-out), opacity 280ms var(--ease);
}

.card:hover .card-mono {
    opacity: 1;
    transform: translateY(-3px);
}

.card-tag {
    position: absolute;
    top: 14px;
    left: 16px;
    z-index: 1;
    color: var(--cat-ink);
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cat-arcade {
    --wash: #F3D8CF;
    --wash-2: #EDC6BA;
    --cat-ink: #8E4333;
}

.cat-sports {
    --wash: #DCE9F1;
    --wash-2: #C8DBE8;
    --cat-ink: #315F79;
}

.cat-sandbox {
    --wash: #E3E0F2;
    --wash-2: #D3CEE9;
    --cat-ink: #5C5287;
}

.cat-puzzle {
    --wash: #F1E5BD;
    --wash-2: #E8D59B;
    --cat-ink: #76601D;
}

.cat-relax {
    --wash: #D5E9E3;
    --wash-2: #C1DED5;
    --cat-ink: #286B59;
}

.card-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr;
    gap: 6px 12px;
    width: 100%;
    min-height: 78px;
    padding: 14px 16px 15px;
}

.card-title {
    overflow: hidden;
    min-width: 0;
    font-size: 0.96rem;
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.18;
    text-overflow: ellipsis;
}

.card-by {
    align-self: end;
    color: var(--mute);
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card-go {
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: center;
    color: var(--mute);
    font-size: 1.05rem;
    transform: translateX(-2px);
    transition:
        color 280ms var(--ease),
        transform 360ms var(--ease-out);
}

.card:hover .card-go,
.card-play:focus-visible .card-go {
    color: var(--accent-dark);
    transform: translateX(4px);
}

.card-star {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(23, 26, 32, 0.14);
    border-radius: 10px;
    color: var(--mute);
    background: rgba(255, 252, 247, 0.94);
    transition:
        transform var(--fast) var(--ease),
        color var(--fast) var(--ease),
        border-color var(--fast) var(--ease),
        background-color var(--fast) var(--ease);
}

.card-star:hover {
    border-color: var(--ink);
    color: var(--ink);
    transform: rotate(-4deg);
}

.card-star:active {
    transform: scale(0.92);
}

.card-star.is-on {
    border-color: rgba(13, 159, 110, 0.36);
    color: var(--accent-dark);
    background: #F4FFF9;
}

/* Empty and no-match states */
.empty {
    width: min(100%, 480px);
    margin: 36px auto 0;
    padding: 64px 24px;
    text-align: center;
}

.empty-mark {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    place-items: center;
    border: 1px solid rgba(13, 159, 110, 0.25);
    border-radius: 14px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: 1.2rem;
}

.empty-title {
    margin: 0 0 7px;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.empty-text {
    margin: 0 0 22px;
    color: var(--mute);
    line-height: 1.5;
}

.empty-match {
    margin-top: 12px;
    padding-top: 52px;
}

/* Library */
.panel {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(13, 159, 110, 0.035), transparent 18%),
        var(--bg);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--panel-time) var(--ease), transform var(--panel-time) var(--ease);
}

.panel.is-open {
    opacity: 1;
    transform: none;
}

.panel-bar {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) minmax(300px, 440px);
    gap: 20px;
    align-items: center;
    width: min(100%, calc(var(--max) + 64px));
    margin: 0 auto;
    padding: 32px 32px 26px;
    border-bottom: 1px solid var(--line-strong);
}

.panel-back {
    align-self: start;
    margin-top: 3px;
}

.panel-title-wrap {
    min-width: 0;
}

.panel-title {
    margin: 0 0 7px;
    font-size: clamp(2.35rem, 4vw, 3.35rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 0.95;
}

.panel-search {
    align-self: end;
}

.panel-toolbar {
    width: min(100%, calc(var(--max) + 64px));
    margin: 0 auto;
    padding: 10px 32px 16px;
}

.panel-note {
    margin: 0;
    color: var(--mute);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.panel-body {
    width: min(100%, calc(var(--max) + 64px));
    flex: 1;
    min-height: 0;
    margin: 0 auto;
    padding: 0 32px 56px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

#library .panel-body {
    -webkit-overflow-scrolling: touch;
    /* Own compositor layer so card paint stays off the scroll thread */
    transform: translateZ(0);
}

/*
 * Library scroll path: freeze hover paint while scrolling, keep offscreen
 * cards skipped, and never promote every tile into its own layer.
 */
#library .card {
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: auto 255px;
    box-shadow: none;
    backface-visibility: hidden;
}

#library .card:hover,
#library .card:active {
    will-change: transform;
}

#library .panel-body.is-scrolling .card,
#library .panel-body.is-scrolling .card-star,
#library .panel-body.is-scrolling .card-go {
    transition: none !important;
    pointer-events: none;
}

#library .panel-body.is-scrolling .card:hover,
#library .panel-body.is-scrolling .card:active {
    transform: none;
    border-color: var(--line);
    will-change: auto;
}

#library .panel-body.is-scrolling .card:hover .card-go {
    color: var(--mute);
    transform: translateX(-2px);
}

/* Settings */
.settings {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

.settings.is-open {
    pointer-events: auto;
}

.settings-scrim {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(23, 26, 32, 0.38);
    opacity: 0;
    backdrop-filter: blur(2px);
    transition:
        opacity 280ms cubic-bezier(0.22, 0.8, 0.24, 1),
        backdrop-filter 280ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.settings-panel {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(440px, 100%);
    height: 100%;
    flex-direction: column;
    padding: 0;
    border-left: 1px solid var(--line-strong);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--paper) 92%, #fff 8%) 0%, var(--paper) 40%);
    opacity: 0.92;
    transform: translateX(28px);
    transition:
        opacity 300ms cubic-bezier(0.22, 0.8, 0.24, 1),
        transform 320ms cubic-bezier(0.18, 0.9, 0.22, 1);
    box-shadow: -18px 0 48px rgba(23, 26, 32, 0.12);
}

.settings.is-open .settings-scrim,
.settings.is-open .settings-panel {
    opacity: 1;
}

.settings.is-open .settings-panel {
    transform: none;
}

.settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 26px 18px;
    border-bottom: 1px solid var(--line);
}

.settings-head-copy {
    min-width: 0;
}

.settings-head h2 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
}

.settings-head-desc {
    margin: 10px 0 0;
    max-width: 28ch;
    color: var(--mute);
    font-size: 0.84rem;
    line-height: 1.45;
}

.settings-nav {
    display: flex;
    gap: 6px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 88%, var(--ink) 4%);
    overflow-x: auto;
    scrollbar-width: none;
}

.settings-nav::-webkit-scrollbar {
    display: none;
}

.settings-nav-btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--mute);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition:
        color 200ms cubic-bezier(0.22, 0.8, 0.24, 1),
        background-color 200ms cubic-bezier(0.22, 0.8, 0.24, 1),
        border-color 200ms cubic-bezier(0.22, 0.8, 0.24, 1),
        transform 200ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.settings-nav-btn:hover {
    color: var(--ink);
    background: rgba(26, 28, 34, 0.05);
}

.settings-nav-btn.is-active {
    color: var(--ink);
    border-color: var(--line-strong);
    background: var(--paper);
    box-shadow: 0 1px 2px rgba(23, 26, 32, 0.06);
}

.settings-body {
    display: grid;
    gap: 0;
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: 8px 18px 32px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.settings-section {
    padding: 18px 0 8px;
}

.settings.is-open .settings-section {
    animation: settings-section-in 420ms cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

.settings.is-open .settings-section:nth-child(1) { animation-delay: 40ms; }
.settings.is-open .settings-section:nth-child(2) { animation-delay: 90ms; }
.settings.is-open .settings-section:nth-child(3) { animation-delay: 140ms; }

.settings-section + .settings-section {
    margin-top: 10px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.settings-section-kicker {
    margin: 0 0 6px;
    color: var(--mute);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-section-head {
    margin-bottom: 14px;
}

.settings-section-head h3 {
    margin: 0 0 6px;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.settings-section-desc {
    margin: 0;
    color: var(--mute);
    font-size: 0.84rem;
    line-height: 1.45;
}

.settings-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--paper) 94%, var(--ink) 3%);
}

.settings-card-stack {
    display: grid;
    gap: 14px;
}

.settings-field {
    display: grid;
    gap: 10px;
}

.settings-field + .settings-field {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.settings-field-copy {
    display: grid;
    gap: 3px;
}

.settings-field-label {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 750;
}

.settings-field-desc {
    margin: 0;
    color: var(--mute);
    font-size: 0.8rem;
    line-height: 1.4;
}

.theme-dd-option-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
    text-align: left;
}

.theme-dd-option-desc {
    color: var(--mute);
    font-size: 0.72rem;
    font-weight: 550;
    line-height: 1.3;
}

.mods-toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.mods-search input {
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: var(--paper);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    outline: none;
    transition:
        border-color 180ms cubic-bezier(0.22, 0.8, 0.24, 1),
        box-shadow 180ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.mods-search input::placeholder {
    color: var(--mute);
    font-weight: 550;
}

.mods-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.mods-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mods-filter {
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--mute);
    background: transparent;
    font-size: 0.74rem;
    font-weight: 750;
    cursor: pointer;
    transition:
        color 180ms cubic-bezier(0.22, 0.8, 0.24, 1),
        background-color 180ms cubic-bezier(0.22, 0.8, 0.24, 1),
        border-color 180ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.mods-filter:hover {
    color: var(--ink);
    border-color: var(--line-strong);
}

.mods-filter.is-active {
    color: var(--accent-dark);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
    background: var(--accent-soft);
}

.mod-list {
    display: grid;
    gap: 18px;
}

.mod-group {
    display: grid;
    gap: 10px;
}

.mod-group-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.mod-group-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.mod-group-blurb {
    margin: 4px 0 0;
    color: var(--mute);
    font-size: 0.76rem;
    line-height: 1.35;
}

.mod-group-count {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--mute);
    background: rgba(26, 28, 34, 0.06);
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
}

.mod-group-list {
    display: grid;
    gap: 8px;
}

.mods-empty {
    display: grid;
    gap: 8px;
    justify-items: start;
    padding: 22px 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    color: var(--mute);
}

.mods-empty strong {
    color: var(--ink);
    font-size: 0.95rem;
}

.mods-empty p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.4;
}

@keyframes settings-section-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .settings-section,
    .settings-scrim,
    .settings-panel {
        animation: none !important;
        transition-duration: 1ms !important;
    }

    .settings-body {
        scroll-behavior: auto;
    }

    .brand-lockup,
    .top-actions,
    .home-search-wrap,
    .card {
        animation: none !important;
    }

    .card,
    .card-art,
    .card-mono,
    .card-go,
    .btn,
    .tag,
    .sort-btn {
        transition-duration: 1ms !important;
    }

    .card:hover,
    .card:hover .card-art,
    .card:hover .card-mono,
    .card:hover .card-go,
    .btn:hover,
    .tag:hover {
        transform: none;
    }
}

.theme-dd {
    position: relative;
    width: 100%;
}

.theme-dd-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: var(--paper);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 180ms cubic-bezier(0.22, 0.8, 0.24, 1),
        background-color 180ms cubic-bezier(0.22, 0.8, 0.24, 1),
        box-shadow 180ms cubic-bezier(0.22, 0.8, 0.24, 1),
        transform 180ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.theme-dd-trigger:hover {
    border-color: var(--line-strong);
}

.theme-dd.is-open .theme-dd-trigger,
.theme-dd-trigger:focus-visible {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.theme-swatch {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(23, 26, 32, 0.16);
    background:
        linear-gradient(135deg, var(--swatch-a, #F7F4EF) 50%, var(--swatch-b, #0D9F6E) 50%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

html[data-scheme="dark"] .theme-swatch {
    border-color: rgba(245, 242, 235, 0.18);
}

.theme-dd-label {
    flex: 1;
    min-width: 0;
}

.theme-dd-chevron {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--mute);
    border-bottom: 2px solid var(--mute);
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform 200ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.theme-dd.is-open .theme-dd-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.theme-dd-menu {
    position: fixed;
    z-index: 60;
    max-height: min(360px, 52vh);
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 18px 40px rgba(23, 26, 32, 0.16);
    scrollbar-width: thin;
}

.theme-dd-menu[hidden] {
    display: none !important;
}

html[data-scheme="dark"] .theme-dd-menu {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.theme-dd-group {
    padding: 4px 0 8px;
}

.theme-dd-group + .theme-dd-group {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.theme-dd-heading {
    padding: 6px 10px 8px;
    color: var(--mute);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.theme-dd-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 11px;
    color: var(--ink);
    background: transparent;
    font-size: 0.92rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    text-align: left;
    cursor: pointer;
    transition: background-color 160ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.theme-dd-option:hover,
.theme-dd-option.is-active {
    background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
}

.theme-dd-option.is-on {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.theme-dd-option-name {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.theme-dd-soon {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 999px;
    color: var(--accent-dark, var(--accent));
    background: var(--accent-soft, color-mix(in srgb, var(--accent) 14%, transparent));
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.theme-dd-soon-badge {
    flex: 0 0 auto;
    color: var(--mute);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.theme-dd-option.is-coming-soon {
    opacity: 0.62;
    cursor: not-allowed;
}

.theme-dd-option.is-coming-soon:hover,
.theme-dd-option.is-coming-soon.is-active {
    background: transparent;
}

.theme-dd-check {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    opacity: 0;
    color: var(--accent-dark);
}

.theme-dd-option.is-on .theme-dd-check {
    opacity: 1;
}

.mod-item {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    overflow: hidden;
    transition:
        border-color 200ms cubic-bezier(0.22, 0.8, 0.24, 1),
        box-shadow 200ms cubic-bezier(0.22, 0.8, 0.24, 1),
        background-color 200ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.mod-item.is-on {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.mod-item.is-opts-open {
    border-color: var(--line-strong);
}

.mod-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

.mod-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.mod-name {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mod-desc {
    color: var(--mute);
    font-size: 0.8rem;
    line-height: 1.35;
}

.mod-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.mod-opts-btn {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--mute);
    background: rgba(26, 28, 34, 0.04);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        color 180ms cubic-bezier(0.22, 0.8, 0.24, 1),
        border-color 180ms cubic-bezier(0.22, 0.8, 0.24, 1),
        background-color 180ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.mod-opts-btn:hover,
.mod-opts-btn.is-open {
    color: var(--ink);
    border-color: var(--line-strong);
    background: rgba(26, 28, 34, 0.07);
}

.mod-opts {
    padding: 0 14px 14px;
    border-top: 1px solid var(--line);
    background: rgba(26, 28, 34, 0.025);
}

.mod-opts-inner {
    display: grid;
    gap: 12px;
    padding-top: 12px;
}

.mod-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mod-opt[data-opt-type="choice"] {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.mod-opt-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.mod-opt-label {
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.mod-opt-value {
    color: var(--mute);
    font-size: 0.72rem;
    font-weight: 700;
    transform-origin: right center;
    transition: color 160ms var(--ease);
}

.mod-opt-value.is-pop {
    animation: mod-opt-value-pop 240ms cubic-bezier(0.2, 1.2, 0.3, 1);
}

.mod-slider {
    position: relative;
    display: grid;
    align-items: center;
    width: 100%;
    height: 32px;
    touch-action: none;
    cursor: grab;
    outline: none;
    --mod-slider: #4C7BF0;
    --mod-slider-glow: color-mix(in srgb, var(--mod-slider) 42%, transparent);
    --index: 0;
    --steps: 3;
    --pos: 0;
}

.mod-slider:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mod-slider) 28%, transparent);
    border-radius: 999px;
}

.mod-slider-track {
    position: absolute;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 16px;
    padding: 0 14px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            color-mix(in srgb, var(--mod-slider) 88%, #fff 12%) 0%,
            var(--mod-slider) 48%,
            color-mix(in srgb, var(--mod-slider) 82%, #1a1c22 18%) 100%
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.08);
    transition:
        transform 160ms cubic-bezier(0.2, 0.9, 0.2, 1),
        filter 160ms var(--ease),
        box-shadow 180ms var(--ease);
}

.mod-slider.is-dragging .mod-slider-track {
    transform: scaleY(1.08);
    filter: saturate(1.08) brightness(1.04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.14),
        0 0 0 4px var(--mod-slider-glow),
        0 6px 18px color-mix(in srgb, var(--mod-slider) 28%, transparent);
}

.mod-slider-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.42);
    pointer-events: none;
    transform: scale(1);
    transition:
        background-color 160ms var(--ease),
        transform 180ms cubic-bezier(0.2, 1.15, 0.3, 1),
        box-shadow 180ms var(--ease);
}

.mod-slider-dot.is-on {
    background: rgba(255, 255, 255, 0.88);
}

.mod-slider-dot.is-active {
    background: #fff;
    transform: scale(1.35);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.mod-slider-dot.is-tick {
    animation: mod-slider-tick 260ms cubic-bezier(0.2, 1.4, 0.3, 1);
}

.mod-slider-thumb {
    position: absolute;
    top: 50%;
    left: calc(14px + ((100% - 28px) * var(--pos)));
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #fff 0%, #f4f6fb 62%, #e8ecf5 100%);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.16),
        0 6px 14px rgba(0, 0, 0, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.55) inset;
    transform: translate(-50%, -50%) scale(1);
    transition:
        left 300ms cubic-bezier(0.22, 1.35, 0.36, 1),
        transform 180ms cubic-bezier(0.2, 1.2, 0.3, 1),
        box-shadow 180ms var(--ease);
    pointer-events: none;
    will-change: left, transform;
}

.mod-slider.is-dragging {
    cursor: grabbing;
}

.mod-slider.is-dragging .mod-slider-thumb {
    transition:
        left 48ms linear,
        transform 140ms cubic-bezier(0.2, 1.1, 0.3, 1),
        box-shadow 140ms var(--ease);
    transform: translate(-50%, -50%) scale(1.14);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.18),
        0 10px 22px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.7) inset,
        0 0 0 6px var(--mod-slider-glow);
}

.mod-slider.is-settling .mod-slider-thumb {
    transition:
        left 340ms cubic-bezier(0.18, 1.45, 0.32, 1),
        transform 280ms cubic-bezier(0.2, 1.25, 0.3, 1),
        box-shadow 280ms var(--ease);
}

.mod-slider.is-tick .mod-slider-thumb {
    animation: mod-slider-thumb-tick 220ms cubic-bezier(0.2, 1.35, 0.3, 1);
}

@keyframes mod-slider-tick {
    0% { transform: scale(1); }
    35% { transform: scale(1.9); background: #fff; }
    100% { transform: scale(1.35); }
}

@keyframes mod-slider-thumb-tick {
    0%, 100% { filter: brightness(1); }
    45% { filter: brightness(1.08); }
}

@keyframes mod-opt-value-pop {
    0% { transform: translateY(0) scale(1); opacity: 0.55; }
    45% { transform: translateY(-2px) scale(1.08); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .mod-opt-value.is-pop,
    .mod-slider-dot.is-tick,
    .mod-slider.is-tick .mod-slider-thumb {
        animation: none !important;
    }

    .mod-slider-thumb,
    .mod-slider.is-dragging .mod-slider-thumb,
    .mod-slider.is-settling .mod-slider-thumb,
    .mod-slider-track,
    .mod-slider-dot {
        transition-duration: 1ms !important;
    }
}

.mod-opt-toggle {
    flex: 0 0 auto;
    width: 42px;
    height: 26px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(26, 28, 34, 0.06);
    cursor: pointer;
    transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.mod-opt-toggle-knob {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    transform: translateX(0);
    transition: transform 160ms var(--ease);
}

.mod-opt-toggle.is-on,
.mod-opt-toggle[aria-checked="true"] {
    background: var(--accent);
    border-color: var(--accent);
}

.mod-opt-toggle.is-on .mod-opt-toggle-knob,
.mod-opt-toggle[aria-checked="true"] .mod-opt-toggle-knob {
    transform: translateX(16px);
    border-color: transparent;
}

.mod-switch {
    flex: 0 0 auto;
    width: 46px;
    height: 28px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(26, 28, 34, 0.06);
    transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.mod-switch-knob {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    transform: translateX(0);
    transition: transform 160ms var(--ease);
}

.mod-switch.is-on,
.mod-switch[aria-checked="true"] {
    background: var(--accent);
    border-color: var(--accent);
}

.mod-switch.is-on .mod-switch-knob,
.mod-switch[aria-checked="true"] .mod-switch-knob {
    transform: translateX(18px);
    border-color: transparent;
}

/* Homepage mod overlays ? decoration only; never in the click path */
.mod-layer,
.mod-layer * {
    pointer-events: none !important;
}

.mod-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none !important;
}

body.is-play .mod-layer,
body.is-library .mod-layer,
body.is-settings .mod-layer {
    display: none !important;
}

.mod-emoji-rain {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none !important;
    contain: strict;
}

.mod-emoji-rain-canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
}

.mod-stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none !important;
}

.mod-stars-canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
}

html[data-scheme="dark"] .mod-stars {
    opacity: 1;
}

html[data-scheme="light"] .mod-stars {
    opacity: 0.92;
}

.mod-soft-glow-fx {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.mod-soft-glow-blob {
    position: absolute;
    width: 58vw;
    height: 46vh;
    border-radius: 50%;
    opacity: 0.9;
}

.mod-soft-glow-blob.is-left {
    left: -12%;
    top: -16%;
    background: radial-gradient(closest-side, rgba(13, 159, 110, 0.2), transparent 72%);
}

.mod-soft-glow-blob.is-right {
    right: -10%;
    top: -12%;
    width: 48vw;
    height: 40vh;
    background: radial-gradient(closest-side, rgba(224, 122, 95, 0.14), transparent 74%);
}

body.mod-blink-stamp::after {
    content: "BLINK";
    position: fixed;
    right: -2%;
    bottom: 4%;
    z-index: 0;
    pointer-events: none !important;
    font-family: var(--font, Outfit, system-ui, sans-serif);
    font-size: clamp(5rem, 18vw, 11rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.8;
    color: var(--stamp);
    transform: rotate(-12deg);
}

body.is-play.mod-blink-stamp::after,
body.is-library.mod-blink-stamp::after,
body.is-settings.mod-blink-stamp::after {
    display: none !important;
}


html[data-scheme="dark"] .cat-arcade {
    --wash: color-mix(in srgb, #C47A68 28%, var(--paper));
    --wash-2: color-mix(in srgb, #8E4F42 18%, var(--bg));
    --cat-ink: #F0C4B6;
}

html[data-scheme="dark"] .cat-sports {
    --wash: color-mix(in srgb, #5A9BB8 26%, var(--paper));
    --wash-2: color-mix(in srgb, #3A6F88 16%, var(--bg));
    --cat-ink: #B7DDF0;
}

html[data-scheme="dark"] .cat-sandbox {
    --wash: color-mix(in srgb, #7A6FB8 26%, var(--paper));
    --wash-2: color-mix(in srgb, #534A88 16%, var(--bg));
    --cat-ink: #D2C6FF;
}

html[data-scheme="dark"] .cat-puzzle {
    --wash: color-mix(in srgb, #C4A45A 24%, var(--paper));
    --wash-2: color-mix(in srgb, #8E7438 15%, var(--bg));
    --cat-ink: #F0DCA0;
}

html[data-scheme="dark"] .cat-relax {
    --wash: color-mix(in srgb, #4DB89A 24%, var(--paper));
    --wash-2: color-mix(in srgb, #2E7A68 15%, var(--bg));
    --cat-ink: #AFEBD6;
}

/* Dark scheme polish ? uses theme tokens so each dark theme stays distinct */
html[data-scheme="dark"] body {
    background:
        radial-gradient(980px 460px at 6% -14%, var(--glow-a), transparent 62%),
        radial-gradient(820px 420px at 100% -4%, var(--glow-b), transparent 66%),
        radial-gradient(640px 320px at 70% 80%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
        var(--bg);
}

html[data-scheme="dark"] .brand {
    text-shadow: 0 0 48px color-mix(in srgb, var(--accent) 28%, transparent);
}

html[data-scheme="dark"] .brand-stop {
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 55%, transparent));
}

html[data-scheme="dark"] .brand-year {
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 42%, transparent));
}

html[data-scheme="dark"] .top {
    border-bottom-color: var(--line-strong);
}

html[data-scheme="dark"] .btn:not(.btn-fill) {
    background: color-mix(in srgb, var(--paper) 92%, #fff 8%);
    border-color: var(--line-strong);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

html[data-scheme="dark"] .btn:not(.btn-fill):hover {
    background: color-mix(in srgb, var(--paper) 80%, #fff 20%);
    border-color: color-mix(in srgb, var(--ink) 28%, transparent);
}

html[data-scheme="dark"] .btn-fill {
    box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 28%, transparent);
}

html[data-scheme="dark"] .search {
    background: color-mix(in srgb, var(--bg-deep) 70%, var(--paper));
    border-color: var(--line-strong);
}

html[data-scheme="dark"] .search:hover {
    border-color: color-mix(in srgb, var(--ink) 28%, transparent);
}

html[data-scheme="dark"] .search:focus {
    border-color: var(--line);
    background: var(--paper);
    box-shadow: inset 0 -2px var(--accent);
}

html[data-scheme="dark"] .search-key {
    background: var(--bg);
    border-color: var(--line);
}

html[data-scheme="dark"] .card {
    background: color-mix(in srgb, var(--paper) 92%, #000 8%);
    border-color: color-mix(in srgb, var(--line) 85%, transparent);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

html[data-scheme="dark"] .card:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    box-shadow:
        0 22px 40px rgba(0, 0, 0, 0.38),
        0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent),
        0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

html[data-scheme="dark"] .btn:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

html[data-scheme="dark"] .card-art {
    border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent);
}

html[data-scheme="dark"] .card-mono {
    text-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

html[data-scheme="dark"] .card-by {
    color: color-mix(in srgb, var(--mute) 82%, var(--accent));
}

html[data-scheme="dark"] .card-star {
    background: color-mix(in srgb, var(--paper) 70%, #000 30%);
    border: 1px solid var(--line-strong);
    color: var(--mute);
}

html[data-scheme="dark"] .card-star:hover {
    color: var(--ink);
    border-color: color-mix(in srgb, var(--ink) 28%, transparent);
}

html[data-scheme="dark"] .card-star.is-on {
    color: var(--accent-dark);
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

html[data-scheme="dark"] .card-play:focus-visible {
    outline-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

html[data-scheme="dark"] .toolbar {
    border-bottom-color: var(--line);
}

html[data-scheme="dark"] .home-section .toolbar {
    border-color: var(--line);
    background: color-mix(in srgb, var(--paper) 70%, transparent);
}

html[data-scheme="dark"] .tag {
    background: transparent;
    border-color: transparent;
}

html[data-scheme="dark"] .tag:hover {
    color: var(--ink);
    background: color-mix(in srgb, var(--ink) 6%, transparent);
    border-color: transparent;
}

html[data-scheme="dark"] .tag.is-on {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    border-color: transparent;
    color: var(--accent-dark);
}

html[data-scheme="dark"] .sort {
    background: color-mix(in srgb, var(--bg) 70%, var(--paper));
    border-color: var(--line);
}

html[data-scheme="dark"] .sort-btn.is-on {
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

html[data-scheme="dark"] .settings-panel {
    background: color-mix(in srgb, var(--paper) 88%, #000 12%);
    border-left-color: var(--line-strong);
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.35);
}

html[data-scheme="dark"] .settings-scrim {
    background: rgba(4, 6, 10, 0.62);
}

html[data-scheme="dark"] .mod-item,
html[data-scheme="dark"] .theme-dd-trigger,
html[data-scheme="dark"] .theme-dd-menu,
html[data-scheme="dark"] .settings-card,
html[data-scheme="dark"] .mods-search input {
    background: var(--paper);
    border-color: var(--line);
}

html[data-scheme="dark"] .settings-nav {
    background: color-mix(in srgb, var(--paper) 82%, #000 18%);
    border-bottom-color: var(--line);
}

html[data-scheme="dark"] .settings-nav-btn.is-active {
    background: color-mix(in srgb, var(--paper) 88%, #fff 8%);
    border-color: var(--line-strong);
}

html[data-scheme="dark"] .mods-filter.is-active {
    color: var(--accent);
}

html[data-scheme="dark"] .mod-group-count {
    background: rgba(255, 255, 255, 0.06);
}

html[data-scheme="dark"] .settings-panel {
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.35);
    background: linear-gradient(180deg, color-mix(in srgb, var(--paper) 96%, #fff 4%) 0%, var(--paper) 42%);
}

html[data-scheme="dark"] .mod-row {
    background: transparent;
}

html[data-scheme="dark"] .mod-opts {
    border-top-color: var(--line);
    background: color-mix(in srgb, var(--paper) 70%, #000 30%);
}

html[data-scheme="dark"] .mod-opts-btn {
    border-color: var(--line);
    background: color-mix(in srgb, var(--paper) 88%, #000 12%);
    color: var(--mute);
}

html[data-scheme="dark"] .mod-opts-btn:hover,
html[data-scheme="dark"] .mod-opts-btn.is-open {
    color: var(--ink);
    border-color: var(--line-strong);
    background: color-mix(in srgb, var(--paper) 82%, #fff 18%);
}

html[data-scheme="dark"] .mod-item:hover,
html[data-scheme="dark"] .theme-dd-trigger:hover {
    border-color: var(--line-strong);
}

html[data-scheme="dark"] .mod-row:hover {
    background: transparent;
}

html[data-scheme="dark"] .theme-dd-option:hover,
html[data-scheme="dark"] .theme-dd-option.is-active {
    background: color-mix(in srgb, var(--paper) 82%, #fff 18%);
}

html[data-scheme="dark"] .theme-dd-option.is-on {
    background: var(--accent-soft);
    color: var(--ink);
}

html[data-scheme="dark"] .theme-dd-option.is-on .theme-dd-check {
    color: var(--accent);
}

html[data-scheme="dark"] .mod-switch {
    background: rgba(245, 242, 235, 0.08);
    border-color: rgba(245, 242, 235, 0.14);
}

html[data-scheme="dark"] .mod-switch-knob {
    background: #E8ECF2;
    border-color: transparent;
}

html[data-scheme="dark"] .mod-switch.is-on,
html[data-scheme="dark"] .mod-switch[aria-checked="true"] {
    background: var(--accent);
    border-color: var(--accent);
}

html[data-scheme="dark"] .panel {
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 20%),
        var(--bg);
}

html[data-scheme="dark"] .panel-bar {
    border-bottom-color: var(--line-strong);
}

html[data-scheme="dark"] .mod-soft-glow-blob.is-left {
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 28%, transparent), transparent 72%);
}

html[data-scheme="dark"] .mod-soft-glow-blob.is-right {
    background: radial-gradient(closest-side, var(--glow-b), transparent 74%);
}

body.is-library .app,
body.is-settings .app,
body.is-play .app,
body.is-play .panel {
    visibility: hidden;
    pointer-events: none;
    /* Skip laying out / painting the home deck while Library is up */
    content-visibility: hidden;
}

body.is-play .panel {
    display: none !important;
}

@media (max-width: 900px) {
    .top {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
        gap: 26px 34px;
    }

    .brand {
        font-size: clamp(4.2rem, 10vw, 6.2rem);
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 14px;
    }

    .panel-note {
        display: none;
    }
}

@media (max-width: 700px) {
    .app {
        padding: 22px 16px 56px;
    }

    .top {
        grid-template-areas:
            "brand actions"
            "search search";
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 18px 14px;
        margin-bottom: 24px;
        padding: 10px 0 22px;
    }

    .brand {
        font-size: clamp(3.6rem, 16vw, 5.2rem);
    }

    .home-section .toolbar {
        padding: 6px;
        border-radius: 12px;
    }

    .brand-line {
        max-width: 17rem;
        margin-top: 18px;
        margin-left: 2px;
        font-size: 0.9rem;
    }

    .top-actions {
        align-self: start;
    }

    .section-title {
        font-size: 2rem;
    }

    .toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding-top: 6px;
    }

    .tags {
        width: calc(100vw - 32px);
        margin-right: -16px;
        margin-left: -16px;
        padding: 0 16px 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tags::-webkit-scrollbar {
        display: none;
    }

    .tag {
        min-height: 42px;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .card-meta {
        min-height: 78px;
        padding: 13px 13px 14px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .card-mono {
        bottom: 13px;
        left: 13px;
        font-size: clamp(2.25rem, 13vw, 3.35rem);
    }

    .card-tag {
        top: 12px;
        left: 13px;
    }

    .card-star {
        top: 8px;
        right: 8px;
        width: 42px;
        height: 42px;
    }

    .panel-bar {
        grid-template-areas:
            "back title"
            "search search";
        grid-template-columns: auto 1fr;
        gap: 15px;
        padding: 24px 16px 20px;
    }

    .panel-back {
        grid-area: back;
    }

    .panel-title-wrap {
        grid-area: title;
    }

    .panel-title {
        font-size: 2.35rem;
    }

    .panel-search {
        grid-area: search;
    }

    .panel-toolbar {
        margin-bottom: 8px;
        padding: 10px 16px 8px;
        border-bottom: 0;
    }

    .panel-toolbar .tags {
        width: calc(100vw - 16px);
    }

    .panel-body {
        padding: 0 16px 40px;
        scrollbar-gutter: auto;
    }

    .empty {
        padding-right: 16px;
        padding-left: 16px;
    }
}

@media (max-width: 420px) {
    .brand-line {
        max-width: 14rem;
    }

    .top-actions .btn:not(.btn-icon) {
        padding-right: 13px;
        padding-left: 13px;
    }

    .section-meta {
        max-width: 110px;
        text-align: right;
    }

    .card-go {
        display: none;
    }

    .card-meta {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-panel {
        padding: 24px 20px 30px;
        border-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* ============================================================
   Liquid glass v2 - grouped optics, bounded motion, no grid
   ============================================================ */
body.mod-liquid-glass {
    --bg: #080D11;
    --bg-deep: #111820;
    --paper: #111820;
    --ink: #F2F7F5;
    --ink-soft: #CFD8D5;
    --mute: #99A6A2;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.2);
    --accent: #2AD49A;
    --accent-dark: #66E8B9;
    --accent-soft: rgba(42, 212, 154, 0.16);
    --glass-fill: rgba(17, 24, 32, 0.58);
    --glass-fill-thick: rgba(12, 18, 24, 0.86);
    --glass-line: rgba(255, 255, 255, 0.16);
    --glass-line-hot: rgba(214, 255, 242, 0.34);
    --glass-highlight: rgba(255, 255, 255, 0.42);
    --glass-shadow: rgba(0, 0, 0, 0.28);
    --glass-blur: 16px;
    --glass-spring: cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--ink);
    background:
        radial-gradient(980px 520px at 50% -22%, rgba(255, 255, 255, 0.055), transparent 66%),
        linear-gradient(155deg, #07110F 0%, #0A1117 48%, #080A0F 100%);
}

body.mod-liquid-glass::before {
    height: 2px;
    background: linear-gradient(90deg, #29D99C, #70E4C3 42%, #6AB7E8 76%, #29D99C);
    box-shadow: 0 0 18px rgba(42, 212, 154, 0.28);
}

body.mod-liquid-glass .mod-layer {
    z-index: 0 !important;
}

.mod-liquid-field {
    position: absolute;
    inset: -16%;
    overflow: hidden;
    contain: strict;
    opacity: 0.94;
    transform: translateZ(0);
}

.mod-liquid-field::after {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 42% 27% at 54% 10%, rgba(255, 255, 255, 0.09), transparent 72%),
        linear-gradient(180deg, rgba(4, 11, 14, 0.02), rgba(4, 7, 11, 0.34));
    content: "";
}

.liquid-flow {
    position: absolute;
    width: 72vmax;
    height: 72vmax;
    border-radius: 50%;
    opacity: 0.58;
    transform: translate3d(0, 0, 0) scale(1);
    will-change: transform, opacity;
}

.liquid-flow-a {
    top: -39vmax;
    left: -28vmax;
    background: radial-gradient(circle, rgba(42, 212, 154, 0.34) 0%, rgba(23, 151, 129, 0.13) 38%, transparent 70%);
    animation: liquidFlowA 18s ease-in-out infinite alternate;
}

.liquid-flow-b {
    top: -31vmax;
    right: -30vmax;
    background: radial-gradient(circle, rgba(98, 179, 232, 0.28) 0%, rgba(75, 112, 212, 0.1) 42%, transparent 70%);
    animation: liquidFlowB 22s ease-in-out infinite alternate;
}

.liquid-flow-c {
    bottom: -48vmax;
    left: 18%;
    background: radial-gradient(circle, rgba(244, 139, 112, 0.17) 0%, rgba(168, 81, 129, 0.07) 42%, transparent 70%);
    animation: liquidFlowC 26s ease-in-out infinite alternate;
}

body.glass-paused .liquid-flow,
body.glass-paused .mod-liquid-field::before,
body.glass-paused .mod-liquid-field::after,
body.glass-paused.mod-liquid-glass .top,
body.glass-paused.mod-liquid-glass .toolbar,
body.glass-paused.mod-liquid-glass .tag.is-on,
body.glass-paused.mod-liquid-glass .sort-btn.is-on {
    animation-play-state: paused;
}

/* Glass belongs to the control layer. Related controls share one lens. */
body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .toolbar,
body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .settings-panel,
body.mod-liquid-glass .theme-dd-menu {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid var(--glass-line);
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.025) 48%, rgba(42, 212, 154, 0.035)),
        var(--glass-fill);
    box-shadow:
        0 14px 36px var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(var(--glass-blur)) saturate(135%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(135%);
}

body.mod-liquid-glass .top-actions {
    gap: 2px;
    padding: 4px;
    border-radius: 18px;
}

body.mod-liquid-glass .home-search-wrap {
    border-radius: 18px;
    transition: border-color 260ms var(--glass-spring), transform 360ms var(--glass-spring);
}

body.mod-liquid-glass .home-search-wrap:focus-within {
    border-color: rgba(111, 240, 193, 0.48);
    transform: translateY(-1px) scale(1.006);
}

body.mod-liquid-glass .toolbar {
    gap: 10px;
    margin-bottom: 26px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--glass-line);
    border-radius: 20px;
}

body.mod-liquid-glass .panel-bar {
    border-width: 0 0 1px;
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.018)),
        rgba(9, 15, 20, 0.84);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px) saturate(125%);
    -webkit-backdrop-filter: blur(10px) saturate(125%);
}

body.mod-liquid-glass .settings-panel {
    border-left-color: var(--glass-line);
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025) 45%, rgba(42, 212, 154, 0.03)),
        var(--glass-fill-thick);
    backdrop-filter: blur(12px) saturate(128%);
    -webkit-backdrop-filter: blur(12px) saturate(128%);
}

body.mod-liquid-glass .theme-dd-menu {
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
        rgba(10, 16, 22, 0.94);
    backdrop-filter: blur(10px) saturate(125%);
    -webkit-backdrop-filter: blur(10px) saturate(125%);
}

/* Inner controls are lightweight: no nested glass or per-control blur. */
body.mod-liquid-glass .btn:not(.btn-fill),
body.mod-liquid-glass .search,
body.mod-liquid-glass .tag,
body.mod-liquid-glass .sort,
body.mod-liquid-glass .sort-btn,
body.mod-liquid-glass .search-clear,
body.mod-liquid-glass .card-star,
body.mod-liquid-glass .mod-row,
body.mod-liquid-glass .theme-dd-trigger,
body.mod-liquid-glass .mod-switch {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

body.mod-liquid-glass .top-actions .btn,
body.mod-liquid-glass .home-search-wrap .search,
body.mod-liquid-glass .toolbar .tag,
body.mod-liquid-glass .toolbar .sort-btn {
    border-color: transparent;
    background: transparent;
}

body.mod-liquid-glass .search {
    color: var(--ink);
}

body.mod-liquid-glass .search:focus {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

body.mod-liquid-glass .search::placeholder {
    color: rgba(214, 225, 221, 0.58);
}

body.mod-liquid-glass .search-key {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--mute);
    background: rgba(255, 255, 255, 0.045);
}

body.mod-liquid-glass .top-actions .btn:hover,
body.mod-liquid-glass .toolbar .tag:hover,
body.mod-liquid-glass .toolbar .sort-btn:hover,
body.mod-liquid-glass .search-clear:hover {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.075);
}

body.mod-liquid-glass .panel-search {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
}

body.mod-liquid-glass .panel-search .search {
    border-color: transparent;
    background: transparent;
}

body.mod-liquid-glass .sort {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.045);
}

body.mod-liquid-glass .tag::after {
    display: none;
}

body.mod-liquid-glass .tag.is-on,
body.mod-liquid-glass .sort-btn.is-on {
    border-color: rgba(130, 255, 210, 0.22);
    color: #C8FBE8;
    background:
        linear-gradient(150deg, rgba(92, 242, 184, 0.2), rgba(42, 212, 154, 0.08)),
        rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body.mod-liquid-glass .mod-row,
body.mod-liquid-glass .theme-dd-trigger {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.045);
}

body.mod-liquid-glass .mod-row:hover,
body.mod-liquid-glass .theme-dd-trigger:hover,
body.mod-liquid-glass .theme-dd-option:hover,
body.mod-liquid-glass .theme-dd-option.is-active {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.075);
}

body.mod-liquid-glass .settings-scrim {
    background: rgba(2, 5, 8, 0.64);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.mod-liquid-glass .panel {
    background:
        radial-gradient(760px 340px at 12% -12%, rgba(42, 212, 154, 0.1), transparent 68%),
        radial-gradient(680px 320px at 96% 4%, rgba(98, 179, 232, 0.08), transparent 70%),
        #090E13;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Cards stay in the content layer, with glass-like rims but no expensive blur. */
body.mod-liquid-glass .card {
    isolation: isolate;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.105);
    border-radius: 20px;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.055), transparent 48%),
        rgba(11, 17, 23, 0.82);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* No translateZ(0) ? a layer per card wrecks Library scroll FPS */
    transition: transform 360ms var(--glass-spring), border-color 220ms ease;
}

/* Library liquid-glass cards: lighter rest state, no inset glow layers while scrolling */
body.mod-liquid-glass #library .card {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

body.mod-liquid-glass #library .card::before {
    display: none;
}

body.mod-liquid-glass #library .panel-body.is-scrolling .card:hover,
body.mod-liquid-glass #library .panel-body.is-scrolling .card:active {
    transform: none;
    border-color: rgba(255, 255, 255, 0.105);
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.055), transparent 48%),
        rgba(11, 17, 23, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

body.mod-liquid-glass .card::before {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.13),
        inset -1px -1px 0 rgba(0, 0, 0, 0.16);
    content: "";
    pointer-events: none;
}

body.mod-liquid-glass .card:hover {
    border-color: rgba(190, 255, 233, 0.24);
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.065), transparent 48%),
        rgba(11, 17, 23, 0.82);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    transform: translateY(-4px) scale(1.008);
}

body.mod-liquid-glass .card:active {
    transform: translateY(-1px) translateZ(0);
    scale: 0.982;
}

body.mod-liquid-glass .card-art {
    border-bottom-color: rgba(255, 255, 255, 0.075);
    background:
        radial-gradient(180px circle at 18% 0%, rgba(255, 255, 255, 0.11), transparent 64%),
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--wash) 76%, transparent),
            color-mix(in srgb, var(--wash-2) 86%, transparent)
        );
}

body.mod-liquid-glass .card-meta {
    background: rgba(5, 9, 13, 0.24);
}

body.mod-liquid-glass .card-star {
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #D8E4E0;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035)),
        rgba(11, 18, 24, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

body.mod-liquid-glass .card-star.is-on {
    border-color: rgba(84, 238, 180, 0.32);
    color: #78F0C3;
    background:
        linear-gradient(145deg, rgba(70, 228, 169, 0.22), rgba(42, 212, 154, 0.08)),
        rgba(10, 28, 23, 0.8);
}

body.mod-liquid-glass .btn-fill {
    border-color: rgba(106, 243, 192, 0.42);
    background: linear-gradient(145deg, #2AD49A, #15966F);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch) {
    transition:
        transform 360ms var(--glass-spring),
        scale 90ms ease,
        border-color 180ms ease,
        background-color 180ms ease;
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch):active {
    transform: translateZ(0);
    scale: 0.975;
}

body.mod-liquid-glass .glass-release {
    animation: glassRelease 420ms var(--glass-spring);
}

body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .toolbar {
    animation: glassMaterialize 460ms var(--glass-spring) both;
}

/* Conservative tier: one moving field and a much smaller blur budget. */
body.mod-liquid-glass.glass-lite {
    --glass-blur: 7px;
}

body.glass-lite .liquid-flow-a {
    opacity: 0.5;
    animation-duration: 28s;
}

body.glass-lite .liquid-flow-b {
    opacity: 0.28;
    animation: none;
    transform: translate3d(-4%, 3%, 0) scale(0.96);
}

body.glass-lite .liquid-flow-c {
    display: none;
}

@keyframes liquidFlowA {
    0% { transform: translate3d(-3%, -2%, 0) scale(0.96); opacity: 0.46; }
    52% { opacity: 0.64; }
    100% { transform: translate3d(11%, 8%, 0) scale(1.08); opacity: 0.54; }
}

@keyframes liquidFlowB {
    0% { transform: translate3d(4%, -3%, 0) scale(1.04); opacity: 0.38; }
    100% { transform: translate3d(-12%, 10%, 0) scale(0.94); opacity: 0.58; }
}

@keyframes liquidFlowC {
    0% { transform: translate3d(-8%, 2%, 0) scale(0.92); opacity: 0.28; }
    100% { transform: translate3d(10%, -10%, 0) scale(1.06); opacity: 0.46; }
}

@keyframes glassMaterialize {
    0% { opacity: 0; transform: translateY(8px) scale(0.985); }
    65% { opacity: 1; }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glassRelease {
    0% { scale: 0.975; }
    44% { scale: 1.014; }
    72% { scale: 0.998; }
    100% { scale: 1; }
}

@media (max-width: 700px) {
    body.mod-liquid-glass .toolbar {
        gap: 6px;
        padding: 9px;
    }

    body.mod-liquid-glass .toolbar .tags {
        width: 100%;
        margin: 0;
        padding: 0 0 4px;
    }

    body.mod-liquid-glass .top-actions {
        border-radius: 16px;
    }
}

@media (pointer: coarse), (update: slow) {
    body.mod-liquid-glass {
        --glass-blur: 7px;
    }

    body.mod-liquid-glass .liquid-flow {
        animation: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    body.mod-liquid-glass .top-actions,
    body.mod-liquid-glass .home-search-wrap,
    body.mod-liquid-glass .toolbar,
    body.mod-liquid-glass .panel-bar,
    body.mod-liquid-glass .settings-panel,
    body.mod-liquid-glass .theme-dd-menu {
        background: rgba(14, 20, 27, 0.96);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@media (forced-colors: active) {
    body.mod-liquid-glass .top-actions,
    body.mod-liquid-glass .home-search-wrap,
    body.mod-liquid-glass .toolbar,
    body.mod-liquid-glass .panel-bar,
    body.mod-liquid-glass .settings-panel,
    body.mod-liquid-glass .theme-dd-menu,
    body.mod-liquid-glass .card {
        border: 1px solid CanvasText;
        color: CanvasText;
        background: Canvas;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.mod-liquid-glass .top-actions,
    body.mod-liquid-glass .home-search-wrap,
    body.mod-liquid-glass .toolbar,
    body.mod-liquid-glass .panel-bar,
    body.mod-liquid-glass .settings-panel,
    body.mod-liquid-glass .theme-dd-menu {
        background: rgba(14, 20, 27, 0.94);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.mod-liquid-glass .liquid-flow,
    body.mod-liquid-glass .top-actions,
    body.mod-liquid-glass .home-search-wrap,
    body.mod-liquid-glass .toolbar,
    body.mod-liquid-glass .glass-release {
        animation: none !important;
    }

}

/* ============================================================
   Liquid glass v3 - real desktop refraction and liquid motion
   Desktop only: js/mods.js does not enable this material below 901px
   or without a fine pointer.
   ============================================================ */
body.mod-liquid-glass {
    --glass-blur: 16px;
    --glass-fill: rgba(10, 20, 27, 0.34);
    --glass-fill-thick: rgba(9, 17, 24, 0.72);
    --glass-line: rgba(224, 255, 247, 0.32);
    --glass-line-hot: rgba(232, 255, 250, 0.72);
    --glass-shadow: rgba(0, 3, 7, 0.52);
    --glass-spring: cubic-bezier(0.18, 1.45, 0.32, 1);
    --glass-viscous: cubic-bezier(0.28, 0.08, 0.12, 1);
    --glass-wobble: cubic-bezier(0.22, 1.8, 0.36, 1);
    background:
        radial-gradient(900px 560px at 8% -8%, rgba(36, 230, 164, 0.13), transparent 64%),
        radial-gradient(820px 520px at 94% 8%, rgba(59, 158, 255, 0.12), transparent 66%),
        linear-gradient(148deg, #050D0C 0%, #08121A 48%, #07090E 100%);
}

body.mod-liquid-glass .mod-liquid-field {
    inset: -10%;
    opacity: 1;
    contain: strict;
    transform: translateZ(0);
    pointer-events: none;
}

body.mod-liquid-glass .mod-liquid-field::before {
    position: absolute;
    inset: -6%;
    background:
        linear-gradient(118deg, transparent 8%, rgba(81, 255, 195, 0.14) 26%, transparent 42%),
        radial-gradient(ellipse 36% 20% at 52% 12%, rgba(255, 255, 255, 0.16), transparent 72%);
    content: "";
    opacity: 0.85;
    transform: translateZ(0);
    animation: liquidSheen 10s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

body.mod-liquid-glass .mod-liquid-field::after {
    background:
        radial-gradient(ellipse 40% 26% at 46% 5%, rgba(255, 255, 255, 0.12), transparent 72%),
        linear-gradient(180deg, rgba(3, 11, 14, 0.01), rgba(3, 6, 10, 0.38));
    animation: none;
}

/* Only transform+opacity ? no border-radius/filter/blend (those caused the lag). */
body.mod-liquid-glass .liquid-flow {
    width: 58vmax;
    height: 58vmax;
    border-radius: 46% 54% 58% 42% / 48% 44% 56% 52%;
    opacity: 0.78;
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

body.mod-liquid-glass .liquid-flow-a {
    top: -30vmax;
    left: -18vmax;
    background:
        radial-gradient(circle at 55% 54%, rgba(61, 255, 191, 0.62) 0%, rgba(24, 206, 159, 0.26) 28%, transparent 68%);
    animation: liquidBlobA 14s ease-in-out infinite;
}

body.mod-liquid-glass .liquid-flow-b {
    top: -24vmax;
    right: -20vmax;
    background:
        radial-gradient(circle at 45% 52%, rgba(104, 190, 255, 0.52) 0%, rgba(62, 114, 235, 0.22) 32%, transparent 70%);
    animation: liquidBlobB 18s ease-in-out infinite;
}

body.mod-liquid-glass .liquid-flow-c,
body.mod-liquid-glass .liquid-flow-d {
    display: none;
}

/* The masthead is the primary lens. The effect is intentionally obvious. */
body.mod-liquid-glass .top {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    gap: 28px 44px;
    margin-bottom: 36px;
    padding: 32px 34px 34px;
    border: 1px solid var(--glass-line);
    border-radius: 32px;
    background:
        radial-gradient(120% 180% at 0% 0%, rgba(255, 255, 255, 0.22), transparent 38%),
        radial-gradient(80% 130% at 100% 100%, rgba(68, 222, 182, 0.1), transparent 58%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.025) 48%, rgba(96, 171, 255, 0.06)),
        var(--glass-fill);
    box-shadow:
        0 28px 78px rgba(0, 4, 9, 0.5),
        0 8px 20px rgba(0, 5, 10, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.32),
        -1px 0 0 rgba(82, 240, 220, 0.22),
        1px 0 0 rgba(104, 153, 255, 0.16);
    backdrop-filter: blur(var(--glass-blur)) saturate(185%) brightness(1.08);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(185%) brightness(1.08);
}

body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap {
    border-color: rgba(255, 255, 255, 0.26);
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.035) 52%, rgba(80, 225, 186, 0.07)),
        rgba(7, 15, 21, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18),
        0 10px 26px rgba(0, 5, 9, 0.2);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.mod-liquid-glass .top-actions {
    border-radius: 19px;
}

body.mod-liquid-glass .home-search-wrap {
    border-radius: 19px;
}

body.mod-liquid-glass .brand {
    color: rgba(248, 255, 253, 0.98);
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35),
        0 18px 52px rgba(35, 224, 163, 0.16);
}

body.mod-liquid-glass .brand-stop {
    color: #54F0B9;
    text-shadow: 0 0 22px rgba(39, 225, 162, 0.38);
}

/* Secondary lenses share the same refractive material. */
body.mod-liquid-glass .toolbar,
body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .settings-panel,
body.mod-liquid-glass .theme-dd-menu {
    border-color: var(--glass-line);
    background:
        radial-gradient(130% 180% at 0% 0%, rgba(255, 255, 255, 0.17), transparent 39%),
        linear-gradient(148deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.025) 50%, rgba(71, 210, 174, 0.055)),
        var(--glass-fill);
    box-shadow:
        0 18px 48px rgba(0, 4, 9, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -1px 0 rgba(0, 0, 0, 0.24),
        -1px 0 0 rgba(92, 238, 219, 0.18),
        1px 0 0 rgba(98, 150, 255, 0.13);
    backdrop-filter: blur(24px) saturate(180%) brightness(1.07);
    -webkit-backdrop-filter: blur(24px) saturate(180%) brightness(1.07);
}

body.mod-liquid-glass .toolbar {
    min-height: 62px;
    padding: 10px 12px;
    border: 1px solid var(--glass-line);
    border-radius: 23px;
}

body.mod-liquid-glass .panel-bar {
    border-bottom-color: rgba(235, 255, 250, 0.28);
}

body.mod-liquid-glass .settings-panel {
    background:
        radial-gradient(110% 75% at 0% 0%, rgba(255, 255, 255, 0.16), transparent 45%),
        linear-gradient(148deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.025) 50%, rgba(71, 210, 174, 0.045)),
        rgba(7, 15, 22, 0.74);
}

/* Frosted panels use translucent fills only ? no backdrop-filter.
   Chromium paints a chromatic cursor disc when SVG url() filters
   (or aggressive blur) sit under the pointer on these surfaces. */
body.mod-liquid-glass .top,
body.mod-liquid-glass .toolbar,
body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .settings-panel,
body.mod-liquid-glass .theme-dd-menu,
body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass:not(.glass-lite) #homeGrid .card,
body.mod-liquid-glass .card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.mod-liquid-glass :is(.top, .toolbar, .panel-bar, .settings-panel, .theme-dd-menu)::before {
    display: none !important;
}

body.mod-liquid-glass :is(.top, .toolbar, .panel-bar, .settings-panel, .theme-dd-menu) > *,
body.mod-liquid-glass .card > *:not(.card-star) {
    position: relative;
    z-index: 2;
}

/* Cards become translucent lenses; full card blur is desktop/full-tier only. */
body.mod-liquid-glass .card {
    border-color: rgba(225, 255, 247, 0.2);
    background:
        radial-gradient(130% 90% at 0% 0%, rgba(255, 255, 255, 0.12), transparent 42%),
        linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.012) 53%, rgba(88, 182, 255, 0.04)),
        rgba(5, 13, 18, 0.58);
    box-shadow:
        0 18px 42px rgba(0, 3, 7, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.28),
        -0.5px 0 0 rgba(78, 228, 204, 0.18),
        0.5px 0 0 rgba(94, 145, 255, 0.14);
}

body.mod-liquid-glass .card::before {
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.34),
        inset -1px -1px 0 rgba(0, 0, 0, 0.22),
        inset 0 0 24px rgba(89, 225, 192, 0.035);
}

body.mod-liquid-glass .card:hover {
    border-color: rgba(230, 255, 248, 0.46);
    transform: translateY(-8px) scale(1.018);
    transition:
        transform 680ms var(--glass-spring),
        border-color 280ms ease,
        box-shadow 680ms var(--glass-viscous);
}

body.mod-liquid-glass .card-art {
    background:
        radial-gradient(210px circle at 16% -4%, rgba(255, 255, 255, 0.2), transparent 62%),
        radial-gradient(170px circle at 88% 104%, rgba(89, 238, 198, 0.08), transparent 67%),
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--wash) 66%, transparent),
            color-mix(in srgb, var(--wash-2) 76%, transparent)
        );
}

body.mod-liquid-glass .card-meta {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
        rgba(2, 8, 12, 0.28);
}

body.mod-liquid-glass .card-star {
    border-color: rgba(235, 255, 250, 0.3);
    background:
        radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.28), transparent 44%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.035)),
        rgba(8, 18, 24, 0.48);
    box-shadow:
        0 7px 18px rgba(0, 3, 7, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

body.mod-liquid-glass .toolbar .tag,
body.mod-liquid-glass .toolbar .sort-btn,
body.mod-liquid-glass .top-actions .btn {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.025);
}

body.mod-liquid-glass .toolbar .tag:hover,
body.mod-liquid-glass .toolbar .sort-btn:hover,
body.mod-liquid-glass .top-actions .btn:hover {
    border-color: rgba(255, 255, 255, 0.17);
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-4px) scale(1.06);
}

body.mod-liquid-glass .tag.is-on,
body.mod-liquid-glass .sort-btn.is-on {
    border-color: rgba(179, 255, 231, 0.34);
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.2), transparent 58%),
        linear-gradient(145deg, rgba(72, 236, 179, 0.25), rgba(27, 137, 111, 0.12));
    box-shadow:
        0 5px 18px rgba(13, 111, 83, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch) {
    transition:
        transform 420ms var(--glass-spring),
        border-color 220ms ease,
        background-color 220ms ease;
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch):active {
    transform: translateY(2px) scale(0.94);
}

body.mod-liquid-glass .glass-release {
    animation: glassReleaseLiquid 620ms var(--glass-wobble);
}

body.mod-liquid-glass .top {
    animation: glassMaterializeLiquid 720ms var(--glass-spring) both;
}

body.mod-liquid-glass .toolbar {
    animation: glassMaterializeLiquid 720ms 60ms var(--glass-spring) both;
}

body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .top-actions {
    transition:
        border-color 220ms ease,
        transform 420ms var(--glass-spring),
        box-shadow 320ms ease;
}

body.mod-liquid-glass .home-search-wrap:focus-within {
    transform: translateY(-2px) scale(1.015);
}

/* Lite: softer blobs, smaller blur budget, same compositor-only motion. */
body.mod-liquid-glass.glass-lite {
    --glass-blur: 12px;
}

body.mod-liquid-glass.glass-lite .liquid-flow-a {
    opacity: 0.55;
    animation-duration: 20s;
}

body.mod-liquid-glass.glass-lite .liquid-flow-b {
    opacity: 0.34;
    animation-duration: 26s;
}

@keyframes liquidSheen {
    0% {
        opacity: 0.6;
        transform: translate3d(-2%, -1%, 0) scale(1);
    }
    100% {
        opacity: 0.95;
        transform: translate3d(3%, 2%, 0) scale(1.04);
    }
}

/* Compositor-only blob motion ? soft blob shape is static radial + border-radius. */
@keyframes liquidBlobA {
    0% {
        transform: translate3d(-8%, -4%, 0) rotate(-8deg) scale(0.88);
        opacity: 0.55;
    }
    35% {
        transform: translate3d(14%, 8%, 0) rotate(8deg) scale(1.14);
        opacity: 0.9;
    }
    70% {
        transform: translate3d(4%, 14%, 0) rotate(-2deg) scale(1.02);
        opacity: 0.72;
    }
    100% {
        transform: translate3d(-8%, -4%, 0) rotate(-8deg) scale(0.88);
        opacity: 0.55;
    }
}

@keyframes liquidBlobB {
    0% {
        transform: translate3d(8%, -6%, 0) rotate(10deg) scale(1.1);
        opacity: 0.42;
    }
    50% {
        transform: translate3d(-14%, 12%, 0) rotate(-12deg) scale(0.9);
        opacity: 0.78;
    }
    100% {
        transform: translate3d(8%, -6%, 0) rotate(10deg) scale(1.1);
        opacity: 0.42;
    }
}

@keyframes glassMaterializeLiquid {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes glassReleaseLiquid {
    0% { transform: scale(0.94); }
    40% { transform: scale(1.04); }
    70% { transform: scale(0.99); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-transparency: reduce) {
    body.mod-liquid-glass :is(.top, .toolbar, .panel-bar, .settings-panel, .theme-dd-menu) {
        background: rgba(9, 17, 23, 0.97);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.mod-liquid-glass .liquid-flow,
    body.mod-liquid-glass .mod-liquid-field::before,
    body.mod-liquid-glass .mod-liquid-field::after,
    body.mod-liquid-glass .top,
    body.mod-liquid-glass .toolbar,
    body.mod-liquid-glass .glass-release {
        animation: none !important;
    }

}

@media (forced-colors: active) {
    body.mod-liquid-glass :is(.top, .toolbar, .panel-bar, .settings-panel, .theme-dd-menu, .card) {
        border: 1px solid CanvasText;
        color: CanvasText;
        background: Canvas;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.mod-liquid-glass :is(.top, .toolbar, .panel-bar, .settings-panel, .theme-dd-menu) {
        background: rgba(9, 17, 23, 0.96);
    }
}
/* ============================================================
   Liquid glass v4 - quiet game cards
   ============================================================ */


/* A quieter game tile with one clear art plane and one clear info plane. */
body.mod-liquid-glass .card {
    overflow: hidden;
    border: 1px solid rgba(213, 244, 238, 0.18);
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.055), transparent 42%),
        rgba(4, 11, 16, 0.68);
    box-shadow:
        0 12px 30px rgba(0, 3, 7, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transform-origin: 50% 72%;
    transition:
        transform 480ms var(--glass-spring),
        border-color 220ms ease,
        box-shadow 320ms ease;
}

body.mod-liquid-glass .card::before {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

body.mod-liquid-glass .card:hover {
    border-color: rgba(194, 255, 237, 0.34);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.075), transparent 44%),
        rgba(5, 13, 18, 0.72);
    box-shadow:
        0 24px 50px rgba(0, 3, 7, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateY(-10px) scale(1.025);
}

body.mod-liquid-glass .card:active {
    transform: translateY(-2px) scale(0.97);
}

body.mod-liquid-glass .card-art {
    aspect-ratio: 16 / 10;
    border-bottom: 0;
    background:
        radial-gradient(160px circle at 12% -8%, rgba(255, 255, 255, 0.2), transparent 64%),
        radial-gradient(190px circle at 105% 110%, color-mix(in srgb, var(--cat-ink) 22%, transparent), transparent 68%),
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--wash) 35%, #07151A 65%),
            color-mix(in srgb, var(--wash-2) 25%, #080E17 75%)
        );
    transform-origin: center;
    transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.mod-liquid-glass .card:hover .card-art {
    transform: scale(1.018);
}

body.mod-liquid-glass .card-art::before {
    top: -58%;
    right: -30%;
    width: 88%;
    border-color: color-mix(in srgb, var(--cat-ink) 34%, transparent);
    box-shadow: 0 0 0 28px color-mix(in srgb, var(--cat-ink) 8%, transparent);
    opacity: 0.84;
}

body.mod-liquid-glass .card-art::after {
    display: none;
}

body.mod-liquid-glass .card-tag {
    top: 16px;
    left: 18px;
    color: color-mix(in srgb, var(--cat-ink) 58%, white 42%);
    font-size: 0.59rem;
    letter-spacing: 0.15em;
    opacity: 0.9;
}

body.mod-liquid-glass .card-mono {
    bottom: 18px;
    left: 18px;
    color: color-mix(in srgb, var(--cat-ink) 57%, white 43%);
    font-size: clamp(2.7rem, 3.8vw, 3.8rem);
    letter-spacing: -0.085em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.mod-liquid-glass .card:hover .card-mono {
    transform: translateY(-2px);
}

body.mod-liquid-glass .card-meta {
    min-height: 78px;
    gap: 5px 10px;
    padding: 14px 15px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.095);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 48%),
        rgba(3, 9, 13, 0.46);
}

body.mod-liquid-glass .card-title {
    color: rgba(247, 252, 250, 0.96);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.022em;
}

body.mod-liquid-glass .card-by {
    color: rgba(91, 235, 181, 0.88);
    font-size: 0.61rem;
    letter-spacing: 0.12em;
}

body.mod-liquid-glass .card-go {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 10px;
    color: rgba(224, 238, 234, 0.56);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.9rem;
    transform: none;
    transition:
        color 220ms ease,
        border-color 220ms ease,
        background-color 220ms ease,
        transform 440ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.mod-liquid-glass .card:hover .card-go,
body.mod-liquid-glass .card-play:focus-visible .card-go {
    border-color: rgba(122, 244, 202, 0.28);
    color: #8CF4CC;
    background: rgba(67, 213, 160, 0.1);
    transform: translateX(2px);
}

body.mod-liquid-glass .card-star {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-color: rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    color: rgba(225, 239, 234, 0.66);
    background: rgba(5, 14, 19, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

body.mod-liquid-glass .card-star:hover {
    border-color: rgba(207, 255, 242, 0.34);
    color: #F2FFFB;
    background: rgba(11, 27, 32, 0.78);
    transform: scale(1.055);
}

body.mod-liquid-glass .card-star.is-on {
    border-color: rgba(92, 239, 184, 0.32);
    color: #76F0BF;
    background: rgba(8, 47, 37, 0.72);
}

body.mod-liquid-glass .card:has(.card-play:focus-visible) {
    border-color: rgba(108, 240, 190, 0.64);
    box-shadow: 0 0 0 3px rgba(59, 218, 160, 0.16);
}

@media (prefers-reduced-motion: reduce) {
    body.mod-liquid-glass .card,
    body.mod-liquid-glass .card-art,
    body.mod-liquid-glass .card-mono,
    body.mod-liquid-glass .card-go {
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    body.mod-liquid-glass .card,
    body.mod-liquid-glass .card-go,
    body.mod-liquid-glass .card-star {
        border: 1px solid CanvasText;
        color: CanvasText;
        background: Canvas;
        box-shadow: none;
    }
}

/* ============================================================
   Liquid glass v5 - no clip + thicker liquid motion
   Keep compositor-only (transform/opacity). Avoid border-radius/
   filter animation ? those made it laggy.
   ============================================================ */
body.mod-liquid-glass {
    --glass-spring: cubic-bezier(0.22, 1.55, 0.28, 1);
    --glass-viscous: cubic-bezier(0.28, 0.12, 0.18, 1);
    --glass-wobble: cubic-bezier(0.18, 1.95, 0.32, 1);
}

/* Don't clip hover/lift motion inside glass shells. */
body.mod-liquid-glass .top,
body.mod-liquid-glass .toolbar,
body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .theme-dd-menu,
body.mod-liquid-glass .tags,
body.mod-liquid-glass .sort {
    overflow: visible !important;
}

/* Room for chips/buttons to rise without hitting neighbors. */
body.mod-liquid-glass .top {
    padding: 36px 38px 40px;
    margin-bottom: 42px;
}

body.mod-liquid-glass .toolbar {
    gap: 12px;
    margin-bottom: 30px;
    padding: 16px 16px 18px;
}

body.mod-liquid-glass .tags,
body.mod-liquid-glass .sort {
    padding-block: 4px;
}

body.mod-liquid-glass .top-actions {
    gap: 4px;
    padding: 6px;
}

body.mod-liquid-glass .home-search-wrap {
    padding-inline: 2px;
}

/* Card lift clearance on the grid ? art stays clipped inside the card. */
body.mod-liquid-glass #homeGrid,
body.mod-liquid-glass #library .grid {
    padding-top: 16px;
    margin-top: -4px;
    overflow: visible;
}

body.mod-liquid-glass .home-section,
body.mod-liquid-glass .main,
body.mod-liquid-glass .app {
    overflow: visible;
}

/* Ambient field: no mid-screen paint-clip of swirling blobs.
   Layer stays viewport-clipped so oversized motion can't force scrollbars. */
body.mod-liquid-glass .mod-liquid-field {
    inset: -22%;
    overflow: visible;
    contain: layout style;
}

body.mod-liquid-glass .liquid-flow {
    width: 64vmax;
    height: 64vmax;
    opacity: 0.82;
}

body.mod-liquid-glass .liquid-flow-a {
    animation: liquidBlobA 11s var(--glass-viscous) infinite;
}

body.mod-liquid-glass .liquid-flow-b {
    animation: liquidBlobB 15s var(--glass-viscous) infinite;
}

body.mod-liquid-glass .mod-liquid-field::before {
    animation: liquidSheen 8s var(--glass-viscous) infinite alternate;
}

/* Squashy interactive gel ? transform only. */
body.mod-liquid-glass .toolbar .tag:hover,
body.mod-liquid-glass .toolbar .sort-btn:hover,
body.mod-liquid-glass .top-actions .btn:hover {
    transform: translateY(-5px) scale(1.07) scaleX(1.05) scaleY(0.96);
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch) {
    transform-origin: 50% 80%;
    transition:
        transform 640ms var(--glass-spring),
        border-color 240ms ease,
        background-color 240ms ease,
        box-shadow 420ms var(--glass-viscous);
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch):active {
    transform: translateY(3px) scale(0.92) scaleX(1.08) scaleY(0.86);
}

body.mod-liquid-glass .glass-release {
    animation: glassReleaseLiquid 920ms var(--glass-wobble);
}

body.mod-liquid-glass .top {
    animation: glassMaterializeLiquid 980ms var(--glass-spring) both;
}

body.mod-liquid-glass .toolbar {
    animation: glassMaterializeLiquid 980ms 70ms var(--glass-spring) both;
}

body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .top-actions {
    transition:
        border-color 240ms ease,
        transform 680ms var(--glass-spring),
        box-shadow 480ms var(--glass-viscous);
}

body.mod-liquid-glass .home-search-wrap:focus-within {
    transform: translateY(-3px) scale(1.02) scaleX(1.025) scaleY(0.985);
}

body.mod-liquid-glass .card {
    transform-origin: 50% 78%;
    transition:
        transform 760ms var(--glass-spring),
        border-color 240ms ease,
        box-shadow 480ms var(--glass-viscous);
}

body.mod-liquid-glass .card:hover {
    transform: translateY(-12px) scale(1.03) scaleX(1.035) scaleY(0.975);
}

body.mod-liquid-glass .card:active {
    transform: translateY(-3px) scale(0.96) scaleX(1.05) scaleY(0.92);
}

body.mod-liquid-glass .card:hover .card-art {
    transform: scale(1.035) scaleX(1.02) scaleY(0.99);
    transition: transform 820ms var(--glass-spring);
}

body.mod-liquid-glass .card:hover .card-mono {
    transform: translateY(-4px) scale(1.02);
}

body.mod-liquid-glass .card:hover .card-go {
    transform: translateX(3px);
}

body.mod-liquid-glass.glass-lite .liquid-flow-a {
    animation-duration: 16s;
}

body.mod-liquid-glass.glass-lite .liquid-flow-b {
    animation-duration: 21s;
}

@keyframes liquidSheen {
    0% {
        opacity: 0.5;
        transform: translate3d(-5%, -2%, 0) scale(1) rotate(-1deg);
    }
    100% {
        opacity: 1;
        transform: translate3d(6%, 3%, 0) scale(1.08) rotate(1.5deg);
    }
}

@keyframes liquidBlobA {
    0% {
        transform: translate3d(-10%, -6%, 0) rotate(-12deg) scale(0.84) scaleX(0.92);
        opacity: 0.48;
    }
    22% {
        transform: translate3d(6%, 0%, 0) rotate(2deg) scale(1.06) scaleX(1.08);
        opacity: 0.88;
    }
    48% {
        transform: translate3d(18%, 10%, 0) rotate(14deg) scale(1.2) scaleX(0.94);
        opacity: 0.7;
    }
    72% {
        transform: translate3d(2%, 16%, 0) rotate(-4deg) scale(1.02) scaleX(1.1);
        opacity: 0.92;
    }
    100% {
        transform: translate3d(-10%, -6%, 0) rotate(-12deg) scale(0.84) scaleX(0.92);
        opacity: 0.48;
    }
}

@keyframes liquidBlobB {
    0% {
        transform: translate3d(10%, -8%, 0) rotate(12deg) scale(1.14) scaleY(0.94);
        opacity: 0.38;
    }
    30% {
        transform: translate3d(-2%, 2%, 0) rotate(-4deg) scale(0.96) scaleY(1.06);
        opacity: 0.82;
    }
    58% {
        transform: translate3d(-18%, 14%, 0) rotate(-16deg) scale(0.84) scaleY(0.92);
        opacity: 0.55;
    }
    82% {
        transform: translate3d(-6%, 4%, 0) rotate(5deg) scale(1.08) scaleY(1.04);
        opacity: 0.9;
    }
    100% {
        transform: translate3d(10%, -8%, 0) rotate(12deg) scale(1.14) scaleY(0.94);
        opacity: 0.38;
    }
}

@keyframes glassMaterializeLiquid {
    0% {
        opacity: 0;
        transform: translateY(22px) scale(0.94) scaleX(0.96) scaleY(0.9);
    }
    55% {
        opacity: 1;
        transform: translateY(-7px) scale(1.03) scaleX(1.025) scaleY(1.01);
    }
    78% {
        transform: translateY(2px) scale(0.992) scaleX(0.995) scaleY(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) scaleX(1) scaleY(1);
    }
}

@keyframes glassReleaseLiquid {
    0% { transform: scale(0.9) scaleX(1.1) scaleY(0.86); }
    16% { transform: scale(1.1) scaleX(0.9) scaleY(1.12); }
    32% { transform: scale(0.95) scaleX(1.06) scaleY(0.94); }
    48% { transform: scale(1.05) scaleX(0.96) scaleY(1.05); }
    64% { transform: scale(0.985) scaleX(1.03) scaleY(0.98); }
    80% { transform: scale(1.015) scaleX(0.99) scaleY(1.015); }
    100% { transform: scale(1) scaleX(1) scaleY(1); }
}

@media (max-width: 700px) {
    /* Horizontal tag scroller needs overflow-x; keep vertical lift room via padding. */
    body.mod-liquid-glass .tags {
        overflow-x: auto !important;
        overflow-y: visible !important;
        padding-block: 8px;
    }

    body.mod-liquid-glass .toolbar .tag:hover,
    body.mod-liquid-glass .toolbar .sort-btn:hover,
    body.mod-liquid-glass .top-actions .btn:hover {
        transform: translateY(-3px) scale(1.04) scaleX(1.03) scaleY(0.98);
    }

    body.mod-liquid-glass .card:hover {
        transform: translateY(-8px) scale(1.02) scaleX(1.02) scaleY(0.985);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.mod-liquid-glass .liquid-flow,
    body.mod-liquid-glass .mod-liquid-field::before,
    body.mod-liquid-glass .top,
    body.mod-liquid-glass .toolbar,
    body.mod-liquid-glass .glass-release {
        animation: none !important;
    }

    body.mod-liquid-glass .card:hover,
    body.mod-liquid-glass .toolbar .tag:hover,
    body.mod-liquid-glass .toolbar .sort-btn:hover,
    body.mod-liquid-glass .top-actions .btn:hover {
        transform: none;
    }
}

/* ============================================================
   Liquid glass v8 - thicker smooth flow (still no bounce)
   ============================================================ */
body.mod-liquid-glass {
    /* Long ease-in-out settle ? honey-slow, zero overshoot. */
    --glass-spring: cubic-bezier(0.33, 0.0, 0.2, 1);
    --glass-viscous: cubic-bezier(0.4, 0.0, 0.15, 1);
    --glass-wobble: cubic-bezier(0.37, 0.0, 0.2, 1);
    --glass-flow: cubic-bezier(0.4, 0.0, 0.2, 1);
}

body.mod-liquid-glass .top {
    padding: 40px 42px 46px;
    margin-bottom: 48px;
}

body.mod-liquid-glass .toolbar {
    gap: 14px;
    margin-bottom: 34px;
    padding: 20px 18px 22px;
}

body.mod-liquid-glass .tags,
body.mod-liquid-glass .sort {
    padding-block: 8px;
}

body.mod-liquid-glass .top-actions {
    gap: 6px;
    padding: 8px;
}

body.mod-liquid-glass #homeGrid,
body.mod-liquid-glass #library .grid {
    padding-top: 24px;
    margin-top: -6px;
}

body.mod-liquid-glass .mod-liquid-field {
    inset: -28%;
    overflow: visible;
    contain: layout style;
}

body.mod-liquid-glass .mod-liquid-field::before {
    animation: liquidSheen 20s ease-in-out infinite alternate;
}

body.mod-liquid-glass .mod-liquid-field::after {
    inset: -10%;
    background:
        radial-gradient(ellipse 36% 24% at 72% 18%, rgba(110, 210, 255, 0.14), transparent 72%),
        radial-gradient(ellipse 30% 20% at 18% 40%, rgba(90, 255, 200, 0.1), transparent 74%),
        linear-gradient(180deg, rgba(3, 11, 14, 0.01), rgba(3, 6, 10, 0.34));
    animation: liquidSheenB 26s ease-in-out infinite alternate;
    will-change: transform, opacity;
    pointer-events: none;
}

body.mod-liquid-glass .liquid-flow {
    width: 68vmax;
    height: 68vmax;
    opacity: 0.82;
}

body.mod-liquid-glass .liquid-flow-a {
    animation: liquidBlobA 32s ease-in-out infinite;
}

body.mod-liquid-glass .liquid-flow-b {
    animation: liquidBlobB 40s ease-in-out infinite;
}

body.mod-liquid-glass .liquid-flow-c {
    display: block !important;
    top: auto;
    right: auto;
    bottom: -38vmax;
    left: 18%;
    width: 52vmax;
    height: 52vmax;
    border-radius: 52% 48% 42% 58% / 44% 56% 48% 52%;
    background:
        radial-gradient(circle at 48% 46%, rgba(255, 176, 132, 0.3) 0%, rgba(180, 90, 160, 0.11) 34%, transparent 68%);
    opacity: 0.48;
    animation: liquidBlobC 48s ease-in-out infinite;
}

body.mod-liquid-glass .liquid-flow-d {
    display: none !important;
}

/* Long glide in/out ? feels poured, not sprung. */
body.mod-liquid-glass .toolbar .tag:hover,
body.mod-liquid-glass .toolbar .sort-btn:hover,
body.mod-liquid-glass .top-actions .btn:hover {
    transform: translateY(-5px) scale(1.04);
    animation: none;
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch) {
    transform-origin: 50% 60%;
    transition:
        transform 980ms var(--glass-flow),
        border-color 560ms var(--glass-viscous),
        background-color 560ms var(--glass-viscous),
        box-shadow 980ms var(--glass-flow);
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch):active {
    transform: translateY(1px) scale(0.975);
    transition-duration: 220ms;
    animation: none;
}

body.mod-liquid-glass .glass-release {
    animation: glassReleaseLiquid 980ms var(--glass-flow);
}

body.mod-liquid-glass .top {
    animation: glassMaterializeLiquid 1200ms var(--glass-flow) both;
}

body.mod-liquid-glass .toolbar {
    animation: glassMaterializeLiquid 1200ms 100ms var(--glass-flow) both;
}

body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .top-actions {
    transition:
        border-color 560ms var(--glass-viscous),
        transform 1040ms var(--glass-flow),
        box-shadow 1040ms var(--glass-flow);
}

body.mod-liquid-glass .home-search-wrap:focus-within {
    transform: translateY(-3px) scale(1.02);
    animation: none;
}

body.mod-liquid-glass .card {
    transform-origin: 50% 60%;
    transition:
        transform 1100ms var(--glass-flow),
        border-color 560ms var(--glass-viscous),
        box-shadow 1100ms var(--glass-flow);
}

body.mod-liquid-glass .card:hover {
    transform: translateY(-12px) scale(1.025);
    animation: none;
}

body.mod-liquid-glass .card:active {
    transform: translateY(-2px) scale(0.988);
    transition-duration: 220ms;
    animation: none;
}

body.mod-liquid-glass .card-art,
body.mod-liquid-glass .card-mono,
body.mod-liquid-glass .card-go {
    transition: transform 1100ms var(--glass-flow);
}

body.mod-liquid-glass .card:hover .card-art {
    transform: scale(1.04);
}

body.mod-liquid-glass .card:hover .card-mono {
    transform: translateY(-4px);
}

body.mod-liquid-glass .card:hover .card-go {
    transform: translateX(5px);
}

body.mod-liquid-glass .tag.is-on,
body.mod-liquid-glass .sort-btn.is-on {
    animation: none;
    transition:
        transform 980ms var(--glass-flow),
        border-color 560ms var(--glass-viscous),
        background-color 560ms var(--glass-viscous),
        box-shadow 980ms var(--glass-flow);
}

body.mod-liquid-glass.glass-lite .liquid-flow-a { animation-duration: 40s; }
body.mod-liquid-glass.glass-lite .liquid-flow-b { animation-duration: 52s; }
body.mod-liquid-glass.glass-lite .liquid-flow-c,
body.mod-liquid-glass.glass-lite .mod-liquid-field::after {
    display: none !important;
    animation: none !important;
}
body.mod-liquid-glass.glass-lite .tag.is-on,
body.mod-liquid-glass.glass-lite .sort-btn.is-on {
    animation: none !important;
}

@keyframes liquidSheen {
    0% {
        opacity: 0.42;
        transform: translate3d(-6%, -2%, 0) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translate3d(7%, 3%, 0) scale(1.06);
    }
}

@keyframes liquidSheenB {
    0% {
        opacity: 0.35;
        transform: translate3d(4%, 1.5%, 0) scale(1.03);
    }
    100% {
        opacity: 0.8;
        transform: translate3d(-5%, -2.5%, 0) scale(0.96);
    }
}

/* Extra midpoints = creamier path, less ?ping-pong?. */
@keyframes liquidBlobA {
    0% {
        transform: translate3d(-10%, -5%, 0) rotate(-7deg) scale(0.9);
        opacity: 0.45;
    }
    25% {
        transform: translate3d(2%, 1%, 0) rotate(-1deg) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate3d(14%, 9%, 0) rotate(9deg) scale(1.12);
        opacity: 0.88;
    }
    75% {
        transform: translate3d(4%, 5%, 0) rotate(3deg) scale(1.02);
        opacity: 0.68;
    }
    100% {
        transform: translate3d(-10%, -5%, 0) rotate(-7deg) scale(0.9);
        opacity: 0.45;
    }
}

@keyframes liquidBlobB {
    0% {
        transform: translate3d(10%, -7%, 0) rotate(9deg) scale(1.1);
        opacity: 0.36;
    }
    25% {
        transform: translate3d(2%, -1%, 0) rotate(2deg) scale(1.02);
        opacity: 0.58;
    }
    50% {
        transform: translate3d(-14%, 11%, 0) rotate(-11deg) scale(0.88);
        opacity: 0.78;
    }
    75% {
        transform: translate3d(-4%, 4%, 0) rotate(-3deg) scale(0.98);
        opacity: 0.56;
    }
    100% {
        transform: translate3d(10%, -7%, 0) rotate(9deg) scale(1.1);
        opacity: 0.36;
    }
}

@keyframes liquidBlobC {
    0% {
        transform: translate3d(-12%, 5%, 0) rotate(-9deg) scale(0.88);
        opacity: 0.28;
    }
    33% {
        transform: translate3d(2%, -2%, 0) rotate(1deg) scale(1);
        opacity: 0.48;
    }
    66% {
        transform: translate3d(12%, -7%, 0) rotate(9deg) scale(1.1);
        opacity: 0.58;
    }
    100% {
        transform: translate3d(-12%, 5%, 0) rotate(-9deg) scale(0.88);
        opacity: 0.28;
    }
}

@keyframes glassMaterializeLiquid {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes glassReleaseLiquid {
    0% { transform: scale(0.975); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 700px) {
    body.mod-liquid-glass .toolbar .tag:hover,
    body.mod-liquid-glass .toolbar .sort-btn:hover,
    body.mod-liquid-glass .top-actions .btn:hover {
        transform: translateY(-3px) scale(1.025);
        animation: none;
    }

    body.mod-liquid-glass .card:hover {
        transform: translateY(-8px) scale(1.018);
        animation: none;
    }

    body.mod-liquid-glass .liquid-flow-c {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.mod-liquid-glass .liquid-flow,
    body.mod-liquid-glass .mod-liquid-field::before,
    body.mod-liquid-glass .mod-liquid-field::after,
    body.mod-liquid-glass .top,
    body.mod-liquid-glass .toolbar,
    body.mod-liquid-glass .glass-release,
    body.mod-liquid-glass .tag.is-on,
    body.mod-liquid-glass .sort-btn.is-on {
        animation: none !important;
    }

    body.mod-liquid-glass .card:hover,
    body.mod-liquid-glass .toolbar .tag:hover,
    body.mod-liquid-glass .toolbar .sort-btn:hover,
    body.mod-liquid-glass .top-actions .btn:hover,
    body.mod-liquid-glass .home-search-wrap:focus-within {
        transform: none;
        animation: none !important;
    }
}

/* ============================================================
   Liquid glass v9 - look pass (fake refraction, no backdrop blur)
   ============================================================ */
body.mod-liquid-glass {
    --glass-fill: rgba(8, 18, 26, 0.42);
    --glass-fill-thick: rgba(6, 14, 20, 0.78);
    --glass-line: rgba(210, 255, 245, 0.28);
    --glass-line-hot: rgba(220, 255, 248, 0.55);
    --glass-shadow: rgba(0, 2, 8, 0.55);
    --ink: #F4FBFA;
    --ink-soft: #D5E6E1;
    --mute: #8FA8A1;
    --accent: #3EE8B0;
    --accent-dark: #7AF5C8;
    background:
        radial-gradient(1100px 620px at 12% -18%, rgba(48, 255, 196, 0.16), transparent 58%),
        radial-gradient(900px 540px at 92% -8%, rgba(78, 168, 255, 0.14), transparent 60%),
        radial-gradient(700px 480px at 70% 110%, rgba(255, 140, 110, 0.08), transparent 62%),
        linear-gradient(155deg, #030A0B 0%, #07131A 42%, #05080E 100%);
}

body.mod-liquid-glass::before {
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        #2FE3A8 18%,
        #7EE7D0 40%,
        #6BB8F0 62%,
        #2FE3A8 82%,
        transparent 100%);
    box-shadow: 0 0 22px rgba(47, 227, 168, 0.35);
}

/* Ambient ? brighter soft pools behind the glass slabs. */
body.mod-liquid-glass .mod-liquid-field::before {
    background:
        linear-gradient(118deg, transparent 10%, rgba(110, 255, 210, 0.16) 28%, transparent 46%),
        linear-gradient(300deg, transparent 48%, rgba(110, 190, 255, 0.12) 66%, transparent 84%),
        radial-gradient(ellipse 42% 24% at 50% 8%, rgba(255, 255, 255, 0.2), transparent 70%);
}

body.mod-liquid-glass .liquid-flow-a {
    background:
        radial-gradient(circle at 52% 48%,
            rgba(90, 255, 210, 0.72) 0%,
            rgba(40, 210, 170, 0.28) 26%,
            rgba(20, 120, 110, 0.08) 48%,
            transparent 70%);
}

body.mod-liquid-glass .liquid-flow-b {
    background:
        radial-gradient(circle at 48% 50%,
            rgba(120, 200, 255, 0.62) 0%,
            rgba(70, 130, 240, 0.24) 28%,
            rgba(40, 70, 160, 0.08) 50%,
            transparent 72%);
}

body.mod-liquid-glass .liquid-flow-c {
    background:
        radial-gradient(circle at 50% 48%,
            rgba(255, 186, 150, 0.4) 0%,
            rgba(200, 100, 150, 0.16) 32%,
            transparent 68%);
}

/* Shared glass slab material ? specular + cool/warm edge, no blur. */
body.mod-liquid-glass .top,
body.mod-liquid-glass .toolbar,
body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .settings-panel,
body.mod-liquid-glass .theme-dd-menu {
    border: 1px solid rgba(220, 255, 248, 0.34);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.04) 18%, transparent 42%),
        linear-gradient(125deg, rgba(255, 255, 255, 0.1), transparent 36%),
        radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.16), transparent 46%),
        radial-gradient(90% 80% at 100% 100%, rgba(55, 220, 180, 0.1), transparent 55%),
        linear-gradient(155deg, rgba(90, 210, 255, 0.06), transparent 50%),
        var(--glass-fill);
    box-shadow:
        0 30px 70px rgba(0, 2, 8, 0.48),
        0 8px 22px rgba(0, 4, 10, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        inset 1px 0 0 rgba(120, 255, 220, 0.12),
        inset -1px 0 0 rgba(120, 170, 255, 0.1);
}

/* Specular streak overlay on primary slabs. */
body.mod-liquid-glass .top::after,
body.mod-liquid-glass .toolbar::after {
    position: absolute;
    top: 0;
    right: 12%;
    left: 12%;
    z-index: 1;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.75) 30%,
        rgba(200, 255, 240, 0.9) 50%,
        rgba(255, 255, 255, 0.7) 70%,
        transparent);
    content: "";
    pointer-events: none;
    opacity: 0.85;
}

body.mod-liquid-glass .top {
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.05) 16%, transparent 40%),
        radial-gradient(90% 140% at -4% -10%, rgba(255, 255, 255, 0.28), transparent 42%),
        radial-gradient(70% 100% at 108% 110%, rgba(60, 230, 185, 0.14), transparent 52%),
        linear-gradient(145deg, rgba(120, 200, 255, 0.08), transparent 48%),
        rgba(7, 16, 24, 0.38);
}

body.mod-liquid-glass .brand {
    color: #F7FFFC;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4),
        0 12px 40px rgba(40, 230, 170, 0.22),
        0 2px 18px rgba(0, 0, 0, 0.35);
}

body.mod-liquid-glass .brand-stop {
    color: #4FF3BC;
    text-shadow:
        0 0 18px rgba(50, 240, 180, 0.55),
        0 0 40px rgba(40, 220, 170, 0.28);
}

body.mod-liquid-glass .brand-line {
    color: rgba(190, 220, 214, 0.78);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

/* Nested controls inside the masthead ? clearer inner lenses. */
body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap {
    border: 1px solid rgba(230, 255, 250, 0.28);
    border-radius: 20px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04) 48%, rgba(70, 230, 190, 0.08)),
        rgba(4, 12, 18, 0.34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        inset 0 -1px 0 rgba(0, 0, 0, 0.22),
        0 12px 28px rgba(0, 4, 10, 0.22);
}

body.mod-liquid-glass .home-search-wrap:focus-within {
    border-color: rgba(120, 255, 210, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 0 0 3px rgba(60, 230, 180, 0.12),
        0 14px 32px rgba(0, 4, 10, 0.28);
}

body.mod-liquid-glass .search::placeholder {
    color: rgba(180, 205, 198, 0.5);
}

body.mod-liquid-glass .search-key {
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(200, 220, 214, 0.7);
    background: rgba(255, 255, 255, 0.06);
}

body.mod-liquid-glass .toolbar {
    border-radius: 26px;
    min-height: 64px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.03) 22%, transparent 48%),
        radial-gradient(100% 120% at 0% 0%, rgba(255, 255, 255, 0.14), transparent 44%),
        rgba(7, 16, 23, 0.4);
}

body.mod-liquid-glass .sort {
    border: 1px solid rgba(220, 255, 248, 0.18);
    border-radius: 16px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.1), transparent 55%),
        rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    padding: 3px;
}

body.mod-liquid-glass .toolbar .tag,
body.mod-liquid-glass .toolbar .sort-btn,
body.mod-liquid-glass .top-actions .btn {
    border: 1px solid transparent;
    border-radius: 14px;
    color: rgba(230, 245, 240, 0.86);
    background: transparent;
}

body.mod-liquid-glass .toolbar .tag:hover,
body.mod-liquid-glass .toolbar .sort-btn:hover,
body.mod-liquid-glass .top-actions .btn:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body.mod-liquid-glass .tag.is-on,
body.mod-liquid-glass .sort-btn.is-on {
    border-color: rgba(160, 255, 220, 0.4);
    color: #D8FFF0;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.28), transparent 55%),
        linear-gradient(145deg, rgba(70, 240, 185, 0.32), rgba(30, 140, 120, 0.14));
    box-shadow:
        0 8px 22px rgba(20, 120, 90, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body.mod-liquid-glass .section-kicker {
    color: rgba(110, 230, 185, 0.78);
    letter-spacing: 0.16em;
}

body.mod-liquid-glass .section-title {
    color: #F3FFFB;
    text-shadow: 0 8px 28px rgba(40, 200, 160, 0.12);
}

body.mod-liquid-glass .section-meta {
    color: rgba(170, 200, 192, 0.7);
}

/* Cards ? crystal tiles over the ambient field. */
body.mod-liquid-glass .card {
    border: 1px solid rgba(210, 250, 240, 0.22);
    border-radius: 24px;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.1) 0%, transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%),
        rgba(5, 14, 20, 0.62);
    box-shadow:
        0 16px 40px rgba(0, 2, 8, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.32),
        -0.5px 0 0 rgba(90, 240, 210, 0.16),
        0.5px 0 0 rgba(110, 160, 255, 0.12);
}

body.mod-liquid-glass .card::before {
    display: block !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.28),
        inset 1px 0 0 rgba(120, 255, 220, 0.06),
        inset -1px 0 0 rgba(120, 170, 255, 0.05);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%);
    border-radius: inherit;
    pointer-events: none;
}

body.mod-liquid-glass #library .card::before {
    display: none !important;
}

body.mod-liquid-glass .card:hover {
    border-color: rgba(190, 255, 235, 0.42);
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, transparent 40%),
        rgba(6, 16, 22, 0.7);
    box-shadow:
        0 28px 60px rgba(0, 2, 8, 0.52),
        0 0 0 1px rgba(120, 255, 210, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -1px 0 rgba(0, 0, 0, 0.28);
}

body.mod-liquid-glass .card-art {
    background:
        radial-gradient(180px circle at 14% -6%, rgba(255, 255, 255, 0.22), transparent 62%),
        radial-gradient(200px circle at 100% 110%, rgba(70, 230, 185, 0.1), transparent 68%),
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--wash) 32%, #06141A 68%),
            color-mix(in srgb, var(--wash-2) 22%, #070F18 78%)
        );
}

body.mod-liquid-glass .card-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 50%),
        rgba(2, 8, 12, 0.5);
}

body.mod-liquid-glass .card-title {
    color: #F6FFFB;
}

body.mod-liquid-glass .card-by {
    color: rgba(100, 240, 190, 0.9);
}

body.mod-liquid-glass .card-go {
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 11px;
    color: rgba(220, 240, 234, 0.62);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body.mod-liquid-glass .card:hover .card-go,
body.mod-liquid-glass .card-play:focus-visible .card-go {
    border-color: rgba(130, 250, 210, 0.36);
    color: #9AF8D4;
    background:
        linear-gradient(160deg, rgba(90, 240, 190, 0.18), rgba(40, 160, 130, 0.08));
}

body.mod-liquid-glass .card-star {
    border-color: rgba(230, 255, 248, 0.22);
    border-radius: 13px;
    background:
        radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.22), transparent 50%),
        rgba(5, 14, 20, 0.62);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 8px 18px rgba(0, 3, 8, 0.28);
}

body.mod-liquid-glass .card-star.is-on {
    border-color: rgba(100, 245, 195, 0.4);
    color: #7FF5C6;
    background:
        radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.2), transparent 50%),
        rgba(8, 50, 40, 0.78);
}

body.mod-liquid-glass .btn-fill {
    border-color: rgba(120, 255, 210, 0.28);
    color: #04140F;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.35), transparent 42%),
        linear-gradient(145deg, #5EF0B8, #2AD49A);
    box-shadow:
        0 10px 28px rgba(30, 160, 120, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.mod-liquid-glass .btn-fill:hover {
    filter: brightness(1.06);
}

body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .settings-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 24%, transparent 50%),
        radial-gradient(100% 80% at 0% 0%, rgba(255, 255, 255, 0.12), transparent 48%),
        var(--glass-fill-thick);
}

body.mod-liquid-glass .theme-dd-menu {
    border-radius: 18px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 48%),
        rgba(6, 14, 20, 0.94);
}

body.mod-liquid-glass .mod-row,
body.mod-liquid-glass .theme-dd-trigger {
    border-color: rgba(220, 255, 248, 0.14);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 55%),
        rgba(255, 255, 255, 0.04);
}

body.mod-liquid-glass .mod-row:hover,
body.mod-liquid-glass .theme-dd-trigger:hover,
body.mod-liquid-glass .theme-dd-option:hover,
body.mod-liquid-glass .theme-dd-option.is-active {
    border-color: rgba(160, 255, 220, 0.28);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(70, 230, 180, 0.06));
}

body.mod-liquid-glass .empty {
    border: 1px solid rgba(210, 250, 240, 0.16);
    border-radius: 28px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 50%),
        rgba(6, 14, 20, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 18px 40px rgba(0, 2, 8, 0.28);
}

body.mod-liquid-glass .empty-mark {
    color: rgba(110, 240, 190, 0.85);
}

/* Keep interactive slabs free of backdrop-filter (Chromium cursor artifact). */
body.mod-liquid-glass .top,
body.mod-liquid-glass .toolbar,
body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .settings-panel,
body.mod-liquid-glass .theme-dd-menu,
body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ============================================================
   Liquid glass v10 - faster smooth timing
   ============================================================ */
body.mod-liquid-glass {
    --glass-spring: cubic-bezier(0.25, 0.1, 0.25, 1);
    --glass-viscous: cubic-bezier(0.3, 0.0, 0.2, 1);
    --glass-wobble: cubic-bezier(0.25, 0.1, 0.25, 1);
    --glass-flow: cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.mod-liquid-glass .mod-liquid-field::before {
    animation-duration: 12s;
}

body.mod-liquid-glass .mod-liquid-field::after {
    animation-duration: 16s;
}

body.mod-liquid-glass .liquid-flow-a {
    animation-duration: 16s;
}

body.mod-liquid-glass .liquid-flow-b {
    animation-duration: 20s;
}

body.mod-liquid-glass .liquid-flow-c {
    animation-duration: 24s;
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch) {
    transition:
        transform 340ms var(--glass-flow),
        border-color 220ms var(--glass-viscous),
        background-color 220ms var(--glass-viscous),
        box-shadow 340ms var(--glass-flow);
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch):active {
    transition-duration: 100ms;
}

body.mod-liquid-glass .glass-release {
    animation: glassReleaseLiquid 380ms var(--glass-flow);
}

body.mod-liquid-glass .top {
    animation: glassMaterializeLiquid 480ms var(--glass-flow) both;
}

body.mod-liquid-glass .toolbar {
    animation: glassMaterializeLiquid 480ms 40ms var(--glass-flow) both;
}

body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .top-actions {
    transition:
        border-color 220ms var(--glass-viscous),
        transform 360ms var(--glass-flow),
        box-shadow 360ms var(--glass-flow);
}

body.mod-liquid-glass .card {
    transition:
        transform 380ms var(--glass-flow),
        border-color 220ms var(--glass-viscous),
        box-shadow 380ms var(--glass-flow);
}

body.mod-liquid-glass .card:active {
    transition-duration: 100ms;
}

body.mod-liquid-glass .card-art,
body.mod-liquid-glass .card-mono,
body.mod-liquid-glass .card-go {
    transition: transform 380ms var(--glass-flow);
}

body.mod-liquid-glass .tag.is-on,
body.mod-liquid-glass .sort-btn.is-on {
    transition:
        transform 340ms var(--glass-flow),
        border-color 220ms var(--glass-viscous),
        background-color 220ms var(--glass-viscous),
        box-shadow 340ms var(--glass-flow);
}

body.mod-liquid-glass.glass-lite .liquid-flow-a { animation-duration: 22s; }
body.mod-liquid-glass.glass-lite .liquid-flow-b { animation-duration: 28s; }

/* ============================================================
   Glass v11 - clean layout, real blur, Library redesign
   ============================================================ */

/* Quieter scene ? less competing glow, more depth for real glass. */
body.mod-liquid-glass {
    --glass-blur: 16px;
    --glass-fill: rgba(10, 18, 26, 0.48);
    --glass-fill-thick: rgba(8, 14, 20, 0.72);
    --glass-line: rgba(255, 255, 255, 0.2);
    --glass-line-hot: rgba(220, 255, 248, 0.42);
    --glass-shadow: rgba(0, 2, 8, 0.4);
    background:
        radial-gradient(900px 520px at 18% -12%, rgba(42, 210, 170, 0.11), transparent 62%),
        radial-gradient(780px 480px at 88% 0%, rgba(70, 150, 230, 0.1), transparent 64%),
        linear-gradient(160deg, #050B0E 0%, #08121A 50%, #06090F 100%);
}

body.mod-liquid-glass::before {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(90, 230, 190, 0.55) 35%, rgba(110, 180, 240, 0.45) 65%, transparent);
    box-shadow: none;
}

/* Soft ambient ? one less blob, softer intensity. */
body.mod-liquid-glass .liquid-flow {
    width: 58vmax;
    height: 58vmax;
    opacity: 0.55;
}

body.mod-liquid-glass .liquid-flow-a {
    background:
        radial-gradient(circle at 50% 50%,
            rgba(70, 230, 185, 0.45) 0%,
            rgba(30, 160, 140, 0.16) 32%,
            transparent 68%);
}

body.mod-liquid-glass .liquid-flow-b {
    background:
        radial-gradient(circle at 50% 50%,
            rgba(100, 180, 245, 0.38) 0%,
            rgba(60, 110, 200, 0.14) 34%,
            transparent 70%);
}

body.mod-liquid-glass .liquid-flow-c {
    display: none !important;
}

body.mod-liquid-glass .mod-liquid-field::after {
    animation: none;
    opacity: 0.7;
    background:
        radial-gradient(ellipse 50% 30% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 70%),
        linear-gradient(180deg, transparent 40%, rgba(3, 6, 10, 0.45));
}

/* Clip motion inside rounded glass ? no spill over borders. */
body.mod-liquid-glass .top,
body.mod-liquid-glass .toolbar,
body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .panel-toolbar,
body.mod-liquid-glass .settings-panel,
body.mod-liquid-glass .theme-dd-menu,
body.mod-liquid-glass .sort {
    overflow: hidden !important;
}

body.mod-liquid-glass .tags {
    overflow: hidden !important;
    padding-block: 0;
}

/* Small lifts that stay inside padded shells. */
body.mod-liquid-glass .toolbar .tag:hover,
body.mod-liquid-glass .toolbar .sort-btn:hover,
body.mod-liquid-glass .top-actions .btn:hover {
    transform: translateY(-1px) scale(1.02);
}

body.mod-liquid-glass .home-search-wrap:focus-within {
    transform: translateY(-1px) scale(1.008);
}

body.mod-liquid-glass .card:hover {
    transform: translateY(-5px) scale(1.012);
    z-index: 2;
}

body.mod-liquid-glass .card:active {
    transform: translateY(-1px) scale(0.992);
}

body.mod-liquid-glass .card:hover .card-art {
    transform: scale(1.02);
}

body.mod-liquid-glass .card:hover .card-mono {
    transform: translateY(-2px);
}

body.mod-liquid-glass .card:hover .card-go {
    transform: translateX(2px);
}

body.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch):active {
    transform: translateY(0) scale(0.98);
}

/* Room inside shells + between cards so rises never collide. */
body.mod-liquid-glass .top {
    padding: 28px 30px 30px;
    margin-bottom: 28px;
}

body.mod-liquid-glass .toolbar {
    gap: 12px;
    margin-bottom: 22px;
    padding: 10px 12px;
}

body.mod-liquid-glass .top-actions {
    gap: 4px;
    padding: 4px;
}

body.mod-liquid-glass #homeGrid,
body.mod-liquid-glass #library .grid {
    gap: 20px;
    padding-top: 4px;
    margin-top: 0;
    overflow: visible;
}

body.mod-liquid-glass .grid {
    isolation: isolate;
}

/* Real glass material ? restrained blur (no SVG filters). */
body.mod-liquid-glass .top,
body.mod-liquid-glass .toolbar,
body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap,
body.mod-liquid-glass .panel-bar,
body.mod-liquid-glass .panel-toolbar,
body.mod-liquid-glass .settings-panel,
body.mod-liquid-glass .theme-dd-menu {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 28%, transparent 55%),
        rgba(12, 20, 28, 0.42);
    box-shadow:
        0 18px 48px rgba(0, 2, 8, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        inset 0 -1px 0 rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(var(--glass-blur)) saturate(155%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(155%);
}

body.mod-liquid-glass .top::after,
body.mod-liquid-glass .toolbar::after {
    display: none;
}

body.mod-liquid-glass .top {
    border-radius: 28px;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.03) 32%, transparent 58%),
        rgba(10, 18, 26, 0.4);
}

body.mod-liquid-glass .toolbar {
    border-radius: 20px;
    min-height: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

body.mod-liquid-glass .top-actions,
body.mod-liquid-glass .home-search-wrap {
    border-radius: 16px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        rgba(8, 16, 22, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}

body.mod-liquid-glass .home-search-wrap:focus-within {
    border-color: rgba(130, 240, 200, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(60, 210, 170, 0.12);
}

body.mod-liquid-glass .sort {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.mod-liquid-glass .toolbar .tag,
body.mod-liquid-glass .toolbar .sort-btn,
body.mod-liquid-glass .top-actions .btn {
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
}

body.mod-liquid-glass .toolbar .tag:hover,
body.mod-liquid-glass .toolbar .sort-btn:hover,
body.mod-liquid-glass .top-actions .btn:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

body.mod-liquid-glass .tag.is-on,
body.mod-liquid-glass .sort-btn.is-on {
    border-color: rgba(140, 240, 200, 0.28);
    color: #E6FFF6;
    background: rgba(55, 200, 160, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Cards ? simpler crystal, no rainbow edges. */
body.mod-liquid-glass .card {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.08), transparent 40%),
        rgba(8, 14, 20, 0.72);
    box-shadow:
        0 14px 32px rgba(0, 2, 8, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.mod-liquid-glass .card::before {
    display: none !important;
}

body.mod-liquid-glass .card:hover {
    border-color: rgba(180, 240, 220, 0.32);
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.1), transparent 42%),
        rgba(10, 18, 24, 0.78);
    box-shadow:
        0 20px 44px rgba(0, 2, 8, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

body.mod-liquid-glass .card-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(2, 8, 12, 0.42);
}

body.mod-liquid-glass .brand {
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.25),
        0 10px 32px rgba(0, 0, 0, 0.35);
}

body.mod-liquid-glass .brand-stop {
    text-shadow: 0 0 16px rgba(50, 220, 170, 0.4);
}

body.mod-liquid-glass .empty {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 50%),
        rgba(8, 14, 20, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
}

/* ---------- Library: floating glass chrome ---------- */
body.mod-liquid-glass #library.panel {
    gap: 12px;
    padding: 16px 0 0;
    background:
        radial-gradient(900px 420px at 20% -10%, rgba(42, 210, 170, 0.1), transparent 60%),
        radial-gradient(700px 380px at 90% 0%, rgba(70, 150, 230, 0.08), transparent 62%),
        #060C11;
}

body.mod-liquid-glass #library .panel-bar {
    position: relative;
    z-index: 3;
    width: min(100% - 32px, calc(var(--max) + 32px));
    margin: 0 auto;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 40%, transparent 70%),
        rgba(10, 18, 26, 0.55);
    box-shadow:
        0 16px 40px rgba(0, 2, 8, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

body.mod-liquid-glass #library .panel-title {
    margin: 0 0 4px;
    color: #F5FFFB;
    font-size: clamp(1.85rem, 3.2vw, 2.45rem);
    letter-spacing: -0.045em;
}

body.mod-liquid-glass #library .section-kicker {
    margin-bottom: 6px;
    color: rgba(110, 220, 180, 0.8);
}

body.mod-liquid-glass #library .panel-meta {
    color: rgba(170, 195, 188, 0.72);
    font-size: 0.8rem;
}

body.mod-liquid-glass #library .panel-back {
    width: 44px;
    height: 44px;
    margin-top: 0;
    align-self: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

body.mod-liquid-glass #library .panel-back:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

body.mod-liquid-glass #library .panel-search {
    align-self: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
        rgba(4, 10, 14, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body.mod-liquid-glass #library .panel-search:focus-within {
    border-color: rgba(130, 240, 200, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 0 0 3px rgba(60, 210, 170, 0.1);
}

body.mod-liquid-glass #library .panel-search .search {
    background: transparent;
}

body.mod-liquid-glass #library .panel-toolbar {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    width: min(100% - 32px, calc(var(--max) + 32px));
    margin: 0 auto;
    padding: 8px 10px 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 50%),
        rgba(10, 18, 26, 0.42);
    box-shadow:
        0 10px 28px rgba(0, 2, 8, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
}

body.mod-liquid-glass #library .panel-note {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: rgba(180, 205, 198, 0.78);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.74rem;
    font-weight: 600;
}

body.mod-liquid-glass #library .panel-body {
    width: min(100% - 32px, calc(var(--max) + 32px));
    padding: 4px 0 40px;
}

body.mod-liquid-glass #library .card {
    border-color: rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.07), transparent 42%),
        rgba(9, 15, 21, 0.82);
    box-shadow:
        0 12px 28px rgba(0, 2, 8, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

body.mod-liquid-glass #library .card:hover {
    border-color: rgba(170, 235, 215, 0.28);
    box-shadow:
        0 18px 40px rgba(0, 2, 8, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.mod-liquid-glass #library .panel-body.is-scrolling .card:hover,
body.mod-liquid-glass #library .panel-body.is-scrolling .card:active {
    transform: none;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 12px 28px rgba(0, 2, 8, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

body.mod-liquid-glass .settings-panel {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 30%),
        rgba(8, 14, 20, 0.82);
}

body.mod-liquid-glass .mod-row,
body.mod-liquid-glass .theme-dd-trigger {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

body.mod-liquid-glass .mod-row:hover,
body.mod-liquid-glass .theme-dd-trigger:hover,
body.mod-liquid-glass .theme-dd-option:hover,
body.mod-liquid-glass .theme-dd-option.is-active {
    border-color: rgba(140, 230, 200, 0.22);
    background: rgba(255, 255, 255, 0.07);
}

body.mod-liquid-glass.glass-lite {
    --glass-blur: 10px;
}

body.mod-liquid-glass.glass-lite .top,
body.mod-liquid-glass.glass-lite .toolbar,
body.mod-liquid-glass.glass-lite .panel-bar,
body.mod-liquid-glass.glass-lite .panel-toolbar,
body.mod-liquid-glass.glass-lite .settings-panel {
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
}

@media (max-width: 700px) {
    body.mod-liquid-glass #library.panel {
        gap: 10px;
        padding-top: 10px;
    }

    body.mod-liquid-glass #library .panel-bar,
    body.mod-liquid-glass #library .panel-toolbar,
    body.mod-liquid-glass #library .panel-body {
        width: calc(100% - 20px);
    }

    body.mod-liquid-glass #library .panel-bar {
        padding: 14px 14px;
        border-radius: 18px;
    }

    body.mod-liquid-glass #library .panel-toolbar {
        flex-wrap: wrap;
        padding: 8px;
        border-radius: 16px;
    }

    body.mod-liquid-glass #library .panel-note {
        width: 100%;
        text-align: center;
        white-space: normal;
    }

    body.mod-liquid-glass .toolbar .tag:hover,
    body.mod-liquid-glass .toolbar .sort-btn:hover,
    body.mod-liquid-glass .top-actions .btn:hover {
        transform: translateY(-1px) scale(1.015);
    }

    body.mod-liquid-glass .card:hover {
        transform: translateY(-3px) scale(1.01);
    }

    body.mod-liquid-glass .tags {
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }
}

@media (prefers-reduced-transparency: reduce) {
    body.mod-liquid-glass .top,
    body.mod-liquid-glass .toolbar,
    body.mod-liquid-glass .top-actions,
    body.mod-liquid-glass .home-search-wrap,
    body.mod-liquid-glass .panel-bar,
    body.mod-liquid-glass .panel-toolbar,
    body.mod-liquid-glass .settings-panel,
    body.mod-liquid-glass .theme-dd-menu,
    body.mod-liquid-glass .empty {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(9, 15, 20, 0.96);
    }
}

/* Glass + other mods: keep ambient blobs softer so stars/glow read through. */
body.mod-liquid-glass.mod-stars .liquid-flow,
body.mod-liquid-glass.mod-soft-glow .liquid-flow {
    opacity: 0.42;
}

body.mod-liquid-glass.mod-stars .mod-stars-canvas {
    opacity: 0.9;
}

/* ============================================================
   Smooth Animations mod ? every motion as silky as possible
   ============================================================ */
body.mod-smooth-anim {
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --fast: 420ms;
    --panel-time: 480ms;
    --glass-spring: cubic-bezier(0.22, 0.61, 0.36, 1);
    --glass-viscous: cubic-bezier(0.33, 0, 0.2, 1);
    --glass-wobble: cubic-bezier(0.22, 0.61, 0.36, 1);
    --glass-flow: cubic-bezier(0.22, 0.61, 0.36, 1);
    scroll-behavior: smooth;
}

/* Soften every existing transition / animation curve site-wide. */
body.mod-smooth-anim *,
body.mod-smooth-anim *::before,
body.mod-smooth-anim *::after {
    transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important;
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

/* Interactive UI ? longer, creamier glides. */
body.mod-smooth-anim :is(
    .btn,
    .tag,
    .sort-btn,
    .card,
    .card-star,
    .card-go,
    .card-art,
    .card-mono,
    .search,
    .search-clear,
    .search-wrap,
    .mod-row,
    .mod-switch,
    .mod-switch-knob,
    .theme-dd-trigger,
    .theme-dd-option,
    .theme-dd-chevron,
    .theme-dd-menu,
    .panel,
    .settings,
    .settings-panel,
    .settings-scrim,
    .play,
    .play-bar,
    .play-handle,
    .survival-pill,
    .survival-dot,
    .empty,
    .skip-link
) {
    transition-duration: 420ms !important;
}

body.mod-smooth-anim :is(.panel, .settings-panel, .settings-scrim, .play) {
    transition-duration: 520ms !important;
}

body.mod-smooth-anim :is(.btn, .tag, .sort-btn, .card-star, .mod-switch, .theme-dd-trigger):active,
body.mod-smooth-anim .card:active {
    transition-duration: 140ms !important;
}

/* Glass ambient drifts a touch slower when Smooth is on. */
body.mod-smooth-anim.mod-liquid-glass .liquid-flow-a { animation-duration: 22s !important; }
body.mod-smooth-anim.mod-liquid-glass .liquid-flow-b { animation-duration: 28s !important; }
body.mod-smooth-anim.mod-liquid-glass .mod-liquid-field::before { animation-duration: 18s !important; }

body.mod-smooth-anim.mod-liquid-glass :is(.btn, .tag, .sort-btn, .card-star, .theme-dd-trigger, .mod-switch) {
    transition-duration: 480ms !important;
}

body.mod-smooth-anim.mod-liquid-glass .card,
body.mod-smooth-anim.mod-liquid-glass .card-art,
body.mod-smooth-anim.mod-liquid-glass .card-mono,
body.mod-smooth-anim.mod-liquid-glass .card-go {
    transition-duration: 500ms !important;
}

body.mod-smooth-anim.mod-liquid-glass .home-search-wrap,
body.mod-smooth-anim.mod-liquid-glass .top-actions {
    transition-duration: 480ms !important;
}

body.mod-smooth-anim.mod-liquid-glass .glass-release {
    animation-duration: 560ms !important;
}

body.mod-smooth-anim.mod-liquid-glass .top,
body.mod-smooth-anim.mod-liquid-glass .toolbar {
    animation-duration: 640ms !important;
}

/* Keep scroll-path freezes instant (perf). */
body.mod-smooth-anim #library .panel-body.is-scrolling .card,
body.mod-smooth-anim #library .panel-body.is-scrolling .card-star,
body.mod-smooth-anim #library .panel-body.is-scrolling .card-go {
    transition: none !important;
}

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

/* ============================================================
   Mod option effects (data attributes set by mods.js)
   ============================================================ */
.mod-soft-glow-fx[data-strength="low"] { opacity: 0.55; }
.mod-soft-glow-fx[data-strength="med"] { opacity: 0.9; }
.mod-soft-glow-fx[data-strength="high"] { opacity: 1; }

.mod-soft-glow-fx[data-warmth="cool"] .mod-soft-glow-blob.is-left {
    background: radial-gradient(closest-side, rgba(70, 160, 230, 0.2), transparent 72%);
}
.mod-soft-glow-fx[data-warmth="cool"] .mod-soft-glow-blob.is-right {
    background: radial-gradient(closest-side, rgba(120, 110, 255, 0.14), transparent 74%);
}
.mod-soft-glow-fx[data-warmth="hot"] .mod-soft-glow-blob.is-left {
    background: radial-gradient(closest-side, rgba(255, 150, 70, 0.22), transparent 72%);
}
.mod-soft-glow-fx[data-warmth="hot"] .mod-soft-glow-blob.is-right {
    background: radial-gradient(closest-side, rgba(240, 90, 110, 0.16), transparent 74%);
}

body.mod-blink-stamp[data-stamp-size="small"]::after {
    font-size: clamp(3.5rem, 12vw, 7.5rem);
}
body.mod-blink-stamp[data-stamp-size="large"]::after {
    font-size: clamp(6.5rem, 22vw, 14rem);
}
body.mod-blink-stamp[data-stamp-weight="faint"]::after {
    opacity: 0.55;
}
body.mod-blink-stamp[data-stamp-weight="bold"]::after {
    opacity: 1.35;
}

body.mod-liquid-glass[data-glass-blur="soft"] {
    --glass-blur: 10px;
}
body.mod-liquid-glass[data-glass-blur="deep"] {
    --glass-blur: 24px;
}
body.mod-liquid-glass[data-glass-ambient="low"] .liquid-flow {
    opacity: 0.32;
}
body.mod-liquid-glass[data-glass-ambient="high"] .liquid-flow {
    opacity: 0.78;
}

body.mod-smooth-anim[data-smooth-amount="subtle"] {
    --fast: 280ms;
    --panel-time: 320ms;
}
body.mod-smooth-anim[data-smooth-amount="subtle"] :is(
    .btn, .tag, .sort-btn, .card, .card-star, .card-go, .card-art, .card-mono,
    .search, .search-clear, .search-wrap, .mod-row, .mod-switch, .mod-switch-knob,
    .theme-dd-trigger, .theme-dd-option, .theme-dd-chevron, .theme-dd-menu,
    .panel, .settings, .settings-panel, .settings-scrim, .play, .play-bar,
    .play-handle, .survival-pill, .survival-dot, .empty, .skip-link,
    .mod-opts-btn, .mod-opt-toggle, .mod-slider-thumb
) {
    transition-duration: 280ms !important;
}

body.mod-smooth-anim[data-smooth-amount="max"] {
    --fast: 620ms;
    --panel-time: 680ms;
}
body.mod-smooth-anim[data-smooth-amount="max"] :is(
    .btn, .tag, .sort-btn, .card, .card-star, .card-go, .card-art, .card-mono,
    .search, .search-clear, .search-wrap, .mod-row, .mod-switch, .mod-switch-knob,
    .theme-dd-trigger, .theme-dd-option, .theme-dd-chevron, .theme-dd-menu,
    .panel, .settings, .settings-panel, .settings-scrim, .play, .play-bar,
    .play-handle, .survival-pill, .survival-dot, .empty, .skip-link,
    .mod-opts-btn, .mod-opt-toggle, .mod-slider-thumb
) {
    transition-duration: 620ms !important;
}
body.mod-smooth-anim[data-smooth-amount="max"] :is(.panel, .settings-panel, .settings-scrim, .play) {
    transition-duration: 720ms !important;
}

body.mod-liquid-glass .mod-item,
body.mod-liquid-glass .mod-opts-btn {
    border-color: rgba(255, 255, 255, 0.12);
}

body.mod-liquid-glass .mod-opts {
    border-top-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

body.mod-liquid-glass .mod-slider {
    --mod-slider: #4F82F5;
}
/* ============================================================
   Pack mods ? multi-select Effects dropdowns + overlay FX
   ============================================================ */

.mod-item.is-pack .mod-opts-btn {
    min-width: 5.6rem;
}

.mod-pack-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.45rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0;
    vertical-align: 0.1em;
    color: #06281C;
    background: var(--accent);
}

.mod-opts.is-pack-opts .mod-opts-inner.is-pack-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}

.mod-item.is-pack .mod-opt[data-opt-type="toggle"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 2px;
    border-radius: 10px;
}

.mod-item.is-pack .mod-opt[data-opt-type="toggle"]:hover {
    background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.mod-item.is-pack.has-pack-on {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

/* Shared overlay hosts inside #modLayer */
.mod-fx-grain,
.mod-fx-vignette-el,
.mod-fx-shimmer,
.mod-fx-aurora,
.mod-fx-clouds,
.mod-fx-shafts,
.mod-fx-bokeh-field,
.mod-fx-rain,
.mod-fx-snow,
.mod-fx-dust,
.mod-fx-paper,
.mod-fx-halftone-el,
.mod-fx-scanlines-el,
.mod-fx-orbit,
.mod-fx-comet-streak,
.mod-fx-comet-trail {
    position: absolute;
    inset: 0;
    pointer-events: none !important;
    overflow: hidden;
}

/* Film grain ? tiny tiled noise, no animation cost beyond opacity */
.mod-fx-grain {
    opacity: 0.28;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    background-size: 160px 160px;
}

html[data-scheme="dark"] .mod-fx-grain {
    opacity: 0.22;
    mix-blend-mode: overlay;
}

.mod-fx-vignette-el {
    background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.28) 100%);
}

html[data-scheme="light"] .mod-fx-vignette-el {
    background: radial-gradient(ellipse at center, transparent 48%, rgba(20, 18, 14, 0.18) 100%);
}

.mod-fx-shimmer {
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 45%,
        transparent 60%
    );
    background-size: 220% 100%;
    animation: modFxShimmer 7s ease-in-out infinite;
    mix-blend-mode: soft-light;
}

@keyframes modFxShimmer {
    0%, 100% { background-position: 100% 0; opacity: 0.35; }
    50% { background-position: 0% 0; opacity: 0.7; }
}

.mod-fx-aurora-band {
    position: absolute;
    width: 70%;
    height: 38%;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.45;
    animation: modFxAurora 16s ease-in-out infinite;
}

.mod-fx-aurora-band.a {
    left: -8%;
    top: 8%;
    background: color-mix(in srgb, var(--accent) 55%, #6ea8ff);
}
.mod-fx-aurora-band.b {
    right: -12%;
    top: 22%;
    width: 58%;
    background: color-mix(in srgb, var(--accent) 35%, #c48ad4);
    animation-duration: 21s;
    animation-direction: reverse;
}
.mod-fx-aurora-band.c {
    left: 20%;
    top: -6%;
    width: 50%;
    height: 28%;
    background: color-mix(in srgb, var(--accent) 40%, #3ecfbb);
    animation-duration: 18s;
}

@keyframes modFxAurora {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.35; }
    50% { transform: translate3d(4%, 3%, 0) scale(1.06); opacity: 0.55; }
}

.mod-fx-cloud {
    position: absolute;
    width: 48vw;
    height: 28vh;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.16), transparent 72%);
    filter: blur(18px);
    animation: modFxCloud 28s linear infinite;
}

.mod-fx-cloud.c1 { left: -10%; top: 12%; animation-duration: 32s; }
.mod-fx-cloud.c2 { right: -8%; top: 28%; width: 40vw; opacity: 0.7; animation-duration: 40s; animation-direction: reverse; }
.mod-fx-cloud.c3 { left: 28%; top: 4%; width: 36vw; height: 20vh; opacity: 0.55; animation-duration: 36s; }

html[data-scheme="dark"] .mod-fx-cloud {
    background: radial-gradient(closest-side, rgba(180, 210, 255, 0.1), transparent 72%);
}

@keyframes modFxCloud {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(12vw, 0, 0); }
}

.mod-fx-shaft {
    position: absolute;
    top: -20%;
    width: 18vw;
    height: 140%;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent) 22%, transparent),
        transparent 70%
    );
    transform-origin: top center;
    filter: blur(8px);
    opacity: 0.35;
    animation: modFxShaft 9s ease-in-out infinite;
}

.mod-fx-shaft.s1 { left: 12%; transform: rotate(12deg); }
.mod-fx-shaft.s2 { left: 38%; width: 12vw; transform: rotate(8deg); animation-delay: -3s; opacity: 0.28; }
.mod-fx-shaft.s3 { right: 18%; transform: rotate(-10deg); animation-delay: -5s; }

@keyframes modFxShaft {
    0%, 100% { opacity: 0.22; }
    50% { opacity: 0.42; }
}

.mod-fx-bokeh-dot {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.05) 55%, transparent 70%);
    opacity: 0.35;
    animation: modFxBokeh 10s ease-in-out infinite;
}

.mod-fx-bokeh-dot.is-accent {
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 70%, #fff), transparent 70%);
}

@keyframes modFxBokeh {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.25; }
    50% { transform: translate3d(0, -10px, 0) scale(1.08); opacity: 0.45; }
}

.mod-fx-raindrop {
    position: absolute;
    top: -10%;
    width: 1.5px;
    border-radius: 2px;
    background: linear-gradient(180deg, transparent, rgba(180, 210, 255, 0.55));
    animation: modFxRain linear infinite;
}

@keyframes modFxRain {
    0% { transform: translate3d(0, -10vh, 0); opacity: 0; }
    10% { opacity: 0.7; }
    100% { transform: translate3d(0, 110vh, 0); opacity: 0; }
}

.mod-fx-flake {
    position: absolute;
    top: -8%;
    line-height: 1;
    color: rgba(255, 255, 255, 0.75);
    opacity: 0;
    animation: modFxSnow linear infinite;
}

html[data-scheme="light"] .mod-fx-flake {
    color: rgba(80, 100, 130, 0.45);
}

@keyframes modFxSnow {
    0% {
        opacity: 0;
        transform: translate3d(0, -8vh, 0);
    }
    12% { opacity: 0.8; }
    100% {
        opacity: 0;
        transform: translate3d(var(--drift, 20px), 110vh, 0);
    }
}

.mod-fx-dust-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.mod-fx-paper {
    opacity: 0.18;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.4'/%3E%3C/svg%3E");
    background-size: 120px 120px;
}

html[data-scheme="dark"] .mod-fx-paper {
    mix-blend-mode: soft-light;
    opacity: 0.14;
}

.mod-fx-halftone-el {
    opacity: 0.12;
    mix-blend-mode: multiply;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.45) 0.55px, transparent 0.65px);
    background-size: 5px 5px;
}

html[data-scheme="dark"] .mod-fx-halftone-el {
    mix-blend-mode: soft-light;
    opacity: 0.1;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0.5px, transparent 0.65px);
}

.mod-fx-scanlines-el {
    opacity: 0.08;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.35) 3px
    );
    mix-blend-mode: multiply;
}

html[data-scheme="dark"] .mod-fx-scanlines-el {
    mix-blend-mode: soft-light;
    opacity: 0.1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.18) 3px
    );
}

body.mod-fx-ink-bleed .card,
body.mod-fx-ink-bleed .btn,
body.mod-fx-ink-bleed .tag {
    box-shadow:
        0 10px 28px color-mix(in srgb, var(--ink) 8%, transparent),
        0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}

body.mod-fx-stamp-noise.mod-blink-stamp::after {
    text-shadow:
        1px 0 0 color-mix(in srgb, var(--stamp) 35%, transparent),
        -1px 1px 0 color-mix(in srgb, var(--stamp) 25%, transparent);
    filter: contrast(1.05);
}

/* Brand */
body.mod-fx-logo-mark::before {
    content: "blink";
    position: fixed;
    left: 3%;
    top: 18%;
    z-index: 0;
    pointer-events: none !important;
    font-family: var(--font, Outfit, system-ui, sans-serif);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--stamp, color-mix(in srgb, var(--ink) 8%, transparent));
    opacity: 0.45;
    transform: rotate(-90deg);
    transform-origin: left top;
}

body.is-play.mod-fx-logo-mark::before,
body.is-library.mod-fx-logo-mark::before,
body.is-settings.mod-fx-logo-mark::before {
    display: none !important;
}

body.mod-fx-blink-pulse {
    animation: modFxPulse 5.5s ease-in-out infinite;
}

@keyframes modFxPulse {
    0%, 100% { filter: none; }
    50% {
        filter: drop-shadow(0 0 28px color-mix(in srgb, var(--accent) 18%, transparent));
    }
}

.mod-fx-orbit {
    inset: auto;
    left: 72%;
    top: 18%;
    width: 140px;
    height: 140px;
}

.mod-fx-orbit-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    margin: -2.5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.55;
    animation: modFxOrbit 12s linear infinite;
}

.mod-fx-orbit-dot.d1 { --orbit-r: 48px; animation-duration: 11s; }
.mod-fx-orbit-dot.d2 { --orbit-r: 64px; animation-duration: 15s; animation-direction: reverse; opacity: 0.4; }
.mod-fx-orbit-dot.d3 { --orbit-r: 36px; animation-duration: 9s; width: 3px; height: 3px; }
.mod-fx-orbit-dot.d4 { --orbit-r: 76px; animation-duration: 18s; opacity: 0.3; }

@keyframes modFxOrbit {
    from { transform: rotate(0deg) translateX(var(--orbit-r, 50px)) rotate(0deg); }
    to { transform: rotate(360deg) translateX(var(--orbit-r, 50px)) rotate(-360deg); }
}

.mod-fx-comet-streak {
    background: linear-gradient(
        115deg,
        transparent 0%,
        transparent 42%,
        color-mix(in srgb, var(--accent) 55%, #fff) 50%,
        transparent 58%,
        transparent 100%
    );
    background-size: 220% 100%;
    opacity: 0;
    animation: modFxCometStreak 9s ease-in-out infinite;
}

@keyframes modFxCometStreak {
    0%, 72%, 100% { opacity: 0; background-position: 120% 0; }
    78% { opacity: 0.55; }
    88% { opacity: 0; background-position: -20% 0; }
}

/* Motion */
body.mod-fx-parallax .mod-layer {
    transform: translate3d(var(--parallax-x, 0), var(--parallax-y, 0), 0);
    will-change: transform;
}

body.mod-fx-magnetic .card.is-mag {
    transform: translate3d(var(--mag-x, 0), var(--mag-y, 0), 0);
    transition: transform 120ms linear;
}

body.mod-fx-card-bloom .card {
    position: relative;
}

body.mod-fx-card-bloom .mod-fx-bloom {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none !important;
    background: radial-gradient(
        160px 120px at var(--bloom-x, 50%) var(--bloom-y, 40%),
        color-mix(in srgb, var(--accent) 28%, transparent),
        transparent 70%
    );
    opacity: 0.85;
    z-index: 3;
}

.mod-fx-ripple-host {
    position: relative;
    overflow: hidden;
}

.mod-fx-ripple {
    position: absolute;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 40%, transparent);
    pointer-events: none;
    animation: modFxRipple 0.6s ease-out forwards;
    z-index: 8;
}

@keyframes modFxRipple {
    to {
        transform: scale(18);
        opacity: 0;
    }
}

/* Polish */
body.mod-fx-focus-glow :focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 75%, #fff);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

body.mod-fx-soft-shadows .card {
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.16),
        0 2px 0 rgba(255, 255, 255, 0.04) inset;
}

html[data-scheme="dark"] body.mod-fx-soft-shadows .card {
    box-shadow:
        0 20px 44px rgba(0, 0, 0, 0.42),
        0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

body.mod-fx-color-grade .mod-fx-grade {
    position: absolute;
    inset: 0;
    pointer-events: none !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 45%),
        linear-gradient(0deg, rgba(255, 180, 120, 0.05), rgba(80, 140, 255, 0.06));
    mix-blend-mode: soft-light;
}

body.mod-fx-color-grade::after {
    content: none;
}

body.mod-fx-high-contrast {
    --mute: color-mix(in srgb, var(--ink) 72%, transparent);
}

body.mod-fx-high-contrast .mod-desc,
body.mod-fx-high-contrast .card-mono,
body.mod-fx-high-contrast .tag {
    opacity: 1;
    color: color-mix(in srgb, var(--ink) 88%, transparent);
}

/* Quiet mode softens every other overlay so they can stack without shouting */
body.mod-fx-quiet .mod-layer {
    opacity: 0.55;
}

body.mod-fx-quiet.mod-soft-glow .mod-soft-glow-fx {
    opacity: 0.45 !important;
}

body.mod-fx-quiet.mod-emoji-rain .mod-emoji-rain {
    opacity: 0.55;
}

body.mod-fx-quiet.mod-blink-stamp::after {
    opacity: 0.45;
}

body.mod-fx-quiet.mod-fx-logo-mark::before {
    opacity: 0.28;
}

/* Combo: glass + atmosphere stay readable */
body.mod-liquid-glass.mod-fx-aurora-wash .liquid-flow,
body.mod-liquid-glass.mod-fx-cloud-haze .liquid-flow {
    opacity: 0.38;
}

body.mod-liquid-glass.mod-fx-film-grain .mod-fx-grain {
    opacity: 0.16;
}

@media (prefers-reduced-motion: reduce) {
    .mod-fx-shimmer,
    .mod-fx-aurora-band,
    .mod-fx-cloud,
    .mod-fx-shaft,
    .mod-fx-bokeh-dot,
    .mod-fx-raindrop,
    .mod-fx-flake,
    .mod-fx-orbit-dot,
    .mod-fx-comet-streak,
    body.mod-fx-blink-pulse {
        animation: none !important;
    }

    .mod-fx-raindrop,
    .mod-fx-flake {
        opacity: 0 !important;
    }
}
