.fx-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.fx-bloom {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: screen;
    opacity: 0.1;
    pointer-events: none;
    will-change: opacity;
}

.fx-bloom.is-fading {
    transition: opacity 0.6s ease;
}

body[data-fx="off"] .fx-bloom {
    display: none;
}

.fx-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

body:not([data-fx="full"]) .fx-particles {
    display: none;
}

.fx-eq {
    position: absolute;
    bottom: 5%;
    height: 28%;
    width: calc((100% - var(--fx-track-width, 960px)) / 2 - 36px);
    display: flex;
    align-items: flex-end;
    padding: 0 18px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.8;
}

.fx-eq--left {
    left: 0;
    justify-content: flex-end;
}

.fx-eq--right {
    right: 0;
    justify-content: flex-start;
}

.fx-eq.is-hidden,
.fx-eq.is-off,
body:not([data-fx="full"]) .fx-eq {
    display: none;
}

.fx-eq-deck {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 100%;
    padding: 14px 14px 12px;
    border-radius: 10px 10px 6px 6px;
    background: linear-gradient(180deg,
        transparent 0%,
        color-mix(in srgb, var(--song-accent) 5%, rgba(4, 9, 15, 0.25)) 55%,
        color-mix(in srgb, var(--song-accent) 12%, rgba(4, 9, 15, 0.7)) 100%);
    box-shadow:
        inset 0 -1px 0 color-mix(in srgb, var(--song-accent) 40%, transparent),
        0 10px 24px rgba(0, 0, 0, 0.35);
}

.fx-eq-deck::before {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 10px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in srgb, var(--song-accent) 85%, #FFFFFF) 18%,
        color-mix(in srgb, var(--song-accent) 85%, #FFFFFF) 82%,
        transparent 100%);
    box-shadow:
        0 0 10px color-mix(in srgb, var(--song-accent) 75%, transparent),
        0 4px 14px color-mix(in srgb, var(--song-accent) 35%, transparent);
}

.fx-eq-deck::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 7px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--song-accent) 22%, transparent) 0%,
        transparent 100%);
}

.fx-bar {
    position: relative;
    flex: 0 0 auto;
    width: var(--fx-bar-w, 8px);
    height: 100%;
    border-radius: 3px 3px 1px 1px;
    transform: scaleY(0.04);
    transform-origin: 50% 100%;
    will-change: transform;
    background: linear-gradient(0deg,
        color-mix(in srgb, var(--song-accent) 55%, transparent) 0%,
        color-mix(in srgb, var(--song-accent) 90%, #FFFFFF) 82%,
        #FFFFFF 100%);
    box-shadow: 0 0 10px color-mix(in srgb, var(--song-accent) 45%, transparent);
}

.fx-beat-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.001;
    will-change: opacity;
    background: radial-gradient(ellipse 72% 58% at 50% 42%,
        color-mix(in srgb, var(--song-accent) 32%, transparent) 0%,
        transparent 70%);
}

.fx-hitline-glow {
    position: absolute;
    left: 0;
    right: 0;
    top: -25%;
    height: 150%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.001;
    will-change: opacity;
    background: radial-gradient(ellipse 58% 42% at 50% 50%,
        color-mix(in srgb, var(--song-accent) 38%, transparent) 0%,
        color-mix(in srgb, var(--song-accent) 12%, transparent) 55%,
        transparent 100%);
}

.fx-beat-overlay.is-fading,
.fx-hitline-glow.is-fading {
    transition: opacity 0.45s ease;
}

.fx-burst,
.fx-ghost {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--note-size, 60px);
    height: var(--note-size, 60px);
    pointer-events: none;
    will-change: transform;
}

.fx-burst {
    z-index: 55;
}

.fx-ghost {
    z-index: 12;
}

.fx-burst-core,
.fx-shards,
.fx-ghost-inner {
    position: absolute;
    inset: 0;
    opacity: 0;
    will-change: transform, opacity;
}

.fx-burst-core {
    border-radius: 10px;
    background: radial-gradient(circle,
        #FFFFFF 0%,
        color-mix(in srgb, var(--lane-top) 75%, #FFFFFF) 32%,
        color-mix(in srgb, var(--lane-top) 60%, transparent) 55%,
        transparent 72%);
}

.fx-shard {
    position: absolute;
    border-radius: 3px;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, #FFFFFF 0%, var(--lane-top) 55%, var(--lane-bottom) 100%);
    box-shadow: 0 0 8px color-mix(in srgb, var(--lane-top) 80%, transparent);
}

.fx-ghost-inner {
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(16px, calc(var(--note-size, 60px) * 0.36), 28px);
    color: var(--rhythm-key-text);
    text-shadow: 0 2px 4px rgba(7, 12, 18, 0.8);
    border: 1px solid color-mix(in srgb, var(--theme-error, #E03C3C) 70%, #FFFFFF);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--theme-error, #E03C3C) 55%, var(--lane-top)) 0%,
        color-mix(in srgb, var(--theme-error, #E03C3C) 60%, var(--lane-bottom)) 100%);
    box-shadow:
        0 0 18px color-mix(in srgb, var(--theme-error, #E03C3C) 60%, transparent),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.fx-ghost-inner.note-key-space {
    font-size: clamp(12px, calc(var(--note-size, 60px) * 0.26), 20px);
    letter-spacing: -0.5px;
}

.fx-beam {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 0;
    bottom: calc(var(--hit-zone-bottom, 80px) + var(--hit-zone-height, 80px) / 2);
    z-index: 5;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: 50% 100%;
    pointer-events: none;
    will-change: transform, opacity;
    background: linear-gradient(0deg,
        color-mix(in srgb, var(--lane-top) 70%, #FFFFFF) 0%,
        color-mix(in srgb, var(--lane-top) 38%, transparent) 38%,
        transparent 100%);
}

.fx-beam.fx-beam--bad {
    background: linear-gradient(0deg,
        color-mix(in srgb, var(--theme-error, #E03C3C) 80%, #FFFFFF) 0%,
        color-mix(in srgb, var(--theme-error, #E03C3C) 40%, transparent) 40%,
        transparent 100%);
}

.fx-chip {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--note-size, 60px);
    z-index: 60;
    pointer-events: none;
    text-align: center;
    will-change: transform;
}

.fx-chip-inner {
    display: inline-block;
    opacity: 0;
    font-weight: 700;
    font-size: clamp(12px, calc(var(--note-size, 60px) * 0.3), 20px);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    color: #E6EAF2;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 0 12px color-mix(in srgb, var(--song-accent) 70%, transparent);
    will-change: transform, opacity;
}

.fx-chip.perfect .fx-chip-inner {
    color: #5BF0A8;
}

.fx-chip.great .fx-chip-inner {
    color: #6FD0FF;
}

.hit-key.fx-wrong .key-top {
    border-color: var(--theme-error, #E03C3C) !important;
    box-shadow:
        0 2px 6px rgba(7, 12, 18, 0.7),
        0 0 24px color-mix(in srgb, var(--theme-error, #E03C3C) 80%, transparent),
        inset 0 0 14px color-mix(in srgb, var(--theme-error, #E03C3C) 45%, transparent) !important;
    filter: saturate(0.6) brightness(1.1) !important;
}

body[data-fx="full"] .note.note-near .note-key,
body[data-fx="reduced"] .note.note-near .note-key {
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.5),
        inset 0 0 14px rgba(255, 255, 255, 0.35),
        0 0 20px color-mix(in srgb, var(--song-accent) 65%, transparent);
}

.fx-top-leak {
    position: absolute;
    left: 0;
    right: 0;
    top: -2px;
    height: 34%;
    z-index: 8;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--song-accent) 28%, transparent) 0%,
        transparent 100%);
}

.fx-edge {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 5px;
    z-index: 9;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.fx-edge--left {
    left: -3px;
}

.fx-edge--right {
    right: -3px;
}

.fx-edge-stream {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2400px;
    background: repeating-linear-gradient(180deg,
        color-mix(in srgb, var(--song-accent) 90%, #FFFFFF) 0 18px,
        transparent 18px 46px);
    box-shadow: 0 0 10px var(--song-accent);
    will-change: transform;
}

.game-container[data-tier="2"] {
    --rhythm-lane-divider: color-mix(in srgb, var(--song-accent) 28%, transparent);
}

.game-container[data-tier="3"] {
    --rhythm-lane-divider: color-mix(in srgb, var(--song-accent) 38%, transparent);
}

.game-container[data-tier="4"] {
    --rhythm-lane-divider: color-mix(in srgb, var(--song-accent) 52%, transparent);
}

.game-container[data-tier="3"] .fx-top-leak {
    opacity: 0.55;
}

.game-container[data-tier="4"] .fx-top-leak {
    opacity: 1;
}

.game-container[data-tier="4"] .fx-edge {
    opacity: 0.9;
}

.game-container[data-tier="3"] .hit-zone-container::after,
.game-container[data-tier="4"] .hit-zone-container::after {
    height: 3px;
    box-shadow: 0 0 14px var(--song-accent);
}

body[data-fx="full"] .game-container[data-tier="4"] .fx-edge-stream {
    animation: fxStream 0.9s linear infinite;
}

@keyframes fxStream {
    from { transform: translateY(-460px); }
    to { transform: translateY(0); }
}

.fx-vignette {
    position: absolute;
    inset: 0;
    z-index: 400;
    pointer-events: none;
    opacity: 0.001;
    transition: opacity 0.4s ease;
    background: radial-gradient(ellipse 78% 78% at 50% 50%,
        transparent 55%,
        color-mix(in srgb, var(--theme-error, #E03C3C) 30%, transparent) 78%,
        color-mix(in srgb, var(--theme-error, #E03C3C) 70%, transparent) 100%);
    will-change: opacity;
}

.fx-vignette.is-on {
    opacity: 0.8;
}

body[data-fx="full"] .fx-vignette.is-on {
    animation: fxBreathe 1s ease-in-out infinite alternate;
}

@keyframes fxBreathe {
    from { opacity: 0.45; }
    to { opacity: 0.95; }
}

.game-container.is-paused .fx-vignette,
.game-container.is-paused .fx-edge-stream {
    animation-play-state: paused;
}

.fx-confetti-wrap {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 57;
    pointer-events: none;
    will-change: transform;
}

.fx-confetti {
    position: absolute;
    width: 9px;
    height: 14px;
    margin: -7px 0 0 -4px;
    border-radius: 2px;
    opacity: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--lane-top) 70%, #FFFFFF), var(--lane-top));
    box-shadow: 0 0 6px color-mix(in srgb, var(--lane-top) 70%, transparent);
    will-change: transform, opacity;
}

.fx-confetti:nth-child(3n) {
    background: linear-gradient(180deg, #FFFFFF, var(--song-accent));
    box-shadow: 0 0 6px color-mix(in srgb, var(--song-accent) 70%, transparent);
}

body[data-fx="full"] .countdown-overlay.hidden {
    transition: opacity 0.55s ease-out, visibility 0.55s ease-out;
}

.fx-title-card {
    position: absolute;
    left: clamp(16px, 6vw, 80px);
    bottom: 18%;
    max-width: min(520px, 70vw);
    padding: 14px 22px 14px 18px;
    border-left: 3px solid var(--song-accent);
    background: linear-gradient(90deg, rgba(4, 9, 15, 0.88) 0%, rgba(4, 9, 15, 0.3) 100%);
    opacity: 0;
    transform: translateX(-30px);
    pointer-events: none;
    text-align: left;
    font-family: var(--font-sans);
}

.countdown-overlay.visible .fx-title-card.is-visible {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s ease-out 0.1s, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s;
}

body[data-fx="reduced"] .fx-title-card {
    transform: none;
}

body[data-fx="reduced"] .countdown-overlay.visible .fx-title-card.is-visible {
    transition: opacity 0.3s ease-out;
}

.fx-title-kicker {
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--song-accent);
}

.fx-title-name {
    margin-top: 4px;
    font-size: clamp(22px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    color: #FFFFFF;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.fx-title-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-top: 8px;
    font-size: 0.82rem;
    color: rgba(247, 244, 235, 0.82);
}

.fx-title-ref:empty,
.fx-title-diff:empty,
.fx-title-stars:empty {
    display: none;
}

.fx-title-diff {
    text-transform: capitalize;
}

.fx-title-stars {
    display: inline-flex;
    gap: 2px;
}

.fx-outro {
    position: absolute;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.001;
    will-change: opacity;
    transition: opacity 0.25s ease;
    background: radial-gradient(ellipse at 50% 55%,
        color-mix(in srgb, var(--song-accent) 38%, transparent) 0%,
        rgba(4, 9, 15, 0.35) 70%);
}

.fx-outro.is-visible {
    opacity: 1;
}

.fx-outro.is-bloom {
    background: radial-gradient(ellipse at 50% 60%,
        color-mix(in srgb, var(--song-accent) 45%, transparent) 0%,
        transparent 65%);
}

.fx-outro-text {
    will-change: transform, opacity;
    font-family: var(--font-sans);
    font-size: clamp(36px, 7vw, 96px);
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #FFFFFF;
    text-shadow:
        0 0 30px var(--song-accent),
        0 4px 18px rgba(0, 0, 0, 0.9);
    opacity: 0;
    transform: scale(0.6);
}

.fx-outro.is-visible .fx-outro-text:not(:empty) {
    animation: fxOutroText 1.1s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes fxOutroText {
    0% { transform: scale(0.6); opacity: 0; }
    25% { transform: scale(1.08); opacity: 1; }
    80% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.04); opacity: 0; }
}

.highway .hit-feedback {
    top: auto;
    bottom: 4px;
    font-size: clamp(18px, calc(var(--hit-zone-bottom, 80px) * 0.32), 26px);
    line-height: 1.05;
    gap: 2px;
    white-space: nowrap;
    z-index: 250;
}

body[data-fx="full"] .hit-feedback.perfect,
body[data-fx="reduced"] .hit-feedback.perfect {
    color: #FFFFFF;
    -webkit-text-stroke: 0.5px color-mix(in srgb, #5BF0A8 70%, transparent);
    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.95),
        0 0 14px #5BF0A8,
        0 0 32px color-mix(in srgb, var(--song-accent) 75%, transparent);
}

body[data-fx="full"] .hit-feedback.great,
body[data-fx="reduced"] .hit-feedback.great {
    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.95),
        0 0 14px color-mix(in srgb, #6FD0FF 60%, transparent),
        0 0 26px rgba(0, 0, 0, 0.75);
}

.play-dock .multiplier-display,
.play-dock .streak-count {
    will-change: transform;
}

.play-dock .multiplier-display {
    transform-style: preserve-3d;
}

.fx-settings-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fx-settings-section h4 {
    color: #8888ff;
    margin: 0 0 8px 0;
    font-size: 18px;
}

.fx-level-toggle {
    display: flex;
    gap: 8px;
    margin: 12px 0 16px;
}

.fx-level-option {
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #aabbcc;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fx-level-option:hover {
    border-color: rgba(0, 200, 255, 0.6);
    color: #ffffff;
}

.fx-level-option.selected {
    border-color: #00c8ff;
    background: rgba(0, 200, 255, 0.18);
    color: #ffffff;
}

.fx-settings-note {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(170, 187, 204, 0.75);
}

@media (prefers-reduced-motion: reduce) {
    .fx-edge-stream,
    .fx-vignette.is-on {
        animation: none !important;
    }
}

body:not(.gameplay) .game-container .fx-burst,
body:not(.gameplay) .game-container .fx-ghost,
body:not(.gameplay) .game-container .fx-beam,
body:not(.gameplay) .game-container .fx-chip,
body:not(.gameplay) .game-container .fx-confetti-wrap,
body:not(.gameplay) .game-container .fx-edge,
body:not(.gameplay) .game-container .fx-top-leak,
body:not(.gameplay) .game-container .fx-vignette,
body:not(.gameplay) .game-container .fx-eq,
body:not(.gameplay) .game-container .fx-particles,
body:not(.gameplay) .game-container .fx-hitline-glow {
    display: none;
}

.game-hud {
    justify-content: space-between;
}

.hud-song {
    min-width: 0;
    max-width: 44%;
    padding: 6px 13px 7px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(6, 10, 16, 0.72);
    text-align: right;
    font-family: var(--font-sans);
}

.hud-song-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    color: #FFFFFF;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-song-verse {
    margin-top: 2px;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--song-accent, #FFFFFF);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-song-verse:empty {
    display: none;
}

@media (max-width: 900px) {
    .hud-song {
        max-width: 100%;
    }
}

body.rhythm-mode .beatmap-tile.is-picking:not(.is-launching) {
    border-color: color-mix(in srgb, var(--song-accent, var(--sh-text)) 55%, transparent);
}

body.rhythm-mode .beatmap-tile.is-picking:not(.is-launching) .beatmap-difficulty-toggle {
    border-color: color-mix(in srgb, var(--song-accent, var(--sh-text)) 80%, transparent);
    animation: rhythm-pick-pulse 1.5s ease-in-out infinite;
}

@keyframes rhythm-pick-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--song-accent, var(--sh-text)) 55%, transparent);
    }
    55% {
        box-shadow: 0 0 0 5px color-mix(in srgb, var(--song-accent, var(--sh-text)) 0%, transparent),
            0 0 14px color-mix(in srgb, var(--song-accent, var(--sh-text)) 55%, transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.rhythm-mode .beatmap-tile.is-picking:not(.is-launching) .beatmap-difficulty-toggle {
        animation: none;
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--song-accent, var(--sh-text)) 45%, transparent);
    }
}

.stats-screen .end-song-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 200px));
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.stats-screen .end-song-buttons.has-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-screen .end-song-buttons .end-song-button {
    justify-content: center;
    white-space: nowrap;
    padding: 11px 10px;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
}

.stats-screen .end-song-buttons .end-song-button .keyboard-hint {
    flex-shrink: 0;
}

@media (max-width: 820px) {
    .stats-screen .end-song-buttons,
    .stats-screen .end-song-buttons.has-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-screen .end-song-buttons.has-nav .prev-song-button { order: 1; }
    .stats-screen .end-song-buttons.has-nav .next-song-button { order: 2; }
    .stats-screen .end-song-buttons.has-nav .play-again-button { order: 3; }
    .stats-screen .end-song-buttons.has-nav .back-selection-button { order: 4; }
}

.stats-screen .end-song-button.next-song-button,
.stats-screen .end-song-button.prev-song-button {
    border: 1px solid color-mix(in srgb, var(--song-accent, #C9A96F) 55%, transparent);
    color: #FFFFFF;
}

.stats-screen .end-song-button.next-song-button {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--song-accent, #C9A96F) 55%, rgba(10, 19, 28, 0.9)) 0%,
        color-mix(in srgb, var(--song-accent, #C9A96F) 30%, rgba(10, 19, 28, 0.9)) 100%);
    box-shadow: 0 0 18px color-mix(in srgb, var(--song-accent, #C9A96F) 25%, transparent);
}

.stats-screen .end-song-button.prev-song-button {
    background: rgba(10, 19, 28, 0.75);
}

.stats-screen .end-song-button.next-song-button:hover,
.stats-screen .end-song-button.prev-song-button:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

/* Which action leads is decided per state, not per button, so the emphasis can
   move to whatever the player can actually do next. After a clear that is the
   next song; when the day's completion is spent it is the road, because nothing
   else advances anything. */
.stats-screen .end-song-button.is-primary {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--song-accent, #C9A96F) 92%, #FFFFFF) 0%,
        var(--song-accent, #C9A96F) 100%);
    border-color: color-mix(in srgb, var(--song-accent, #C9A96F) 80%, #FFFFFF);
    color: #16202C;
    font-weight: 800;
    box-shadow: 0 0 26px color-mix(in srgb, var(--song-accent, #C9A96F) 42%, transparent);
}

.stats-screen .end-song-button.is-primary .keyboard-hint {
    border-color: rgba(22, 32, 44, 0.42);
    color: #16202C;
}

.stats-screen .end-song-button.is-secondary {
    background: rgba(10, 19, 28, 0.78);
    border: 1px solid color-mix(in srgb, var(--song-accent, #C9A96F) 40%, transparent);
    color: #F1F5FB;
    box-shadow: none;
    font-weight: 700;
}

/* rhythm_hud_v2.css forces `.next-song-button { color: var(--sh-on-light)
   !important }` because that button's own fill is light. This makes it dark again,
   and an !important on a class selector beats an equally specific author rule, so
   the label would sit near-black on near-black. Equal importance, higher
   specificity, per the note in CLAUDE.md. */
.stats-screen .end-song-button.is-secondary {
    color: #F1F5FB !important;
}

.stats-screen .end-song-button.is-secondary .keyboard-hint {
    color: rgba(241, 245, 251, 0.78) !important;
    border-color: rgba(241, 245, 251, 0.32) !important;
}

/* Not a fifth navigation button. Next Song / Play Again / Back are all "where do
   I go"; this is a closing thought about the song just finished, so it sits above
   them with its own shape and names the passage rather than advertising a feature. */
.stats-scripture {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 12px auto 0;
    padding: 9px 16px;
    width: max-content;
    max-width: 92%;
    border: 1px solid color-mix(in srgb, var(--song-accent, #C9A96F) 34%, transparent);
    border-radius: 999px;
    background: rgba(10, 19, 28, 0.6);
}

.stats-scripture[hidden] { display: none; }

.stats-scripture__label {
    font-size: 0.82rem;
    color: color-mix(in srgb, #F1F5FB 70%, transparent);
}

.stats-scripture__ref {
    font-family: var(--font-sans);
    font-variant-numeric: lining-nums tabular-nums;
    font-size: 0.9rem;
    font-weight: 700;
    color: #F1F5FB;
}

.stats-scripture__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border: 1px solid var(--song-accent, #C9A96F);
    border-radius: 999px;
    background: transparent;
    color: var(--song-accent, #C9A96F);
    font: 700 0.76rem/1 var(--font-sans, system-ui, sans-serif);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}

.stats-scripture__btn:hover { filter: brightness(1.15); }
.stats-scripture__btn img { width: 13px; height: 13px; }

.stats-day-note {
    margin: 10px auto 0;
    max-width: 46ch;
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #E7EDF6;
}

.stats-day-upgrade {
    display: inline-block;
    margin-top: 4px;
    color: var(--song-accent, #C9A96F);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.stats-day-upgrade:hover { filter: brightness(1.15); }

.song-loading {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0B1119;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    font-family: var(--font-sans);
}

.song-loading.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.song-loading-art {
    position: absolute;
    inset: -6%;
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(0.5) saturate(1.1);
    transform: scale(1.04);
}

.song-loading-scrim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 50%, color-mix(in srgb, var(--song-accent, #C9A96F) 14%, transparent) 0%, transparent 70%),
        linear-gradient(180deg, rgba(4, 9, 15, 0.55) 0%, rgba(4, 9, 15, 0.8) 100%);
}

.song-loading-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(520px, calc(100% - 48px));
    text-align: center;
}

.song-loading-kicker {
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--song-accent, #C9A96F);
}

.song-loading-title {
    font-family: var(--font-serif);
    font-size: clamp(26px, 3.4vw, 42px);
    font-weight: 700;
    line-height: 1.1;
    color: #FFFFFF;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.song-loading-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
    font-size: 0.82rem;
    color: rgba(247, 244, 235, 0.82);
}

.song-loading-stars {
    display: inline-flex;
    gap: 2px;
}

.song-loading-stars:empty,
.song-loading-verse:empty,
.song-loading-difficulty:empty {
    display: none;
}

.song-loading-verse {
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.66rem;
    color: var(--song-accent, #C9A96F);
}

.song-loading-bar {
    width: min(320px, 100%);
    height: 6px;
    margin-top: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.song-loading-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--song-accent, #C9A96F) 70%, #FFFFFF), var(--song-accent, #C9A96F));
    box-shadow: 0 0 12px color-mix(in srgb, var(--song-accent, #C9A96F) 70%, transparent);
    transition: width 0.4s ease;
}

.song-loading-step {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(247, 244, 235, 0.7);
}

.song-loading-step::after {
    content: '...';
    display: inline-block;
    width: 0;
    overflow: hidden;
    vertical-align: bottom;
    text-align: left;
    animation: songLoadingDots 1.2s steps(4, end) infinite;
}

@keyframes songLoadingDots {
    from { width: 0; }
    to { width: 1.3em; }
}

@media (prefers-reduced-motion: reduce) {
    .song-loading-step::after {
        animation: none;
        width: 1.3em;
    }
}

body.tutorial-gameplay-preview .game-container .fx-eq,
body.tutorial-gameplay-preview .game-container .fx-particles,
body.tutorial-gameplay-preview .game-container .fx-hitline-glow {
    display: none;
}
