/* rc-game/rc-game.css - all River Rescue styles: the floating cat button,
   the fullscreen overlay, HUD, screens, trophy case, and lightbox. Scoped
   under .rc-game-*. Uses the site's design tokens with hex fallbacks, has
   html.rc-lite overrides (flat panels, no glow) and a prefers-reduced-motion
   block (no bob, no pulse, no confetti). */

/* --- Floating cat button (bottom-left; back-to-top owns bottom-right). --- */

.rc-game-fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    background: var(--card-bg, #121215);
    border: 1px solid var(--accent-gold, #DAA520);
    box-shadow: 0 4px 22px rgba(218, 165, 32, 0.25);
    cursor: pointer;
    z-index: 998;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.2s ease-in-out;
}

.rc-game-fab.is-in {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.rc-game-fab.is-suppressed {
    opacity: 0 !important;
    pointer-events: none !important;
}

.rc-game-fab:hover {
    box-shadow: 0 6px 28px rgba(218, 165, 32, 0.45);
}

.rc-game-fab:focus-visible {
    outline: 2px solid var(--accent-gold, #DAA520);
    outline-offset: 3px;
}

/* The cat peeks over the rim: the image is taller than the button and
   bottom-anchored, so the head rises above the circle. */
.rc-game-fab-cat {
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 76px;
    height: auto;
    transform: translateX(-50%);
    pointer-events: none;
}

.rc-game-fab.is-bob .rc-game-fab-cat {
    animation: rc-game-fab-bob 0.9s ease-in-out;
}

@keyframes rc-game-fab-bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    30% { transform: translateX(-50%) translateY(-7px); }
    60% { transform: translateX(-50%) translateY(-3px); }
}

/* --- Fullscreen overlay and stage. --- */

/* The hidden attribute must always win. Several rules below set display
   (flex/grid), which would otherwise override the browser's built-in
   [hidden] { display: none } and leave hidden layers covering the game. */
.rc-game-overlay [hidden] {
    display: none !important;
}

.rc-game-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    background: linear-gradient(165deg, #060608 0%, #0a1424 100%);
}

.rc-game-overlay.active {
    display: block;
}

.rc-game-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    outline: none;
}

.rc-game-canvas {
    position: absolute;
    inset: 0;
    display: block;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* --- Icon buttons, top bar, HUD. --- */

.rc-game-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 21, 0.75);
    border: 1px solid var(--border-color, #222228);
    color: var(--text-primary, #f0f0f0);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.rc-game-icon-btn:hover {
    border-color: var(--accent-gold, #DAA520);
    color: var(--accent-gold-light, #F0C75E);
}

.rc-game-icon-btn:focus-visible {
    outline: 2px solid var(--accent-gold, #DAA520);
    outline-offset: 2px;
}

.rc-game-topbar {
    position: absolute;
    top: 12px;
    right: 14px;
    display: flex;
    gap: 8px;
    z-index: 7;
}

.rc-game-hud {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 118px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    z-index: 4;
    pointer-events: none;
}

.rc-game-hud .rc-game-icon-btn {
    pointer-events: auto;
}

.rc-game-hud-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rc-game-hud-score {
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold, #DAA520);
    line-height: 1;
}

.rc-game-hud-combo {
    padding: 3px 9px;
    border: 1px solid var(--accent-gold, #DAA520);
    border-radius: 999px;
    color: var(--accent-gold-light, #F0C75E);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.rc-game-hud-best {
    color: var(--text-muted, #8a8a96);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rc-game-hud-level {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(218, 165, 32, 0.12);
    border: 1px solid var(--accent-gold, #DAA520);
    color: var(--accent-gold, #DAA520);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.rc-game-hud-level.is-raft {
    background: rgba(77, 139, 255, 0.16);
    border-color: var(--accent-blue, #4d8bff);
    color: var(--light-blue, #93c5fd);
}

.rc-game-hud-level.is-raft::after {
    content: " ⛵";
}

.rc-game-hud-lives {
    display: inline-flex;
    gap: 4px;
    color: var(--accent-gold, #DAA520);
    font-size: 1rem;
}

/* --- Boss HP bar (top-centre while the end-of-level fight is on). --- */

.rc-game-boss {
    position: absolute;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    width: min(440px, calc(100% - 40px));
    z-index: 5;
    text-align: center;
    pointer-events: none;
}

.rc-game-boss-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.rc-game-boss-name {
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff9d7a;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.rc-game-boss-weapon {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #F0C75E;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.rc-game-boss-buff {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 12px;
    border-radius: 999px;
    background: rgba(125, 255, 196, 0.16);
    border: 1px solid rgba(125, 255, 196, 0.6);
    color: #aeffde;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
}

.rc-game-boss-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(10, 10, 14, 0.7);
    border: 1px solid rgba(255, 120, 90, 0.6);
    overflow: hidden;
}

.rc-game-boss-track span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff5c4d, #ffb347);
    transition: width 0.25s ease;
}

.rc-game-hud-lives .far {
    opacity: 0.3;
}

/* --- Panels (menu, pause, game over, celebrate, trophy). --- */

.rc-game-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    overflow: auto;
    background: rgba(18, 18, 21, 0.92);
    -webkit-backdrop-filter: var(--blur, blur(10px));
    backdrop-filter: var(--blur, blur(10px));
    border: 1px solid var(--border-color, #222228);
    border-radius: var(--border-radius, 16px);
    padding: 28px 24px;
    text-align: center;
    z-index: 6;
    color: var(--text-primary, #f0f0f0);
    font-family: var(--font-secondary, "Inter", sans-serif);
}

.rc-game-panel h2 {
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 1.7rem;
    color: var(--accent-gold, #DAA520);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 10px;
}

.rc-game-panel h3 {
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 1rem;
    color: var(--text-primary, #f0f0f0);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 10px;
}

/* Reference-heavy panels get more room than the default 480px card so they
   read like a desktop game screen, not a skinny modal. */
.rc-game-panel.rc-game-helpview {
    width: min(820px, calc(100% - 40px));
    text-align: left;
}

.rc-game-panel.rc-game-levels,
.rc-game-panel.rc-game-armory {
    width: min(760px, calc(100% - 40px));
}

.rc-game-tag {
    color: var(--text-secondary, #a8a8b3);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 18px;
}

.rc-game-btn-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.rc-game-btn-column {
    flex-direction: column;
    align-items: stretch;
}

.rc-game-btn {
    padding: 12px 22px;
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid var(--border-color-hover, #33333a);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #f0f0f0);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: border-color 0.2s ease-in-out, background 0.2s ease-in-out;
}

.rc-game-btn:hover {
    border-color: var(--accent-gold, #DAA520);
    background: rgba(218, 165, 32, 0.08);
}

.rc-game-btn:focus-visible {
    outline: 2px solid var(--accent-gold, #DAA520);
    outline-offset: 2px;
}

.rc-game-btn-gold {
    background: var(--gradient-warm, linear-gradient(135deg, #DAA520, #e65c00));
    border-color: transparent;
    color: #0c0c0e;
}

.rc-game-btn-gold:hover {
    border-color: transparent;
    background: var(--gradient-warm, linear-gradient(135deg, #DAA520, #e65c00));
    filter: brightness(1.1);
}

/* =========================================================================
   TITLE SCREEN + MAIN MENU. Desktop-only game, so these are FULLSCREEN layers
   over the stage-filling parallax canvas (title.js), not the narrow centered
   card. Mega Man 2 intro energy, on the site's gold-on-dark motif.
   ========================================================================= */

/* The fullscreen parallax canvas that backs the title + menu (dimmed there). */
.rc-game-title-canvas {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Title screen: canvas shows through; a story line + a blinking start
   prompt sit near the bottom. Clicking anywhere starts (overlay.js). --- */
.rc-game-titlescreen {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
}

.rc-game-titlescreen-inner {
    width: min(640px, calc(100% - 48px));
    text-align: center;
    padding: 22px 26px clamp(24px, 6vh, 60px);
    margin-bottom: clamp(20px, 6vh, 60px);
    /* A solid readable backing so the story reads over the bright climb (no
       "everything transparent" contrast problems). */
    background: linear-gradient(180deg, rgba(8, 10, 20, 0) 0%, rgba(8, 10, 20, 0.72) 32%, rgba(8, 10, 20, 0.82) 100%);
    border-radius: 16px;
    animation: rc-game-title-fadein 1.1s ease 0.9s both;
}

@keyframes rc-game-title-fadein {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

.rc-game-title-story {
    color: #eef2fb;
    font-size: clamp(0.92rem, 1.4vw, 1.08rem);
    line-height: 1.65;
    margin: 0 auto 22px;
    max-width: 50ch;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.rc-game-title-start {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 30px;
    border-radius: 999px;
    border: 1px solid var(--accent-gold, #DAA520);
    background: rgba(10, 10, 14, 0.85);
    color: #fff;
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    animation: rc-game-blink 1.5s ease-in-out infinite;
}

.rc-game-title-start:hover { background: rgba(218, 165, 32, 0.18); }
.rc-game-title-start:focus-visible { outline: 2px solid var(--accent-gold, #DAA520); outline-offset: 3px; }

.rc-game-title-start-key {
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--accent-gold, #DAA520);
    color: #0c0c0e;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
}

@keyframes rc-game-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Main menu: a full-stage layout over the dimmed parallax. Brand up top,
   a column of big menu buttons, and a progress + utilities side panel. --- */
.rc-game-menuscreen {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-game-menuscreen-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(6, 7, 16, 0.88) 0%, rgba(6, 7, 16, 0.55) 52%, rgba(6, 7, 16, 0.18) 100%);
}

.rc-game-menuscreen-inner {
    position: relative;
    width: min(1000px, calc(100% - 64px));
    max-height: calc(100% - 48px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3.5vh, 36px);
    padding: 8px;
}

.rc-game-menuscreen-brand { text-align: left; }

.rc-game-menuscreen-logo {
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1;
    margin: 0;
    color: var(--accent-gold, #DAA520);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow: 0 0 34px rgba(218, 165, 32, 0.45);
}

.rc-game-menuscreen-sub {
    margin: 8px 0 0;
    font-size: clamp(0.78rem, 1.3vw, 1rem);
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: #9fb0d6;
}

.rc-game-menuscreen-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(230px, 0.9fr);
    gap: clamp(16px, 3vw, 40px);
    align-items: start;
}

.rc-game-menuscreen-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rc-game-menu-item {
    display: grid;
    grid-template-columns: 30px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 14px;
    padding: 13px 20px;
    text-align: left;
    border: 1px solid var(--border-color, #222228);
    border-left: 3px solid transparent;
    border-radius: var(--border-radius-sm, 8px);
    background: rgba(16, 16, 20, 0.86);
    color: var(--text-primary, #f0f0f0);
    font-family: var(--font-secondary, "Inter", sans-serif);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.rc-game-menu-item > i {
    grid-row: 1 / span 2;
    font-size: 1.05rem;
    color: var(--accent-gold, #DAA520);
    text-align: center;
}

.rc-game-menu-item-label {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rc-game-menu-item-sub {
    font-size: 0.74rem;
    color: var(--text-secondary, #a8a8b3);
    letter-spacing: 0.02em;
}

.rc-game-menu-item:hover,
.rc-game-menu-item:focus-visible {
    outline: none;
    border-color: var(--border-color-hover, #33333a);
    border-left-color: var(--accent-gold, #DAA520);
    background: rgba(218, 165, 32, 0.10);
    transform: translateX(4px);
}

.rc-game-menu-item.is-primary {
    border-color: transparent;
    border-left-color: transparent;
    background: var(--gradient-warm, linear-gradient(135deg, #DAA520, #e65c00));
    color: #0c0c0e;
}

.rc-game-menu-item.is-primary > i { color: #0c0c0e; }
.rc-game-menu-item.is-primary .rc-game-menu-item-sub { color: rgba(12, 12, 14, 0.78); }
.rc-game-menu-item.is-primary:hover,
.rc-game-menu-item.is-primary:focus-visible { filter: brightness(1.08); }

.rc-game-menuscreen-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rc-game-progcard {
    padding: 16px 18px;
    border: 1px solid var(--border-color, #222228);
    border-radius: var(--border-radius-sm, 8px);
    background: rgba(16, 16, 20, 0.86);
    text-align: left;
}

.rc-game-progcard-level {
    display: block;
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-gold, #DAA520);
    margin-bottom: 10px;
}

.rc-game-progcard-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary, #a8a8b3);
}

.rc-game-progcard-stat > i { color: var(--accent-gold, #DAA520); margin-right: 4px; }

.rc-game-menuscreen-story {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.55;
    font-style: italic;
    color: #9aa6c2;
    padding-left: 12px;
    border-left: 2px solid rgba(218, 165, 32, 0.4);
}

.rc-game-menuscreen-util {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.rc-game-btn-sm {
    padding: 8px 14px;
    font-size: 0.72rem;
}

/* --- Menu accordion (still used by the How to Play guide). --- */

.rc-game-acc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.rc-game-acc {
    border: 1px solid var(--border-color, #222228);
    border-radius: var(--border-radius-sm, 8px);
    background: rgba(6, 6, 8, 0.5);
    overflow: hidden;
}

.rc-game-acc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    color: var(--text-primary, #f0f0f0);
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.rc-game-acc-head > span {
    flex: 1 1 auto;
    text-align: left;
}

.rc-game-acc-head > i:first-child {
    color: var(--accent-gold, #DAA520);
    width: 18px;
    text-align: center;
}

.rc-game-acc-head:hover {
    background: rgba(218, 165, 32, 0.06);
}

.rc-game-acc-head:focus-visible {
    outline: 2px solid var(--accent-gold, #DAA520);
    outline-offset: -2px;
}

.rc-game-acc-chev {
    color: var(--text-muted, #8a8a96);
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.rc-game-acc.is-open .rc-game-acc-chev {
    transform: rotate(180deg);
}

.rc-game-acc-body {
    display: none;
    padding: 0 14px 14px;
}

.rc-game-acc.is-open .rc-game-acc-body {
    display: block;
}

/* The levels list can run long: cap it and scroll inside the open section. */
.rc-game-acc-body .rc-game-tracks {
    max-height: 32vh;
    overflow-y: auto;
    margin-bottom: 12px;
}

.rc-game-acc-body .rc-game-btn {
    width: 100%;
}

/* --- Menu: album rescue progress. --- */

.rc-game-album {
    border: 1px solid var(--border-color, #222228);
    border-radius: var(--border-radius-sm, 8px);
    padding: 16px 16px 14px;
    margin: 0 0 14px;
    background: rgba(6, 6, 8, 0.5);
}

.rc-game-tracks {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    text-align: left;
    color: var(--text-secondary, #a8a8b3);
    font-size: 0.88rem;
    line-height: 1.9;
}

/* The little gold "Lv N" chip in front of each level row. */
.rc-game-level-chip {
    display: inline-block;
    min-width: 44px;
    margin-right: 10px;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color-hover, #33333a);
    color: var(--accent-gold, #DAA520);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    font-style: normal;
}

.rc-game-tracks .is-rescued .rc-game-level-chip {
    border-color: var(--accent-gold, #DAA520);
    background: rgba(218, 165, 32, 0.12);
}

.rc-game-tracks .is-rescued {
    color: var(--accent-gold-light, #F0C75E);
}

/* The "Master" tag on a boss level: its prize is an Original Master Record. */
.rc-game-level-chip-master {
    min-width: 0;
    margin-right: 0;
    margin-left: 8px;
    color: #0d0d10;
    border-color: transparent;
    background: var(--accent-gold, #DAA520);
    text-transform: uppercase;
    font-size: 0.6rem;
}

.rc-game-track-thumb {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color-hover, #33333a);
    vertical-align: -6px;
    margin-right: 8px;
}

.rc-game-tracks .is-rescued::after {
    content: " \2713";
}

.rc-game-tracks .is-locked {
    opacity: 0.65;
    font-style: italic;
}

.rc-game-bankbar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
    margin-bottom: 8px;
}

.rc-game-bankbar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--gradient-warm, linear-gradient(135deg, #DAA520, #e65c00));
    transition: width 0.4s ease;
}

.rc-game-bank-label {
    color: var(--text-muted, #8a8a96);
    font-size: 0.78rem;
    margin: 0;
}

.rc-game-best-line {
    color: var(--text-secondary, #a8a8b3);
    font-size: 0.85rem;
    margin: 0;
}

/* "Reset progress" on the menu: a quiet text control with an inline
   two-step confirm (armed state turns coral). */
.rc-game-reset {
    display: block;
    margin: 14px auto 0;
    padding: 4px 8px;
    background: none;
    border: none;
    color: var(--text-muted, #8a8a96);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.rc-game-reset:hover {
    color: var(--text-secondary, #a8a8b3);
}

.rc-game-reset:focus-visible {
    outline: 2px solid var(--accent-gold, #DAA520);
    outline-offset: 2px;
}

.rc-game-reset.is-armed {
    color: #df6b57;
    text-transform: none;
    letter-spacing: 0.02em;
}

/* --- How to Play (the dedicated help screen). --- */

.rc-game-helpview {
    width: min(640px, calc(100% - 32px));
    text-align: left;
}

.rc-game-help-body {
    display: grid;
    gap: 16px;
}

.rc-game-help-body section {
    border: 1px solid var(--border-color, #222228);
    border-radius: var(--border-radius-sm, 8px);
    background: rgba(6, 6, 8, 0.5);
    padding: 14px 16px;
}

.rc-game-help-body h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    text-align: left;
    color: var(--accent-gold, #DAA520);
}

.rc-game-help-body h3 i {
    font-size: 0.85rem;
    opacity: 0.85;
}

.rc-game-help-body p {
    margin: 0;
    color: var(--text-secondary, #a8a8b3);
    font-size: 0.88rem;
    line-height: 1.6;
}

.rc-game-keys {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    color: var(--text-secondary, #a8a8b3);
    font-size: 0.88rem;
}

.rc-game-keys li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.rc-game-keys li > span:last-child {
    flex: 1;
    min-width: 160px;
}

.rc-game-keys i {
    width: 26px;
    text-align: center;
    color: var(--accent-gold, #DAA520);
}

/* Keyboard key chips. */
.rc-game-kbd {
    display: inline-block;
    min-width: 26px;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid var(--border-color-hover, #33333a);
    border-bottom-width: 2px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #f0f0f0);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}

/* --- Game over. --- */

.rc-game-final-score {
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--text-primary, #f0f0f0);
    margin: 4px 0;
    line-height: 1;
}

.rc-game-newbest {
    font-family: var(--font-primary, "Cinzel", serif);
    color: var(--accent-gold, #DAA520);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 1rem;
    margin: 6px 0;
    animation: rc-game-pulse 1.2s ease-in-out infinite;
}

@keyframes rc-game-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.rc-game-over-progress {
    color: var(--text-muted, #8a8a96);
    font-size: 0.82rem;
    margin: 10px 0 0;
}

/* --- Celebration. --- */

.rc-game-album-art {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
    margin: 0 auto 14px;
    border-radius: var(--border-radius-sm, 8px);
    border: 2px solid var(--accent-gold, #DAA520);
    box-shadow: 0 0 30px rgba(218, 165, 32, 0.35);
}

.rc-game-vinyl {
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: radial-gradient(circle, #0d0d10 58%, #16161a 100%);
    border: 2px solid var(--accent-gold, #DAA520);
    display: grid;
    place-items: center;
    box-shadow: 0 0 30px rgba(218, 165, 32, 0.35);
}

.rc-game-vinyl span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-warm, linear-gradient(135deg, #DAA520, #e65c00));
}

.rc-game-tracks-done {
    display: inline-block;
    margin: 0 auto 4px;
}

/* Boss intro / defeat cards: an animated portrait, an eyebrow, a funny line. */
.rc-game-bosscard {
    border-color: rgba(218, 165, 32, 0.5);
    box-shadow: 0 0 60px rgba(218, 165, 32, 0.16);
}

.rc-game-bosscard-win {
    border-color: rgba(125, 255, 196, 0.5);
    box-shadow: 0 0 60px rgba(125, 255, 196, 0.16);
}

.rc-game-bosscard-art {
    width: 180px;
    height: 180px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(218, 165, 32, 0.14) 0%, rgba(18, 18, 21, 0) 70%);
}

.rc-game-bosscard-win .rc-game-bosscard-art {
    background: radial-gradient(circle, rgba(125, 255, 196, 0.14) 0%, rgba(18, 18, 21, 0) 70%);
}

.rc-game-bosscard-art canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

.rc-game-bosscard-eyebrow {
    display: inline-block;
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-gold, #DAA520);
    margin-bottom: 4px;
}

.rc-game-bosscard-eyebrow-win {
    color: #7dffc4;
}

.rc-game-bosscard-quote {
    color: var(--text-primary, #f0f0f0);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 34ch;
    margin: 8px auto 18px;
}
.rc-game-bosscard-quote::before { content: "\201C"; }
.rc-game-bosscard-quote::after { content: "\201D"; }

/* Post-boss "Master Recovered" card: the won Original Master Record (disc or
   cover art) + the minimal act stats. Won by beating the boss that guards it. */
.rc-game-master {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 auto 14px;
    padding: 12px 16px;
    max-width: 340px;
    border: 1px solid rgba(218, 165, 32, 0.4);
    border-radius: var(--border-radius-sm, 8px);
    background: radial-gradient(circle at 20% 30%, rgba(218, 165, 32, 0.12), rgba(18, 18, 21, 0.2));
}

.rc-game-master-disc {
    position: relative;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle, #2a2a30 34%, #0d0d10 36%, #0d0d10 60%, #1a1a1f 62%);
    box-shadow: 0 0 0 4px rgba(218, 165, 32, 0.35), 0 6px 16px rgba(0, 0, 0, 0.5);
}

.rc-game-master-disc::after {
    content: "";
    position: absolute;
    inset: 42%;
    border-radius: 50%;
    background: var(--accent-gold, #DAA520);
}

.rc-game-master-cover {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.rc-game-master-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.rc-game-master-label {
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-gold, #DAA520);
}

.rc-game-master-text strong {
    font-size: 1.05rem;
    color: var(--text-primary, #f0f0f0);
}

.rc-game-statgrid {
    list-style: none;
    margin: 0 auto 18px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-width: 360px;
}

.rc-game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color, #222228);
}

.rc-game-stat > i {
    color: var(--accent-gold, #DAA520);
    font-size: 0.85rem;
}

.rc-game-stat-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #f0f0f0);
}

.rc-game-stat-label {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary, #a8a8b3);
}

.rc-game-stat.is-win {
    border-color: rgba(125, 255, 196, 0.5);
    background: rgba(125, 255, 196, 0.08);
}

.rc-game-stat.is-win > i,
.rc-game-stat.is-win .rc-game-stat-val {
    color: #7dffc4;
}

/* Between-level transition: a gold vignette wash that fades in over the whole
   stage, hides the level swap, then fades out onto the new scene. */
.rc-game-fade {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at 50% 44%, rgba(218, 165, 32, 0.28), #0a0a0d 68%);
    transition: opacity 320ms ease;
}

.rc-game-fade.is-active {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .rc-game-fade { transition: none; }
}

.rc-game-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
}

.rc-game-confetti span {
    position: absolute;
    top: -14px;
    width: 7px;
    height: 12px;
    border-radius: 2px;
    opacity: 0;
    animation: rc-game-confetti-fall 2.6s linear forwards;
}

@keyframes rc-game-confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(540deg); opacity: 0.2; }
}

/* --- Trophy case. --- */

.rc-game-trophy {
    width: min(720px, calc(100% - 32px));
    text-align: left;
}

.rc-game-trophy-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.rc-game-trophy-head h2 {
    margin: 0;
    flex: 1;
}

.rc-game-trophy-count {
    color: var(--text-muted, #8a8a96);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Trophy Case tab bar: Original Records vs Collectibles. */
.rc-game-trophy-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #222228);
}

.rc-game-trophy-tab {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 8px 12px;
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted, #8a8a96);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.rc-game-trophy-tab i {
    margin-right: 6px;
    opacity: 0.85;
}

.rc-game-trophy-tab:hover {
    color: var(--text-secondary, #a8a8b3);
}

.rc-game-trophy-tab.is-active {
    color: var(--accent-gold, #DAA520);
    border-bottom-color: var(--accent-gold, #DAA520);
}

/* --- How to Play: tabbed guide (Basics / River / Bosses / Progress), organised
   into tidy blocks instead of one long accordion. Tabs match the Trophy Case. --- */
.rc-game-help-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #222228);
}

.rc-game-help-tab {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 9px 16px;
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #8a8a96);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.rc-game-help-tab i {
    margin-right: 6px;
    opacity: 0.85;
}

.rc-game-help-tab:hover {
    color: var(--text-secondary, #a8a8b3);
}

.rc-game-help-tab.is-active {
    color: var(--accent-gold, #DAA520);
    border-bottom-color: var(--accent-gold, #DAA520);
}

.rc-game-help-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 12px;
    align-items: start;
}

.rc-game-help-block {
    padding: 14px 16px;
    border: 1px solid var(--border-color, #222228);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    text-align: left;
}

.rc-game-help-block h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-gold, #DAA520);
}

.rc-game-help-block p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-secondary, #a8a8b3);
}

.rc-game-help-block .rc-game-keys {
    margin: 0;
}

.rc-game-trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    perspective: 900px;
}

.rc-game-trophy-empty {
    color: var(--text-secondary, #a8a8b3);
    font-size: 0.9rem;
    grid-column: 1 / -1;
    margin: 8px 0;
}

.rc-game-trophy-card {
    position: relative;
    background: var(--card-bg, #121215);
    border: 1px solid var(--border-color, #222228);
    border-radius: var(--border-radius-sm, 8px);
    overflow: hidden;
    transition: border-color 0.2s ease-in-out, transform 0.22s ease, box-shadow 0.22s ease;
    /* Staggered fly-in: --i is set per card in collect.js. */
    opacity: 0;
    animation: rc-game-trophy-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes rc-game-trophy-in {
    0% { opacity: 0; transform: translateY(16px) rotateX(12deg) scale(0.94); }
    100% { opacity: 1; transform: none; }
}

/* Unlocked cards lift and glow in their tier colour on hover/focus. */
.rc-game-trophy-card.is-unlocked:hover,
.rc-game-trophy-card.is-unlocked:focus-visible {
    transform: translateY(-4px);
    outline: none;
}

.rc-game-trophy-card.is-unlocked.tier-gold {
    border-color: rgba(218, 165, 32, 0.55);
}

.rc-game-trophy-card.is-unlocked.tier-gold:hover,
.rc-game-trophy-card.is-unlocked.tier-gold:focus-visible {
    border-color: var(--accent-gold, #DAA520);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 22px rgba(218, 165, 32, 0.4);
}

.rc-game-trophy-card.is-unlocked.tier-platinum {
    border-color: rgba(200, 200, 210, 0.5);
}

.rc-game-trophy-card.is-unlocked.tier-platinum:hover,
.rc-game-trophy-card.is-unlocked.tier-platinum:focus-visible {
    border-color: #c8c8d2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 22px rgba(200, 200, 214, 0.4);
}

.rc-game-trophy-card.is-unlocked.tier-photo {
    border-color: rgba(77, 139, 255, 0.5);
}

.rc-game-trophy-card.is-unlocked.tier-photo:hover,
.rc-game-trophy-card.is-unlocked.tier-photo:focus-visible {
    border-color: var(--accent-blue, #4d8bff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 22px rgba(77, 139, 255, 0.42);
}

.rc-game-trophy-card.is-photo {
    cursor: pointer;
}

.rc-game-trophy-media {
    position: relative;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    background: #0c0c0e;
    overflow: hidden;
}

.rc-game-trophy-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.rc-game-trophy-card.is-unlocked:hover .rc-game-trophy-media img {
    transform: scale(1.06);
}

/* The diagonal shine that sweeps across a trophy on hover. */
.rc-game-trophy-shine {
    position: absolute;
    top: -60%;
    left: -120%;
    width: 60%;
    height: 220%;
    transform: rotate(20deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    pointer-events: none;
}

.rc-game-trophy-card.is-unlocked:hover .rc-game-trophy-shine {
    animation: rc-game-trophy-shine 0.8s ease-out;
}

@keyframes rc-game-trophy-shine {
    0% { left: -120%; }
    100% { left: 160%; }
}

.rc-game-trophy-lock {
    color: var(--text-muted, #8a8a96);
    font-size: 1.6rem;
    opacity: 0.7;
}

.rc-game-trophy-card.is-locked .rc-game-trophy-media,
.rc-game-trophy-card.is-broken .rc-game-trophy-media {
    background: repeating-linear-gradient(135deg, #0c0c0e 0 12px, #101013 12px 24px);
}

/* A drawn record disk for Original Records without (or before) a prize cover:
   gold-rimmed vinyl when rescued, muted silhouette when the level is locked. */
.rc-game-record-disc {
    width: 62%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: radial-gradient(circle, #0d0d10 30%, #1c1c22 32% 57%, #0d0d10 59%);
    border: 2px solid var(--accent-gold, #DAA520);
    box-shadow: 0 0 18px rgba(218, 165, 32, 0.35);
    position: relative;
}

.rc-game-record-disc::after {
    content: '';
    position: absolute;
    inset: 37%;
    border-radius: 50%;
    background: var(--gradient-warm, linear-gradient(135deg, #DAA520, #e65c00));
}

.rc-game-record-card.is-locked .rc-game-record-disc {
    border-color: rgba(138, 138, 150, 0.4);
    box-shadow: none;
    opacity: 0.55;
}

.rc-game-record-card.is-locked .rc-game-record-disc::after {
    background: #2a2a30;
}

/* The lock overlays the record silhouette instead of stacking beside it. */
.rc-game-record-card .rc-game-trophy-lock {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.rc-game-trophy-body {
    padding: 10px 12px 12px;
}

.rc-game-trophy-body h4 {
    margin: 8px 0 4px;
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.92rem;
    color: var(--text-primary, #f0f0f0);
}

.rc-game-trophy-body p {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--text-muted, #8a8a96);
}

.rc-game-tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid currentColor;
}

.rc-game-tier-badge.tier-gold {
    color: var(--accent-gold, #DAA520);
}

.rc-game-tier-badge.tier-platinum {
    color: #c8c8d2;
}

.rc-game-tier-badge.tier-photo {
    color: var(--accent-blue, #4d8bff);
}

/* --- Achievements: bronze / silver tiers + the emoji medallion + progress. --- */
.rc-game-tier-badge.tier-bronze { color: #cd7f32; }
.rc-game-tier-badge.tier-silver { color: #c3ccd6; }

.rc-game-trophy-card.is-unlocked.tier-bronze { border-color: rgba(205, 127, 50, 0.5); }
.rc-game-trophy-card.is-unlocked.tier-bronze:hover,
.rc-game-trophy-card.is-unlocked.tier-bronze:focus-visible {
    border-color: #cd7f32;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 22px rgba(205, 127, 50, 0.38);
}
.rc-game-trophy-card.is-unlocked.tier-silver { border-color: rgba(195, 204, 214, 0.5); }
.rc-game-trophy-card.is-unlocked.tier-silver:hover,
.rc-game-trophy-card.is-unlocked.tier-silver:focus-visible {
    border-color: #c3ccd6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 22px rgba(195, 204, 214, 0.36);
}

.rc-game-ach-icon {
    font-size: clamp(2.2rem, 7vw, 3rem);
    line-height: 1;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}
.rc-game-ach-card.is-unlocked.tier-gold .rc-game-trophy-media { background: radial-gradient(circle at 50% 38%, rgba(218, 165, 32, 0.22), #0c0c0e 70%); }
.rc-game-ach-card.is-unlocked.tier-platinum .rc-game-trophy-media { background: radial-gradient(circle at 50% 38%, rgba(200, 200, 214, 0.2), #0c0c0e 70%); }
.rc-game-ach-card.is-unlocked.tier-silver .rc-game-trophy-media { background: radial-gradient(circle at 50% 38%, rgba(195, 204, 214, 0.18), #0c0c0e 70%); }
.rc-game-ach-card.is-unlocked.tier-bronze .rc-game-trophy-media { background: radial-gradient(circle at 50% 38%, rgba(205, 127, 50, 0.2), #0c0c0e 70%); }

.rc-game-ach-progress {
    margin-top: 8px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.rc-game-ach-progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent-gold, #DAA520);
}
.rc-game-ach-progress-label {
    display: block;
    margin-top: 4px;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
}

.rc-game-data-tag { margin-top: 4px; }

/* --- Achievement unlock pop-up: slides in top-right, one at a time. --- */
.rc-game-ach-pop {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 12;
    max-width: min(340px, 78%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(218, 165, 32, 0.55);
    background: linear-gradient(135deg, rgba(24, 22, 16, 0.96), rgba(14, 14, 16, 0.96));
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 24px rgba(218, 165, 32, 0.28);
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}
.rc-game-ach-pop.is-in { animation: rc-game-ach-in 3.6s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
@keyframes rc-game-ach-in {
    0% { transform: translateX(120%); opacity: 0; }
    8% { transform: translateX(0); opacity: 1; }
    88% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(120%); opacity: 0; }
}
.rc-game-ach-pop.tier-bronze { border-color: rgba(205, 127, 50, 0.6); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 24px rgba(205, 127, 50, 0.3); }
.rc-game-ach-pop.tier-silver { border-color: rgba(195, 204, 214, 0.6); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 24px rgba(195, 204, 214, 0.28); }
.rc-game-ach-pop.tier-platinum { border-color: rgba(200, 200, 214, 0.6); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 24px rgba(200, 200, 214, 0.3); }
.rc-game-ach-pop-icon {
    font-size: 2rem;
    line-height: 1;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}
.rc-game-ach-pop-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rc-game-ach-pop-kicker {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-gold, #DAA520);
}
.rc-game-ach-pop-title { font-weight: 700; font-size: 0.95rem; color: #fff; }
.rc-game-ach-pop-desc {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
    .rc-game-ach-pop.is-in { animation: none; transform: none; opacity: 1; }
}

/* --- Photo lightbox (inside the game overlay). --- */

.rc-game-lightbox {
    position: absolute;
    inset: 0;
    z-index: 10;
    margin: 0;
    display: grid;
    place-items: center;
    grid-template-rows: 1fr auto;
    padding: 48px 16px 20px;
    background: rgba(6, 6, 8, 0.9);
}

.rc-game-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid var(--border-color-hover, #33333a);
}

.rc-game-lightbox figcaption {
    color: var(--text-secondary, #a8a8b3);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.85rem;
    padding-top: 12px;
    text-align: center;
}

.rc-game-lightbox > button {
    position: absolute;
    top: 12px;
    right: 14px;
}

/* --- Toast and damage flash. --- */

.rc-game-toast {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(18, 18, 21, 0.95);
    border: 1px solid var(--accent-gold, #DAA520);
    color: var(--accent-gold-light, #F0C75E);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
    z-index: 8;
    pointer-events: none;
}

.rc-game-toast-img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--border-color-hover, #33333a);
    flex: 0 0 auto;
}

.rc-game-toast-unlock {
    border-color: var(--accent-blue, #4d8bff);
    color: var(--light-blue, #93c5fd);
}

.rc-game-flash {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    box-shadow: inset 0 0 90px 30px rgba(223, 60, 60, 0.55);
}

.rc-game-flash.is-on {
    animation: rc-game-flash-fade 0.45s ease-out;
}

@keyframes rc-game-flash-fade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- Tutorial banner. Waiting state: dim scrim + a centered card with the
   press-a-key hint (the world is frozen). Acting state: a compact strip at
   the top showing the current objective. The card never blocks the mouse
   (only the Skip button is interactive), so pointer-drag play is unaffected. */

.rc-game-tutor {
    position: absolute;
    inset: 0;
    z-index: 9;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 68px;
    pointer-events: none;
    transition: background 0.25s ease;
}

.rc-game-tutor.is-waiting {
    align-items: center;
    padding-top: 0;
    background: rgba(6, 6, 8, 0.55);
}

.rc-game-tutor-card {
    pointer-events: none;
    width: min(540px, calc(100% - 32px));
    background: rgba(18, 18, 21, 0.96);
    border: 1px solid var(--accent-gold, #DAA520);
    border-radius: var(--border-radius, 16px);
    padding: 14px 18px 12px;
    text-align: center;
    box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
}

.rc-game-tutor.is-waiting .rc-game-tutor-card {
    padding: 22px 24px 18px;
    box-shadow: 0 0 40px rgba(218, 165, 32, 0.25), 0 12px 44px rgba(0, 0, 0, 0.55);
    animation: rc-game-tutor-pop 0.32s ease-out;
}

@keyframes rc-game-tutor-pop {
    0% { transform: translateY(10px) scale(0.96); opacity: 0; }
    100% { transform: none; opacity: 1; }
}

.rc-game-tutor-step {
    display: inline-block;
    margin-bottom: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(218, 165, 32, 0.14);
    border: 1px solid var(--accent-gold, #DAA520);
    color: var(--accent-gold, #DAA520);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rc-game-tutor-text {
    margin: 0;
    color: var(--text-primary, #f0f0f0);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.95rem;
    line-height: 1.5;
}

.rc-game-tutor:not(.is-waiting) .rc-game-tutor-text {
    font-size: 0.85rem;
}

.rc-game-tutor-hint {
    display: none;
    margin-top: 12px;
    color: var(--accent-gold-light, #F0C75E);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    animation: rc-game-pulse 1.4s ease-in-out infinite;
}

.rc-game-tutor.is-waiting .rc-game-tutor-hint {
    display: inline-block;
}

.rc-game-tutor-skip {
    pointer-events: auto;
    display: block;
    margin: 12px auto 0;
    padding: 4px 10px;
    background: none;
    border: none;
    color: var(--text-muted, #8a8a96);
    font-family: var(--font-secondary, "Inter", sans-serif);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.rc-game-tutor-skip:hover {
    color: var(--text-secondary, #a8a8b3);
}

.rc-game-tutor-skip:focus-visible {
    outline: 2px solid var(--accent-gold, #DAA520);
    outline-offset: 2px;
}

.rc-game-tutor:not(.is-waiting) .rc-game-tutor-skip {
    margin-top: 6px;
    font-size: 0.66rem;
}

/* --- Menu action buttons (Level Select / Armory row under Play). --- */

.rc-game-menu-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.rc-game-menu-actions .rc-game-btn {
    flex: 1 1 0;
    min-width: 120px;
}

.rc-game-panel-hint {
    font-size: 0.72rem;
    color: var(--text-muted, #9a9aa2);
    letter-spacing: 0.03em;
}

/* --- Weapon hotbar (during a boss fight, keys 1-5). --- */

.rc-game-weaponbar {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
    pointer-events: none;
    max-width: calc(100% - 24px);
    flex-wrap: wrap;
    justify-content: center;
}

.rc-game-wslot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 62px;
    padding: 5px 8px 6px;
    border-radius: 10px;
    background: rgba(12, 12, 16, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.rc-game-wslot b {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
}

.rc-game-wslot-name {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted, #b6b6be);
    white-space: nowrap;
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-game-wslot.is-active {
    border-color: var(--wcolor, #F0C75E);
    box-shadow: 0 0 0 1px var(--wcolor, #F0C75E), 0 4px 18px rgba(0, 0, 0, 0.5);
    transform: translateY(-3px);
}

.rc-game-wslot.is-active b {
    background: var(--wcolor, #F0C75E);
    color: #141014;
}

.rc-game-wslot.is-active .rc-game-wslot-name {
    color: var(--wcolor, #F0C75E);
}

.rc-game-wslot.is-locked {
    opacity: 0.4;
    filter: grayscale(0.7);
}

/* --- Armory (weapon loadout grid). --- */

.rc-game-armory-tag {
    margin-bottom: 14px;
}

.rc-game-weapon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    text-align: left;
}

.rc-game-weapon-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 14px 14px 16px;
    border-radius: 14px;
    background: rgba(10, 10, 14, 0.6);
    border: 1px solid var(--border-color, #26262c);
    color: var(--text-primary, #f0f0f0);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.rc-game-weapon-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--wcolor, #F0C75E);
}

.rc-game-weapon-card:not(:disabled):hover {
    transform: translateY(-2px);
    border-color: var(--wcolor, #F0C75E);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.rc-game-weapon-card:focus-visible {
    outline: 2px solid var(--wcolor, #F0C75E);
    outline-offset: 2px;
}

.rc-game-weapon-card.is-equipped {
    border-color: var(--wcolor, #F0C75E);
    box-shadow: 0 0 0 1px var(--wcolor, #F0C75E);
}

.rc-game-weapon-card.is-locked {
    opacity: 0.55;
    cursor: default;
}

.rc-game-weapon-slot {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--wcolor, #F0C75E);
    opacity: 0.7;
}

.rc-game-weapon-name {
    font-family: var(--font-primary, "Cinzel", serif);
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.rc-game-weapon-fire {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wcolor, #F0C75E);
}

.rc-game-weapon-stats {
    font-size: 0.74rem;
    color: var(--text-muted, #b6b6be);
}

.rc-game-weapon-state {
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-muted, #9a9aa2);
}

.rc-game-weapon-card.is-equipped .rc-game-weapon-state {
    color: var(--wcolor, #F0C75E);
}

/* --- Level select grid. --- */

.rc-game-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

.rc-game-level-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 8px 10px;
    border-radius: 14px;
    background: rgba(10, 10, 14, 0.6);
    border: 1px solid var(--border-color, #26262c);
    color: var(--text-primary, #f0f0f0);
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.rc-game-level-card:not(.is-locked):hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--accent-gold, #DAA520);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.25);
}

.rc-game-level-card:focus-visible {
    outline: 2px solid var(--accent-gold, #DAA520);
    outline-offset: 2px;
}

.rc-game-level-card.is-boss {
    border-color: rgba(255, 120, 90, 0.5);
    background: linear-gradient(180deg, rgba(60, 20, 24, 0.5), rgba(10, 10, 14, 0.6));
}

.rc-game-level-card.is-boss:not(.is-locked):hover {
    border-color: #ff785a;
    box-shadow: 0 6px 20px rgba(255, 120, 90, 0.28);
}

.rc-game-level-card.is-locked {
    opacity: 0.45;
    cursor: default;
}

.rc-game-level-num {
    font-family: var(--font-primary, "Cinzel", serif);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-gold, #DAA520);
}

.rc-game-level-card.is-boss .rc-game-level-num {
    color: #ff9d7a;
}

.rc-game-level-mode {
    font-size: 0.9rem;
    color: var(--text-muted, #b6b6be);
}

.rc-game-level-name {
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary, #e8e8ee);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rc-game-level-best {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--accent-gold, #DAA520);
}

.rc-game-level-card.is-locked .rc-game-level-best {
    color: var(--text-muted, #7a7a82);
}

/* The How to Play accordion reuses the menu accordion styles; give it its own
   scroll so long sections never blow out the panel. */
.rc-game-help-acc {
    max-height: 100%;
}

/* --- Small screens. --- */

@media (max-width: 1024px) {
    .rc-game-fab {
        bottom: 20px;
        left: 14px;
        width: 50px;
        height: 50px;
    }

    .rc-game-fab-cat {
        width: 66px;
    }
}

@media (max-width: 640px) {
    .rc-game-panel {
        padding: 22px 16px;
    }

    .rc-game-panel h2 {
        font-size: 1.4rem;
    }

    .rc-game-hud {
        right: 108px;
    }

    .rc-game-hud-score {
        font-size: 1.25rem;
    }

    .rc-game-hud-best {
        display: none;
    }

    .rc-game-trophy-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .rc-game-icon-btn {
        width: 38px;
        height: 38px;
    }
}

/* --- Lite mode: flat panels, no glow, no blur (rc-lite.css motif). --- */

html.rc-lite .rc-game-fab {
    box-shadow: none;
}

html.rc-lite .rc-game-panel {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #121215;
}

html.rc-lite .rc-game-vinyl,
html.rc-lite .rc-game-album-art {
    box-shadow: none;
}

html.rc-lite .rc-game-confetti {
    display: none;
}

/* Lite: trophies appear instantly, no fly-in or shine sweep. */
html.rc-lite .rc-game-trophy-card {
    opacity: 1;
    animation: none;
}

html.rc-lite .rc-game-trophy-shine {
    display: none;
}

/* --- Reduced motion: no bob, no pulse, no confetti, no bar sweep. --- */

@media (prefers-reduced-motion: reduce) {
    .rc-game-fab {
        transition: opacity 0.6s ease;
        transform: none;
    }

    .rc-game-fab.is-bob .rc-game-fab-cat {
        animation: none;
    }

    .rc-game-title-start,
    .rc-game-titlescreen-inner {
        animation: none;
    }

    .rc-game-menu-item {
        transition: none;
    }

    .rc-game-newbest {
        animation: none;
    }

    .rc-game-confetti {
        display: none;
    }

    .rc-game-bankbar span {
        transition: none;
    }

    .rc-game-acc-chev {
        transition: none;
    }

    .rc-game-tutor.is-waiting .rc-game-tutor-card {
        animation: none;
    }

    .rc-game-tutor-hint {
        animation: none;
    }

    .rc-game-trophy-card {
        opacity: 1;
        animation: none;
    }

    .rc-game-trophy-card.is-unlocked:hover {
        transform: none;
    }

    .rc-game-trophy-shine {
        display: none;
    }
}
