/* ============================================
   gabs.games - Arcade Cabinet Horizontal Scroller
   Late-90s Korean Arcade (오락실) Aesthetic
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0A0A0F;
    --bg-secondary: #12122A;
    --phosphor-green: #00FF88;
    --amber-glow: #FF6B35;
    --arcade-gold: #FFD700;
    --hot-pink: #FF3366;
    --lavender-gray: #C8C8E0;
    --muted-periwinkle: #7878A0;
    --electric-cyan: #00E5FF;
    --deep-plum: #2A1A3E;
}

/* --- Global Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    background: var(--bg-primary);
    color: var(--lavender-gray);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    line-height: 2.0;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    image-rendering: pixelated;
    overflow: hidden;
    height: 100%;
    cursor: default;
}

/* --- Scanline CRT Overlay --- */
#scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    opacity: 1;
}

/* --- Boot Sequence Overlay --- */
#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 2000;
    pointer-events: none;
    animation: bootFade 0.1s 3s forwards;
}

#boot-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    opacity: 0;
    animation: scanlineIn 0.2s 0.3s forwards;
}

#boot-hline {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--phosphor-green);
    box-shadow: 0 0 8px var(--phosphor-green), 0 0 16px var(--phosphor-green);
    animation: hlineSweep 0.4s 0.5s steps(20) forwards;
}

#boot-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(200, 200, 224, 0.3);
    opacity: 0;
    animation: flashPulse 0.1s 0.9s forwards, flashOut 0.2s 1.0s forwards;
}

@keyframes scanlineIn {
    to { opacity: 1; }
}

@keyframes hlineSweep {
    to { width: 100%; }
}

@keyframes flashPulse {
    to { opacity: 1; }
}

@keyframes flashOut {
    to { opacity: 0; }
}

@keyframes bootFade {
    to { opacity: 0; z-index: -1; }
}

/* --- Horizontal Scroll Container --- */
#cabinet-row {
    display: flex;
    width: 500vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#cabinet-row::-webkit-scrollbar {
    display: none;
}

/* --- Cabinet Base Styles --- */
.cabinet {
    min-width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cabinet-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* --- Pixel Grid Underlay --- */
.pixel-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(120, 120, 160, 0.12) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
    z-index: 1;
}

/* --- Cabinet Wipe Effect --- */
.cabinet-wipe {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--phosphor-green);
    box-shadow: 0 0 8px var(--phosphor-green), 0 0 16px var(--phosphor-green);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
}

.cabinet.in-view .cabinet-wipe {
    animation: cabinetWipe 0.2s steps(40) forwards;
}

@keyframes cabinetWipe {
    0% { left: 0; opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* --- Typography --- */
.cabinet-title {
    font-family: 'Silkscreen', monospace;
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
}

.cabinet-title.green {
    color: var(--phosphor-green);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

.cabinet-title.amber {
    color: var(--amber-glow);
    text-shadow: 0 0 8px rgba(255, 107, 53, 0.4);
}

.cabinet-title.gold {
    color: var(--arcade-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.cabinet-title.pink {
    color: var(--hot-pink);
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.4);
}

.cabinet-subtitle {
    font-family: 'Silkscreen', monospace;
    font-size: clamp(1.2rem, 3vw, 2.4rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--amber-glow);
    text-shadow: 0 0 8px rgba(255, 107, 53, 0.4);
    margin-bottom: 1.5rem;
}

.narrative-text {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    line-height: 2.0;
    color: var(--lavender-gray);
    margin-bottom: 0.8rem;
    max-width: 600px;
}

.highlight-green { color: var(--phosphor-green); }
.highlight-amber { color: var(--amber-glow); }
.highlight-cyan { color: var(--electric-cyan); }
.highlight-pink { color: var(--hot-pink); }

/* --- Blinking Cursor --- */
.blink-cursor {
    color: var(--phosphor-green);
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    margin-top: 1.5rem;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* --- Blink Title (High Scores) --- */
.blink-title {
    animation: blinkTitle 0.5s steps(1) infinite;
}

@keyframes blinkTitle {
    0%, 49% { color: var(--arcade-gold); }
    50%, 100% { color: var(--hot-pink); }
}

/* ============================================
   CABINET 1: INSERT COIN
   ============================================ */
#cabinet-1 {
    background: var(--bg-primary);
}

.cabinet-1-content {
    justify-content: center;
    min-height: 100vh;
    padding-top: 8vh;
}

/* Coin Slot */
.coin-slot-wrapper {
    margin-bottom: 2rem;
}

.coin-slot {
    position: relative;
    width: 120px;
    height: 200px;
    margin: 0 auto;
}

.slot-frame {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 80px;
    border: 4px solid var(--muted-periwinkle);
    background: var(--bg-secondary);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.slot-opening {
    width: 36px;
    height: 6px;
    background: var(--bg-primary);
    border: 2px solid var(--muted-periwinkle);
}

.coin {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--arcade-gold);
    border: 2px solid #B8960A;
    animation: coinDrop 1.2s 1.5s steps(8) forwards;
    opacity: 0;
}

@keyframes coinDrop {
    0% { top: 0; opacity: 1; }
    80% { top: 100px; opacity: 1; }
    100% { top: 100px; opacity: 0; }
}

/* Coin Sparks */
.coin-sparks {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
}

.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--arcade-gold);
    opacity: 0;
}

.spark-1 { animation: sparkBurst1 0.3s 2.4s steps(4) forwards; }
.spark-2 { animation: sparkBurst2 0.3s 2.4s steps(4) forwards; }
.spark-3 { animation: sparkBurst3 0.3s 2.4s steps(4) forwards; }
.spark-4 { animation: sparkBurst4 0.3s 2.4s steps(4) forwards; }

@keyframes sparkBurst1 {
    0% { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 0; transform: translate(-16px, -16px); }
}
@keyframes sparkBurst2 {
    0% { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 0; transform: translate(16px, -16px); }
}
@keyframes sparkBurst3 {
    0% { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 0; transform: translate(-16px, 12px); }
}
@keyframes sparkBurst4 {
    0% { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 0; transform: translate(16px, 12px); }
}

/* Screen shake on coin drop */
#cabinet-1 {
    animation: screenShake 0.1s 2.4s steps(4);
}

@keyframes screenShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

/* Site Title */
.site-title {
    font-family: 'Silkscreen', monospace;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--phosphor-green);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
    margin-bottom: 1rem;
    overflow: hidden;
}

.title-char {
    display: inline-block;
    opacity: 0;
    animation: typeChar 0.12s calc(1.5s + var(--i) * 0.12s) steps(1) forwards;
}

@keyframes typeChar {
    0% {
        opacity: 0;
        text-shadow: 0 0 12px var(--phosphor-green);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 12px var(--phosphor-green);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 4px rgba(0, 255, 136, 0.4);
    }
}

/* Press Start */
.press-start {
    font-family: 'Silkscreen', monospace;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--arcade-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    margin-top: 2rem;
    opacity: 0;
    animation: blink 1s steps(1) infinite, pressStartAppear 0.1s 2.5s steps(1) forwards;
}

@keyframes pressStartAppear {
    to { opacity: 1; }
}

/* ============================================
   CABINET 2: PLAYER SELECT
   ============================================ */
#cabinet-2 {
    background: var(--bg-primary);
}

.player-select-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 1100px;
    align-items: start;
}

.stat-column {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-top: 1rem;
}

.narrative-column {
    padding: 1rem 1.5rem;
    border-left: 2px solid var(--muted-periwinkle);
    border-right: 2px solid var(--muted-periwinkle);
    text-align: left;
}

.narrative-column .narrative-text {
    max-width: none;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-secondary);
    border: 2px solid var(--muted-periwinkle);
    padding: 0.8rem;
}

.stat-label {
    font-family: 'VT323', monospace;
    font-size: 0.7rem;
    color: var(--lavender-gray);
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    letter-spacing: 0.1em;
}

.stat-bar-outer {
    width: 100%;
    height: 12px;
    border: 2px solid var(--muted-periwinkle);
    background: var(--bg-primary);
    position: relative;
    margin-bottom: 0.3rem;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--phosphor-green) 0%, var(--phosphor-green) var(--fill), transparent var(--fill));
    image-rendering: pixelated;
}

.stat-bar-fill.fill-amber {
    background: linear-gradient(to right, var(--amber-glow) 0%, var(--amber-glow) var(--fill), transparent var(--fill));
}

.stat-value {
    font-family: 'VT323', monospace;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--arcade-gold);
    text-align: right;
}

/* ============================================
   CABINET 3: STAGE MAP
   ============================================ */
#cabinet-3 {
    background: var(--bg-primary);
}

.stage-intro {
    margin-bottom: 2rem;
}

.isometric-map {
    perspective: 800px;
    margin-bottom: 1.5rem;
}

.iso-grid {
    display: grid;
    grid-template-columns: repeat(4, 64px);
    grid-template-rows: repeat(3, 64px);
    gap: 8px;
    transform: rotateX(60deg) rotateZ(-45deg);
    transform-style: preserve-3d;
}

.iso-tile {
    width: 64px;
    height: 64px;
    border: 2px solid var(--muted-periwinkle);
    position: relative;
    cursor: pointer;
    transition: transform 0.15s steps(2), box-shadow 0.15s steps(2);
    display: flex;
    align-items: center;
    justify-content: center;
    image-rendering: pixelated;
}

.iso-tile:hover {
    transform: translateZ(8px);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.4);
}

/* Tile Textures */
.iso-tile.grass {
    background:
        linear-gradient(45deg, rgba(0, 255, 136, 0.15) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 255, 136, 0.15) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 255, 136, 0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 255, 136, 0.1) 75%);
    background-size: 8px 8px;
    background-color: #0A2A1A;
    border-color: var(--phosphor-green);
}

.iso-tile.stone {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(120, 120, 160, 0.2) 0px,
            rgba(120, 120, 160, 0.2) 8px,
            rgba(80, 80, 120, 0.15) 8px,
            rgba(80, 80, 120, 0.15) 16px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 16px,
            rgba(120, 120, 160, 0.1) 16px,
            rgba(120, 120, 160, 0.1) 32px
        );
    background-color: #1A1A2A;
    border-color: var(--muted-periwinkle);
}

.iso-tile.water {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 229, 255, 0.12) 0px,
            transparent 4px,
            transparent 8px
        );
    background-color: #0A1A2A;
    border-color: var(--electric-cyan);
    animation: waterShimmer 2s steps(4) infinite;
}

@keyframes waterShimmer {
    0% { background-position: 0 0; }
    100% { background-position: 0 16px; }
}

.iso-tile.lava {
    background:
        repeating-linear-gradient(
            45deg,
            rgba(255, 51, 102, 0.2) 0px,
            rgba(255, 107, 53, 0.2) 4px,
            transparent 4px,
            transparent 8px
        );
    background-color: #2A0A0A;
    border-color: var(--hot-pink);
    animation: lavaGlow 1s steps(2) infinite;
}

@keyframes lavaGlow {
    0%, 49% { box-shadow: inset 0 0 8px rgba(255, 51, 102, 0.3); }
    50%, 100% { box-shadow: inset 0 0 8px rgba(255, 107, 53, 0.3); }
}

.tile-label {
    font-family: 'VT323', monospace;
    font-size: 0.65rem;
    color: var(--lavender-gray);
    text-transform: uppercase;
    pointer-events: none;
    text-shadow: 0 0 4px var(--bg-primary);
}

#tile-info {
    font-family: 'VT323', monospace;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--electric-cyan);
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    min-height: 2em;
    margin-top: 1rem;
}

/* ============================================
   CABINET 4: HIGH SCORES
   ============================================ */
#cabinet-4 {
    background: var(--bg-primary);
}

.highscore-table-wrapper {
    width: 100%;
    max-width: 700px;
    margin: 1rem auto;
    overflow-y: auto;
    max-height: 50vh;
}

.highscore-table {
    width: 100%;
    border-collapse: collapse;
    border: 4px solid var(--muted-periwinkle);
}

.highscore-table th {
    font-family: 'Silkscreen', monospace;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.8rem 1rem;
    border-bottom: 4px solid var(--muted-periwinkle);
    animation: blinkTitle 0.5s steps(1) infinite;
}

.highscore-table td {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.6rem, 1vw, 0.75rem);
    padding: 0.6rem 1rem;
    border-bottom: 2px solid rgba(120, 120, 160, 0.2);
    color: var(--lavender-gray);
}

.row-dark { background: var(--bg-primary); }
.row-light { background: var(--bg-secondary); }

.rank-num {
    font-family: 'VT323', monospace;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--arcade-gold);
}

.score-num {
    font-family: 'VT323', monospace;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--arcade-gold);
}

.stage-num {
    font-family: 'VT323', monospace;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--phosphor-green);
}

.rank-col { text-align: center; width: 15%; }
.name-col { text-align: center; width: 30%; }
.score-col { text-align: right; width: 35%; }
.stage-col { text-align: center; width: 20%; }

.highscore-caption {
    margin-top: 1rem;
    color: var(--muted-periwinkle);
    font-style: normal;
}

/* ============================================
   CABINET 5: GAME OVER / CONTINUE?
   ============================================ */
#cabinet-5 {
    background: var(--bg-primary);
    animation: hueShift 30s linear infinite;
}

@keyframes hueShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.countdown-wrapper {
    margin: 2rem 0;
    text-align: center;
}

.countdown-label {
    font-family: 'Silkscreen', monospace;
    font-size: clamp(1.2rem, 3vw, 2.4rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lavender-gray);
    text-shadow: 0 0 8px rgba(200, 200, 224, 0.4);
    margin-bottom: 1rem;
}

.countdown-number {
    font-family: 'VT323', monospace;
    font-size: clamp(6rem, 20vw, 14rem);
    color: var(--hot-pink);
    text-shadow: 0 0 16px rgba(255, 51, 102, 0.6), 0 0 32px rgba(255, 51, 102, 0.3);
    line-height: 1;
}

.credit-links {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.credit-btn {
    font-family: 'VT323', monospace;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--electric-cyan);
    text-decoration: none;
    border: 2px solid var(--electric-cyan);
    padding: 0.6rem 1.2rem;
    background: transparent;
    text-transform: uppercase;
    transition: background 0.15s steps(2), color 0.15s steps(2);
    cursor: pointer;
}

.credit-btn:hover {
    background: var(--electric-cyan);
    color: var(--bg-primary);
    transform: scale(1.05);
}

.continue-prompt {
    margin-top: 2rem;
    font-family: 'Silkscreen', monospace;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.continue-slash {
    color: var(--muted-periwinkle);
    margin: 0 0.5em;
}

.continue-yes {
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
    cursor: pointer;
    transition: text-shadow 0.15s;
}

.continue-yes:hover {
    text-shadow: 0 0 16px var(--phosphor-green), 0 0 32px var(--phosphor-green);
}

.continue-no {
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.4);
    cursor: pointer;
    transition: text-shadow 0.15s;
}

.continue-no:hover {
    text-shadow: 0 0 16px var(--hot-pink), 0 0 32px var(--hot-pink);
}

/* ============================================
   BOTTOM NAVIGATION BAR
   ============================================ */
#nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: #0D0D1A;
    border-top: 2px solid var(--muted-periwinkle);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    gap: 0;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--muted-periwinkle);
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.nav-btn-label {
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    color: var(--muted-periwinkle);
    pointer-events: none;
}

.nav-btn.active {
    border-color: var(--phosphor-green);
    box-shadow: 0 0 8px var(--phosphor-green), 0 0 16px rgba(0, 255, 136, 0.3);
    animation: btnPulse 1.5s ease-in-out infinite;
}

.nav-btn.active .nav-btn-label {
    color: var(--phosphor-green);
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 8px var(--phosphor-green), 0 0 16px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 12px var(--phosphor-green), 0 0 24px rgba(0, 255, 136, 0.5); }
}

.nav-btn:hover:not(.active) {
    border-color: var(--lavender-gray);
}

.nav-btn:hover:not(.active) .nav-btn-label {
    color: var(--lavender-gray);
}

.nav-arrow {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    color: var(--muted-periwinkle);
    background: transparent;
    border: 2px solid var(--muted-periwinkle);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 1.5rem;
    transition: color 0.15s, border-color 0.15s;
}

.nav-arrow:hover {
    color: var(--phosphor-green);
    border-color: var(--phosphor-green);
}

/* ============================================
   DITHERING TRANSITIONS
   ============================================ */
.cabinet::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    background-image:
        linear-gradient(45deg, var(--bg-primary) 25%, transparent 25%),
        linear-gradient(-45deg, var(--bg-primary) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--bg-secondary) 75%),
        linear-gradient(-45deg, transparent 75%, var(--bg-secondary) 75%);
    background-size: 4px 4px;
    opacity: 0.6;
}

.cabinet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    background-image:
        linear-gradient(45deg, var(--bg-secondary) 25%, transparent 25%),
        linear-gradient(-45deg, var(--bg-secondary) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--bg-primary) 75%),
        linear-gradient(-45deg, transparent 75%, var(--bg-primary) 75%);
    background-size: 4px 4px;
    opacity: 0.6;
}

/* ============================================
   RESPONSIVE: < 768px
   ============================================ */
@media (max-width: 768px) {
    html {
        overflow: auto;
    }

    body {
        overflow: auto;
    }

    #cabinet-row {
        flex-direction: column;
        width: 100%;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }

    .cabinet {
        min-width: 100%;
        min-height: 100vh;
        height: auto;
        scroll-snap-align: start;
    }

    .player-select-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .stat-column {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.8rem;
        justify-content: center;
    }

    .stat-card {
        width: calc(50% - 0.4rem);
    }

    .narrative-column {
        border-left: none;
        border-right: none;
        border-top: 2px solid var(--muted-periwinkle);
        border-bottom: 2px solid var(--muted-periwinkle);
        text-align: center;
        order: -1;
    }

    .iso-grid {
        grid-template-columns: repeat(4, 48px);
        grid-template-rows: repeat(3, 48px);
        gap: 4px;
    }

    .iso-tile {
        width: 48px;
        height: 48px;
    }

    /* Nav bar moves to right edge as vertical strip */
    #nav-bar {
        top: 0;
        left: auto;
        right: 0;
        bottom: 0;
        width: 48px;
        height: 100%;
        flex-direction: column;
        border-top: none;
        border-left: 2px solid var(--muted-periwinkle);
    }

    .nav-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-arrow {
        margin: 0.5rem 0;
    }

    .nav-btn {
        width: 28px;
        height: 28px;
    }

    .cabinet-content {
        padding-right: 60px;
    }
}

/* ============================================
   RESPONSIVE: < 480px
   ============================================ */
@media (max-width: 480px) {
    #scanline-overlay {
        background: repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 3px,
            rgba(0, 0, 0, 0.15) 3px,
            rgba(0, 0, 0, 0.15) 6px
        );
    }

    .iso-grid {
        transform: none;
        grid-template-columns: repeat(3, 56px);
        grid-template-rows: auto;
        gap: 4px;
    }

    .iso-tile {
        width: 56px;
        height: 56px;
    }

    .site-title {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .credit-links {
        flex-direction: column;
        gap: 1rem;
    }

    .highscore-table td,
    .highscore-table th {
        padding: 0.4rem 0.5rem;
    }
}

/* ============================================
   HOVER / INTERACTION STYLES
   ============================================ */
.iso-tile:active {
    transform: scale(0.95);
}

.credit-btn:active {
    transform: scale(0.95);
}

/* Arcade button press feel */
.nav-btn:active {
    transform: scale(0.9);
}

.nav-arrow:active {
    transform: scale(0.9);
}
