@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');
     
html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: #000; overflow: hidden; font-family: 'Bungee', cursive; touch-action: none; color: white; user-select: none; }
#game-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; overflow: hidden; }
#game-scale-container { position: absolute; top: 0; left: 0; width: 450px; height: 800px; transform-origin: top left; }

/* ФИКС КАНВАСА */
canvas { display: block; width: 450px; height: 800px; position: absolute; top: 0; left: 0; z-index: 1; }

#ui { position: absolute; top: 10px; left: 0; right: 0; pointer-events: none; z-index: 10; display: flex; justify-content: space-between; padding: 0 20px; box-sizing: border-box; }
#livesContainer { display: flex; gap: 2px; align-items: center; filter: drop-shadow(0 0 5px #f00); width: 90px; }
.life-icon { width: 20px; height: 20px; object-fit: contain; }
#scoreDisplay { font-size: 32px; color: #0f8; text-shadow: 0 0 10px #0f8; position: absolute; left: 50%; transform: translateX(-50%); width: 120px; text-align: center; }
#timerDisplay { font-size: 20px; color: #ff0; text-shadow: 0 0 10px #ff0; text-align: right; width: 90px; }

/* === ХАТА СОЛЯНА (HUB) === */
#hub-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #111; overflow: hidden; z-index: 10; }
.hub-layer { position: absolute; top: -10%; left: -10%; width: 120%; height: 120%; display: block; background-size: cover; background-position: center; pointer-events: none; }
#hub-ui-top { position: absolute; top: 15px; right: 20px; z-index: 20; color: #0ff; font-family: 'Bungee'; font-size: 18px; text-shadow: 0 0 10px #0ff; text-align: right; }

.hub-interactable { 
    position: absolute; display: flex; justify-content: center; align-items: center; text-align: center; 
    font-family: 'Bungee'; color: #fff; font-size: 14px; text-shadow: 0 2px 5px #000;
    border: 2px dashed rgba(255,255,255,0.5); background: rgba(0,0,0,0.4); 
    border-radius: 12px; cursor: pointer; pointer-events: auto; backdrop-filter: blur(2px);
    transition: transform 0.1s, border-color 0.2s;
}
.hub-interactable:active { transform: scale(0.95); background: rgba(0,0,0,0.7); }
.hub-interactable:hover { border-color: #0f8; color: #0f8; }

#hub-window { width: 140px; height: 220px; left: 10%; top: 25%; background: rgba(30, 40, 60, 0.6); pointer-events: none; }
#hub-door { width: 110px; height: 260px; left: 55%; top: 25%; border-color: #f2a65a; }
#hub-wardrobe { width: 120px; height: 280px; left: 75%; top: 20%; }
#hub-tv { width: 130px; height: 90px; left: 25%; top: 50%; border-color: #ff4757; }
#hub-radio { width: 80px; height: 50px; left: 45%; top: 55%; }
#hub-laptop { width: 100px; height: 70px; right: 35%; top: 60%; }
#hub-phone { width: 80px; height: 140px; right: 15%; bottom: 15%; border-color: #0ff; background: rgba(0, 255, 255, 0.1); font-size: 11px; }
#hub-legs { position: absolute; bottom: -5%; left: 35%; width: 180px; height: 150px; background: rgba(200, 100, 100, 0.3); border-radius: 50% 50% 0 0; display: flex; justify-content: center; align-items: center; color: #fff; font-family: 'Bungee'; pointer-events: none; }

/* === НОВЫЙ БРОНЕБОЙНЫЙ ВЫБОР ПЕРСОНАЖА === */
#sj-char-select { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(14, 22, 33, 0.98); display: none; flex-direction: column; 
    justify-content: center; align-items: center; z-index: 150; backdrop-filter: blur(10px); 
}
.sj-title { color: #fff; font-size: 28px; margin-bottom: 30px; text-shadow: 0 4px 10px rgba(0,0,0,0.8); }
.sj-cards-container { 
    display: flex; gap: 15px; width: 90%; justify-content: center; align-items: stretch;
}
.sj-card { 
    background: #17212b; border: 2px solid #303b4a; border-radius: 16px; 
    padding: 15px; text-align: center; cursor: pointer; flex: 1; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); transition: 0.1s;
    display: flex; flex-direction: column; align-items: center;
}
.sj-card:active { transform: scale(0.95); background: #1e293b; }
.sj-img-wrapper {
    width: 80px; height: 80px; display: flex; justify-content: center; align-items: center;
    margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;
}
.sj-img-wrapper img {
    max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
}
.sj-card h3 { margin: 0 0 5px 0; font-size: 14px; color: #0f8; }
.sj-card p { margin: 0; font-size: 10px; color: #aaa; font-family: Arial, sans-serif; line-height: 1.3; }
.sj-back-btn { 
    margin-top: 30px; padding: 15px 40px; background: transparent; border: 2px solid #5288c1; 
    color: #5288c1; font-family: 'Bungee'; border-radius: 12px; font-size: 16px; cursor: pointer;
}
.sj-back-btn:active { background: rgba(82, 136, 193, 0.2); }

/* === ДАШБОРД СМЕРТИ === */
#game-over-screen { 
    display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(10, 15, 24, 0.85); z-index: 150; flex-direction: column; 
    justify-content: center; align-items: center; backdrop-filter: blur(10px); 
}
.go-content {
    background: linear-gradient(145deg, #17212b, #0e1621); border: 2px solid #242f3d;
    border-radius: 24px; padding: 30px 20px; width: 85%; max-width: 350px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 2px 10px rgba(255,255,255,0.05);
    display: flex; flex-direction: column; align-items: center; box-sizing: border-box;
}
#go-title { color: #ff4757; font-size: 16px; font-family: 'Bungee'; letter-spacing: 3px; margin: 0 0 15px 0; opacity: 0.8; }
#go-text { color: #fff; font-size: 28px; line-height: 1.1; margin-bottom: 20px; text-transform: uppercase; text-shadow: 0 4px 15px rgba(255, 71, 87, 0.4); font-family: 'Bungee'; }
#go-score { font-size: 24px; color: #2ed573; margin-bottom: 25px; font-family: 'Bungee'; background: rgba(0,0,0,0.3); padding: 15px; border-radius: 16px; border: 1px solid #242f3d; width: 100%; box-sizing: border-box; }

.go-btn-main { 
    width: 100%; background: linear-gradient(180deg, #3742fa, #5352ed); padding: 18px; font-size: 18px; border-radius: 16px; color: white !important; border: none; font-family: 'Bungee'; text-transform: uppercase; box-shadow: 0 6px 0 #1e293b, 0 10px 20px rgba(0,0,0,0.4); transition: all 0.1s; cursor: pointer; margin-bottom: 20px; 
}
.go-btn-main:active { transform: translateY(6px); box-shadow: 0 0 0 #1e293b, 0 2px 5px rgba(0,0,0,0.4); }

.go-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.go-btn-sm { background: #242f3d; border: 1px solid #303b4a; padding: 12px 5px; border-radius: 12px; color: #fff; font-family: 'Bungee'; font-size: 12px; cursor: pointer; box-shadow: 0 4px 0 #17212b; transition: 0.1s; }
.go-btn-sm:active { transform: translateY(4px); box-shadow: 0 0 0 #17212b; }
.go-btn-gold { background: linear-gradient(180deg, #f2a65a, #d18238); box-shadow: 0 4px 0 #8e5826; border: none; }
.go-btn-gold:active { transform: translateY(4px); box-shadow: 0 0 0 #8e5826; }

#acid-status { position: absolute; bottom: 20%; width: 100%; text-align: center; color: #f0f; font-size: 20px; display: none; text-shadow: 0 0 10px #f0f; z-index: 20; pointer-events: none; }
#inv-text { color: red; font-size: 14px; display: block; margin-top: 5px; animation: blink 0.5s infinite; }
@keyframes blink { 50% { opacity: 0; } }