:root { --main-color: #0f0; --dim-color: rgba(0, 50, 0, 0.3); --bg-color: #000; --danger-color: #f00; }

body { background-color: var(--bg-color); color: var(--main-color); font-family: 'Courier New', Courier, monospace; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; height: 100dvh; margin: 0; overflow: hidden; user-select: none; touch-action: none; }
.screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 10; padding: 0; background: #000; }
.screen.active { display: flex; }

/* INTRO SCREEN */
#screen-intro { background: #000; z-index: 2000; }
#intro-player { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); }
#intro-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #000; z-index: 2010; cursor: pointer; }
.blink-text { color: #0f8; font-size: 1.8rem; animation: blink 1s infinite; text-shadow: 0 0 10px rgba(0,255,120,0.5); font-family: 'Courier New', monospace; letter-spacing: 3px; }
#skip-intro-btn { position: absolute; bottom: 30px; right: 30px; z-index: 2020; background: rgba(5,12,8,0.8); border: 1px solid rgba(0,255,120,0.3); color: rgba(0,255,120,0.7); padding: 8px 18px; cursor: pointer; display: none; font-family: 'Courier New', monospace; font-weight: bold; letter-spacing: 1px; }
/* BITTEN OVERLAY */
#bitten-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 3000; display: none; align-items: center; justify-content: center; flex-direction: column; }
#bitten-overlay h1 { color: #f44; font-size: 2.5rem; text-shadow: 0 0 15px rgba(255,0,0,0.5); animation: blink 0.1s infinite; margin: 0; text-transform: uppercase; border: 1px solid rgba(255,60,60,0.5); padding: 20px 30px; transform: none; background: rgba(40,0,0,0.8); text-align: center; max-width: 90%; font-family: 'Courier New', monospace; letter-spacing: 3px; }

/* WARNING SCREEN */
#screen-warning { background-color: #000; background-image: url('assets/warning_icon.png'); background-size: cover; background-position: center; z-index: 3000; }
#screen-warning .warning-content { max-width: 600px; text-align: center; padding: 20px; }
#screen-warning h1 { color: #f44; font-family: 'Courier New', monospace; text-transform: uppercase; margin-bottom: 20px; font-size: 2.2rem; letter-spacing: 4px; text-shadow: 0 0 15px rgba(255,0,0,0.4), 2px 2px 0 #000; }
#screen-warning p { color: rgba(0,255,120,0.7); font-family: 'Courier New', monospace; font-size: 1.1rem; line-height: 1.6; margin-bottom: 40px; text-shadow: 0 0 5px rgba(0,0,0,0.8); font-weight: bold; }

/* ALARM OVERLAY (EMERGENCY MODE) */
#alarm-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1; /* Debajo de .game-ui (z-index: 2) */
    opacity: 0; transition: opacity 0.5s;
    background-image: radial-gradient(circle, transparent 40%, rgba(100, 0, 0, 0.9)); /* Viñeta fija */
    background-color: rgba(255, 0, 0, 0);
}
#alarm-overlay.alarm-active { opacity: 1; animation: alarm-pulse 0.8s infinite alternate; }
@keyframes alarm-pulse { from { background-color: rgba(255, 0, 0, 0.1); } to { background-color: rgba(255, 0, 0, 0.4); } }

/* ====== MENÚ PRINCIPAL - TERMINAL RETRO-FUTURISTA ====== */
#screen-menu {
    position: relative;
    background: #000;
}
#screen-menu::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('assets/INTRO.png');
    background-size: cover;
    background-position: center top;
    filter: blur(4px) brightness(0.35);
    z-index: 0;
}
#screen-menu::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(0,20,10,0.4) 0%, rgba(0,0,0,0.6) 50%, rgba(0,10,5,0.5) 100%);
    z-index: 0;
    pointer-events: none;
}

/* SCANLINES OVERLAY */
.menu-scanlines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    z-index: 1;
    pointer-events: none;
}

/* PANEL PRINCIPAL */
.menu-panel {
    position: relative;
    background: rgba(5, 12, 8, 0.92);
    border: 1px solid rgba(0, 255, 120, 0.25);
    padding: 30px 25px 25px;
    width: 90%; max-width: 360px; text-align: center;
    box-shadow:
        0 0 15px rgba(0, 255, 100, 0.08),
        0 0 60px rgba(0, 0, 0, 0.8),
        inset 0 0 30px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(0, 255, 120, 0.1);
    z-index: 2;
    animation: menu-panel-glow 4s ease-in-out infinite alternate;
}
@keyframes menu-panel-glow {
    0% { border-color: rgba(0, 255, 120, 0.2); box-shadow: 0 0 15px rgba(0, 255, 100, 0.06), 0 0 60px rgba(0,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.6); }
    100% { border-color: rgba(0, 255, 120, 0.35); box-shadow: 0 0 20px rgba(0, 255, 100, 0.12), 0 0 60px rgba(0,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.6); }
}

/* ESQUINAS DECORATIVAS */
.menu-corner {
    position: absolute;
    width: 14px; height: 14px;
    border-color: rgba(0, 255, 120, 0.5);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
}
.menu-corner.tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.menu-corner.tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.menu-corner.bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.menu-corner.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

/* BARRA DE ESTADO */
.menu-status-bar {
    position: absolute;
    top: 8px; left: 12px; right: 12px;
    font-size: 0.6rem;
    color: rgba(0, 255, 120, 0.45);
    text-align: left;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}
.status-dot {
    display: inline-block;
    width: 5px; height: 5px;
    background: #0f8;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    animation: status-blink 2s ease-in-out infinite;
    box-shadow: 0 0 4px #0f8;
}
@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.status-sep { color: rgba(0, 255, 120, 0.2); margin: 0 3px; }

/* TÍTULO */
.title {
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    color: #0f8;
    background: none;
    padding: 12px 10px;
    border: none;
    border-top: 1px solid rgba(0, 255, 120, 0.2);
    border-bottom: 1px solid rgba(0, 255, 120, 0.2);
    text-shadow: 0 0 10px rgba(0, 255, 120, 0.6), 0 0 30px rgba(0, 255, 100, 0.2);
    margin-bottom: 5px;
    margin-top: 10px;
    box-shadow: none;
    font-size: 1.7rem;
    letter-spacing: 4px;
    animation: titleRGBGlitch 10s ease-in-out infinite;
    position: relative;
}

/* SUBTÍTULO */
#menu-subtitle {
    color: rgba(0, 255, 120, 0.35);
    font-size: 0.7rem;
    letter-spacing: 3px;
}

/* MONEDA GLOBAL */
#global-currency {
    position: absolute;
    top: 18px; left: 18px;
    color: #0f8;
    font-weight: bold; font-size: 0.95rem;
    text-shadow: 0 0 8px rgba(0,255,120,0.4);
    z-index: 50;
    background: rgba(0, 15, 8, 0.7);
    border: 1px solid rgba(0, 255, 120, 0.2);
    padding: 5px 10px;
    letter-spacing: 1px;
}
.currency-icon {
    color: #fa0;
    text-shadow: 0 0 6px rgba(255, 170, 0, 0.5);
}

/* BOTONES DEL MENÚ PRINCIPAL */
#main-menu-btns button, #survival-options button {
    background: rgba(0, 20, 10, 0.8) !important;
    color: rgba(0, 255, 120, 0.85) !important;
    border: 1px solid rgba(0, 255, 120, 0.15) !important;
    border-left: 3px solid rgba(0, 255, 120, 0.5) !important;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-shadow: 0 0 5px rgba(0, 255, 120, 0.3);
    box-shadow: none;
    margin-top: 8px; width: 100%; padding: 11px 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    transform: none;
    position: relative;
}
#main-menu-btns button::before, #survival-options button::before {
    content: '>';
    margin-right: 8px;
    color: rgba(0, 255, 120, 0.3);
    transition: color 0.15s;
}
#main-menu-btns button:hover, #survival-options button:hover {
    background: rgba(0, 255, 120, 0.1) !important;
    border-left-color: #0f8 !important;
    color: #fff !important;
    text-shadow: 0 0 8px rgba(0, 255, 120, 0.5);
    transform: none;
}
#main-menu-btns button:hover::before, #survival-options button:hover::before {
    color: #0f8;
}
#main-menu-btns button:active, #survival-options button:active {
    background: rgba(0, 255, 120, 0.2) !important;
    transform: scale(0.98);
}

/* BOTÓN DANGER (Reset, Horde) */
#main-menu-btns .menu-btn-danger, #survival-options .menu-btn-danger {
    border-left-color: rgba(255, 60, 60, 0.6) !important;
    color: rgba(255, 80, 80, 0.85) !important;
    text-shadow: 0 0 5px rgba(255, 60, 60, 0.3);
    margin-top: 18px;
    font-size: 0.75rem;
}
#main-menu-btns .menu-btn-danger::before, #survival-options .menu-btn-danger::before {
    color: rgba(255, 60, 60, 0.3);
}
#main-menu-btns .menu-btn-danger:hover, #survival-options .menu-btn-danger:hover {
    background: rgba(255, 40, 40, 0.12) !important;
    border-left-color: #f44 !important;
    color: #f88 !important;
}
#main-menu-btns .menu-btn-danger:hover::before, #survival-options .menu-btn-danger:hover::before {
    color: #f44;
}

/* BOTÓN START CAMPAIGN (Destacado) */
#main-menu-btns #start-btn {
    border-left-width: 4px !important;
    border-left-color: #0f8 !important;
    font-size: 0.95rem;
    padding: 13px 15px;
    color: #0f8 !important;
}

/* PANTALLA TITLE INTRO (Estilo RE) */
#screen-title-intro {
    background: #000;
    z-index: 5000;
}
#title-intro-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.8rem;
    color: #fff;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 60px rgba(0,180,255,0.3);
    opacity: 0;
    text-align: center;
    padding: 0 20px;
}

/* CHAR SELECT */
/* CHAR SELECT - TERMINAL STYLE */
#screen-char { background: #000; overflow: hidden; }
#char-display-area { position: absolute; top:0; left:0; width: 100%; height: 100%; z-index: 1; }
#char-img-display { width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0.55; mask-image: linear-gradient(to bottom, black 55%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%); }
.char-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px 20px 60px 20px; background: rgba(5, 12, 8, 0.95); border-top: 1px solid rgba(0, 255, 120, 0.3); display: flex; flex-direction: column; align-items: center; text-align: center; z-index: 5; box-sizing: border-box; }
.char-overlay h2 { font-size: 2.2rem; margin: 0; color: #0f8; text-shadow: 0 0 15px rgba(0,255,120,0.5); text-transform: uppercase; letter-spacing: 3px; font-family: 'Courier New', monospace; }
.char-overlay p { font-size: 0.85rem; color: rgba(0, 255, 120, 0.7); margin-bottom: 20px; font-weight: bold; white-space: pre-wrap; line-height: 1.4; max-width: 700px; text-align: left; display: inline-block; }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: rgba(0, 255, 120, 0.4); font-size: 4rem; cursor: pointer; z-index: 10; text-shadow: 0 0 10px rgba(0,255,120,0.3); }
.nav-arrow:hover { color: rgba(0, 255, 120, 0.8); }
.back-btn-corner { position: absolute; top: 20px; left: 20px; background: rgba(0,15,8,0.7); border: 1px solid rgba(0,255,120,0.3); color: rgba(0,255,120,0.7); font-size: 1.5rem; z-index: 20; cursor: pointer; padding: 5px 10px; font-family: 'Courier New', monospace; }
.left { left: 10px; } .right { right: 10px; }

/* SHOOTER */
#screen-shooter { background-image: url('assets/lab_bg.png'); background-size: cover; background-position: center; }
#shooter-canvas { position: absolute; top:0; left:0; width:100%; height:100%; z-index:20; }
#muzzle-flash { position: fixed; bottom: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at bottom center, rgba(255, 200, 50, 0.6) 0%, transparent 60%); opacity: 0; pointer-events: none; z-index: 50; transition: opacity 0.05s; }
#breach-info { position:absolute; bottom:140px; right:20px; color:#0f8; z-index:30; background:rgba(5,12,8,0.85); padding:6px 10px; border:1px solid rgba(255,60,60,0.5); pointer-events: none; font-family: 'Courier New', monospace; font-size: 0.85rem; letter-spacing: 1px; }
#ammo-panel { position:absolute; bottom:30px; width:100%; text-align:center; z-index:40; pointer-events:none; }
#ammo-counter { font-size: 2rem; color: #0f8; font-weight: bold; text-shadow: 0 0 8px rgba(0,255,120,0.4), 2px 2px 0 #000; font-family: 'Courier New', monospace; }
#reload-btn { pointer-events: auto; z-index: 1000; position: relative; background: rgba(5,12,8,0.9); border: 1px solid rgba(0,255,120,0.4); color: #0f8; padding: 10px 40px; font-size: 1.3rem; margin-top:10px; transition: 0.15s; font-family: 'Courier New', monospace; letter-spacing: 2px; text-shadow: 0 0 5px rgba(0,255,120,0.3); }
#reload-btn:hover { background: rgba(0,255,120,0.1); border-color: #0f8; }
#reload-btn.jammed { background: #500; border-color: #f00; color: #f00; animation: shake 0.2s infinite; }

#btn-switch-weapon {
    pointer-events: auto; z-index: 1000; position: absolute;
    right: 20px; bottom: 5px;
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(5,12,8,0.85); border: 2px solid #fa0; color: #fa0;
    font-size: 2rem; cursor: pointer; display: none;
    align-items: center; justify-content: center;
    box-shadow: 0 0 8px rgba(255,170,0,0.3);
}
#btn-switch-weapon:active { transform: scale(0.95); background: #fa0; color: #000; }

.alert-msg { color: #f44; font-size: 2.5rem; text-align: center; z-index: 30; pointer-events:none; margin:0; animation: blink 0.2s infinite; position:relative; top:20%; text-shadow: 0 0 15px rgba(255,0,0,0.5); font-family: 'Courier New', monospace; }
#combat-score { position: absolute; top: 20px; left: 20px; color: #fa0; font-size: 1.1rem; font-weight: bold; text-shadow: 0 0 6px rgba(255,170,0,0.4), 2px 2px 0 #000; z-index: 30; pointer-events: none; font-family: 'Courier New', monospace; letter-spacing: 1px; }

/* SPECIAL ATTACK WIDGET */
.special-widget {
    position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%);
    width: 50px; height: 50px;
    background: rgba(0,0,0,0.6); border: 2px solid #0ff; border-radius: 50%;
    display: none; justify-content: center; align-items: center;
    color: #0ff; font-size: 1.5rem; font-weight: bold;
    overflow: hidden; box-shadow: 0 0 10px #0ff;
    z-index: 40; pointer-events: none;
}
.special-widget.cooldown { border-color: #555; color: #555; box-shadow: none; background: rgba(0,0,0,0.8); }
#special-fill { position: absolute; bottom: 0; left: 0; width: 100%; height: 0%; background: rgba(0, 255, 255, 0.2); z-index: 0; transition: height 0.1s linear; }
#special-icon { z-index: 1; text-shadow: 0 0 5px #0ff; }
#special-timer { position: absolute; z-index: 2; font-size: 1rem; color: #fff; text-shadow: 0 0 2px #000; font-family: monospace; }

/* COMBO SYSTEM */
#combo-container { position: absolute; top: 115px; left: 20px; z-index: 35; pointer-events: none; display: none; }
#combo-val { font-family: 'Impact', sans-serif; font-size: 3rem; font-weight: 900; text-shadow: 3px 3px 0 #000; transition: color 0.2s; font-style: italic; }

/* Colores Dinámicos */
.combo-low { color: #ffeb3b; -webkit-text-stroke: 1px #000; } /* Amarillo */
.combo-med { color: #ff9800; -webkit-text-stroke: 1px #000; } /* Naranja */
.combo-high { color: #f44336; -webkit-text-stroke: 2px #fff; text-shadow: 0 0 15px #f00; } /* Rojo Fuego */

/* Animaciones */
.combo-pulse { animation: comboPulse 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes comboPulse { 0% { transform: scale(1); } 50% { transform: scale(1.8); } 100% { transform: scale(1); } }

.combo-blinking { animation: comboBlink 0.3s steps(2, start) infinite; }
@keyframes comboBlink { to { visibility: hidden; } }

.combo-shake { animation: comboShake 0.1s infinite; }
@keyframes comboShake { 0% { transform: translate(0,0) rotate(0deg); } 25% { transform: translate(-2px, 2px) rotate(-2deg); } 50% { transform: translate(2px, -2px) rotate(2deg); } 75% { transform: translate(-2px, -2px) rotate(-1deg); } 100% { transform: translate(0,0) rotate(0deg); } }

/* Enhanced Combo Tiers */
.combo-epic { color: #bf40ff; -webkit-text-stroke: 2px #000; text-shadow: 0 0 20px rgba(191,64,255,0.8), 0 0 40px rgba(191,64,255,0.4); font-size: 3.5rem !important; }
.combo-legendary { color: #ffd700; -webkit-text-stroke: 2px #000; text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,215,0,0.5), 0 0 60px rgba(255,100,0,0.3); font-size: 4rem !important; }
.combo-mythic { color: #fff; -webkit-text-stroke: 2px rgba(0,200,255,0.8); text-shadow: 0 0 25px rgba(255,255,255,0.9), 0 0 50px rgba(0,200,255,0.6), 0 0 80px rgba(255,0,100,0.4); font-size: 4.5rem !important; }
.combo-godlike { color: #fff; -webkit-text-stroke: 2px #f0f; text-shadow: 0 0 30px #f0f, 0 0 60px #0ff, 0 0 90px #ff0; font-size: 5rem !important; animation: comboGodlike 0.2s infinite alternate !important; }
@keyframes comboGodlike { 0% { filter: hue-rotate(0deg); transform: translate(-1px,1px) rotate(-1deg) scale(1.05); } 100% { filter: hue-rotate(60deg); transform: translate(1px,-1px) rotate(1deg) scale(1); } }

.combo-streak-flash {
    position: fixed; top: 30%; left: 50%; transform: translate(-50%,-50%);
    font-family: 'Impact', sans-serif; font-size: 2rem; font-weight: 900; color: #ffd700;
    text-shadow: 0 0 15px rgba(255,215,0,0.8), 3px 3px 0 #000; z-index: 200; pointer-events: none;
    animation: streakFlash 1s ease-out forwards; white-space: nowrap;
}
@keyframes streakFlash { 0% { opacity: 1; transform: translate(-50%,-50%) scale(0.5); } 30% { opacity: 1; transform: translate(-50%,-50%) scale(1.3); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1) translateY(-40px); } }

/* COIN DROP SYSTEM */
.coin-drop {
    position: absolute; font-size: 1.8rem; z-index: 45; pointer-events: auto; cursor: pointer;
    animation: coinBounce 0.6s ease-out forwards;
    filter: drop-shadow(0 0 6px rgba(255,200,0,0.6));
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.coin-drop.coin-fly {
    transition: left 0.4s ease-in, top 0.4s ease-in, opacity 0.3s ease, transform 0.4s ease-in;
    opacity: 0.5; transform: scale(0.3); pointer-events: none;
}
.coin-drop.coin-fade {
    opacity: 0; transform: scale(0.5) translateY(-20px); pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
@keyframes coinBounce {
    0% { transform: scale(0) translateY(0); opacity: 0; }
    40% { transform: scale(1.3) translateY(-25px); opacity: 1; }
    70% { transform: scale(0.9) translateY(-5px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}
.coin-idle { animation: coinIdle 1.5s ease-in-out infinite; }
@keyframes coinIdle {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* PERK SELECTION OVERLAY */
#perk-selection {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 9000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.4s ease;
}
#perk-selection.perk-active { opacity: 1; }
.perk-title {
    font-family: 'Courier New', monospace; font-size: 1.5rem; color: #ffd700;
    letter-spacing: 4px; margin-bottom: 30px; text-shadow: 0 0 10px rgba(255,215,0,0.5);
    text-transform: uppercase; font-weight: bold;
}
#perk-cards { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; padding: 0 10px; }
.perk-card {
    background: rgba(10,25,15,0.95); border: 2px solid rgba(0,255,120,0.3);
    padding: 20px 15px; width: 130px; text-align: center; cursor: pointer;
    transition: all 0.3s ease; position: relative; overflow: hidden;
    animation: perkCardIn 0.4s ease-out both;
}
@keyframes perkCardIn { 0% { opacity: 0; transform: translateY(40px) scale(0.8); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.perk-card:hover { border-color: #ffd700; background: rgba(255,215,0,0.08); transform: translateY(-5px); box-shadow: 0 0 20px rgba(255,215,0,0.2); }
.perk-card:active { transform: scale(0.95); }
.perk-icon { font-size: 2.5rem; margin-bottom: 10px; }
.perk-name { font-family: 'Courier New', monospace; font-size: 0.85rem; color: #ffd700; font-weight: bold; margin-bottom: 8px; letter-spacing: 1px; }
.perk-desc { font-family: 'Courier New', monospace; font-size: 0.65rem; color: rgba(255,255,255,0.6); line-height: 1.3; }
.perk-selected { border-color: #ffd700 !important; box-shadow: 0 0 30px rgba(255,215,0,0.5); transform: scale(1.15) !important; z-index: 2; }
.perk-rejected { opacity: 0.2; transform: scale(0.85); pointer-events: none; }

/* MODIFIER ANNOUNCEMENT */
#modifier-announcement {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 8500;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
}
#modifier-announcement.mod-enter { opacity: 1; animation: modZoomIn 0.4s ease-out; pointer-events: auto; }
#modifier-announcement.mod-exit { opacity: 0; transition: opacity 0.4s ease; }
@keyframes modZoomIn { 0% { opacity: 0; transform: scale(2); } 100% { opacity: 1; transform: scale(1); } }
.mod-icon-big { font-size: 4rem; margin-bottom: 15px; animation: modIconPulse 0.6s ease-in-out infinite alternate; }
@keyframes modIconPulse { 0% { transform: scale(1); } 100% { transform: scale(1.15); } }
.mod-name-big { font-family: 'Impact', sans-serif; font-size: 3rem; color: #fff; letter-spacing: 6px; text-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(255,0,0,0.3); text-transform: uppercase; }
.mod-desc-text { font-family: 'Courier New', monospace; font-size: 0.85rem; color: rgba(255,255,255,0.5); margin-top: 10px; letter-spacing: 2px; }

/* PUZZLE CORRUPTIONS */
.corruption-announce {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 9000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    animation: corrFadeIn 0.3s ease-out; pointer-events: none;
}
.corruption-announce.corr-fade { opacity: 0; transition: opacity 0.5s ease; }
@keyframes corrFadeIn { 0% { opacity: 0; transform: scale(1.3); } 100% { opacity: 1; transform: scale(1); } }
.corr-title { font-family: 'Impact', sans-serif; font-size: 2rem; color: #f0f; letter-spacing: 6px; text-shadow: 0 0 20px rgba(255,0,255,0.6); margin-bottom: 15px; }
.corr-item { text-align: center; margin: 8px 0; }
.corr-icon { font-size: 2.5rem; }
.corr-name { font-family: 'Impact', sans-serif; font-size: 1.5rem; color: #f0f; letter-spacing: 3px; }
.corr-desc { font-family: 'Courier New', monospace; font-size: 0.75rem; color: rgba(255,255,255,0.5); letter-spacing: 1px; }

/* Phantom tube corruption */
.tube-container.phantom-hidden { opacity: 0 !important; transition: opacity 0.3s ease; }

/* Locked cell corruption indicator */
.inf-cell.corr-locked { outline: 2px solid #f0f !important; box-shadow: 0 0 8px rgba(255,0,255,0.5); pointer-events: none; }

/* EARTHQUAKE modifier shake */
.eq-shake { animation: eqShake 0.5s ease-in-out; }
@keyframes eqShake {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-8px, 5px); }
    20% { transform: translate(7px, -6px); }
    30% { transform: translate(-6px, 3px); }
    40% { transform: translate(5px, -4px); }
    50% { transform: translate(-4px, 6px); }
    60% { transform: translate(6px, -3px); }
    70% { transform: translate(-3px, 4px); }
    80% { transform: translate(4px, -5px); }
    90% { transform: translate(-5px, 2px); }
}

/* Bounty star marker */
.bounty-star {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    font-size: 1.2rem; z-index: 60; pointer-events: none;
    animation: bountyStar 0.8s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 5px rgba(255,215,0,0.8));
}
@keyframes bountyStar { 0% { transform: translateX(-50%) scale(1); } 100% { transform: translateX(-50%) scale(1.3); } }

/* GAME UI (PUZZLE) - FIX LINEA GRIS */
#screen-game {
    background-image: url('assets/mesa.png');
    background-size: cover;
    background-position: center;
    /* display is controlled by .screen and .screen.active */
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}
.game-ui {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background-color: rgba(5, 12, 8, 0.92);
    border: 1px solid rgba(0, 255, 120, 0.2);
    box-shadow: 0 0 15px rgba(0,255,100,0.06), 0 10px 30px rgba(0,0,0,0.8), inset 0 0 25px rgba(0,0,0,0.6);
    border-radius: 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-sizing: border-box;
    margin: 0 auto;
}
#puzzle-module {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: rgba(0, 15, 8, 0.8);
    padding: 10px;
    color: #0f8;
    font-weight: bold;
    border: 1px solid rgba(0, 255, 120, 0.15);
    border-left: 3px solid rgba(0, 255, 120, 0.4);
    text-shadow: 0 0 5px rgba(0,255,120,0.4);
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}
.row-container { display: flex; flex-direction: column; gap: 5px; margin-bottom: 5px; width: 100%; position: relative; }
.lbl {
    font-size: 0.7rem; font-weight: 700; display:flex; justify-content:space-between;
    background: rgba(0,15,8,0.6); color: rgba(0,255,120,0.6); padding: 2px 6px; font-family: 'Courier New', monospace; text-shadow: none; border-left: 2px solid rgba(0,255,120,0.3); width: fit-content; margin-bottom: 2px; transform: none; letter-spacing: 1px; text-transform: uppercase;
}
.tube-row {
    display: flex; gap: 4px; align-items: flex-end; height: 55px;
    background: rgba(0,5,3,0.9); padding: 5px; border: 1px solid rgba(0,255,120,0.1); width: 100%; box-sizing: border-box; box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}
.tube-container { flex: 1; height: 100%; background: rgba(0,20,10,0.4); border: 1px solid rgba(0,255,120,0.1); border-radius: 0; position: relative; overflow: hidden; }
.tube-liquid { 
    position: absolute; bottom: 0; left: 0; width: 100%; 
    background-color: transparent; background-image: repeating-linear-gradient(to top, var(--main-color) 0px, var(--main-color) 4px, #000 4px, #000 5px);
    transition: height 0.2s; opacity: 1; box-shadow: none; 
}
/* CUSTOM CHANNEL COLORS */
#target-row .tube-liquid { background-image: repeating-linear-gradient(to top, #0ff 0px, #0ff 4px, #000 4px, #000 5px); box-shadow: 0 0 8px #0ff; }
#row-a .tube-liquid { background-image: repeating-linear-gradient(to top, #ff4444 0px, #ff4444 4px, #000 4px, #000 5px); }
#row-b .tube-liquid { background-image: repeating-linear-gradient(to top, #44ff44 0px, #44ff44 4px, #000 4px, #000 5px); }
#row-c .tube-liquid { background-image: repeating-linear-gradient(to top, #4488ff 0px, #4488ff 4px, #000 4px, #000 5px); }
.lvl-0{height:0%} .lvl-1{height:33%;opacity:0.7} .lvl-2{height:66%;opacity:0.9} .lvl-3{height:100%; background-image: repeating-linear-gradient(to top, #fff 0px, #fff 4px, #000 4px, #000 5px); box-shadow:0 0 10px #fff;}
.ctrl-btns { display: flex; gap: 5px; position:absolute; right:0; top:0; }
.move-btn { background: rgba(0,15,8,0.8); color: #0f8; border: 1px solid rgba(0,255,120,0.3); padding: 2px 10px; font-size: 1rem; font-weight: bold; cursor: pointer; font-family: 'Courier New', monospace; }
.move-btn:active { background: rgba(0,255,120,0.15); transform: translate(1px, 1px); }
.status-panel { margin-top: 10px; background: rgba(0,10,5,0.8); padding: 15px; border: 1px solid rgba(0,255,120,0.15); box-shadow: inset 0 0 15px rgba(0,0,0,0.6); display: flex; flex-direction: column; align-items: center; width: 100%; box-sizing: border-box; }
.lbl-status { color: rgba(0,255,120,0.5); font-family: 'Courier New', monospace; font-weight: bold; font-size: 0.75rem; display: flex; justify-content: space-between; margin-bottom: 5px; letter-spacing: 1px; text-transform: uppercase; }
.bar-bg { background: rgba(0,5,3,0.9); height: 15px; width: 100%; margin-bottom: 10px; border: 1px solid rgba(0,255,120,0.2); }
.bar-fill { background-image: repeating-linear-gradient(to right, #0f0 0px, #0f0 4px, #000 4px, #000 5px); height: 100%; width: 0%; transition: width 0.3s; }
#synth-btn { width: 100%; background: rgba(0,15,8,0.8); color: #0f8; border: 1px solid rgba(0,255,120,0.3); padding: 12px; font-size: 1rem; font-weight: bold; cursor: pointer; text-shadow: 0 0 5px rgba(0,255,120,0.4); box-shadow: none; text-align: center; font-family: 'Courier New', monospace; letter-spacing: 2px; }
#synth-btn:active { background: rgba(0,255,120,0.1); }
#synth-btn.ready { background: rgba(0,255,120,0.15); color: #0f8; border-color: #0f8; box-shadow: 0 0 15px rgba(0,255,120,0.3); animation: pulse-green 1s infinite; }
@keyframes pulse-green { 0% { box-shadow: 0 0 15px rgba(0,255,120,0.3); } 50% { box-shadow: 0 0 25px rgba(0,255,120,0.5); } 100% { box-shadow: 0 0 15px rgba(0,255,120,0.3); } }
.overdrive-btn { width: 100%; background: rgba(40,0,0,0.8); color: #f44; border: 1px solid rgba(255,60,60,0.4); padding: 10px; font-size: 1rem; font-weight: bold; cursor: pointer; margin-top: 8px; transition: 0.15s; box-shadow: 0 0 8px rgba(255,0,0,0.2); text-shadow: 0 0 5px rgba(255,60,60,0.4); text-align: center; font-family: 'Courier New', monospace; letter-spacing: 1px; } .overdrive-btn:active { background: rgba(255,60,60,0.2); transform: scale(0.98); }

/* FIX: Ensure Status Panel in Game UI is full width and centered */
.game-ui .status-panel { width: 100%; max-width: none; align-items: center; }

/* SHOPS (GLASS EFFECT) */
#screen-shop, #screen-global-shop, #screen-survival-shop, #screen-survival-summary { background-image: url('assets/shop_bg.png'); background-size: cover; background-position: center; }
.shop-ui {
    width: 95%; max-width: 600px; height: 90%;
    background: rgba(5, 12, 8, 0.93);
    border: 1px solid rgba(0, 255, 120, 0.2);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    padding: 20px; display: flex; flex-direction: column;
    box-shadow: 0 0 15px rgba(0,255,100,0.06), 0 10px 40px rgba(0,0,0,0.8), inset 0 0 25px rgba(0,0,0,0.5);
}
.shop-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(0,255,120,0.2); margin-bottom: 20px; padding-bottom: 10px; color: #0f8; font-family: 'Courier New', monospace; letter-spacing: 1px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 10px; }
.shop-card { background: rgba(0, 20, 10, 0.5); border: 1px solid rgba(0, 255, 120, 0.1); border-left: 3px solid rgba(0, 255, 120, 0.3); padding: 15px; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; transition: 0.15s; color: rgba(0,255,120,0.7); font-family: 'Courier New', monospace; }
.shop-card:hover { background: rgba(0, 255, 120, 0.08); border-left-color: #0f8; }
.shop-card:active { background: rgba(0, 255, 120, 0.15); color: #fff; }
.shop-card .cost { margin-top: 10px; font-weight: bold; color: #fa0; border: 1px solid rgba(255,170,0,0.4); padding: 2px 8px; border-radius: 0; text-shadow: 0 0 5px rgba(255,170,0,0.3); }
.shop-card.disabled { opacity: 1; filter: grayscale(100%); pointer-events: none; cursor: default; background: rgba(30,30,30,0.6); border-color: rgba(100,100,100,0.3); color: rgba(150,150,150,0.5); }
.shop-card.disabled .cost { color: rgba(150,150,150,0.5); border-color: rgba(150,150,150,0.3); text-shadow: none; }

/* PANTALLAS SECUNDARIAS */
#screen-tutorial { background: #000; position: relative; overflow: hidden; }
#screen-tutorial::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('assets/tutorial.png'); background-size: cover; background-position: center; filter: blur(4px) brightness(0.3); -webkit-filter: blur(4px) brightness(0.3); transform: scale(1.05); z-index: 0; }
#screen-tutorial .menu-panel { position: relative; z-index: 1; }
#screen-leaderboard { position: relative; }
#screen-leaderboard::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('assets/highscore_bg.png');
    background-size: cover; background-position: center top;
    filter: blur(5px) brightness(0.35);
    z-index: -1;
}
#screen-cinematic { background-image: url('assets/cinematic_bg.png'); background-size: cover; background-position: center; }
#screen-lore { background-image: url('assets/lore_bg.png'); background-size: cover; background-position: center; }
#screen-victory { background-image: url('assets/victory_bg.png'); background-size: cover; background-position: center; }
#screen-win { background-image: url('assets/win_bg.png'); background-size: cover; background-position: center; }
#screen-fail { background-color: #000; background-size: cover; background-position: center; }

/* Censored text block */
.censored-block { background: #111; color: transparent; padding: 0 2px; border-radius: 2px; user-select: none; }

/* LORE CARDS & READER */
#screen-lore .menu-panel { display: flex; flex-direction: column; max-height: 85vh; }
#lore-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; width: 100%; overflow-y: auto; padding: 10px; box-sizing: border-box; flex: 1; min-height: 0; }
.lore-card { background: rgba(0, 20, 10, 0.6); border: 1px solid rgba(255, 170, 0, 0.3); border-radius: 0; aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s; padding: 5px; }
.lore-card:active { transform: scale(0.95); }
.lore-card.unlocked:hover { transform: scale(1.03); background: rgba(255, 170, 0, 0.12); border-color: #fa0; }
.lore-card.locked { border-color: rgba(0,255,120,0.1); opacity: 0.5; cursor: default; background: rgba(0,5,3,0.8); }
.lore-card .icon { font-size: 2.5rem; margin-bottom: 5px; }
.lore-card .icon.thorne-icon { filter: grayscale(1) brightness(0.15); }
.lore-card .label { font-size: 0.7rem; color: rgba(255,255,255,0.8); text-align: center; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; font-weight: bold; font-family: 'Courier New', monospace; }

#screen-lore-reader { background-image: url('assets/lore_bg.png'); background-size: cover; background-position: center; }
.reader-panel {
    background: rgba(5, 12, 8, 0.93);
    border: 1px solid rgba(0, 255, 120, 0.2);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    padding: 20px; width: 90%; max-width: 600px; max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 0 15px rgba(0,255,100,0.06), 0 10px 40px rgba(0,0,0,0.8), inset 0 0 25px rgba(0,0,0,0.5);
    overflow: hidden; position: relative;
}
#lore-read-content { flex: 1; overflow-y: auto; margin: 20px 0; font-family: 'Courier New', Courier, monospace; font-size: 1.0rem; line-height: 1.6; color: rgba(0,255,120,0.75); white-space: pre-wrap; text-align: left; padding-right: 10px; }

/* =========================================
   STORY SCREEN - DIARY OVERLAY
   ========================================= */
#screen-story { background: #000; position: relative; overflow: hidden; padding: 0; justify-content: center; align-items: center; }
#story-bg-blur { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; filter: blur(10px) brightness(0.3); -webkit-filter: blur(10px) brightness(0.3); transform: scale(1.1); z-index: 0; }

.story-layout {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box;
}

/* Frame: imagen + texto superpuesto */
.story-frame {
    position: relative;
    max-width: 70vw; max-height: 90vh;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0,255,120,0.15);
    box-shadow: 0 0 25px rgba(0,0,0,0.9), 0 0 8px rgba(0,255,120,0.06);
    overflow: hidden;
}
.story-frame img {
    display: block;
    width: 100%; height: 100%;
    object-fit: contain;
}

/* Texto superpuesto en el tercio superior */
.story-content {
    position: absolute; top: 0; left: 0; width: 100%;
    max-height: 38%;
    background: linear-gradient(180deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    padding: 20px 25px 30px;
    box-sizing: border-box;
    display: flex; flex-direction: column; align-items: center;
    overflow: hidden;
}
#day-title {
    color: #0f8; font-family: 'Courier New', monospace;
    font-size: 1.3rem; letter-spacing: 3px; text-transform: uppercase;
    margin: 0 0 8px 0;
    text-shadow: 0 0 10px rgba(0,255,120,0.5);
    border-bottom: 1px solid rgba(0,255,120,0.2);
    padding-bottom: 6px; width: 100%; text-align: center;
}
.story-scroll {
    max-height: 130px; overflow-y: auto; width: 100%;
    text-align: justify; padding-right: 8px;
    font-size: 0.9rem; line-height: 1.55; letter-spacing: 0.3px;
    color: rgba(255,255,255,0.85);
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}
.story-scroll::-webkit-scrollbar { width: 3px; }
.story-scroll::-webkit-scrollbar-track { background: transparent; }
.story-scroll::-webkit-scrollbar-thumb { background: rgba(0,255,120,0.3); }

/* Botón en la parte inferior del frame */
#next-day-btn {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    width: auto; min-width: 200px; padding: 10px 25px;
    font-size: 1rem;
    background: rgba(0,0,0,0.75); border: 1px solid rgba(0,255,120,0.5);
    border-left: 4px solid #0f8;
    font-weight: bold; cursor: pointer; color: #0f8;
    font-family: 'Courier New', monospace; letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(0,255,120,0.3);
    transition: all 0.15s; z-index: 5;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
#next-day-btn:hover { background: rgba(0,255,120,0.15); color: #fff; }

/* --- PORTRAIT (Móviles) --- */
@media (orientation: portrait) {
    .story-layout { padding: 15px; }
    .story-frame { max-width: 92vw; max-height: 85vh; }
    .story-content { max-height: 35%; padding: 15px 15px 25px; }
    #day-title { font-size: 1.1rem; letter-spacing: 2px; margin-bottom: 6px; padding-bottom: 5px; }
    .story-scroll { max-height: 110px; font-size: 0.85rem; line-height: 1.5; }
    #next-day-btn { bottom: 10px; min-width: 170px; padding: 9px 20px; font-size: 0.9rem; }
}

/* --- LANDSCAPE (Tablets, PC) --- */
@media (orientation: landscape) {
    .story-frame { max-width: 65vw; max-height: 92vh; }
    .story-content { max-height: 33%; padding: 18px 25px 28px; }
    .story-scroll { max-height: 140px; }
}

/* --- Landscape corto (Nest Hub <=700px altura) --- */
@media (orientation: landscape) and (max-height: 700px) {
    .story-layout { padding: 8px; }
    .story-frame { max-width: 72vw; max-height: 94vh; }
    .story-content { max-height: 36%; padding: 12px 18px 22px; }
    #day-title { font-size: 1rem; margin-bottom: 4px; }
    .story-scroll { max-height: 100px; font-size: 0.82rem; }
    #next-day-btn { bottom: 8px; padding: 7px 16px; font-size: 0.85rem; min-width: 150px; }
}

/* --- Pantallas grandes (iPad+) - texto 15% mayor --- */
@media (min-width: 768px) and (min-height: 700px) {
    #day-title { font-size: 1.5rem; }
    .story-scroll { font-size: 1.035rem; line-height: 1.65; max-height: 160px; }
    #next-day-btn { font-size: 1.15rem; padding: 12px 30px; min-width: 230px; }
}

/* --- Pantallas muy anchas (ultrawide, >16:9) --- */
@media (min-aspect-ratio: 16/9) {
    .story-frame { max-width: 55vw; }
}
@media (min-aspect-ratio: 2/1) {
    .story-frame { max-width: 45vw; }
}

.cinematic-text-container {
    background: rgba(5, 12, 8, 0.85);
    border-top: 1px solid rgba(0, 255, 120, 0.3);
    border-bottom: 1px solid rgba(0, 255, 120, 0.3);
    border-left: none; border-right: none;
    padding: 20px;
    width: 85%;
    max-height: 50vh;
    overflow-y: auto;
    text-align: center;
    border-radius: 0;
    margin-bottom: 20px;
}
#cinematic-text { color: rgba(0, 255, 120, 0.8); font-size: 1.05rem; line-height: 1.6; text-shadow: 0 0 5px rgba(0,255,120,0.2); font-family: 'Courier New', monospace; }
.lang-selector { position: absolute; top: 16px; right: 16px; z-index: 100; display:flex; gap:4px; }
.lang-btn { background: rgba(0,15,8,0.8); border: 1px solid rgba(0,255,120,0.25); color: rgba(0,255,120,0.7); padding: 4px 9px; cursor: pointer; font-family:'Courier New', monospace; font-weight:bold; font-size: 0.75rem; letter-spacing: 1px; transition: all 0.15s; }
.lang-btn:hover { background: rgba(0,255,120,0.1); color: #0f8; border-color: rgba(0,255,120,0.5); }
.audio-controls { position: absolute; top: 52px; right: 16px; z-index: 100; display:flex; gap:4px; flex-wrap: wrap; max-width: 160px; justify-content: flex-end; }
#score-list { list-style: none; padding: 0; margin: 20px 0; text-align: left; width: 100%;}
#score-list li { display: flex; justify-content: space-between; padding: 8px; border-bottom: 1px solid rgba(0,255,120,0.1); color: rgba(0,255,120,0.7); font-size: 1rem; font-family: 'Courier New', monospace; }

/* UTILS */
#start-btn, #select-btn { width: 100%; padding: 13px; font-size: 1.1rem; background: rgba(0,255,120,0.12); border: 1px solid rgba(0,255,120,0.5); border-left: 4px solid #0f8; font-weight: bold; cursor: pointer; margin-top:15px; color:#0f8; font-family: 'Courier New', monospace; letter-spacing: 2px; text-shadow: 0 0 5px rgba(0,255,120,0.3); transition: all 0.15s; }
#start-btn:hover, #select-btn:hover { background: rgba(0,255,120,0.2); color: #fff; }
.restart-btn { margin-top: 20px; padding: 15px 30px; background: rgba(5,12,8,0.9); border: 1px solid rgba(0,255,120,0.3); color: #0f8; font-size: 1.1rem; cursor: pointer; pointer-events: auto; z-index: 100; font-family: 'Courier New', monospace; letter-spacing: 2px; }
.restart-btn:hover { background: rgba(0,255,120,0.1); border-color: #0f8; }
.opt-btn { background: rgba(0,15,8,0.8); border: 1px solid rgba(0,255,120,0.15); border-left: 3px solid rgba(0,255,120,0.4); color: rgba(0,255,120,0.7); padding: 10px; cursor: pointer; z-index: 50; position: relative; font-family: 'Courier New', monospace; letter-spacing: 1px; transition: all 0.15s; }
.opt-btn:hover { background: rgba(0,255,120,0.08); color: #0f8; border-left-color: #0f8; }
#player-name, #player-name-fail { background: rgba(0,5,3,0.9); border: 1px solid rgba(0,255,120,0.3); color: #0f8; padding: 10px; font-size: 1.5rem; text-align: center; width: 150px; margin-bottom: 10px; font-family: 'Courier New', monospace; text-transform: uppercase; text-shadow: 0 0 5px rgba(0,255,120,0.3); }
.powerup { position: absolute; width: 40px; height: 40px; background: rgba(5,12,8,0.85); border: 1px solid #0ff; border-radius: 50%; color: #0ff; font-weight: bold; display: flex; justify-content: center; align-items: center; z-index: 80; cursor: pointer; animation: float 2s infinite ease-in-out; box-shadow: 0 0 8px rgba(0,255,255,0.3);}
.lore-drop { position: absolute; width: 50px; height: 50px; background: url('assets/lore_item.png') no-repeat center center; background-size: contain; z-index: 90; cursor: pointer; animation: float 2s infinite; filter: drop-shadow(0 0 10px #fa0); }
#ar-container { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); width: 300px; z-index: 100; display: none; }
#ar-bar { width: 100%; height: 20px; background: rgba(0,5,3,0.9); border: 1px solid rgba(0,255,120,0.3); position: relative; overflow: hidden; border-radius: 0; }
#ar-zone { position: absolute; top: 0; height: 100%; width: 20%; left: 60%; background: rgba(0,255,120,0.5); }
#ar-marker { position: absolute; top: 0; left: 0; height: 100%; width: 4px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.6); }
#ar-label { text-align: center; color: #0f8; font-weight: bold; margin-top: 5px; text-shadow: 0 0 5px rgba(0,0,0,0.8); font-family: 'Courier New', monospace; font-size: 0.85rem; letter-spacing: 1px; }

/* EFECTOS */
.ar-anim { animation: moveMarker 1.0s linear infinite; }
.shake-anim { animation: shakeScreen 0.3s cubic-bezier(.36,.07,.19,.97) both; }
.emergency-mode::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(rgba(255, 0, 0, 0.2), rgba(50, 0, 0, 0.6)); z-index: 5; pointer-events: none; animation: alarmPulse 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
#screen-crack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/screen_crack.png');
    background-size: cover;
    background-position: center; /* <-- ESTA ES LA CLAVE */
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.5s;
}
/* Survival Perks HUD - shows active perk icons */
#survival-perks-hud {
    position: fixed; top: 8px; left: 8px; z-index: 9999;
    display: flex; flex-direction: row; gap: 3px; flex-wrap: wrap;
    pointer-events: none; max-width: 180px;
}
.sph-perk {
    font-size: 0.9rem; background: rgba(0,0,0,0.6);
    padding: 2px 4px; border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    line-height: 1; cursor: default;
}
.sph-perk.sph-temp { border-color: rgba(255,170,0,0.3); }

/* Campaign Status HUD - always visible during campaign */
#campaign-status-hud {
    position: fixed; top: 8px; right: 8px; z-index: 9999;
    display: flex; flex-direction: column; gap: 3px;
    pointer-events: none; font-family: 'Courier New', monospace;
}
.csh-icon {
    font-size: 0.65rem; color: #aaa; background: rgba(0,0,0,0.6);
    padding: 2px 6px; border-radius: 3px; white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
}
#csh-infection.csh-danger { color: #f44; border-color: rgba(255,0,0,0.4); }
#csh-infection.csh-warning { color: #fa0; border-color: rgba(255,170,0,0.3); }
#csh-infection.csh-safe { color: #0f8; }

#damage-fx {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.6) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 101;
}

@keyframes moveMarker { 0% { left: 0%; } 100% { left: 100%; } }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes shakeScreen { 10%, 90% { transform: translate3d(-2px, 0, 0); } 20%, 80% { transform: translate3d(4px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-6px, 0, 0); } 40%, 60% { transform: translate3d(6px, 0, 0); } }
@keyframes alarmPulse { 0%{opacity:0.5} 50%{opacity:1} 100%{opacity:0.5} }
@keyframes glitchShake { 0%{transform:translate(1px, 1px)} 50%{transform:translate(-1px, -1px)} 100%{transform:translate(1px, -1px)} }
@keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 100% { transform: translateX(0); } }
.tube-row.glitched { filter: grayscale(100%) contrast(1.5); border-color: #aaa; animation: glitchShake 0.2s infinite; position: relative; }
.tube-row.glitched::after { content: attr(data-glitch-text); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: red; font-weight: bold; background: #000; padding: 2px 5px; z-index: 10; font-size: 0.8rem; white-space: nowrap; }

/* OVERDRIVE CONFIRMATION */
#screen-overdrive-confirm {
    background: rgba(0,0,0,0.8);
    z-index: 150;
}

/* LOCKED PUZZLE ROW */
.row-container.locked {
    pointer-events: none; /* Disable clicks on buttons */
    opacity: 0.6;
    position: relative;
}
.row-container.locked::after {
    content: '🔒';
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font-size: 2.5rem; color: #fa0; text-shadow: 0 0 10px #000; z-index: 10;
}
/* PUZZLE MASTER: pre-aligned channel */
.row-container.pm-locked {
    pointer-events: none;
    position: relative;
    border: 1px solid rgba(170,0,255,0.4);
    box-shadow: 0 0 8px rgba(170,0,255,0.3);
}
.row-container.pm-locked::after {
    content: '🧩';
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    font-size: 1.2rem; opacity: 0.7; z-index: 10;
}

/* PERK REROLL BUTTON */
.perk-reroll-btn {
    background: transparent; border: 1px solid #0ff; color: #0ff;
    font-family: 'Courier New', monospace; font-size: 0.8rem;
    padding: 6px 18px; cursor: pointer; letter-spacing: 2px;
    margin-bottom: 15px; transition: all 0.2s;
}
.perk-reroll-btn:hover { background: rgba(0,255,255,0.15); box-shadow: 0 0 10px rgba(0,255,255,0.3); }

/* SURVIVAL STATUS SCREEN */
#screen-survival-status { background-color: #000; background-size: cover; background-position: center; }
#screen-survival-status .status-panel {
    background: rgba(5, 12, 8, 0.93);
    border: 1px solid rgba(0, 255, 120, 0.2);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    padding: 20px; border-radius: 0; width: 90%; max-width: 400px; text-align: center; gap: 15px;
    box-shadow: 0 0 15px rgba(0,255,100,0.06), 0 10px 40px rgba(0,0,0,0.8), inset 0 0 25px rgba(0,0,0,0.5);
}
.stat-row { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(0,255,120,0.1); padding: 5px 0; color: rgba(0,255,120,0.7); font-size: 1rem; font-family: 'Courier New', monospace; }
.stat-val { font-weight: bold; color: #0f8; }
.stat-val.penalty { color: #f44; } .stat-val.gained { color: #0f8; }
.inf-bar-container { width: 100%; height: 20px; background: rgba(0,5,3,0.9); border: 1px solid rgba(0,255,120,0.2); margin-top: 5px; position: relative; }
.inf-bar-fill { height: 100%; background: #d0f; width: 0%; transition: width 0.5s; }
.inf-text { position: absolute; top: 0; left: 0; width: 100%; height: 100%; text-align: center; line-height: 20px; font-size: 0.8rem; color: #fff; text-shadow: 1px 1px 0 #000; font-weight: bold; font-family: 'Courier New', monospace; }
.quit-btn { background: rgba(40,0,0,0.8); border: 1px solid rgba(255,60,60,0.4); color: #f44; margin-top: 10px; width: 100%; padding: 10px; cursor: pointer; font-weight: bold; font-family: 'Courier New', monospace; letter-spacing: 1px; }
.quit-btn:hover { background: rgba(255,60,60,0.15); color: #f88; border-color: #f44; }

#throwables-container { position: absolute; bottom: 20px; left: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 50; align-items: flex-start; }
.throw-btn { width: 60px; height: 60px; border-radius: 50%; border: 1px solid rgba(0,255,120,0.3); background: rgba(5,12,8,0.85); color: #0f8; font-size: 1.5rem; cursor: pointer; display: flex; justify-content: center; align-items: center; position: relative; transition: 0.15s; }
.throw-btn.active { background: rgba(255,170,0,0.2); border-color: #fa0; color: #fa0; transform: scale(1.1); box-shadow: 0 0 12px rgba(255,170,0,0.3); }
.throw-count { position: absolute; top: -5px; right: -5px; background: rgba(255,60,60,0.9); color: #fff; font-size: 0.75rem; padding: 2px 6px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.3); font-weight: bold; font-family: 'Courier New', monospace; }

/* Menu controls overlap fix for all screen sizes */
#screen-menu {
    padding-top: 95px;
    justify-content: flex-start;
    box-sizing: border-box;
}

/* RESPONSIVE FIXES FOR LARGE SCREENS (iPad Pro, Tablets, Desktops) */
@media (min-width: 768px) and (min-height: 800px) {
    #screen-menu {
        padding-top: 0;
        justify-content: center;
    }
    .menu-panel {
        max-width: 480px;
        padding: 40px 35px 35px;
    }
    .title {
        font-size: 2.2rem;
        letter-spacing: 6px;
    }
    #menu-subtitle {
        font-size: 0.85rem;
    }
    #main-menu-btns button, #survival-options button {
        font-size: 1rem;
        padding: 14px 18px;
        margin-top: 10px;
    }
    #main-menu-btns #start-btn {
        font-size: 1.1rem;
        padding: 16px 18px;
    }
    .menu-status-bar {
        font-size: 0.7rem;
    }
    #global-currency {
        font-size: 1.1rem;
        padding: 8px 14px;
    }
    .lang-btn {
        font-size: 0.85rem !important;
        padding: 6px 12px !important;
    }
}

/* RESPONSIVE FIX: Center menu on narrow/tall screens (iPhones) */
@media (max-width: 430px) and (min-height: 700px) {
    #screen-menu {
        padding-top: 0;
        justify-content: center;
    }
}

/* RESPONSIVE FIXES FOR IPHONE SE / SMALL SCREENS */
@media (max-height: 700px) {
    .game-ui { padding: 10px; gap: 5px; }
    .tube-row { height: 40px; }
    .row-container { gap: 2px; margin-bottom: 2px; }
    .lbl { font-size: 0.65rem; padding: 1px 4px; }
    .header { padding: 5px; font-size: 0.9rem; }
    .status-panel { padding: 10px; }
    #synth-btn, .overdrive-btn { padding: 8px; font-size: 0.9rem; }
    .bar-bg { height: 10px; margin-bottom: 5px; }
    #screen-menu .menu-panel {
        padding: 15px;
        max-height: calc(100% - 20px); /* No salirse de la pantalla */
        display: flex;
        flex-direction: column;
    }
    #screen-menu .title {
        font-size: 1.4rem !important;
        margin-bottom: 10px !important;
        padding: 5px;
    }
    #main-menu-btns {
        overflow-y: auto; /* Scroll si hay muchos botones */
        padding-right: 5px;
        flex: 1; /* Ocupar espacio restante */
        min-height: 0;
    }
    #main-menu-btns button {
        padding: 8px;
        margin-top: 6px;
        font-size: 0.9rem;
    }

    /* Story & Cinematic Fixes for Small Screens (iPhone SE) */
    #screen-story { padding: 0; }
    .story-layout { padding: 8px; }
    .story-frame { max-width: 96vw; max-height: 88vh; }
    .story-content { max-height: 38%; padding: 10px 10px 20px; }
    #day-title { font-size: 0.95rem; letter-spacing: 1.5px; margin-bottom: 4px; padding-bottom: 4px; }
    .story-scroll { max-height: 80px; font-size: 0.78rem; line-height: 1.4; }
    #next-day-btn { bottom: 6px; min-width: 140px; padding: 7px 14px; font-size: 0.8rem; letter-spacing: 1px; }
    .cinematic-text-container { max-height: 40vh; padding: 10px; width: 90%; }
    #cinematic-text { font-size: 0.95rem; }

    /* Character Select Fixes for Small Screens */
    .char-overlay { padding: 10px 15px 30px 15px; }
    .char-overlay h2 { font-size: 1.5rem; margin-bottom: 5px; }
    .char-overlay p { font-size: 0.75rem; margin-bottom: 10px; line-height: 1.3; }
    #select-btn { padding: 8px; font-size: 1rem; margin-top: 5px; }
}

/* GENERAL LANDSCAPE OPTIMIZATIONS (Nest Hub, iPad, Tablets, Phones) */
@media (orientation: landscape) {
    /* Reducir arma drásticamente en horizontal para que no tape */
    #weapon-container { width: 30% !important; max-width: 350px; bottom: -5px; }

    /* Escalar UI para ganar espacio visual */
    #breach-info { transform: scale(0.85); transform-origin: bottom right; right: 10px; bottom: 100px; }
    #combat-score { transform: scale(0.85); transform-origin: top left; left: 10px; top: 10px; }
    #ammo-panel { bottom: 5px; transform: scale(0.85); transform-origin: bottom center; }
    .alert-msg { font-size: 2rem; top: 15%; }

    /* Personaje de cuerpo entero en landscape */
    #char-img-display {
        object-fit: contain !important;
        object-position: center !important;
        opacity: 0.8 !important;
        mask-image: none !important;
        -webkit-mask-image: none !important;
    }
    .char-overlay {
        background: linear-gradient(to top, rgba(0,0,0,0.95) 60%, transparent 100%) !important;
        padding-bottom: 20px !important;
    }
}

/* PUZZLE GAME UI - General responsive fixes */
@media (max-height: 600px) {
    .game-ui {
        padding: 8px;
        gap: 8px;
        max-height: 95vh;
        overflow-y: auto;
    }
    .game-ui .header {
        padding: 8px 10px;
        font-size: 0.8rem;
        gap: 10px;
    }
}

/* Header spacing fix for narrow + short screens */
@media (max-width: 450px) and (max-height: 700px) {
    .game-ui .header {
        padding: 8px;
        gap: 8px;
        font-size: 0.8rem;
    }
    .game-ui .header > * {
        flex-shrink: 1;
        min-width: 0;
    }
}

/* Very small screens (iPhone SE and similar) */
@media (max-height: 568px) {
    .game-ui {
        padding: 5px;
        gap: 5px;
    }
    .infection-ui { gap: 4px; }
    .inf-grid { max-width: 240px; padding: 3px; }
    .inf-header { padding: 4px 8px; font-size: 0.75rem; }
    .inf-legend, .inf-hint { font-size: 0.6rem !important; margin: 2px 0 !important; }
    .infection-ui button { padding: 6px !important; font-size: 0.75rem !important; }
    .overdrive-btn { padding: 6px !important; font-size: 0.75rem !important; }
}

/* Medium phones (iPhone 14 Pro Max ~430px, etc) */
@media (min-width: 400px) and (max-width: 500px) {
    #screen-game { padding: 10px; }
    .game-ui {
        max-width: calc(100% - 20px);
        padding: 15px;
        margin: 0 auto;
    }
    .header {
        gap: 10px;
        font-size: 0.85rem;
    }
    .bd-ui {
        max-width: calc(100% - 20px);
        margin: 0 auto;
    }
}

/* Narrow screens (phones portrait <400px) */
@media (max-width: 400px) {
    #screen-game { padding: 5px; }
    .game-ui {
        max-width: calc(100% - 10px);
        padding: 10px;
        margin: 0 auto;
    }
    .header {
        padding: 6px 8px;
        gap: 5px;
        font-size: 0.75rem;
    }
    #puzzle-module { align-items: center; }
    .infection-ui {
        max-width: 100%;
        margin: 0 auto;
    }
    .inf-grid { max-width: 280px; margin: 0 auto; }
    .bd-ui {
        max-width: calc(100% - 10px);
        margin: 0 auto;
        padding: 10px;
        box-sizing: border-box;
    }
    .bd-lock-container { width: 200px; height: 200px; }
    .bd-ring-0 { width: 180px; height: 180px; }
    .bd-ring-1 { width: 148px; height: 148px; }
    .bd-ring-2 { width: 116px; height: 116px; }
    .bd-ring-3 { width: 84px; height: 84px; }
    .bd-ring-4 { width: 52px; height: 52px; }
    .bd-notch { width: 12px; height: 18px; }
    .bd-center-icon { width: 40px; height: 40px; font-size: 1.4rem; }
}

/* LOOT SYSTEM */
.loot-item {
    position: fixed;
    font-size: 2rem;
    z-index: 9999;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), top 0.8s ease-in, left 0.8s ease-in, opacity 0.8s ease-in;
    text-shadow: 0 0 5px #fff;
}

/* DAMAGE NUMBERS (RPG ACTION STYLE) */
.damage-number {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    color: #ffffaa; /* Amarillo pálido */
    -webkit-text-stroke: 1.5px black;
    text-shadow: 3px 3px 0 #000;
    animation: damagePop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; /* Efecto elástico */
    text-align: center;
    line-height: 0.9;
}
.damage-number.crit {
    color: #ff4400; /* Naranja fuego intenso */
    font-size: 4rem; /* 1.5x más grande */
    -webkit-text-stroke: 2.5px black;
    text-shadow: 5px 5px 0 #000;
    z-index: 10001;
}
@keyframes damagePop {
    0% { transform: scale(0) translate(0, 0); opacity: 0; }
    20% { transform: scale(1.5) translate(0, -20px); opacity: 1; } /* Explosión inicial */
    40% { transform: scale(1.0) translate(0, -30px); } /* Rebote */
    100% { transform: scale(1.0) translate(0, -100px); opacity: 0; } /* Flotar y desvanecer */
}

/* WEAPON VIEWMODEL & RECOIL */
#weapon-container {
    position: absolute; bottom: 0; right: 0;
    width: 50%; max-width: 600px; /* Ajustable según preferencia */
    z-index: 25; /* Encima del canvas (20), debajo del HUD (30+) */
    pointer-events: none;
    display: flex; justify-content: flex-end; align-items: flex-end;
}
#current-weapon-view { width: 100%; height: auto; display: block; transform-origin: bottom right; }
.shooting-anim { animation: weapon-recoil 0.2s ease-out; }
@keyframes weapon-recoil {
    0% { transform: none; }
    20% { transform: translateY(30px) rotateZ(-5deg) scale(1.05); }
    100% { transform: none; }
}

/* Left-handed viewmodel (Shotgun) */
#weapon-container.left-handed {
    right: auto;
    left: 0;
    justify-content: flex-start;
}
#weapon-container.left-handed #current-weapon-view {
    transform-origin: bottom left;
}
#weapon-container.left-handed .shooting-anim {
    animation-name: weapon-recoil-left;
}
@keyframes weapon-recoil-left {
    0% { transform: none; }
    20% { transform: translateY(30px) rotateZ(5deg) scale(1.05); }
    100% { transform: none; }
}

/* =========================================
   SKIN DIGITAL (LEGACY OS v1.0)
   ========================================= */
/* SKIN DIGITAL: Ya integrado en el tema base (retro-futurista) */

/* DEV MODE */
#dev-mode-toggle.active { border-color: #0f0 !important; color: #0f0 !important; background: rgba(0, 20, 0, 0.8) !important; box-shadow: 0 0 10px #0f0; }

/* =========================================
   PUZZLE: INFECTION (BIOHAZARD NETWORK)
   ========================================= */
.infection-ui {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin: 0 auto;
}
.inf-header {
    width: 100%;
    display: flex;
    justify-content: center;
    color: #0f8;
    font-weight: bold;
    font-size: 0.85rem;
    text-shadow: 0 0 5px rgba(0,255,120,0.4);
    background: rgba(5,15,5,0.9);
    padding: 8px 15px;
    border: 1px solid rgba(0,200,80,0.2);
    border-left: 3px solid rgba(0,255,120,0.5);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}
.inf-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    background: rgba(5,15,5,0.95);
    padding: 8px;
    border: 1px solid rgba(0,200,80,0.2);
    border-radius: 0;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.9), 0 0 12px rgba(0,200,80,0.08);
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1;
}
.inf-cell {
    background: rgba(8,20,8,0.9);
    border: 1px solid rgba(0,200,80,0.15);
    border-radius: 0;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.inf-cell:hover { background: rgba(15,35,15,0.9); box-shadow: inset 0 0 10px rgba(0,255,120,0.15); }
.inf-cell:active { transform: scale(0.95); background: rgba(20,45,20,0.9); }
.inf-cell.locked { cursor: default; border-color: rgba(255,0,0,0.5); box-shadow: 0 0 5px rgba(255,0,0,0.3); }
/* Noise cells look identical to path cells (distraction/difficulty) */

/* PIPES (CSS SHAPES) */
.inf-pipe { position: absolute; background: #4a7a5a; transition: background 0.3s; z-index: 2; border-radius: 2px; }

/* EXTENDED PIPES (To remove visual gaps) */
.pipe-straight { width: 30%; height: 120%; top: -10%; }
.pipe-elbow-v { width: 30%; height: 70%; top: -10%; }
.pipe-elbow-h { height: 30%; width: 70%; right: -10%; }
.pipe-cross-v { width: 30%; height: 120%; top: -10%; }
.pipe-cross-h { height: 30%; width: 120%; left: -10%; }

/* Nucleus Marker */
.inf-nucleus { width: 35%; height: 35%; background: #0f8; border: 2px solid #000; border-radius: 50%; z-index: 10; box-shadow: 0 0 8px rgba(0,255,120,0.8); animation: pulse-nuc 2s infinite; }
.inf-start { width: 45%; height: 45%; background: radial-gradient(circle, #ff4444, #aa0000); border-radius: 50%; z-index: 10; box-shadow: 0 0 15px #f00; border: 2px solid #fff; }
.inf-end { width: 45%; height: 45%; background: radial-gradient(circle, #44ff44, #00aa00); border-radius: 50%; z-index: 10; box-shadow: 0 0 15px #0f0; border: 2px solid #fff; }

/* Direction arrows on start/end cells */
.inf-dir-arrow { position: absolute; width: 0; height: 0; z-index: 11; }
/* Up (dir 0) */
.inf-dir-arrow-0 { top: 2px; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid #fff; }
/* Right (dir 1) */
.inf-dir-arrow-1 { right: 2px; top: 50%; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid #fff; }
/* Down (dir 2) */
.inf-dir-arrow-2 { bottom: 2px; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid #fff; }
/* Left (dir 3) */
.inf-dir-arrow-3 { left: 2px; top: 50%; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 8px solid #fff; }

/* INFECTED STATE */
.inf-cell.infected .inf-pipe { background: #ff3333 !important; box-shadow: 0 0 10px #ff0000; animation: pulse-blood 1.5s infinite; }
.inf-cell.infected { background: rgba(50,0,0,0.9); border-color: #880000; }
.inf-cell.infected .inf-nucleus { background: #f00; border-color: #000; box-shadow: 0 0 10px #f00; }

/* INFECTION PUZZLE - Responsive */
@media (max-width: 400px), (max-height: 600px) {
    .infection-ui { max-width: 100%; gap: 6px; }
    .inf-grid { max-width: 280px; padding: 5px; }
    .inf-header { font-size: 0.8rem; padding: 5px 10px; }
    .infection-ui button { padding: 8px; font-size: 0.85rem; }
}

/* Wide screens (Nest Hub, tablets landscape) */
@media (min-aspect-ratio: 16/10) {
    .infection-ui { max-width: 350px; }
    .inf-grid { max-width: 280px; }
}

/* Defeat screen on landscape/Nest Hub - center the character better */
@media (orientation: landscape) and (max-height: 700px) {
    #escape-fail-overlay {
        background-position: center bottom !important;
    }
    #screen-fail {
        background-position: center bottom !important;
    }
    #screen-victory {
        background-position: center 20% !important;
    }
    #screen-win {
        background-position: center 20% !important;
    }
}

/* Panoramic/widescreen: center KIA background so character is visible */
@media (min-aspect-ratio: 16/10) {
    #screen-fail {
        background-position: center center !important;
    }
}
@media (min-aspect-ratio: 2/1) {
    #screen-fail {
        background-position: center 40% !important;
    }
}

/* Very wide screens (Nest Hub) */
@media (min-aspect-ratio: 16/9) and (max-height: 600px) {
    .game-ui { max-width: 500px; padding: 10px; }
    .infection-ui { max-width: 300px; gap: 5px; }
    .inf-grid { max-width: 220px; padding: 4px; border-width: 2px; }
    .inf-header { font-size: 0.75rem; padding: 4px 8px; }
    .infection-ui button { padding: 6px; font-size: 0.8rem; }
}

/* Surface Duo and foldables */
@media (min-width: 500px) and (max-width: 750px) and (min-height: 700px) {
    .infection-ui { max-width: 380px; }
    .inf-grid { max-width: 300px; }
}

/* FADE TRANSITION OVERLAY */
#fade-transition {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 10000; pointer-events: none;
    opacity: 0; transition: opacity 0.25s ease-in-out;
}
#fade-transition.active { opacity: 1; pointer-events: all; }

/* =========================================
   PUZZLE: BLAST DOOR (THORNE DAY 7)
   REDESIGNED - Clear visual feedback
   ========================================= */
/* ============================================
   BLAST DOOR PUZZLE - VISUAL REDESIGN
   ============================================ */
.bd-ui {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(5, 12, 8, 0.95);
    border: 1px solid rgba(0, 255, 120, 0.15);
    padding: 15px;
    border-radius: 0;
    box-shadow: 0 0 15px rgba(0,255,100,0.05), inset 0 0 25px rgba(0,0,0,0.6);
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* ARMORED DOOR BACKGROUND */
.bd-door-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    z-index: 0;
    pointer-events: none;
}
.bd-door-half {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 6px;
    color: rgba(80, 80, 80, 0.15);
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 40%, #111 60%, #0a0a0a 100%);
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 0 solid #333;
}
.bd-door-left {
    border-right: 3px solid #2a2a2a;
    writing-mode: vertical-lr;
}
.bd-door-right {
    border-left: 3px solid #2a2a2a;
    writing-mode: vertical-lr;
}
/* Door open animation */
.bd-ui.door-open .bd-door-left { transform: translateX(-110%); }
.bd-ui.door-open .bd-door-right { transform: translateX(110%); }
.bd-ui.door-open .bd-door-half { border-color: #0f8; }

/* All content above the door */
.bd-header, .bd-hint, .bd-progress, .bd-lock-container,
.bd-ring-labels, .bd-sentinel-float, .bd-moves,
.bd-ui > button, .bd-ui > .restart-btn, .bd-ui > .overdrive-btn, .bd-ui > .opt-btn {
    position: relative;
    z-index: 2;
}

/* CRACK EFFECTS — green light leaking through door */
.bd-ui::before, .bd-ui::after { content: ''; position: absolute; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.8s; }
.bd-ui.crack-1::before {
    opacity: 1;
    top: 15%; left: 48%; width: 2px; height: 30%;
    background: linear-gradient(180deg, transparent, #0f8, transparent);
    box-shadow: 0 0 8px #0f8, 0 0 15px rgba(0,255,136,0.3);
    transform: rotate(-5deg);
}
.bd-ui.crack-2::after {
    opacity: 1;
    top: 10%; left: 52%; width: 2px; height: 25%;
    background: linear-gradient(180deg, transparent, #0f8, transparent);
    box-shadow: 0 0 8px #0f8, 0 0 15px rgba(0,255,136,0.3);
    transform: rotate(8deg);
}
.bd-ui.crack-3 { box-shadow: 0 0 15px rgba(0,255,100,0.05), inset 0 0 25px rgba(0,0,0,0.6), inset 0 0 30px rgba(0,255,136,0.05); }
.bd-ui.crack-4 { box-shadow: 0 0 15px rgba(0,255,100,0.05), inset 0 0 25px rgba(0,0,0,0.6), inset 0 0 40px rgba(0,255,136,0.1); }
.bd-ui.crack-5 {
    box-shadow: 0 0 25px rgba(0,255,136,0.2), inset 0 0 25px rgba(0,0,0,0.6), inset 0 0 50px rgba(0,255,136,0.15);
    border-color: rgba(0,255,136,0.3);
}

.bd-header {
    width: 100%;
    text-align: center;
    background: transparent;
    padding: 8px;
    border-bottom: 1px solid rgba(0,255,120,0.1);
}
.bd-header h2 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: rgba(0,255,120,0.5);
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}
.bd-status {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 0;
    display: inline-block;
}
.bd-status.locked {
    color: #ff6600;
    background: rgba(255, 100, 0, 0.15);
    border: 1px solid #ff6600;
    text-shadow: 0 0 5px #ff6600;
}
.bd-status.unlocked {
    color: #00ffaa;
    background: rgba(0, 255, 170, 0.15);
    border: 1px solid #00ffaa;
    text-shadow: 0 0 10px #00ffaa;
    animation: pulse-green 1s infinite;
}

/* Instruction hint */
.bd-hint {
    font-size: 0.75rem;
    color: rgba(0,255,120,0.4);
    text-align: center;
    padding: 5px;
    background: rgba(0,5,3,0.6);
    border-radius: 0;
    width: 100%;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}
.bd-hint span { color: #fa0; }

.bd-lock-container {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #1a1a1a 0%, #080808 60%, #000 100%);
    border-radius: 50%;
    border: 4px solid #333;
    box-shadow: 0 0 30px rgba(0,0,0,0.9), inset 0 0 40px rgba(0,0,0,0.8);
    margin-top: 5px;
}

/* POWER SOURCE — fixed indicator at top of container */
.bd-power-source {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    z-index: 20;
    filter: drop-shadow(0 0 8px #ff0) drop-shadow(0 0 15px rgba(255,255,0,0.6));
    animation: power-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes power-pulse {
    0%, 100% { filter: drop-shadow(0 0 6px #ff0) drop-shadow(0 0 12px rgba(255,255,0,0.4)); }
    50% { filter: drop-shadow(0 0 12px #ff0) drop-shadow(0 0 25px rgba(255,255,0,0.7)); }
}

/* RINGS — Each with distinct color */
.bd-ring {
    position: absolute;
    border-radius: 50%;
    border: 6px solid;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bd-ring:hover { box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 15px rgba(255,150,0,0.4); }

/* Ring sizes and INDIVIDUAL COLORS */
.bd-ring-0 { width: 220px; height: 220px; z-index: 1; background: transparent; border-color: #e33; }
.bd-ring-1 { width: 180px; height: 180px; z-index: 2; background: rgba(10,10,10,0.9); border-color: #f80; }
.bd-ring-2 { width: 140px; height: 140px; z-index: 3; background: rgba(12,12,12,0.9); border-color: #ee0; }
.bd-ring-3 { width: 100px; height: 100px; z-index: 4; background: rgba(14,14,14,0.9); border-color: #0dd; }
.bd-ring-4 { width: 60px; height: 60px; z-index: 5; background: rgba(16,16,16,0.9); border-color: #eee; }

/* MARKERS — Entry (green ▼) and Exit (cyan ▲) */
.bd-marker {
    position: absolute;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    transition: box-shadow 0.3s;
}
.bd-marker-entry {
    background: radial-gradient(circle, #0f8, #0a5);
    color: #fff;
    border: 2px solid #0f8;
    box-shadow: 0 0 10px #0f8, 0 0 20px rgba(0,255,136,0.4);
    text-shadow: 0 0 4px #fff;
}
.bd-marker-exit {
    background: radial-gradient(circle, #0ff, #066);
    color: #fff;
    border: 2px solid #0ff;
    box-shadow: 0 0 10px #0ff, 0 0 20px rgba(0,255,255,0.4);
    text-shadow: 0 0 4px #fff;
}

/* Smaller markers for inner rings */
.bd-ring-3 .bd-marker, .bd-ring-4 .bd-marker { width: 14px; height: 14px; font-size: 0.55rem; }

/* RING STATES */
/* Completed — green border with energy flowing */
.bd-ring.ring-aligned {
    border-color: #0f8 !important;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 12px rgba(0,255,136,0.5) !important;
    cursor: default;
}
.bd-ring.ring-aligned .bd-marker-entry {
    background: radial-gradient(circle, #0f8, #0a5);
    box-shadow: 0 0 12px #0f8, 0 0 25px rgba(0,255,136,0.6) !important;
}
.bd-ring.ring-aligned .bd-marker-exit {
    background: radial-gradient(circle, #0ff, #066);
    box-shadow: 0 0 12px #0ff, 0 0 25px rgba(0,255,255,0.6) !important;
}

/* Energized — staggered illumination during win sequence */
.bd-ring.ring-energized {
    border-color: #0f8 !important;
    box-shadow: inset 0 0 15px rgba(0,255,136,0.2), 0 0 25px rgba(0,255,136,0.7), 0 0 50px rgba(0,255,136,0.3) !important;
    animation: ring-energize-flash 0.6s ease-out !important;
}
@keyframes ring-energize-flash {
    0% { box-shadow: inset 0 0 30px rgba(0,255,136,0.8), 0 0 50px #0f8, 0 0 80px rgba(0,255,136,0.6); }
    100% { box-shadow: inset 0 0 15px rgba(0,255,136,0.2), 0 0 25px rgba(0,255,136,0.7), 0 0 50px rgba(0,255,136,0.3); }
}

/* Active — pulsing glow */
.bd-ring.ring-active {
    animation: ring-active-pulse 1s ease-in-out infinite !important;
    cursor: pointer;
}
@keyframes ring-active-pulse {
    0%, 100% { box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 15px rgba(255,170,0,0.6); }
    50% { box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 30px rgba(255,170,0,0.9), 0 0 50px rgba(255,100,0,0.4); }
}
.bd-ring.ring-active .bd-marker {
    animation: marker-glow 1s ease-in-out infinite;
}
@keyframes marker-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

/* Locked — dim */
.bd-ring.ring-locked {
    border-color: #333 !important;
    opacity: 0.4;
    cursor: not-allowed;
}
.bd-ring.ring-locked .bd-marker {
    opacity: 0.4;
    box-shadow: none !important;
}

/* CENTER EYE ICON */
.bd-center-icon {
    font-size: 1.8rem;
    z-index: 10;
    pointer-events: none;
    transition: all 0.5s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #1a1a1a, #000);
    border-radius: 50%;
    border: 3px solid #f44;
    color: #f44;
    text-shadow: 0 0 15px #f00;
    animation: eye-pulse 2s ease-in-out infinite;
}
@keyframes eye-pulse {
    0%, 100% { text-shadow: 0 0 10px #f00; transform: scale(1); }
    50% { text-shadow: 0 0 25px #f00, 0 0 40px rgba(255,0,0,0.4); transform: scale(1.08); }
}
/* Eye blink on ring completion */
.bd-center-icon.blink {
    animation: eye-blink 0.4s ease !important;
}
@keyframes eye-blink {
    0% { opacity: 1; transform: scaleY(1); }
    40% { opacity: 0.2; transform: scaleY(0.1); }
    100% { opacity: 1; transform: scaleY(1); }
}
/* Eye unlocked — green */
.bd-center-icon.unlocked {
    color: #0f8 !important;
    text-shadow: 0 0 20px #0f8, 0 0 40px rgba(0,255,136,0.5) !important;
    border-color: #0f8 !important;
    animation: none !important;
}

/* FIREWALL LABELS */
.bd-ring-labels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
    width: 100%;
    margin-top: 4px;
}
.bd-rlabel {
    font-family: 'Courier New', monospace;
    font-size: 0.55rem;
    color: rgba(0,255,120,0.25);
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border: 1px solid rgba(0,255,120,0.08);
    background: rgba(0,5,3,0.4);
    transition: all 0.3s;
}
/* Highlight active ring's label */
.bd-rlabel.active {
    color: #fa0;
    border-color: rgba(255,170,0,0.3);
    background: rgba(30,20,0,0.5);
    text-shadow: 0 0 5px rgba(255,170,0,0.3);
}
/* Bypassed label */
.bd-rlabel.bypassed {
    color: #0f8 !important;
    border-color: rgba(0,255,136,0.3) !important;
    background: rgba(0,15,8,0.5) !important;
    text-shadow: 0 0 5px rgba(0,255,136,0.3);
}

/* SENTINEL FLOATING MESSAGE */
.bd-sentinel-float {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #0f8;
    text-shadow: 0 0 10px #0f8;
    text-align: center;
    padding: 6px 12px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.5s, transform 0.5s;
    pointer-events: none;
    min-height: 1.2em;
    letter-spacing: 1px;
}
.bd-sentinel-float.show {
    opacity: 1;
    transform: translateY(0);
}

/* Progress indicator */
.bd-progress {
    font-size: 0.9rem;
    font-weight: bold;
    color: rgba(0,255,120,0.8);
    text-align: center;
    padding: 8px 15px;
    background: rgba(0,10,5,0.7);
    border: 1px solid rgba(0,255,120,0.2);
    border-radius: 0;
    margin-bottom: 2px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* ALL ALIGNED STATE */
.bd-ui.aligned .bd-ring { border-color: #0f8 !important; }
.bd-ui.aligned .bd-marker-entry {
    background: radial-gradient(circle, #0f8, #0a5) !important;
    box-shadow: 0 0 15px #0f8, 0 0 30px rgba(0,255,136,0.6) !important;
}
.bd-ui.aligned .bd-marker-exit {
    background: radial-gradient(circle, #0ff, #066) !important;
    box-shadow: 0 0 15px #0ff, 0 0 30px rgba(0,255,255,0.6) !important;
}
.bd-ui.aligned .bd-lock-container {
    box-shadow: 0 0 40px rgba(0,255,136,0.4), inset 0 0 40px rgba(0,0,0,0.8);
}

/* HINT BUTTON */
.bd-hint-btn {
    background: rgba(20,18,0,0.8);
    border: 1px solid rgba(255,255,0,0.3);
    border-left: 3px solid rgba(255,255,0,0.6);
    color: #ff0;
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0;
    text-shadow: 0 0 5px rgba(255,255,0,0.4);
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}
.bd-hint-btn:hover {
    background: rgba(255,255,0,0.1);
    border-color: #ff0;
    border-left-color: #ff0;
    box-shadow: 0 0 10px rgba(255,255,0,0.2);
}
.bd-hint-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* MOVE COUNTER */
.bd-moves {
    font-size: 0.7rem;
    color: rgba(0,255,120,0.4);
    text-align: center;
    margin-top: 2px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}
.bd-moves span { color: #0ff; font-weight: bold; }

/* Responsive Blast Door — Small phones (iPhone SE: 375x667) */
@media (max-width: 400px) {
    .bd-ui { padding: 10px; gap: 6px; max-width: 340px; }
    .bd-header h2 { font-size: 0.85rem; letter-spacing: 1px; }
    .bd-status { font-size: 0.7rem; padding: 3px 8px; }
    .bd-hint { font-size: 0.65rem; }
    .bd-lock-container { width: 200px; height: 200px; }
    .bd-ring-0 { width: 180px; height: 180px; }
    .bd-ring-1 { width: 148px; height: 148px; }
    .bd-ring-2 { width: 116px; height: 116px; }
    .bd-ring-3 { width: 84px; height: 84px; }
    .bd-ring-4 { width: 52px; height: 52px; }
    .bd-marker { width: 14px; height: 14px; font-size: 0.55rem; }
    .bd-ring-3 .bd-marker, .bd-ring-4 .bd-marker { width: 12px; height: 12px; font-size: 0.5rem; }
    .bd-center-icon { width: 40px; height: 40px; font-size: 1.3rem; }
    .bd-rlabel { font-size: 0.5rem; padding: 1px 4px; }
    .bd-sentinel-float { font-size: 0.65rem; }
    .bd-door-half { font-size: 1.5rem; }
    .bd-progress { font-size: 0.8rem; padding: 5px 10px; }
    .bd-moves { font-size: 0.65rem; }
    .bd-power-source { font-size: 1.1rem; top: -12px; }
}

/* Very narrow phones (< 350px like Galaxy Z Fold inner) */
@media (max-width: 350px) {
    .bd-ui { padding: 8px; gap: 4px; max-width: 300px; }
    .bd-header h2 { font-size: 0.75rem; }
    .bd-lock-container { width: 170px; height: 170px; }
    .bd-ring-0 { width: 155px; height: 155px; }
    .bd-ring-1 { width: 128px; height: 128px; }
    .bd-ring-2 { width: 100px; height: 100px; }
    .bd-ring-3 { width: 72px; height: 72px; }
    .bd-ring-4 { width: 45px; height: 45px; }
    .bd-marker { width: 12px; height: 12px; font-size: 0.45rem; }
    .bd-ring-3 .bd-marker, .bd-ring-4 .bd-marker { width: 10px; height: 10px; font-size: 0.4rem; }
    .bd-center-icon { width: 35px; height: 35px; font-size: 1.1rem; }
    .bd-door-half { font-size: 1.2rem; }
    .bd-power-source { font-size: 1rem; top: -10px; }
}

/* Square-ish screens (Surface Duo ~540x720, aspect ~0.75) */
@media (min-width: 500px) and (max-width: 650px) and (min-aspect-ratio: 7/10) and (max-aspect-ratio: 9/10) {
    .bd-ui { max-width: 420px; padding: 14px; }
    .bd-lock-container { width: 230px; height: 230px; }
    .bd-ring-0 { width: 210px; height: 210px; }
    .bd-ring-1 { width: 174px; height: 174px; }
    .bd-ring-2 { width: 136px; height: 136px; }
    .bd-ring-3 { width: 98px; height: 98px; }
    .bd-ring-4 { width: 58px; height: 58px; }
    .bd-center-icon { width: 48px; height: 48px; font-size: 1.6rem; }
}

/* Short/landscape screens (general) */
@media (max-height: 600px) and (min-width: 400px) {
    .bd-ui { padding: 8px; gap: 4px; }
    .bd-lock-container { width: 170px; height: 170px; margin-top: 2px; }
    .bd-ring-0 { width: 155px; height: 155px; }
    .bd-ring-1 { width: 128px; height: 128px; }
    .bd-ring-2 { width: 100px; height: 100px; }
    .bd-ring-3 { width: 72px; height: 72px; }
    .bd-ring-4 { width: 45px; height: 45px; }
    .bd-marker { width: 12px; height: 12px; font-size: 0.45rem; }
    .bd-center-icon { width: 36px; height: 36px; font-size: 1.2rem; }
    .bd-door-half { font-size: 1.2rem; }
    .bd-rlabel { font-size: 0.5rem; padding: 1px 4px; }
    .bd-sentinel-float { font-size: 0.65rem; min-height: 0; padding: 3px 8px; }
    .bd-progress { font-size: 0.8rem; padding: 4px 10px; }
    .bd-header { padding: 4px; }
    .bd-header h2 { font-size: 0.85rem; margin-bottom: 2px; }
    .bd-power-source { font-size: 1rem; top: -10px; }
}

/* Wide screens — Nest Hub (1024x600, aspect ~16/9) */
@media (min-aspect-ratio: 16/9) and (max-height: 650px) {
    .game-ui {
        max-width: 700px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
    }
    .game-ui .header {
        width: 100%;
        flex-shrink: 0;
    }
    .bd-ui {
        max-width: 550px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
        padding: 8px 15px;
    }
    .bd-header { width: 100%; order: 1; padding: 4px; }
    .bd-header h2 { font-size: 0.85rem; margin-bottom: 2px; }
    .bd-hint { width: 100%; order: 2; font-size: 0.65rem; }
    .bd-lock-container {
        width: 175px; height: 175px;
        order: 3; flex-shrink: 0; margin-top: 0;
    }
    .bd-ring-0 { width: 158px; height: 158px; }
    .bd-ring-1 { width: 130px; height: 130px; }
    .bd-ring-2 { width: 102px; height: 102px; }
    .bd-ring-3 { width: 74px; height: 74px; }
    .bd-ring-4 { width: 46px; height: 46px; }
    .bd-notch { width: 10px; height: 14px; }
    .bd-ui > button, .bd-ui > .restart-btn {
        order: 4; width: auto; min-width: 160px; flex-grow: 0;
    }
    .bd-center-icon { width: 36px; height: 36px; font-size: 1.2rem; }
    .bd-ring-labels { order: 5; }
    .bd-sentinel-float { order: 6; width: 100%; font-size: 0.65rem; min-height: 0; padding: 3px 8px; }
    .bd-door-half { font-size: 1.2rem; }
    .bd-progress { font-size: 0.8rem; padding: 4px 10px; order: 7; }
    .bd-moves { order: 8; }
}

/* Very wide screens (Nest Hub Max, ultrawide) */
@media (min-aspect-ratio: 2/1) and (max-height: 600px) {
    .game-ui { max-width: 750px; }
    .bd-ui { max-width: 600px; gap: 8px; }
    .bd-lock-container { width: 180px; height: 180px; }
    .bd-ring-0 { width: 164px; height: 164px; }
    .bd-ring-1 { width: 136px; height: 136px; }
    .bd-ring-2 { width: 108px; height: 108px; }
    .bd-ring-3 { width: 78px; height: 78px; }
    .bd-ring-4 { width: 50px; height: 50px; }
    .bd-notch { width: 12px; height: 16px; }
}

@keyframes pulse-nuc { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse-blood { 0% { box-shadow: 0 0 5px #f00; } 50% { box-shadow: 0 0 15px #f00; } 100% { box-shadow: 0 0 5px #f00; } }

/* =========================================
   ESCAPE RUN HUD
   ========================================= */
@keyframes escape-combo-glow {
    0% { box-shadow: 0 0 10px rgba(255,100,0,0.5), inset 0 0 10px rgba(255,100,0,0.2); }
    100% { box-shadow: 0 0 20px rgba(255,100,0,0.8), inset 0 0 15px rgba(255,100,0,0.4); }
}
@keyframes escape-combo-pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
#escape-combo.active {
    animation: escape-combo-pulse 0.6s ease-out forwards;
}
#escape-combo-panel.combo-high {
    border-color: #ff0 !important;
    background: linear-gradient(180deg, rgba(255,200,0,0.3) 0%, rgba(255,100,0,0.4) 100%) !important;
}
#escape-combo-panel.combo-high #escape-combo-value {
    color: #ff0 !important;
    text-shadow: 0 0 15px #ff0, 0 0 30px #fa0, 3px 3px 0 #000 !important;
}
#escape-combo-panel.combo-max {
    border-color: #f00 !important;
    background: linear-gradient(180deg, rgba(255,50,50,0.4) 0%, rgba(200,0,0,0.5) 100%) !important;
    animation: escape-combo-glow 0.2s infinite alternate !important;
}
#escape-combo-panel.combo-max #escape-combo-value {
    color: #fff !important;
    text-shadow: 0 0 15px #f00, 0 0 30px #f00, 3px 3px 0 #000 !important;
    animation: comboShake 0.1s infinite;
}

/* INSUFFICIENT FUNDS FLOATING MSG */
.float-msg {
    position: fixed;
    top: 18%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(40, 0, 0, 0.92);
    color: #f44;
    padding: 15px 30px;
    border: 1px solid rgba(255,60,60,0.5);
    border-left: 3px solid #f44;
    font-weight: bold;
    font-size: 1.5rem;
    z-index: 20000;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(255,0,0,0.4);
    animation: fadeUp 1.0s forwards;
    text-align: center;
}
@keyframes fadeUp {
    0% { opacity: 1; transform: translate(-50%, 0%); }
    100% { opacity: 0; transform: translate(-50%, -80%); }
}

/* =========================================
   PUZZLE CONDENSATION FOG OVERLAY
   ========================================= */
#puzzle-fog-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 15;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(180,200,210,var(--fog-opacity,0.05)) 100%);
}

/* =========================================
   SHOOTER CORRIDOR LIGHT FLICKER
   ========================================= */
#corridor-flicker {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; opacity: 0; pointer-events: none; z-index: 19;
}

/* =========================================
   WEAPON SMOKE EFFECT
   ========================================= */
#weapon-smoke {
    position: absolute; bottom: 35%; right: 15%;
    width: 40px; height: 60px;
    pointer-events: none; z-index: 26;
    opacity: 0; transition: opacity 0.3s;
}
#weapon-smoke.active { opacity: 1; }
#weapon-smoke .smoke-wisp {
    position: absolute; width: 6px; height: 6px;
    background: rgba(200,200,200,0.4); border-radius: 50%;
    animation: smokeRise 1.5s ease-out infinite;
}
#weapon-smoke .smoke-wisp:nth-child(2) { left: 12px; animation-delay: 0.3s; }
#weapon-smoke .smoke-wisp:nth-child(3) { left: 6px; animation-delay: 0.6s; }
@keyframes smokeRise {
    0% { transform: translateY(0) scale(1); opacity: 0.5; }
    100% { transform: translateY(-50px) scale(2.5); opacity: 0; }
}
#weapon-container.left-handed ~ #weapon-smoke,
.left-handed-smoke {
    right: auto; left: 15%;
}

/* =========================================
   VIEWMODEL BREATHING SWAY
   ========================================= */
@keyframes weaponBreathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}
#current-weapon-view.breathing { animation: weaponBreathe 2.5s ease-in-out infinite; }
#current-weapon-view.breathing.shooting-anim { animation: weapon-recoil 0.2s ease-out; }

/* =========================================
   THORNE CLASSIFIED WATERMARK
   ========================================= */
.classified-watermark {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 4rem; font-weight: bold; letter-spacing: 8px;
    color: rgba(255, 60, 60, 0.08);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    pointer-events: none; z-index: 1;
    white-space: nowrap;
    user-select: none;
}

/* =========================================
   SHOP NEON FLICKER TITLE
   ========================================= */
@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { text-shadow: 0 0 7px currentColor, 0 0 15px currentColor, 0 0 30px currentColor; opacity: 1; }
    20%, 24%, 55% { text-shadow: none; opacity: 0.6; }
}
.shop-header h2 { animation: neonFlicker 3s infinite; }

/* =========================================
   SHOP SOLD OUT TAPE
   ========================================= */
.shop-card.disabled {
    opacity: 0.5; filter: grayscale(80%); pointer-events: none; cursor: default;
    position: relative; overflow: hidden;
}
.shop-card.disabled::after {
    content: 'SOLD OUT';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    background: repeating-linear-gradient(90deg, #000 0px, #000 8px, #fc0 8px, #fc0 16px);
    color: #000; font-weight: bold; font-size: 0.75rem; letter-spacing: 2px;
    padding: 3px 30px; white-space: nowrap;
    font-family: 'Courier New', monospace;
    border: 2px solid #000;
    z-index: 5;
    text-shadow: none;
}

/* =========================================
   PUZZLE OVERDRIVE VIBRATION
   ========================================= */
@keyframes overdriveShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px) translateY(1px); }
    30% { transform: translateX(2px) translateY(-1px); }
    50% { transform: translateX(-1px) translateY(1px); }
    70% { transform: translateX(1px) translateY(-1px); }
    90% { transform: translateX(-2px); }
}
#puzzle-module.overdrive-shake { animation: overdriveShake 0.15s linear infinite; }

/* =========================================
   PUZZLE LIGHT REFLECTION SWEEP
   ========================================= */
#puzzle-light-sweep {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 16; overflow: hidden;
}
#puzzle-light-sweep::after {
    content: '';
    position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.04) 45%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 55%, transparent 60%);
    animation: lightSweep var(--sweep-duration, 18s) linear infinite;
}
@keyframes lightSweep {
    0% { left: -100%; }
    90%, 100% { left: 200%; }
}

/* =========================================
   SHOOTER DYNAMIC VIGNETTE
   ========================================= */
#shooter-vignette {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 18;
    background: radial-gradient(ellipse at center, transparent 50%, #000 100%);
    opacity: 0;
    transition: opacity 0.5s;
}

/* =========================================
   SHOP PURCHASE ANIMATION
   ========================================= */
@keyframes purchaseStamp {
    0% { transform: scale(1); border-color: rgba(0,255,120,0.3); }
    30% { transform: scale(0.93); }
    60% { transform: scale(1.02); border-color: #0f8; box-shadow: 0 0 15px rgba(0,255,120,0.5); }
    100% { transform: scale(1); border-color: rgba(0,255,120,0.3); box-shadow: none; }
}
.shop-card.purchase-flash { animation: purchaseStamp 0.4s ease-out; }

/* =========================================
   MENU TITLE RGB GLITCH (Enhanced)
   ========================================= */
@keyframes titleRGBGlitch {
    0%, 89%, 100% { text-shadow: 0 0 10px rgba(0,255,120,0.6), 0 0 30px rgba(0,255,100,0.2); transform: none; }
    90% { text-shadow: 2px 0 #f00, -2px 0 #0ff, 0 0 10px rgba(0,255,120,0.6); transform: translateX(-1px); }
    91% { text-shadow: -2px 0 #f00, 2px 0 #0ff, 0 0 10px rgba(0,255,120,0.6); transform: translateX(2px); }
    92% { text-shadow: 1px 1px #f00, -1px -1px #0ff; transform: translateX(-1px) skewX(1deg); }
    93% { text-shadow: -1px 0 #f00, 1px 0 #0ff; transform: none; }
}

/* =========================================
   MATRIX RAIN CANVAS
   ========================================= */
#matrix-rain {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; opacity: 0.25;
}

/* =========================================
   MENU BUTTONS SEQUENTIAL LOAD
   ========================================= */
@keyframes btnLoad {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}
#main-menu-btns button, #main-menu-btns .opt-btn {
    opacity: 0;
    animation: btnLoad 0.3s ease-out forwards;
}

/* =========================================
   SCANLINE TRANSITION OVERLAY
   ========================================= */
#fade-transition.active::after {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px, transparent 2px,
        rgba(0,255,120,0.03) 2px, rgba(0,255,120,0.03) 4px
    );
    animation: scanSwipe 0.25s linear;
    pointer-events: none;
}
@keyframes scanSwipe {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

/* =========================================
   TYPING FLOAT MESSAGE
   ========================================= */
.float-msg { overflow: hidden; white-space: nowrap; }

/* =========================================
   TAP RIPPLE FEEDBACK
   ========================================= */
.tap-ripple {
    position: fixed;
    width: 10px; height: 10px;
    border: 1.5px solid rgba(0, 255, 120, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    animation: tapRippleExpand 200ms ease-out forwards;
    display: none;
}
@keyframes tapRippleExpand {
    0%   { width: 10px; height: 10px; opacity: 1; }
    100% { width: 30px; height: 30px; opacity: 0; }
}

/* =========================================
   TITLE GLITCH INTERFERENCE (clip-path)
   ========================================= */
.title-glitch-interference {
    animation: titleInterference 0.15s steps(2) forwards !important;
}
@keyframes titleInterference {
    0%   { clip-path: polygon(0 0, 100% 0, 100% 20%, 0 20%); transform: translateX(1px); }
    12%  { clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%); transform: translateX(-1px); }
    25%  { clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%); transform: translateX(1px); }
    37%  { clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%); transform: translateX(-1px); }
    50%  { clip-path: polygon(0 80%, 100% 80%, 100% 100%, 0 100%); transform: translateX(1px); }
    62%  { clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%); transform: translateX(-1px); }
    75%  { clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%); transform: translateX(1px); }
    100% { clip-path: none; transform: none; }
}

/* =========================================
   ODOMETER DIGIT SCROLL
   ========================================= */
.odometer-wrap {
    display: inline-flex;
    overflow: hidden;
    vertical-align: bottom;
}
.odometer-digit {
    display: inline-block;
    overflow: hidden;
    height: 1.1em;
    line-height: 1.1em;
    position: relative;
}
.odometer-digit-inner {
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.odometer-digit-inner span {
    display: block;
    height: 1.1em;
    line-height: 1.1em;
    text-align: center;
}

/* =========================================
   PUZZLE DISINTEGRATION EFFECT
   ========================================= */
/* =========================================
   PERK DURATION BADGE
   ========================================= */
.perk-duration {
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 0.6rem;
    font-family: 'Courier New', monospace;
    color: #fa0;
    border: 1px solid rgba(255, 170, 0, 0.4);
    border-radius: 4px;
    background: rgba(255, 170, 0, 0.1);
    letter-spacing: 1px;
}

/* =========================================
   COUNTDOWN MODIFIER TIMER
   ========================================= */
#countdown-timer {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    font-size: 3rem;
    color: #ff0;
    font-weight: bold;
    text-shadow: 0 0 15px #f50, 0 0 30px rgba(255,80,0,0.4);
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
}

/* =========================================
   WAVE REACTION OVERLAY
   ========================================= */
#wave-reaction {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.80);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
#reaction-text {
    max-width: 500px;
    text-align: center;
    color: rgba(0, 255, 120, 0.9);
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.6;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 120, 0.3);
    letter-spacing: 1px;
}

/* =========================================
   SENTINEL MESSAGE
   ========================================= */
#sentinel-msg {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(0, 5, 3, 0.9);
    border: 1px solid rgba(0, 255, 120, 0.3);
    border-left: 3px solid rgba(0, 255, 120, 0.5);
    padding: 8px 15px;
    max-width: 90%;
    font-size: 0.75rem;
    color: rgba(0, 255, 120, 0.7);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.5s;
}

/* =========================================
   SKIN: CRIMSON PROTOCOL
   Blood red theme - replaces ALL greens
   Primary: #c22  Accent: #f44  Dim: #811
   ========================================= */
body.skin-crimson {
    --main-color: #f44;
    --dim-color: rgba(50, 0, 0, 0.3);
    --bg-color: #0a0000;
    --danger-color: #ff0;
}
/* --- Screens & Backgrounds --- */
body.skin-crimson .screen { background-color: #0a0000; }
body.skin-crimson #screen-menu { background: radial-gradient(ellipse at center, #1a0000 0%, #0a0000 70%, #000 100%); }
body.skin-crimson #screen-menu::after { background: linear-gradient(180deg, rgba(30,0,0,0.4) 0%, rgba(0,0,0,0.6) 50%, rgba(20,0,0,0.5) 100%); }
/* --- Panels --- */
body.skin-crimson .menu-panel,
body.skin-crimson .shop-ui,
body.skin-crimson .status-panel {
    border-color: rgba(255, 68, 68, 0.4) !important;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.1), inset 0 0 25px rgba(0, 0, 0, 0.6);
    background: rgba(10, 0, 0, 0.95);
    animation: crimson-panel-glow 4s ease-in-out infinite;
}
@keyframes crimson-panel-glow {
    0%, 100% { border-color: rgba(255, 68, 68, 0.25); }
    50% { border-color: rgba(255, 68, 68, 0.45); }
}
/* --- Headings --- */
body.skin-crimson h1, body.skin-crimson h2, body.skin-crimson h3 {
    color: #f44 !important;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5) !important;
}
/* --- Buttons --- */
body.skin-crimson .opt-btn {
    border-color: rgba(255, 68, 68, 0.5) !important;
    color: #f44 !important;
}
body.skin-crimson .opt-btn:active { background: rgba(255, 68, 68, 0.2); }
body.skin-crimson #main-menu-btns button {
    border-left-color: rgba(180, 30, 30, 0.4) !important;
    color: rgba(255, 68, 68, 0.7) !important;
}
body.skin-crimson #main-menu-btns button:hover {
    border-left-color: #f44 !important;
    color: #f44 !important;
}
body.skin-crimson #main-menu-btns button:hover::before { color: #f44 !important; }
body.skin-crimson #main-menu-btns #start-btn {
    border-left-color: #f44 !important;
    color: #f44 !important;
}
body.skin-crimson #start-btn, body.skin-crimson #select-btn {
    border-left-color: #f44 !important;
    color: #f44 !important;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3) !important;
}
body.skin-crimson .restart-btn {
    color: #f44 !important;
    border-color: rgba(255, 68, 68, 0.3) !important;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3) !important;
}
body.skin-crimson #next-day-btn {
    border-left-color: #f44 !important;
    color: #f44 !important;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3) !important;
}
/* --- Intro & Blink --- */
body.skin-crimson .blink-text {
    color: #f44 !important;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5) !important;
}
body.skin-crimson #skip-intro-btn {
    border-color: rgba(255, 68, 68, 0.3) !important;
    color: rgba(255, 68, 68, 0.7) !important;
    background: rgba(10, 0, 0, 0.8) !important;
}
/* --- Title & Currency --- */
body.skin-crimson .title { color: #f44 !important; text-shadow: 0 0 15px rgba(255,0,0,0.5) !important; }
body.skin-crimson #global-currency { color: #f44 !important; text-shadow: 0 0 8px rgba(255,0,0,0.4) !important; }
body.skin-crimson .status-dot { background: #f44 !important; box-shadow: 0 0 4px #f44 !important; }
body.skin-crimson .menu-status-bar { color: rgba(255, 68, 68, 0.5) !important; }
/* --- Character Select --- */
body.skin-crimson .char-overlay h2 { color: #f44 !important; text-shadow: 0 0 15px rgba(255,0,0,0.5) !important; }
body.skin-crimson .char-overlay p { color: rgba(255, 68, 68, 0.7) !important; }
body.skin-crimson .nav-arrow { color: rgba(255, 68, 68, 0.4) !important; text-shadow: 0 0 10px rgba(255,0,0,0.3) !important; }
/* --- Shooter HUD --- */
body.skin-crimson #breach-info { color: #f44 !important; }
body.skin-crimson #ammo-counter { color: #f44 !important; text-shadow: 0 0 8px rgba(255,0,0,0.4), 2px 2px 0 #000 !important; }
body.skin-crimson #reload-btn {
    border-color: rgba(255, 68, 68, 0.4) !important;
    color: #f44 !important;
    text-shadow: 0 0 5px rgba(255,0,0,0.3) !important;
}
body.skin-crimson #reload-btn:hover { background: rgba(255,68,68,0.1) !important; border-color: #f44 !important; }
body.skin-crimson #combat-score { color: #f44 !important; }
body.skin-crimson .alert-msg { text-shadow: 0 0 15px rgba(255,0,0,0.5) !important; }
/* --- Puzzle / Game UI --- */
body.skin-crimson .header {
    color: #f44 !important;
    border-left-color: rgba(255, 68, 68, 0.4) !important;
    text-shadow: 0 0 5px rgba(255,0,0,0.4) !important;
}
body.skin-crimson .game-ui { background: rgba(10, 0, 0, 0.95) !important; }
body.skin-crimson .move-btn {
    color: #f44 !important;
    border-color: rgba(255, 68, 68, 0.3) !important;
}
body.skin-crimson .bar-fill {
    background-image: repeating-linear-gradient(to right, #c22 0px, #c22 4px, #000 4px, #000 5px) !important;
}
body.skin-crimson #synth-btn {
    color: #f44 !important;
    border-color: rgba(255, 68, 68, 0.3) !important;
    text-shadow: 0 0 5px rgba(255,0,0,0.4) !important;
}
body.skin-crimson #synth-btn.ready {
    background: rgba(255, 68, 68, 0.15) !important;
    color: #f44 !important;
    border-color: #f44 !important;
    box-shadow: 0 0 15px rgba(255,0,0,0.3) !important;
    animation: crimson-pulse 1s infinite !important;
}
@keyframes crimson-pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255,0,0,0.3); }
    50% { box-shadow: 0 0 25px rgba(255,0,0,0.5); }
}
body.skin-crimson .overdrive-btn {
    color: #f44 !important;
    border-color: rgba(255,68,68,0.3) !important;
}
/* --- Shop --- */
body.skin-crimson .shop-header { color: #f44 !important; border-bottom-color: rgba(255,68,68,0.2) !important; }
body.skin-crimson .shop-card {
    border-color: rgba(255, 68, 68, 0.3) !important;
    background: rgba(20, 0, 0, 0.6);
}
body.skin-crimson .shop-card:hover { border-left-color: #f44 !important; }
/* --- Story --- */
body.skin-crimson #day-title { color: #f44 !important; text-shadow: 0 0 10px rgba(255,0,0,0.5) !important; }
body.skin-crimson .story-content { border-color: rgba(255,68,68,0.2) !important; }
/* --- Player Name Input --- */
body.skin-crimson #player-name, body.skin-crimson #player-name-fail {
    color: #f44 !important;
    border-color: rgba(255, 68, 68, 0.3) !important;
    text-shadow: 0 0 5px rgba(255,0,0,0.3) !important;
}
/* --- Score/Stats --- */
body.skin-crimson .stat-val { color: #f44 !important; }
body.skin-crimson #ar-label { color: #f44 !important; }
body.skin-crimson .throw-btn { color: #f44 !important; border-color: rgba(255,68,68,0.3) !important; }
/* --- Infection Puzzle --- */
body.skin-crimson .inf-nucleus { background: #f44 !important; box-shadow: 0 0 8px rgba(255,68,68,0.8) !important; }
body.skin-crimson .inf-end { background: radial-gradient(circle, #ff4444, #aa0000) !important; box-shadow: 0 0 15px #f44 !important; }
/* --- Sentinel & Reactions --- */
body.skin-crimson #sentinel-msg {
    border-color: rgba(255, 68, 68, 0.3) !important;
    border-left-color: rgba(255, 68, 68, 0.5) !important;
    color: rgba(255, 68, 68, 0.7) !important;
}
body.skin-crimson #reaction-text { color: rgba(255, 100, 100, 0.9) !important; text-shadow: 0 0 10px rgba(255,0,0,0.3) !important; }
/* --- Escape Run HUD (inline style overrides) --- */
body.skin-crimson #btn-escape-pause {
    color: #f44 !important;
    border-color: rgba(255, 68, 68, 0.4) !important;
    background: rgba(10, 0, 0, 0.8) !important;
}
body.skin-crimson #escape-pause-overlay h1 { color: #f44 !important; text-shadow: 0 0 15px rgba(255,0,0,0.5) !important; }
body.skin-crimson #escape-score-panel {
    background: rgba(10, 0, 0, 0.92) !important;
    border-color: rgba(255, 68, 68, 0.25) !important;
    border-left-color: rgba(255, 68, 68, 0.5) !important;
}
body.skin-crimson #escape-score-value {
    color: #f44 !important;
    text-shadow: 0 0 10px rgba(255,0,0,0.5), 0 0 20px rgba(255,0,0,0.3) !important;
}
body.skin-crimson #escape-score-panel > div:last-child { color: rgba(255,68,68,0.4) !important; }
/* --- Leaderboard & High Scores --- */
body.skin-crimson .hs-entry { border-color: rgba(255,68,68,0.15) !important; }
/* --- Perk Cards --- */
body.skin-crimson .perk-card { border-color: rgba(255,68,68,0.3) !important; background: rgba(10,0,0,0.9) !important; }
body.skin-crimson .perk-title { color: #f44 !important; }
body.skin-crimson .perk-desc { color: rgba(255,150,150,0.8) !important; }
body.skin-crimson .perk-duration { background: rgba(180,30,30,0.3) !important; color: #f44 !important; border-color: rgba(255,68,68,0.3) !important; }
/* --- Countdown Timer --- */
body.skin-crimson #countdown-timer { color: #f44 !important; text-shadow: 0 0 15px rgba(255,0,0,0.6) !important; }
/* --- Dev Mode --- */
body.skin-crimson #dev-mode-toggle.active { border-color: #f44 !important; color: #f44 !important; }
/* --- Bitten Overlay --- */
body.skin-crimson #bitten-overlay h1 { color: #f44 !important; }
/* --- Wave Reaction --- */
body.skin-crimson #wave-reaction { background: rgba(10,0,0,0.85) !important; }
/* --- Lang Buttons --- */
body.skin-crimson .lang-btn { color: rgba(255,68,68,0.6) !important; border-color: rgba(255,68,68,0.2) !important; }
/* --- Menu Scanlines tint --- */
body.skin-crimson .menu-scanlines { background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,0,0,0.015) 2px, rgba(255,0,0,0.015) 4px) !important; }

/* =========================================
   SKIN: LEGACY OS (Digital Corruption)
   Muted brownish-green "demacrado" theme
   Primary: #9b8a45  Accent: #b8a455  Dim: #6b5e30
   ========================================= */
body.skin-digital {
    --main-color: #9b8a45;
    --dim-color: rgba(60, 50, 20, 0.3);
    --bg-color: #0a0800;
}
/* --- Screens --- */
body.skin-digital .screen { background-color: #0a0800; }
body.skin-digital #screen-menu { background: radial-gradient(ellipse at center, #12100a 0%, #0a0800 70%, #000 100%); }
body.skin-digital #screen-menu::after { background: linear-gradient(180deg, rgba(20,18,5,0.4) 0%, rgba(0,0,0,0.6) 50%, rgba(15,12,5,0.5) 100%); }
/* --- Panels --- */
body.skin-digital .menu-panel,
body.skin-digital .shop-ui,
body.skin-digital .status-panel {
    animation: digital-panel-shake 4s infinite;
    border-color: rgba(155, 138, 69, 0.4) !important;
    box-shadow: 0 0 12px rgba(155, 138, 69, 0.08), inset 0 0 20px rgba(0, 0, 0, 0.5);
    background: rgba(10, 8, 0, 0.95);
}
body.skin-digital h1, body.skin-digital h2, body.skin-digital h3, body.skin-digital .perk-title {
    color: #b8a455 !important;
    text-shadow: 0 0 8px rgba(155, 138, 69, 0.4) !important;
    animation: digital-text-glitch 3s infinite;
}
@keyframes digital-panel-shake {
    0%, 96% { transform: translate(0); }
    96.5% { transform: translate(-2px, 1px); }
    97% { transform: translate(3px, -1px); }
    97.5% { transform: translate(-1px, 2px); }
    98% { transform: translate(0); }
    100% { transform: translate(0); }
}
@keyframes digital-text-glitch {
    0%, 93% { text-shadow: 0 0 8px rgba(155, 138, 69, 0.4); transform: none; }
    93.5% { text-shadow: -3px 0 #a08040, 3px 0 #706030; transform: skewX(-2deg); }
    94% { text-shadow: 3px 0 #a08040, -3px 0 #706030; transform: skewX(1deg); }
    94.5% { text-shadow: 0 0 8px rgba(155, 138, 69, 0.4); transform: none; }
    100% { text-shadow: 0 0 8px rgba(155, 138, 69, 0.4); transform: none; }
}
body.skin-digital::after {
    content: '';
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(155, 138, 69, 0.025) 2px,
        rgba(155, 138, 69, 0.025) 4px
    );
    pointer-events: none;
    z-index: 9999;
    animation: digital-static 0.15s infinite;
}
@keyframes digital-static {
    0% { opacity: 0.6; }
    50% { opacity: 0.4; }
    100% { opacity: 0.6; }
}
/* --- Buttons --- */
body.skin-digital .opt-btn {
    border-color: rgba(155, 138, 69, 0.4) !important;
    color: #9b8a45 !important;
}
body.skin-digital .opt-btn:active { background: rgba(155, 138, 69, 0.15); }
body.skin-digital #main-menu-btns button {
    border-left-color: rgba(107, 94, 48, 0.4) !important;
    color: rgba(155, 138, 69, 0.7) !important;
}
body.skin-digital #main-menu-btns button:hover { border-left-color: #b8a455 !important; color: #b8a455 !important; }
body.skin-digital #main-menu-btns button:hover::before { color: #b8a455 !important; }
body.skin-digital #main-menu-btns #start-btn { border-left-color: #9b8a45 !important; color: #9b8a45 !important; }
body.skin-digital #start-btn, body.skin-digital #select-btn {
    border-left-color: #9b8a45 !important; color: #9b8a45 !important;
    text-shadow: 0 0 5px rgba(155, 138, 69, 0.3) !important;
}
body.skin-digital .restart-btn { color: #9b8a45 !important; border-color: rgba(155, 138, 69, 0.3) !important; }
body.skin-digital #next-day-btn { border-left-color: #9b8a45 !important; color: #9b8a45 !important; }
/* --- Intro & Title --- */
body.skin-digital .blink-text { color: #9b8a45 !important; text-shadow: 0 0 10px rgba(155, 138, 69, 0.5) !important; }
body.skin-digital #skip-intro-btn { border-color: rgba(155, 138, 69, 0.3) !important; color: rgba(155, 138, 69, 0.7) !important; background: rgba(10,8,0,0.8) !important; }
body.skin-digital .title { color: #b8a455 !important; }
body.skin-digital #global-currency { color: #9b8a45 !important; text-shadow: 0 0 8px rgba(155,138,69,0.4) !important; }
body.skin-digital .status-dot { background: #9b8a45 !important; box-shadow: 0 0 4px #9b8a45 !important; }
body.skin-digital .menu-status-bar { color: rgba(155, 138, 69, 0.5) !important; }
/* --- Character Select --- */
body.skin-digital .char-overlay h2 { color: #b8a455 !important; text-shadow: 0 0 15px rgba(155,138,69,0.5) !important; }
body.skin-digital .char-overlay p { color: rgba(155, 138, 69, 0.7) !important; }
body.skin-digital .nav-arrow { color: rgba(155, 138, 69, 0.4) !important; }
/* --- Shooter HUD --- */
body.skin-digital #breach-info { color: #9b8a45 !important; }
body.skin-digital #ammo-counter { color: #9b8a45 !important; text-shadow: 0 0 8px rgba(155,138,69,0.4), 2px 2px 0 #000 !important; }
body.skin-digital #reload-btn { border-color: rgba(155, 138, 69, 0.4) !important; color: #9b8a45 !important; }
body.skin-digital #combat-score { color: #9b8a45 !important; }
/* --- Puzzle / Game UI --- */
body.skin-digital .header { color: #9b8a45 !important; border-left-color: rgba(155,138,69,0.4) !important; text-shadow: 0 0 5px rgba(155,138,69,0.4) !important; }
body.skin-digital .game-ui { background: rgba(10, 8, 0, 0.95) !important; }
body.skin-digital .move-btn { color: #9b8a45 !important; border-color: rgba(155,138,69,0.3) !important; }
body.skin-digital .bar-fill { background-image: repeating-linear-gradient(to right, #9b8a45 0px, #9b8a45 4px, #000 4px, #000 5px) !important; }
body.skin-digital #synth-btn { color: #9b8a45 !important; border-color: rgba(155,138,69,0.3) !important; }
body.skin-digital #synth-btn.ready { background: rgba(155,138,69,0.15) !important; color: #b8a455 !important; border-color: #9b8a45 !important; box-shadow: 0 0 15px rgba(155,138,69,0.3) !important; }
body.skin-digital .overdrive-btn { color: #9b8a45 !important; border-color: rgba(155,138,69,0.3) !important; }
/* --- Shop --- */
body.skin-digital .shop-header { color: #9b8a45 !important; border-bottom-color: rgba(155,138,69,0.2) !important; }
body.skin-digital .shop-card { border-color: rgba(155,138,69,0.3) !important; background: rgba(15,12,0,0.6); }
body.skin-digital .shop-card:hover { border-left-color: #b8a455 !important; }
/* --- Story --- */
body.skin-digital #day-title { color: #b8a455 !important; text-shadow: 0 0 10px rgba(155,138,69,0.5) !important; }
/* --- Player Input --- */
body.skin-digital #player-name, body.skin-digital #player-name-fail { color: #9b8a45 !important; border-color: rgba(155,138,69,0.3) !important; }
/* --- Stats --- */
body.skin-digital .stat-val { color: #9b8a45 !important; }
body.skin-digital #ar-label { color: #9b8a45 !important; }
body.skin-digital .throw-btn { color: #9b8a45 !important; border-color: rgba(155,138,69,0.3) !important; }
/* --- Infection Puzzle --- */
body.skin-digital .inf-nucleus { background: #9b8a45 !important; box-shadow: 0 0 8px rgba(155,138,69,0.8) !important; }
body.skin-digital .inf-end { background: radial-gradient(circle, #b8a455, #6b5e30) !important; box-shadow: 0 0 15px #9b8a45 !important; }
/* --- Sentinel & Reactions --- */
body.skin-digital #sentinel-msg { border-color: rgba(155,138,69,0.3) !important; border-left-color: rgba(155,138,69,0.5) !important; color: rgba(155,138,69,0.7) !important; }
body.skin-digital #reaction-text { color: rgba(180, 160, 80, 0.9) !important; text-shadow: 0 0 10px rgba(155,138,69,0.3) !important; }
/* --- Escape Run HUD --- */
body.skin-digital #btn-escape-pause { color: #9b8a45 !important; border-color: rgba(155,138,69,0.4) !important; background: rgba(10,8,0,0.8) !important; }
body.skin-digital #escape-pause-overlay h1 { color: #9b8a45 !important; text-shadow: 0 0 15px rgba(155,138,69,0.5) !important; }
body.skin-digital #escape-score-panel { background: rgba(10,8,0,0.92) !important; border-color: rgba(155,138,69,0.25) !important; border-left-color: rgba(155,138,69,0.5) !important; }
body.skin-digital #escape-score-value { color: #9b8a45 !important; text-shadow: 0 0 10px rgba(155,138,69,0.5) !important; }
body.skin-digital #escape-score-panel > div:last-child { color: rgba(155,138,69,0.4) !important; }
/* --- Perks --- */
body.skin-digital .perk-card { border-color: rgba(155,138,69,0.3) !important; background: rgba(10,8,0,0.9) !important; }
body.skin-digital .perk-desc { color: rgba(180,160,80,0.8) !important; }
body.skin-digital .perk-duration { background: rgba(107,94,48,0.3) !important; color: #9b8a45 !important; border-color: rgba(155,138,69,0.3) !important; }
/* --- Countdown & Dev --- */
body.skin-digital #countdown-timer { color: #b8a455 !important; text-shadow: 0 0 15px rgba(155,138,69,0.6) !important; }
body.skin-digital #dev-mode-toggle.active { border-color: #9b8a45 !important; color: #9b8a45 !important; }
/* --- Lang Buttons --- */
body.skin-digital .lang-btn { color: rgba(155,138,69,0.6) !important; border-color: rgba(155,138,69,0.2) !important; }
/* --- Menu scanlines --- */
body.skin-digital .menu-scanlines { background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(155,138,69,0.015) 2px, rgba(155,138,69,0.015) 4px) !important; }

/* =========================================
   SKIN: WHITEOUT
   Full black & white inversion, high contrast
   Primary: #111  Accent: #444  BG: #f0f0f0
   ========================================= */
body.skin-whiteout {
    --main-color: #222;
    --dim-color: rgba(200, 200, 200, 0.3);
    --bg-color: #f0f0f0;
    --danger-color: #c00;
}
/* --- Screens & Backgrounds --- */
body.skin-whiteout .screen { background: #f0f0f0; color: #222; }
body.skin-whiteout #screen-menu { background: radial-gradient(ellipse at center, #fff 0%, #e8e8e8 70%, #ddd 100%); }
body.skin-whiteout #screen-menu::before { filter: blur(4px) brightness(0.35) grayscale(1) !important; }
body.skin-whiteout #screen-menu::after { background: linear-gradient(180deg, rgba(220,220,220,0.4) 0%, rgba(200,200,200,0.5) 50%, rgba(210,210,210,0.4) 100%); }
/* --- Panels --- */
body.skin-whiteout .menu-panel,
body.skin-whiteout .shop-ui,
body.skin-whiteout .status-panel {
    background: rgba(240, 240, 240, 0.95);
    border-color: #999 !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05), inset 0 0 25px rgba(200, 200, 200, 0.3);
}
/* --- Headings --- */
body.skin-whiteout h1, body.skin-whiteout h2, body.skin-whiteout h3 {
    color: #111 !important;
    text-shadow: none !important;
}
/* --- Buttons --- */
body.skin-whiteout .opt-btn {
    border-color: #999 !important;
    color: #333 !important;
    background: rgba(255, 255, 255, 0.8);
}
body.skin-whiteout .opt-btn:active { background: rgba(0, 0, 0, 0.1); }
body.skin-whiteout #main-menu-btns button {
    border-left-color: #bbb !important;
    color: #444 !important;
    background: rgba(255,255,255,0.5) !important;
}
body.skin-whiteout #main-menu-btns button:hover {
    border-left-color: #333 !important;
    color: #111 !important;
    background: rgba(0,0,0,0.05) !important;
}
body.skin-whiteout #main-menu-btns button:hover::before { color: #333 !important; }
body.skin-whiteout #main-menu-btns #start-btn {
    border-left-color: #333 !important;
    color: #111 !important;
}
body.skin-whiteout #start-btn, body.skin-whiteout #select-btn {
    border-left-color: #333 !important;
    color: #111 !important;
    text-shadow: none !important;
}
body.skin-whiteout .restart-btn {
    color: #333 !important;
    border-color: #999 !important;
    text-shadow: none !important;
    background: rgba(255,255,255,0.8) !important;
}
body.skin-whiteout #next-day-btn {
    border-left-color: #333 !important;
    color: #111 !important;
    text-shadow: none !important;
}
/* --- Intro & Blink --- */
body.skin-whiteout .blink-text {
    color: #222 !important;
    text-shadow: none !important;
}
body.skin-whiteout #skip-intro-btn {
    border-color: #999 !important;
    color: #444 !important;
    background: rgba(240,240,240,0.9) !important;
}
/* --- Title & Currency --- */
body.skin-whiteout .title { color: #111 !important; text-shadow: none !important; }
body.skin-whiteout #global-currency { color: #333 !important; text-shadow: none !important; }
body.skin-whiteout .status-dot { background: #333 !important; box-shadow: 0 0 4px rgba(0,0,0,0.3) !important; }
body.skin-whiteout .menu-status-bar { color: #888 !important; }
/* --- Character Select --- */
body.skin-whiteout .char-overlay h2 { color: #111 !important; text-shadow: none !important; }
body.skin-whiteout .char-overlay p { color: #555 !important; }
body.skin-whiteout .nav-arrow { color: #999 !important; text-shadow: none !important; }
body.skin-whiteout .char-overlay { background: linear-gradient(to top, rgba(240,240,240,0.95) 0%, rgba(240,240,240,0.7) 60%, transparent 100%) !important; }
/* --- Shooter HUD --- */
body.skin-whiteout #breach-info { color: #333 !important; border-color: rgba(0,0,0,0.3) !important; }
body.skin-whiteout #ammo-counter { color: #222 !important; text-shadow: 1px 1px 0 rgba(255,255,255,0.8) !important; }
body.skin-whiteout #reload-btn {
    border-color: #999 !important;
    color: #333 !important;
    text-shadow: none !important;
    background: rgba(240,240,240,0.8) !important;
}
body.skin-whiteout #reload-btn:hover { background: rgba(0,0,0,0.1) !important; border-color: #666 !important; }
body.skin-whiteout #combat-score { color: #222 !important; }
body.skin-whiteout .alert-msg { color: #111 !important; text-shadow: 1px 1px 0 rgba(255,255,255,0.5) !important; }
/* --- Puzzle / Game UI --- */
body.skin-whiteout .header {
    color: #222 !important;
    border-left-color: #999 !important;
    text-shadow: none !important;
    background: rgba(240,240,240,0.8) !important;
}
body.skin-whiteout .game-ui { background: rgba(240, 240, 240, 0.95) !important; border-color: #ccc !important; }
body.skin-whiteout .move-btn {
    color: #333 !important;
    border-color: #999 !important;
    background: rgba(255,255,255,0.8) !important;
}
body.skin-whiteout .bar-fill {
    background-image: repeating-linear-gradient(to right, #333 0px, #333 4px, #ddd 4px, #ddd 5px) !important;
}
body.skin-whiteout .bar-bg { background: #ddd !important; border-color: #aaa !important; }
body.skin-whiteout #synth-btn {
    color: #333 !important;
    border-color: #999 !important;
    text-shadow: none !important;
    background: rgba(255,255,255,0.8) !important;
}
body.skin-whiteout #synth-btn.ready {
    background: #111 !important;
    color: #fff !important;
    border-color: #000 !important;
    box-shadow: 0 0 12px rgba(0,0,0,0.4) !important;
    text-shadow: 0 0 5px rgba(255,255,255,0.5) !important;
    animation: whiteout-pulse 1s infinite !important;
}
@keyframes whiteout-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 0 20px rgba(0,0,0,0.2); }
}
body.skin-whiteout .overdrive-btn { color: #333 !important; border-color: #999 !important; background: rgba(255,255,255,0.8) !important; }
/* --- Shop --- */
body.skin-whiteout .shop-header { color: #222 !important; border-bottom-color: #ccc !important; }
body.skin-whiteout .shop-card {
    border-color: #bbb !important;
    background: rgba(255, 255, 255, 0.8);
    color: #222;
}
body.skin-whiteout .shop-card .icon { filter: grayscale(0.5); }
body.skin-whiteout .shop-card:hover { border-left-color: #444 !important; }
/* --- Story --- */
body.skin-whiteout #day-title { color: #111 !important; text-shadow: none !important; }
body.skin-whiteout .story-content { color: #333 !important; background: rgba(240,240,240,0.95) !important; border-color: #ccc !important; }
body.skin-whiteout .story-scroll { color: #444 !important; }
/* --- Player Name Input --- */
body.skin-whiteout #player-name, body.skin-whiteout #player-name-fail {
    color: #222 !important;
    border-color: #999 !important;
    text-shadow: none !important;
    background: rgba(255,255,255,0.9) !important;
}
/* --- Score/Stats --- */
body.skin-whiteout .stat-val { color: #222 !important; }
body.skin-whiteout #ar-label { color: #222 !important; }
body.skin-whiteout .throw-btn { color: #333 !important; border-color: #999 !important; background: rgba(255,255,255,0.8) !important; }
/* --- Infection Puzzle --- */
body.skin-whiteout .inf-nucleus { background: #333 !important; box-shadow: 0 0 8px rgba(0,0,0,0.5) !important; }
body.skin-whiteout .inf-end { background: radial-gradient(circle, #666, #333) !important; box-shadow: 0 0 15px rgba(0,0,0,0.4) !important; }
body.skin-whiteout .inf-cell { background: rgba(255,255,255,0.9) !important; border-color: #ccc !important; }
body.skin-whiteout .inf-cell.infected { background: #555 !important; }
body.skin-whiteout .inf-grid { border-color: #aaa !important; background: rgba(230,230,230,0.5) !important; }
body.skin-whiteout .inf-header { color: #222 !important; background: rgba(240,240,240,0.9) !important; border-color: #aaa !important; }
/* --- Sentinel & Reactions --- */
body.skin-whiteout #sentinel-msg {
    background: rgba(240, 240, 240, 0.9) !important;
    border-color: #aaa !important;
    border-left-color: #666 !important;
    color: #444 !important;
}
body.skin-whiteout #reaction-text { color: #222 !important; text-shadow: none !important; }
/* --- Escape Run HUD --- */
body.skin-whiteout #btn-escape-pause {
    color: #333 !important;
    border-color: #999 !important;
    background: rgba(240,240,240,0.9) !important;
}
body.skin-whiteout #escape-pause-overlay { background: rgba(240,240,240,0.9) !important; }
body.skin-whiteout #escape-pause-overlay h1 { color: #222 !important; text-shadow: none !important; }
body.skin-whiteout #escape-score-panel {
    background: rgba(240,240,240,0.92) !important;
    border-color: #999 !important;
    border-left-color: #555 !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.05) !important;
}
body.skin-whiteout #escape-score-value {
    color: #222 !important;
    text-shadow: none !important;
}
body.skin-whiteout #escape-score-panel > div:last-child { color: #999 !important; }
body.skin-whiteout #escape-combo-panel {
    background: rgba(230,230,230,0.9) !important;
    border-color: #999 !important;
    border-left-color: #555 !important;
}
/* --- Leaderboard --- */
body.skin-whiteout .hs-entry { border-color: #ddd !important; color: #333 !important; }
/* --- Perks --- */
body.skin-whiteout .perk-card { border-color: #bbb !important; background: rgba(245,245,245,0.95) !important; color: #222 !important; }
body.skin-whiteout .perk-title { color: #111 !important; }
body.skin-whiteout .perk-desc { color: #555 !important; }
body.skin-whiteout .perk-duration { background: rgba(0,0,0,0.05) !important; color: #444 !important; border-color: #bbb !important; }
/* --- Countdown --- */
body.skin-whiteout #countdown-timer { color: #222 !important; text-shadow: 0 0 10px rgba(0,0,0,0.2) !important; }
/* --- Dev Mode --- */
body.skin-whiteout #dev-mode-toggle { background: rgba(240,240,240,0.7) !important; border-color: #ccc !important; color: #999 !important; }
body.skin-whiteout #dev-mode-toggle.active { border-color: #333 !important; color: #333 !important; }
/* --- Bitten Overlay --- */
body.skin-whiteout #bitten-overlay { background: rgba(240,240,240,0.95) !important; }
body.skin-whiteout #bitten-overlay h1 { color: #c00 !important; background: rgba(255,255,255,0.9) !important; border-color: #c00 !important; }
/* --- Wave Reaction --- */
body.skin-whiteout #wave-reaction { background: rgba(240,240,240,0.85) !important; }
/* --- KIA (fail screen) --- */
body.skin-whiteout #screen-fail .menu-panel { border-color: #999 !important; box-shadow: 0 0 15px rgba(0,0,0,0.05) !important; }
body.skin-whiteout #fail-title { color: #c00 !important; text-shadow: none !important; }
body.skin-whiteout #btn-save-restart { border-color: #999 !important; color: #333 !important; border-left-color: #555 !important; }
/* --- Victory/Win --- */
body.skin-whiteout #screen-victory, body.skin-whiteout #screen-win { color: #222 !important; }
/* --- Lang Buttons --- */
body.skin-whiteout .lang-btn { color: #666 !important; border-color: #ccc !important; background: rgba(255,255,255,0.7) !important; }
/* --- Menu Scanlines --- */
body.skin-whiteout .menu-scanlines { background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.01) 2px, rgba(0,0,0,0.01) 4px) !important; }
/* --- Tubes puzzle --- */
body.skin-whiteout .tube-row { border-color: #ccc !important; }
body.skin-whiteout .lbl { color: #444 !important; }
