* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Courier New', monospace;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden;
    user-select: none;
}

.hidden { display: none !important; }

/* MENU */
.menu-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #000 80%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.brand-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #ff3030;
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.5), 4px 4px 0 #000;
    text-align: center;
    line-height: 0.9;
    margin-bottom: 1rem;
    animation: flicker 4s infinite;
}

@keyframes flicker {
    0%, 92%, 100% { opacity: 1; }
    93% { opacity: 0.6; }
    94% { opacity: 1; }
    95% { opacity: 0.4; }
    96% { opacity: 1; }
}

.brand-tagline {
    font-size: 1.5rem;
    color: #888;
    margin-bottom: 0.25rem;
    letter-spacing: 0.15em;
}

.brand-subtag {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    text-align: center;
    max-width: 500px;
}

.menu-card {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 100, 100, 0.3);
    padding: 2rem 3rem;
    text-align: center;
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.menu-card h3 {
    color: #ff6060;
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
    font-size: 1.5rem;
}

.menu-card p {
    color: #aaa;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

#start-btn, #retry-btn, #win-retry-btn {
    background: #cc0000;
    color: #fff;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

#start-btn:hover, #retry-btn:hover, #win-retry-btn:hover {
    background: #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.controls-hint {
    color: #555;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.controls-hint strong { color: #aaa; }

.secondary-btn {
    background: rgba(60, 60, 80, 0.6) !important;
    color: #aaaaaa !important;
    margin-top: 0.5rem !important;
    font-size: 0.85rem !important;
    padding: 0.6rem 1.5rem !important;
}
.secondary-btn:hover {
    background: rgba(100, 100, 130, 0.7) !important;
    color: #ffffff !important;
}

/* === CAREER DISPLAY (main menu) === */
.career-display {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}
.career-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
}
.career-label {
    font-size: 0.65rem;
    color: #888;
    letter-spacing: 0.2em;
}
.career-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd400;
    font-family: 'Courier New', monospace;
}
.career-value.quota {
    color: #ff6060;
}
.career-bar {
    background: rgba(0, 0, 0, 0.5);
    height: 6px;
    margin: 0.4rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
#career-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6060, #ffd400);
    width: 0%;
    transition: width 0.3s;
}
.career-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #777;
    margin-top: 0.3rem;
}
.career-stats strong {
    color: #aaa;
    font-family: 'Courier New', monospace;
}

/* === IN-GAME QUOTA HUD === */
.quota-hud {
    position: absolute;
    top: 70px;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 0.6rem 1rem;
    pointer-events: none;
    min-width: 220px;
    z-index: 5;
}
.quota-hud .quota-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.75rem;
    color: #aaa;
}
.quota-hud .quota-row strong {
    color: #ffd400;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}
.quota-hud .quota-row.met strong {
    color: #00ff88;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
}
.quota-hud .quota-bar {
    background: rgba(0, 0, 0, 0.6);
    height: 4px;
    margin-top: 0.4rem;
}
.quota-hud .quota-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6060, #ffd400);
    transition: width 0.3s, background 0.3s;
}
.quota-hud .quota-bar-fill.met {
    background: linear-gradient(90deg, #00ff88, #88ff00);
}

/* Cash earned popup */
.cash-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffd400;
    font-family: 'Courier New', monospace;
    font-weight: 900;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 212, 0, 0.6), 0 0 4px #000;
    pointer-events: none;
    animation: cashFloat 1.4s ease-out forwards;
    z-index: 9;
}
@keyframes cashFloat {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -55%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -90%) scale(1); }
}

/* Unlock popup */
.unlock-popup {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #aa0000, #ffaa00);
    color: #fff;
    padding: 1rem 2rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid #ffd400;
    box-shadow: 0 0 30px rgba(255, 212, 0, 0.5);
    pointer-events: none;
    animation: unlockFlash 4s ease-out forwards;
    z-index: 50;
}
@keyframes unlockFlash {
    0% { opacity: 0; transform: translate(-50%, 30%) scale(0.7); }
    10%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -30%) scale(0.95); }
}
.unlock-popup .unlock-title {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    margin-bottom: 0.4rem;
    color: #ffd400;
}
.unlock-popup .unlock-name {
    font-size: 1.4rem;
    letter-spacing: 0.1em;
}

/* === CHARACTER CUSTOMIZATION MODAL === */
#customize-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
#customize-modal.hidden { display: none; }

.customize-card {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 100, 100, 0.4);
    padding: 1.5rem 2rem;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.customize-card h2 {
    color: #ff5050;
    font-size: 1.5rem;
    letter-spacing: 0.25em;
    margin-bottom: 1rem;
    text-align: center;
}

.char-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(40, 30, 60, 0.4), rgba(20, 0, 30, 0.4));
    border: 1px solid rgba(255, 100, 100, 0.2);
}

#char-preview-canvas {
    image-rendering: pixelated;
    border-radius: 4px;
}

.customize-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.customize-grid label {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    color: #aaa;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    gap: 0.75rem;
}

.customize-grid input[type="text"] {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.swatch-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.swatch {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
    border-radius: 4px;
}
.swatch:hover { transform: scale(1.1); border-color: #ffffff; }
.swatch.selected { border-color: #00ddff; box-shadow: 0 0 8px rgba(0, 221, 255, 0.6); }

.opt-btn {
    background: rgba(0, 0, 0, 0.5);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    transition: all 0.15s;
}
.opt-btn:hover { border-color: #fff; color: #fff; }
.opt-btn.selected {
    background: linear-gradient(135deg, #aa0000, #cc3333);
    color: #fff;
    border-color: #ff5050;
}

#customize-save {
    width: 100%;
    background: linear-gradient(135deg, #aa0000, #cc3333);
    color: #fff;
    border: none;
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
#customize-save:hover {
    background: linear-gradient(135deg, #cc0000, #ff4040);
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.5);
}

/* GAME */
#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #000;
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: none;
    filter: contrast(1.08) saturate(0.85) brightness(0.95);
}

/* === POST-PROCESSING OVERLAYS === */

/* Grain texture (procedural via SVG filter) */
#grain-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0.18;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
    background-size: 200px;
    animation: grainShift 0.15s steps(2) infinite;
}

@keyframes grainShift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-3%, 2%); }
    50% { transform: translate(2%, -3%); }
    75% { transform: translate(-2%, -2%); }
    100% { transform: translate(0, 0); }
}

/* Vignette */
#vignette-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    background: radial-gradient(ellipse at center,
        transparent 25%,
        rgba(0, 0, 0, 0.3) 65%,
        rgba(0, 0, 0, 0.85) 100%);
    transition: background 0.5s;
}

#vignette-overlay.danger {
    background: radial-gradient(ellipse at center,
        transparent 15%,
        rgba(80, 0, 0, 0.4) 55%,
        rgba(0, 0, 0, 0.95) 100%);
}

#vignette-overlay.lowsanity {
    background: radial-gradient(ellipse at center,
        transparent 8%,
        rgba(20, 0, 30, 0.6) 45%,
        rgba(0, 0, 0, 0.98) 95%);
    animation: sanityPulse 1.5s ease-in-out infinite;
}

@keyframes sanityPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Color grade — cool tint, slight magenta in shadows */
#color-grade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    background: linear-gradient(to bottom,
        rgba(20, 20, 60, 0.08) 0%,
        rgba(0, 0, 0, 0) 50%,
        rgba(60, 0, 40, 0.05) 100%);
    mix-blend-mode: multiply;
}

/* Chromatic aberration — bottom layer only triggers during danger */
#ca-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 7;
    opacity: 0;
    transition: opacity 0.3s;
}

#ca-overlay.active {
    opacity: 0.4;
    background:
        radial-gradient(circle at 48% 50%, rgba(255, 0, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 52% 50%, rgba(0, 200, 255, 0.08) 0%, transparent 50%);
}

/* Crosshair */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    pointer-events: none;
}
#crosshair::before, #crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
}
#crosshair::before {
    top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%);
}
#crosshair::after {
    top: 0; left: 50%; width: 1px; height: 100%; transform: translateX(-50%);
}

/* HUD Top */
#hud-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.time-display, .task-display, .status-display {
    text-align: center;
}

.time-label, .task-label, .status-label, .stamina-label, .task-list-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #666;
    margin-bottom: 0.2rem;
}

.time-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.4);
}

.task-value {
    font-size: 1rem;
    color: #00ddff;
    max-width: 400px;
}

.status-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #00ff44;
    transition: color 0.3s;
}
.status-value.warn { color: #ffaa00; }
.status-value.danger { color: #ff3030; animation: pulse 0.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* HUD Bottom */
#hud-bottom {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.task-list {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 255, 255, 0.2);
    padding: 0.75rem 1rem;
    min-width: 280px;
    max-width: 320px;
}

#task-checklist {
    list-style: none;
}

#task-checklist li {
    color: #ccc;
    font-size: 0.85rem;
    padding: 0.15rem 0;
    transition: color 0.3s;
}

#task-checklist li.done {
    color: #00ff44;
    text-decoration: line-through;
    opacity: 0.6;
}

#task-checklist li::before { content: '☐ '; color: #888; }
#task-checklist li.done::before { content: '☑ '; color: #00ff44; }

.stamina-display {
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 200, 0, 0.3);
    padding: 0.6rem 1rem;
    min-width: 220px;
    backdrop-filter: blur(4px);
}

.meter-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.meter-label {
    font-size: 0.6rem;
    color: #888;
    letter-spacing: 0.15em;
}

.meter-bar {
    background: rgba(0, 0, 0, 0.5);
    height: 8px;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.meter-fill {
    height: 100%;
    width: 100%;
    transition: width 0.15s, background 0.3s;
}

.meter-fill.stamina { background: linear-gradient(90deg, #ff8800, #ffcc00); }
.meter-fill.sanity  { background: linear-gradient(90deg, #00aaff, #00ddff); }
.meter-fill.battery { background: linear-gradient(90deg, #ffdd00, #fff8a0); }

.meter-fill.low {
    background: linear-gradient(90deg, #ff0000, #ff5500);
    animation: meterPulse 0.5s infinite;
}

@keyframes meterPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.flashlight-indicator {
    font-size: 0.7rem;
    color: #ffaa00;
    letter-spacing: 0.1em;
    margin-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.4rem;
}
.flashlight-indicator.off { color: #555; }

.compass {
    font-size: 0.75rem;
    color: #00ddff;
    letter-spacing: 0.05em;
    margin-top: 0.3rem;
    font-family: 'Courier New', monospace;
}

.anomaly-feed {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-width: 350px;
    align-items: flex-end;
}

.anomaly {
    background: rgba(50, 0, 0, 0.85);
    border-left: 3px solid #ff3030;
    padding: 0.4rem 0.8rem;
    color: #ffaaaa;
    font-size: 0.85rem;
    animation: slideInRight 0.5s;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Interaction prompt */
#interact-prompt {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ddff;
    padding: 0.75rem 1.5rem;
    pointer-events: none;
    text-align: center;
}

.prompt-key {
    display: inline-block;
    background: #00ddff;
    color: #000;
    padding: 0.2rem 0.6rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.prompt-text {
    display: inline-block;
    color: #00ddff;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.prompt-progress {
    margin-top: 0.5rem;
    width: 200px;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
}

#prompt-fill {
    height: 100%;
    background: #00ddff;
    width: 0%;
    transition: width 0.05s;
}

/* Lock overlay */
#lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    cursor: pointer;
}

.lock-message {
    text-align: center;
    background: rgba(255, 50, 50, 0.1);
    border: 2px solid #ff3030;
    padding: 2rem 3rem;
}

.lock-message h2 {
    color: #ff6060;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    letter-spacing: 0.2em;
}

.lock-message p {
    color: #aaa;
}

/* Damage vignette */
#damage-vignette {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 100px rgba(255, 0, 0, 0);
    pointer-events: none;
    transition: box-shadow 0.3s;
}

#damage-vignette.hit {
    box-shadow: inset 0 0 200px rgba(255, 0, 0, 0.8);
}

/* Damage flash (full white blink for near-miss / hits) */
#damage-flash {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    z-index: 8;
    mix-blend-mode: screen;
    transition: background 0.05s ease-out;
}

#damage-flash.flash {
    background: rgba(255, 255, 255, 0.85);
    transition: background 0.4s ease-out;
}

#damage-flash.bloodflash {
    background: rgba(255, 0, 0, 0.6);
    transition: background 0.6s ease-out;
}

/* Hallucination overlay (sanity low) */
#hallucination-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 9;
    opacity: 0;
    transition: opacity 0.5s;
}

#hallucination-overlay.active {
    opacity: 1;
}

#hallucination-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg,
        rgba(60, 0, 30, 0.15) 0%,
        transparent 30%,
        rgba(0, 30, 60, 0.1) 70%,
        rgba(80, 0, 0, 0.2) 100%);
    animation: hallucinate 4s ease-in-out infinite;
}

#hallucination-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        transparent 0px,
        rgba(255, 255, 255, 0.02) 1px,
        transparent 2px,
        transparent 4px
    );
    animation: scanlines 0.1s linear infinite;
}

@keyframes hallucinate {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.8; }
    25% { transform: scale(1.02) translate(-1%, 1%); opacity: 1; }
    50% { transform: scale(1.01) translate(1%, -1%); opacity: 0.6; }
    75% { transform: scale(1.03) translate(-0.5%, 0.5%); opacity: 0.9; }
}

@keyframes scanlines {
    from { background-position: 0 0; }
    to { background-position: 0 4px; }
}

/* Hallucination figure (peripheral vision manager) */
.peripheral-figure {
    position: absolute;
    width: 80px;
    height: 200px;
    background: radial-gradient(ellipse at center, rgba(80, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 9;
    animation: figureFlash 0.6s ease-out forwards;
    filter: blur(2px);
}

@keyframes figureFlash {
    0% { opacity: 0; transform: scale(0.8); }
    20% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.1); }
}

/* Pause menu */
#pause-menu {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 70;
}

.pause-card {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 100, 100, 0.4);
    padding: 2.5rem 3rem;
    min-width: 380px;
    text-align: center;
}

.pause-card h2 {
    color: #ff5050;
    font-size: 2.5rem;
    letter-spacing: 0.3em;
    margin-bottom: 1.5rem;
    animation: flicker 4s infinite;
}

.pause-card button {
    display: block;
    width: 100%;
    background: rgba(80, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 100, 100, 0.4);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.pause-card button:hover {
    background: rgba(150, 0, 0, 0.8);
    border-color: #ff5050;
}

.pause-settings {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.pause-settings label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: #aaa;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    margin-bottom: 0.6rem;
}

.pause-settings input[type="range"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 6px;
}

.pause-settings span {
    min-width: 50px;
    color: #00ddff;
    text-align: right;
    font-weight: 700;
}

.pause-settings select {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    color: #00ddff;
    border: 1px solid rgba(0, 221, 255, 0.3);
    padding: 0.3rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.quality-note {
    color: #777;
    font-size: 0.65rem;
    font-style: italic;
    text-align: center;
    margin-top: 0.4rem;
    letter-spacing: 0.1em;
}

/* === FPS COUNTER === */
#fps-counter {
    position: absolute;
    top: 70px;
    left: 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(0, 255, 136, 0.3);
    pointer-events: none;
    z-index: 6;
    min-width: 80px;
    display: none;
}

#fps-counter.visible {
    display: block;
}

#fps-counter.warn { color: #ffaa00; border-color: rgba(255, 170, 0, 0.4); }
#fps-counter.bad { color: #ff5050; border-color: rgba(255, 80, 80, 0.4); }

/* End screens */
#death-screen, #win-screen {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

#death-screen h1 {
    color: #ff0000;
    font-size: 5rem;
    text-shadow: 0 0 40px rgba(255, 0, 0, 0.8);
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
    animation: flicker 2s infinite;
}

#death-screen p, #win-screen p {
    color: #888;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
    max-width: 600px;
}

#win-screen h1 {
    color: #00ff44;
    font-size: 4rem;
    text-shadow: 0 0 40px rgba(0, 255, 68, 0.5);
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
}

#win-screen .stats {
    color: #00ddff;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* ===== UPGRADE SHOP MODAL ===== */
#upgrades-modal {
    position: fixed; inset: 0;
    background: rgba(5, 8, 16, 0.94);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
}
#upgrades-modal.hidden { display: none; }
.upgrades-card {
    background: linear-gradient(180deg, #0d1119 0%, #050810 100%);
    border: 2px solid #ffd400;
    box-shadow: 0 0 50px rgba(255, 212, 0, 0.25);
    padding: 1.6rem 2rem;
    width: min(720px, 92vw);
    max-height: 92vh; overflow-y: auto;
    color: #e8e8f0;
    font-family: 'Courier New', monospace;
}
.upgrades-card h2 {
    color: #ffd400;
    letter-spacing: 4px;
    text-align: center;
    border-bottom: 1px solid #ffd400;
    padding-bottom: 0.6rem;
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
}
.bank-display {
    text-align: center;
    background: rgba(255, 212, 0, 0.08);
    border: 1px solid rgba(255, 212, 0, 0.4);
    padding: 0.6rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    font-size: 1.05rem;
}
.bank-display span { color: #ffd400; font-weight: bold; }
.upgrades-tabs {
    display: flex; gap: 4px; margin-bottom: 1rem;
}
.tab-btn {
    flex: 1;
    background: rgba(255, 212, 0, 0.04);
    color: #888;
    border: 1px solid #444;
    padding: 0.55rem;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: 0.78rem;
}
.tab-btn.active {
    background: rgba(255, 212, 0, 0.18);
    color: #ffd400;
    border-color: #ffd400;
}
.upgrades-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.upgrades-grid.hidden { display: none; }
.upgrade-row {
    display: flex; align-items: center;
    background: rgba(20, 25, 35, 0.7);
    border: 1px solid #2a3040;
    padding: 0.55rem 0.75rem;
    gap: 0.6rem;
}
.upgrade-row.maxed { border-color: #00ddff; background: rgba(0, 80, 100, 0.25); }
.upgrade-row.affordable { border-color: #ffd400; }
.upg-icon { font-size: 1.6rem; flex-shrink: 0; }
.upg-info { flex: 1; min-width: 0; }
.upg-name { color: #fff; font-weight: bold; font-size: 0.82rem; letter-spacing: 1px; }
.upg-desc { color: #aaa; font-size: 0.7rem; margin-top: 2px; }
.upg-effect { color: #00ddff; font-size: 0.7rem; margin-top: 2px; }
.upg-level { color: #888; font-size: 0.65rem; }
.upg-buy-btn {
    background: rgba(255, 212, 0, 0.85);
    color: #000;
    border: none;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.75rem;
    letter-spacing: 1px;
}
.upg-buy-btn:disabled {
    background: #333; color: #666; cursor: not-allowed;
}
.upg-buy-btn.maxed { background: #00ddff; color: #000; }
#upgrades-close {
    width: 100%;
    background: rgba(0, 221, 255, 0.85);
    color: #000;
    border: none;
    padding: 0.7rem;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 3px;
    font-size: 0.95rem;
}

/* ===== ITEM SLOTS HUD (in-game) ===== */
#item-slots {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 25;
    pointer-events: none;
}
.item-slot {
    width: 56px; height: 56px;
    background: rgba(10, 15, 25, 0.7);
    border: 1px solid rgba(255, 212, 0, 0.4);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-family: 'Courier New', monospace;
    color: #fff;
    position: relative;
}
.item-slot .icon { font-size: 1.3rem; }
.item-slot .count { font-size: 0.7rem; color: #ffd400; }
.item-slot .key { position: absolute; top: 2px; left: 4px; font-size: 0.6rem; color: #888; }
.item-slot.empty { opacity: 0.35; }
.item-slot.flash { animation: itemFlash 0.4s; }
@keyframes itemFlash {
    0% { background: rgba(255, 212, 0, 0.6); }
    100% { background: rgba(10, 15, 25, 0.7); }
}
