:root {
    --bg-color: #111;
    --neon-blue: #0ff;
    --neon-pink: #f0f;
    --neon-green: #0f0;
    --cabinet-timelock: #2a2a4a;
    --cabinet-reflex: #4a2a2a;
    --cabinet-clickless: #2a4a2a;
    --left-panel-width: 260px;
}

body {
    margin: 0;
    padding: 0;
    background-color: #050510;
    background-image: 
        radial-gradient(circle at 50% 0%, #2a2a4a 0%, transparent 60%),
        linear-gradient(0deg, transparent 24%, rgba(255, 0, 255, .1) 25%, rgba(255, 0, 255, .1) 26%, transparent 27%, transparent 74%, rgba(255, 0, 255, .1) 75%, rgba(255, 0, 255, .1) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(255, 0, 255, .1) 25%, rgba(255, 0, 255, .1) 26%, transparent 27%, transparent 74%, rgba(255, 0, 255, .1) 75%, rgba(255, 0, 255, .1) 76%, transparent 77%, transparent);
    background-size: 100% 100%, 50px 50px, 50px 50px;
    color: white;
    font-family: 'VT323', monospace;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 1.2rem 2rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Polished header hero band */
.header-hero {
    width: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.92), rgba(250,250,252,0.94));
    border-top: 1px solid rgba(0,0,0,0.04);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding: 6px 0 12px 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02) inset;
}
.hero-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.hero-tag { margin: 6px 0 0 0; color: #666; font-family: 'VT323'; font-size: 1rem; }

/* Hide shop and daily bonus for now (no backend features yet) */
.global-stats { display: none !important; }
.shop-btn { display: none !important; }

/* Stronger, centered neon hero for better visibility */
.header-hero .neon-text {
    font-size: 2.2rem;
    color: #ffd1f7;
    text-shadow:
        0 0 8px rgba(255,255,255,0.9),
        0 0 18px rgba(255,150,220,0.9),
        0 0 36px rgba(200,50,255,0.7),
        0 6px 18px rgba(0,0,0,0.12);
    margin: 0;
    padding: 6px 12px;
    display: inline-block;
    background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.55));
    border-radius: 8px;
    box-shadow: 0 6px 30px rgba(200,50,255,0.08) inset, 0 8px 30px rgba(200,50,255,0.06);
}

/* Decorative subtle neon behind logo */
.logo-wrap::after {
    content: '';
    position: absolute;
    left: 44px; top: 6px;
    width: 220px; height: 38px;
    background: radial-gradient(ellipse at center, rgba(255,200,240,0.18), transparent 40%);
    filter: blur(8px);
    z-index: 0;
    pointer-events: none;
}

/* Ensure header text/logo sits above the decorative glow */
.logo-wrap, .logo-wrap * { position: relative; z-index: 2; }

/* Position global stats to the top-right while keeping logo centered */
.header-inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.global-stats {
    position: absolute;
    right: 18px;
    top: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 3rem;
    margin: 0;
    text-transform: uppercase;
}

.neon-text {
    color: #fff;
    text-shadow:
        0 0 6px #fff,
        0 0 12px #fff,
        0 0 20px var(--neon-pink),
        0 0 40px var(--neon-pink),
        0 0 100px var(--neon-pink);
    animation: flicker 1.5s infinite alternate;
    font-size: 2.6rem;
    letter-spacing: 2px;
}

/* Pipe-contour logo style */
.pipe-logo {
    font-family: 'Press Start 2P', monospace;
    font-weight: 700;
    text-transform: lowercase;
    /* metallic pipe stripes */
    background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 4px, rgba(0,0,0,0.08) 4px 8px),
                      linear-gradient(180deg, #ffd700, #ff9f00 40%, #c66a00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
    padding: 6px 10px;
}
.pipe-logo::after {
    /* pipe contour outline */
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.6), inset 0 -6px 14px rgba(0,0,0,0.35);
    pointer-events: none;
}

/* Enhanced animated background */
body {
    margin: 0;
    padding: 0;
    background-color: #050510;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(80,20,140,0.06), transparent 12%),
        radial-gradient(circle at 90% 30%, rgba(20,160,200,0.03), transparent 12%),
        linear-gradient(0deg, rgba(255,0,255,0.02) 0%, transparent 30%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.01) 0 1px, transparent 1px 40px),
        linear-gradient(90deg, rgba(10,0,30,0.2), rgba(0,0,0,0));
    background-blend-mode: screen, screen, overlay, overlay, normal;
    background-size: 1200px 800px, 1000px 700px, auto, 200px 200px, auto;
    color: white;
    font-family: 'VT323', monospace;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: bgMove 20s linear infinite;
}

@keyframes bgMove {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    50% { background-position: -200px -100px, 150px 80px, 0 0, 40px 40px, 0 0; }
    100% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
        0 0 4px #fff,
        0 0 11px #fff,
        0 0 19px var(--neon-pink),
        0 0 40px var(--neon-pink),
        0 0 80px var(--neon-pink);
    }
    20%, 24%, 55% {        
        text-shadow: none;
    }
}

/* Logo wrap and badge styling for richer look */
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateY(-4px);
}
.site-title { display: flex; flex-direction: column; gap: 4px; }
.site-title .subtitle { font-family: 'VT323'; color: #555; font-size: 0.95rem; margin-top: 2px; }
.logo-badge {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 25%, #ffd700, #ff9f00 30%, #aa5600 80%);
    box-shadow: 0 6px 18px rgba(255,160,20,0.18), inset 0 -6px 20px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.08);
    position: relative;
}
.logo-badge::after {
    content: 'E';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P';
    font-size: 22px;
    color: rgba(0,0,0,0.8);
    transform: translateY(1px);
    text-shadow: 0 0 6px rgba(255,255,255,0.12);
}

/* Subtle decorative ring behind the badge */
.logo-badge::before {
    content: '';
    position: absolute;
    left: -10px;
    top: -10px;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 1px solid rgba(255,215,0,0.06);
    box-shadow: 0 0 40px rgba(255,160,20,0.06);
    z-index: -1;
}

/* Image logo styling */
.logo-img {
    height: 56px;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    filter: none;
}

/* If an image logo is present, hide the text logo to avoid duplication */
.logo-img + .site-title .pipe-logo { display: none; }

/* Ensure header content sits above the hero band */
.header-inner { z-index: 3; position: relative; }
.header-hero { z-index: 1; position: relative; }

/* Tighten header spacing on small screens */
@media (max-width: 700px) {
    .logo-img { height: 46px; }
    .hero-inner .neon-text { font-size: 1.1rem; }
    .hero-tag { font-size: 0.9rem; }
}

/* When using the image-based logo (replaced on lobby), ensure correct sizing */
/* remove extra badge rule to avoid duplicate styling/shadow */
.logo-wrap img.logo-badge { display:none; }

main.arcade-room {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4rem;
    padding: 4rem;
    perspective: 1000px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

/* Simplified light background for the main arcade lobby
   Top area is white, the rest is a soft light grey. Machines/HUD stay unchanged. */
main.arcade-room {
    background: linear-gradient(to bottom, #ffffff 0px, #ffffff 140px, #f4f6f8 140px, #f4f6f8 100%);
    /* subtle divider line to separate top header area */
    border-top: 1px solid rgba(0,0,0,0.04);
}

/* Force a simple light background for pages using the lobby body class so
   earlier generic body rules don't leak in. This is specific and should
   override the animated/dark backgrounds elsewhere. */
body.lobby {
    background: linear-gradient(to bottom, #ffffff 0px, #ffffff 140px, #eef2f7 140px, #eef2f7 100%);
    color: #111;
}

/* Keep global-stats visible on light background */
body.lobby .global-stats {
    background: rgba(0,0,0,0.65);
    color: #fff;
}

/* Header should sit on the white top area */
body.lobby header {
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

/* Footer contrast on light background */
body.lobby footer { color: #666; }

/* Stage polish for lobby */
/* Clean wall highlight (remove extra gray band) */
main.arcade-room::before { display: none; }
main.arcade-room::after {
        content: '';
        position: absolute;
        left: -8%; right: -8%; bottom: -24%; height: 68%;
        background:
            radial-gradient(1100px 380px at 50% 18%, rgba(0,0,0,0.10), transparent 62%),
            linear-gradient(180deg, rgba(0,0,0,0.10), transparent 60%);
        transform: perspective(820px) rotateX(64deg);
        transform-origin: bottom center;
        pointer-events: none;
}

footer {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-size: 1.2rem;
}

/* Subtle elegant footer treatment for lobby */
body.lobby footer {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    padding: 1.2rem 0;
    color: #666;
    font-size: 0.95rem;
}

/* Game Page Layouts */
.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #000;
    overflow: hidden;
    position: relative;
}

/* Main Arcade Room Background */
body {
    margin: 0;
    padding: 0;
    background-color: #050510;
    background-image: 
        radial-gradient(circle at 50% 0%, #2a2a4a 0%, transparent 60%),
        linear-gradient(0deg, transparent 24%, rgba(255, 0, 255, .1) 25%, rgba(255, 0, 255, .1) 26%, transparent 27%, transparent 74%, rgba(255, 0, 255, .1) 75%, rgba(255, 0, 255, .1) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(255, 0, 255, .1) 25%, rgba(255, 0, 255, .1) 26%, transparent 27%, transparent 74%, rgba(255, 0, 255, .1) 75%, rgba(255, 0, 255, .1) 76%, transparent 77%, transparent);
    background-size: 100% 100%, 50px 50px, 50px 50px;
    color: white;
    font-family: 'VT323', monospace;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TimeLock Background: Digital Circuit */
.timelock-bg {
    background-color: #001;
    background-image: 
        linear-gradient(90deg, rgba(0,255,255,0.05) 1px, transparent 1px),
        linear-gradient(rgba(0,255,255,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}
.timelock-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 0%, #000 100%);
    pointer-events: none;
}

/* Reflex Background: Warp Speed */
.reflex-bg {
    background-color: #100;
    background-image: radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px);
    background-size: 550px 550px;
    animation: stars-move 5s linear infinite;
}
@keyframes stars-move {
    from { background-position: 0 0; }
    to { background-position: 100% 100%; }
}

/* Clickless Background: Glitch/Static */
.clickless-bg {
    background-color: #010;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.05) 2px,
        rgba(0, 255, 0, 0.05) 4px
    );
    animation: static-scroll 10s linear infinite;
}
@keyframes static-scroll {
    from { background-position: 0 0; }
    to { background-position: 0 100%; }
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    z-index: 100;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.back-button:hover {
    opacity: 1;
}

/* Arcade System UI */
.arcade-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #0f0;
    color: #0f0;
    padding: 15px 30px;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    z-index: 1000;
    animation: slideDown 0.5s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

@keyframes slideDown {
    from { top: -50px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.global-stats {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border: 1px solid #fff;
    border-radius: 5px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-item svg {
    vertical-align: middle;
    margin-right: 5px;
}

#global-coins { color: #ffd700; text-shadow: 0 0 5px #ffd700; }
#global-level { color: #0ff; text-shadow: 0 0 5px #0ff; }

.share-btn {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.share-btn:hover {
    transform: scale(1.05);
    background: #4db5f5;
}

.share-btn::before {
    content: '';
}

.share-btn svg {
    margin-right: 5px;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Leaderboard left panel (persistent) */
.leaderboard-panel {
    position: fixed;
    left: 20px;
    top: 80px;
    bottom: 20px;
    width: var(--left-panel-width);
    /* translucent so underlying game/lobby background shows through */
    background: rgba(0,0,0,0.12);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
    z-index: 90;
    overflow-y: auto;
    font-family: 'VT323', monospace;
    color: #fff;
}
.leaderboard-panel h3 {
    margin: 4px 0 10px 0;
    font-size: 0.9rem;
    color: #ffd700;
    text-align: center;
}
.leaderboard-section {
    margin-bottom: 14px;
}
.leaderboard-list ol {
    padding-left: 18px;
    margin: 6px 0;
}
.leaderboard-list li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* Standardized Leaderboard Styles (from Three Body) */
.std-leaderboard-panel {
    width: 20%;
    background: #050510;
    border-right: 2px solid #333;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 5;
}

.std-game-container {
    width: 80%;
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.std-lb-header {
    font-family: 'Press Start 2P';
    color: #ffd700;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 40px;
    font-size: 1.5rem;
}

.std-lb-list {
    list-style: none;
    padding: 0;
    font-family: 'VT323';
    font-size: 1.2rem;
}

.std-lb-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #333;
}

.std-lb-list li:nth-child(1) { color: #ffd700; font-size: 1.4rem; }
.std-lb-list li:nth-child(2) { color: #c0c0c0; }
.std-lb-list li:nth-child(3) { color: #cd7f32; }

/* Themed variants for game pages */
.leaderboard-panel.timelock {
    /* use a subtle translucent tint that reads warm over timelock background */
    background: rgba(245,235,215,0.12);
    border-color: rgba(150,120,80,0.12);
    color: #f3e8d8;
}
.leaderboard-panel.timelock .leaderboard-list li { color: rgba(240,230,210,0.95); }

.leaderboard-panel.reflex {
    /* dark translucent tint that blends with reflex warp background */
    background: rgba(5,10,5,0.14);
    border-color: rgba(0,255,0,0.06);
    color: #bfffbf;
}
.leaderboard-panel.reflex .leaderboard-list li { color: #dfffdc; }

.leaderboard-panel.clickless {
    /* slightly cool translucent tint for clickless */
    background: rgba(250,250,250,0.06);
    border-color: rgba(120,120,120,0.06);
    color: #eef;
}
.leaderboard-panel.clickless .leaderboard-list li { color: #eef; }

/* apply left margin only on pages that include the panel */
body.with-left-panel main.arcade-room {
    margin-left: calc(var(--left-panel-width) + 40px);
}

/* When the leaderboard is placed inside the game's container, position it there so
   its backdrop-filter shows the game's background instead of the global body. */
.game-container > .leaderboard-panel {
    position: absolute;
    left: 18px;
    top: 40px;
    bottom: 20px;
    width: var(--left-panel-width);
}

/* Ensure pages that opt in don't also shift the game content when the panel overlays it */
body.with-left-panel .game-container { margin-left: 0; }

@media (max-width: 900px) {
    .leaderboard-panel { display: none; }
    body.with-left-panel main.arcade-room, body.with-left-panel .game-container { margin-left: 0; padding: 1rem; }
}

.modal-content {
    background-color: #111;
    border: 2px solid #0ff;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 0 20px #0ff;
    position: relative;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

/* Polished Shop Button */
.shop-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #111, #000);
    color: #ffd700;
    padding: 6px 10px;
    border: 2px solid rgba(255,215,0,0.2);
    border-radius: 6px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255,215,0,0.08);
}

.shop-btn svg { width: 16px; height: 16px; stroke: #ffd700; }

.shop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255,215,0,0.12);
}

/* Save Score Modal (reuses .modal/.modal-content) */
.save-score-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.save-score-form input[type="text"] {
    padding: 8px;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    border: 1px solid #333;
    background: #000;
    color: #fff;
}
.save-score-form button {
    padding: 8px 12px;
    background: #0f0;
    color: #000;
    border: none;
    cursor: pointer;
}

.shop-item {
    border: 1px solid #333;
    padding: 10px;
    text-align: center;
    transition: transform 0.2s;
}

.shop-item:hover {
    transform: scale(1.05);
    border-color: #fff;
}

.shop-item h3 {
    font-size: 0.8rem;
    color: #0ff;
    margin: 10px 0;
}

.shop-item button {
    background: #0f0;
    color: #000;
    border: none;
    padding: 5px 10px;
    font-family: 'Press Start 2P';
    font-size: 0.6rem;
    cursor: pointer;
    margin-top: 10px;
}

.shop-item button:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.shop-item svg {
    width: 32px;
    height: 32px;
    stroke: #0ff;
}

/* TimeLock Advanced Graphics */
.timelock-layout {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.manual-container {
    background: #e0e0d0;
    color: #333;
    padding: 20px;
    width: 250px;
    font-family: 'VT323', monospace;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.5);
    transform: rotate(2deg);
    border: 1px solid #999;
    position: relative;
}

.manual-container::before {
    content: 'TOP SECRET';
    position: absolute;
    top: 10px;
    right: 10px;
    color: rgba(255, 0, 0, 0.3);
    border: 2px solid rgba(255, 0, 0, 0.3);
    padding: 2px 5px;
    font-weight: bold;
    transform: rotate(-15deg);
    font-family: sans-serif;
}

.manual-title {
    font-size: 1.5rem;
    border-bottom: 2px solid #333;
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
}

.manual-text {
    font-size: 1.1rem;
    line-height: 1.4;
}

.module {
    background: #222;
    border: 2px solid #444;
    border-radius: 5px;
    padding: 10px;
    box-shadow: inset 0 0 10px #000;
    position: relative;
    transition: transform 0.1s;
}

.module:active {
    transform: scale(0.98);
}

.module-clock-face {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #111 60%, #333 100%);
    border-radius: 50%;
    border: 2px solid #666;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 5px #000;
}

.clock-hand {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 35px;
    background: #0ff;
    transform-origin: bottom center;
    transition: transform 0.3s cubic-bezier(0.4, 2.0, 0.2, 1);
    box-shadow: 0 0 5px #0ff;
}

.clock-marker {
    position: absolute;
    width: 2px;
    height: 4px;
    background: #444;
    left: 50%;
    top: 2px;
    transform-origin: 0 38px;
}

.module-switch-body {
    width: 40px;
    height: 70px;
    background: #111;
    margin: 5px auto;
    border-radius: 5px;
    position: relative;
    border: 1px solid #333;
}

.switch-toggle {
    width: 30px;
    height: 30px;
    background: linear-gradient(to bottom, #666, #333);
    position: absolute;
    left: 4px;
    border-radius: 2px;
    transition: top 0.2s;
    box-shadow: 0 2px 5px #000;
}

.switch-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #300;
    margin: 0 auto 5px;
    box-shadow: inset 0 0 2px #000;
    transition: background 0.2s, box-shadow 0.2s;
}

.switch-led.on {
    background: #0f0;
    box-shadow: 0 0 5px #0f0;
}

.module-label {
    font-family: 'VT323', monospace;
    color: #888;
    font-size: 0.8rem;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Reflex Advanced Graphics */
.reflex-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

.target {
    /* Reset basic styles */
    background: transparent;
    box-shadow: none;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Reticle Style */
.target::before {
    content: 'INSERT COIN';
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    color: #ffd700;
    z-index: 12;
    animation: blink 1s infinite;
    text-shadow: 0 2px 2px rgba(0,0,0,0.6), 0 0 6px rgba(255,215,0,0.6);
    background: rgba(0,0,0,0.0);
    padding: 2px 6px;
    border-radius: 4px;
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.5;
}

/* Target Types */
.target.normal { color: #f00; }
.target.dont-click { color: #fff; }
.target.color-change { color: #00f; }
.target.golden { color: #ffd700; }
.target.bomb {
    color: #000;
    position: relative;
}

/* Bomb drawn with CSS (no emoji) */
.target.bomb::before {
    content: '';
    position: absolute;
    left: 15%;
    top: 15%;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #666, #000 60%);
    box-shadow: inset -6px -6px 12px rgba(255,255,255,0.04), 0 4px 12px rgba(0,0,0,0.6);
}

.target.bomb::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 18px;
    top: 4%;
    left: 58%;
    background: linear-gradient(180deg, #333, #111);
    border-radius: 3px;
    transform: rotate(-25deg);
    box-shadow: 0 -6px 8px rgba(255,120,0,0.35);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.reflex-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 18px; /* extra right padding to avoid clipping */
    display: flex;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    z-index: 20;
    font-family: 'Press Start 2P';
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
    white-space: nowrap;
}

/* Clickless Advanced Graphics */
.clickless-terminal {
    border: 2px solid #0f0;
    padding: 20px;
    height: 100%;
    background: rgba(0, 20, 0, 0.9);
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.clickless-terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 255, 0, 0.5);
    animation: scan 3s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

.terminal-header {
    border-bottom: 1px solid #0f0;
    margin-bottom: 20px;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    font-family: 'VT323';
    font-size: 1.2rem;
    color: #0f0;
}

.instruction {
    font-family: 'Press Start 2P';
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.2rem;
}

.fake-button {
    background: #333;
    border: 2px outset #555;
    color: #fff;
    font-family: sans-serif;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: 2px 2px 5px #000;
}

.fake-button:active {
    border-style: inset;
    transform: translate(1px, 1px);
}

.lvl1-btn-danger {
    background: #d00;
    border-color: #f55;
    font-size: 1.5rem;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    box-shadow: 0 5px 0 #900, 0 10px 10px rgba(0,0,0,0.5);
}

.lvl1-btn-danger:active {
    box-shadow: 0 2px 0 #900, 0 5px 5px rgba(0,0,0,0.5);
    transform: translateY(3px);
}

/* Reflex Layout Styles */
.reflex-layout {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.score-card-container {
    background: #111;
    border: 2px solid #333;
    width: 250px;
    padding: 20px;
    font-family: 'VT323', monospace;
    color: #0f0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
    transform: rotate(-2deg);
    position: relative;
}

.score-card-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.05) 2px,
        rgba(0, 255, 0, 0.05) 4px
    );
    pointer-events: none;
}

.score-card-header {
    font-size: 1.5rem;
    border-bottom: 2px solid #0f0;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 0 5px #0f0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red { background: #f00; box-shadow: 0 0 5px #f00; }
.dot.white { background: #fff; box-shadow: 0 0 5px #fff; }
.dot.blue { background: #00f; box-shadow: 0 0 5px #00f; }
.dot.gold { background: #ffd700; box-shadow: 0 0 5px #ffd700; }
.dot.black { background: #000; border: 1px solid #f00; }

.current-stats p {
    font-size: 1.2rem;
    margin: 10px 0;
}

/* Clickless Layout Styles */
.clickless-layout {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.system-manual-container {
    background: #f0f0f0;
    border: 1px solid #ccc;
    width: 250px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    color: #333;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    transform: rotate(1deg);
    position: relative;
}

.system-manual-container::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 30px;
    background: rgba(255, 255, 0, 0.4); /* Tape look */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.manual-header {
    font-weight: bold;
    text-decoration: underline;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #000;
}

.protocol-list {
    list-style-type: square;
    padding-left: 20px;
    margin-bottom: 20px;
}

.protocol-list li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.warning-box {
    border: 2px solid #d00;
    color: #d00;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    font-size: 0.8rem;
    background: rgba(255, 0, 0, 0.05);
}
