body.rhythm-mode {
    --song-accent: #FFFFFF;

    --rhythm-key-1-top: #3F7BEE;   --rhythm-key-1-bottom: #1E4699;   --rhythm-key-1-border: #6E9DF5;
    --rhythm-key-2-top: #3FA1EE;   --rhythm-key-2-bottom: #1E6299;   --rhythm-key-2-border: #6EBCF5;
    --rhythm-key-3-top: #2FC7DD;   --rhythm-key-3-bottom: #157A8C;   --rhythm-key-3-border: #63DCEC;
    --rhythm-key-4-top: #2BDBB2;   --rhythm-key-4-bottom: #13886D;   --rhythm-key-4-border: #61EBCB;
    --rhythm-key-5-top: #4BDB5E;   --rhythm-key-5-bottom: #268036;   --rhythm-key-5-border: #7DEB8C;
    --rhythm-key-6-top: #9AE035;   --rhythm-key-6-bottom: #5C8C1B;   --rhythm-key-6-border: #BCEE72;
    --rhythm-key-7-top: #E2D72D;   --rhythm-key-7-bottom: #8C8515;   --rhythm-key-7-border: #EEE66E;
    --rhythm-key-8-top: #E9B035;   --rhythm-key-8-bottom: #946C1B;   --rhythm-key-8-border: #F2C971;
    --rhythm-key-9-top: #ED8A36;   --rhythm-key-9-bottom: #95521B;   --rhythm-key-9-border: #F4A970;
    --rhythm-key-10-top: #EA5F47;  --rhythm-key-10-bottom: #933327;  --rhythm-key-10-border: #F28C79;
    --rhythm-key-11-top: #E64B86;  --rhythm-key-11-bottom: #8F274F;  --rhythm-key-11-border: #F080AD;
    --rhythm-key-12-top: #C74BC7;  --rhythm-key-12-bottom: #7A277A;  --rhythm-key-12-border: #DA80DA;

    --rhythm-lane-divider: color-mix(in srgb, var(--song-accent) 18%, transparent);
}

/* ---------- keys: same keycap shape, stronger colour ---------- */

.key-top {
    border-radius: 6px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.16) 0%,
            var(--lane-top) 22%,
            var(--lane-bottom) 100%);
    box-shadow:
        0 8px 18px rgba(7, 12, 18, 0.65),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        0 0 14px rgba(0, 0, 0, 0.4);
}

.hit-key.pressed .key-top {
    filter: brightness(1.2);
    box-shadow:
        0 2px 5px rgba(7, 12, 18, 0.7),
        inset 0 0 18px rgba(255, 255, 255, 0.3),
        0 0 26px var(--song-accent);
}

.hit-key.perfect-timing .key-top {
    box-shadow:
        0 6px 14px rgba(7, 12, 18, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.35),
        0 0 34px var(--song-accent);
}

.hit-zone-glow {
    background: linear-gradient(180deg,
            transparent 0%,
            color-mix(in srgb, var(--song-accent) 14%, transparent) 44%,
            color-mix(in srgb, var(--song-accent) 26%, transparent) 50%,
            color-mix(in srgb, var(--song-accent) 14%, transparent) 56%,
            transparent 100%);
    box-shadow:
        0 1px 0 color-mix(in srgb, var(--song-accent) 80%, transparent),
        0 -1px 0 color-mix(in srgb, var(--song-accent) 80%, transparent),
        0 0 34px color-mix(in srgb, var(--song-accent) 34%, transparent);
}

.note-key {
    border-radius: 6px;
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

/* ---------- HUD: score and progress recede, live readouts come down ---------- */

.progress-container {
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(4, 9, 15, 0.92) 0%, rgba(4, 9, 15, 0.72) 70%, rgba(4, 9, 15, 0) 100%);
    box-shadow: none;
    overflow: visible;
}

.progress-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 4px;
    height: 6px;
    background: rgba(255, 255, 255, 0.16);
}

.progress-bar {
    position: relative;
    height: 6px;
    border-radius: 0;
    background: var(--song-accent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--song-accent) 85%, transparent);
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -3px;
    width: 3px;
    height: 12px;
    background: #fff;
    box-shadow: 0 0 10px #fff, 0 0 18px var(--song-accent);
}

.game-hud {
    justify-content: flex-start;
    padding: 16px 20px 0;
    pointer-events: none;
}

.score-section {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    padding: 7px 13px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(6, 10, 16, 0.72);
    box-shadow: none;
}

.score-label {
    margin-bottom: 0;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.55);
}

.score-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

/* ---------- the play dock, directly under the keys ---------- */

.play-dock {
    position: relative;
    width: min(960px, calc(100% - 40px));
    margin: 0 auto;
    padding-bottom: 22px;
    flex: 0 0 auto;
    z-index: 120;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    pointer-events: none;
}

.highway {
    max-height: none;
}

body:not(.gameplay) .play-dock {
    display: none;
}

.play-dock .health-section {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.play-dock .health-label {
    display: none;
}

.play-dock .focus-meter .health-percentage {
    margin-top: 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.play-dock .health-bar-container {
    width: 100%;
    height: 8px;
    border-radius: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
    -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 calc(100% / 24 - 3px), transparent calc(100% / 24 - 3px) calc(100% / 24));
    mask-image: repeating-linear-gradient(90deg, #000 0 calc(100% / 24 - 3px), transparent calc(100% / 24 - 3px) calc(100% / 24));
}

.play-dock .health-bar {
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    transition: width 0.25s ease;
}

.play-dock .health-bar.danger {
    animation: healthPulse 0.9s infinite;
}

/* Out of focus with No Fail on: the multiplier is locked, the run is not at risk.
   Gold and steady, so it reads as a state rather than an emergency. */
.play-dock .health-bar.locked {
    animation: none;
}

.play-dock .focus-meter {
    width: auto;
    height: auto;
    min-width: 0;
    padding: 6px 15px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(6, 10, 16, 0.72);
    box-shadow: none;
    backdrop-filter: none;
    flex-direction: row;
    align-items: center;
    gap: 13px;
}

.play-dock .meter-needle {
    display: none;
}

.play-dock .multiplier-display {
    padding-left: 13px;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--song-accent);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.play-dock .streak-count {
    margin-top: 0;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    font-variant-numeric: tabular-nums;
}

.play-dock .health-pause-hint {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    padding-left: 13px;
    gap: 6px;
}

.play-dock .health-pause-hint .pause-key {
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.58rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: none;
}

.play-dock .health-pause-hint .pause-text {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
}

.focus-meter.max-multiplier {
    border-color: color-mix(in srgb, var(--song-accent) 60%, transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--song-accent) 32%, transparent);
}

@media (max-height: 700px) {
    .play-dock {
        padding-bottom: 12px;
        gap: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .play-dock .health-bar.danger {
        animation: none;
    }
}

.hit-feedback {
    top: auto;
    bottom: 92px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95);
}

@media (max-height: 700px) {
    .hit-feedback {
        bottom: 78px;
    }
}

.hit-feedback.perfect,
.hit-feedback.great,
.hit-feedback.good,
.hit-feedback.miss {
    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.95),
        0 0 12px rgba(0, 0, 0, 0.9),
        0 0 26px rgba(0, 0, 0, 0.75);
}

.hit-feedback.perfect {
    color: #5BF0A8;
}

.hit-feedback.great {
    color: #6FD0FF;
}

.hit-feedback.good {
    color: #E6EAF2;
}

.hit-feedback.miss {
    color: #FF7060;
}

.hit-feedback .timing-offset {
    font-size: 13px;
    letter-spacing: 0.14em;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.85);
}

.hit-feedback .timing-offset.early {
    color: #8FB6FF;
}

.hit-feedback .timing-offset.late {
    color: #FFB07A;
}
