/* ===== GLOBAL RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: 'Segoe UI', Arial, sans-serif; }

/* ===== SCREENS ===== */
.screen { position: fixed; inset: 0; display: none; z-index: 10; }
.screen.active { display: flex; align-items: center; justify-content: center; }

/* Game screen is column layout, not centered */
#game-screen.active { flex-direction: column; align-items: stretch; justify-content: flex-start; }

/* ===== MAIN MENU ===== */
#main-menu { background: #0a0a0f; }
.menu-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 60%, rgba(30,80,180,0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 30%, rgba(200,30,30,0.18) 0%, transparent 50%),
        linear-gradient(180deg, #0a0a14 0%, #111120 50%, #0a0a0a 100%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}
@keyframes bgPulse { from { opacity: 0.85; } to { opacity: 1; } }

/* City silhouette painted via CSS */
.menu-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; height: 320px;
    background:
        /* Moon */
        radial-gradient(circle 60px at 78% 18%, #f5e87a 0%, #e2c84a 40%, transparent 70%),
        /* Building silhouettes */
        linear-gradient(to top, #07070e 0%, transparent 100%);
    pointer-events: none;
}

.menu-content { position: relative; z-index: 2; text-align: center; width: 460px; max-width: 95vw; }

.badge-icon { font-size: 64px; margin-bottom: 8px; filter: drop-shadow(0 0 20px #3a8eff); animation: badgePulse 3s ease-in-out infinite; }
@keyframes badgePulse { 0%,100%{filter:drop-shadow(0 0 16px #3a8eff);} 50%{filter:drop-shadow(0 0 36px #80c0ff);} }

.game-title {
    font-size: 72px; font-weight: 900; letter-spacing: 8px; line-height: 1;
    color: #fff;
    text-shadow: 0 0 30px #3a8eff, 0 0 60px #1a4aaa, 2px 2px 0 #000, -2px -2px 0 #000;
    font-family: 'Impact', 'Arial Black', sans-serif;
}
.game-subtitle { font-size: 15px; color: #7ab0ff; letter-spacing: 3px; margin: 6px 0 36px; text-transform: uppercase; }

.menu-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.menu-btn {
    width: 280px; padding: 14px 0; font-size: 18px; font-weight: 700;
    letter-spacing: 3px; text-transform: uppercase; cursor: pointer;
    background: rgba(30,50,110,0.7); color: #b0d0ff;
    border: 2px solid #3a6aee; border-radius: 4px;
    transition: all 0.15s; font-family: inherit;
}
.menu-btn:hover { background: rgba(60,100,200,0.85); color: #fff; border-color: #80b0ff; transform: translateY(-2px); box-shadow: 0 6px 24px rgba(60,120,255,0.35); }
.menu-btn.primary { background: rgba(30,80,200,0.9); color: #fff; border-color: #6090ff; font-size: 22px; }
.menu-btn.primary:hover { background: #2255cc; box-shadow: 0 8px 32px rgba(30,80,255,0.5); }
.menu-btn.danger { background: rgba(120,20,20,0.7); color: #ffaaaa; border-color: #aa3333; }
.menu-btn.danger:hover { background: rgba(180,40,40,0.9); color: #fff; border-color: #ff6060; }

.menu-footer { margin-top: 32px; color: #334466; font-size: 12px; letter-spacing: 2px; }

/* ===== MODAL / HOW TO PLAY / CREDITS ===== */
.modal-box {
    background: rgba(8,12,28,0.97); border: 2px solid #2a4aaa; border-radius: 8px;
    padding: 36px 40px; max-width: 640px; width: 95vw; max-height: 90vh; overflow-y: auto;
    color: #c8d8ff;
}
.modal-box h2 { font-size: 28px; letter-spacing: 6px; color: #80aaff; margin-bottom: 24px; text-align: center; font-family: 'Impact', sans-serif; }
.modal-box h3 { font-size: 14px; color: #6090ee; letter-spacing: 2px; margin-bottom: 8px; margin-top: 4px; }
.modal-box p { font-size: 14px; line-height: 1.7; margin-bottom: 6px; }
.modal-box b { color: #ffcc66; }

.instr-section { background: rgba(20,30,60,0.6); border-left: 3px solid #2a5aee; border-radius: 4px; padding: 12px 16px; margin-bottom: 14px; }
.modal-box hr { border: none; border-top: 1px solid #1a2a4a; margin: 12px 0; }
.credits-studio { font-size: 22px; color: #80aaff; font-weight: 700; letter-spacing: 3px; margin-bottom: 4px; }
.credits-name { font-size: 18px; color: #ffcc66; font-weight: 700; }
.credits-thanks { font-style: italic; color: #6090aa; margin-top: 8px; }
.credits-content { text-align: center; line-height: 2; }

/* ===== GAME SCREEN ===== */
#game-screen { display: none; flex-direction: column; background: #000; overflow: hidden; }
#game-screen.active { display: flex; }

/* HUD */
#hud {
    height: 52px; min-height: 52px;
    background: linear-gradient(90deg, #07091a 0%, #0d1128 50%, #07091a 100%);
    border-bottom: 2px solid #1a3a8a;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px; gap: 12px; z-index: 100;
}
.hud-left { display: flex; align-items: center; gap: 8px; }
.hud-badge { font-size: 24px; }
.hud-info { display: flex; flex-direction: column; }
.hud-info span { line-height: 1.3; }
#hud-name { color: #fff; font-weight: 700; font-size: 13px; }
#hud-rank { color: #6090cc; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }

.hud-center { display: flex; gap: 16px; align-items: center; }
.hud-stat { display: flex; flex-direction: column; gap: 2px; }
.hud-label { font-size: 9px; color: #5070a0; letter-spacing: 1px; text-transform: uppercase; }
.bar-bg { width: 120px; height: 10px; background: #0a1020; border: 1px solid #1a2a4a; border-radius: 3px; overflow: hidden; }
.bar { height: 100%; border-radius: 2px; transition: width 0.3s; }
.bar.green { background: linear-gradient(90deg, #1a8a3a, #40ff80); width: 100%; }
.bar.yellow { background: linear-gradient(90deg, #aa8800, #ffdd00); width: 100%; }
.bar.red { background: linear-gradient(90deg, #8a1a1a, #ff4040); }

.hud-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.hud-money { color: #80cc60; font-weight: 700; }
.hud-weapon { color: #ffcc88; }
.hud-score { color: #8ab0ff; }
.hud-conduct { color: #aaa; }
.hud-conduct .good { color: #60ee60; }
.hud-conduct .warning { color: #ffcc00; }
.hud-conduct .bad { color: #ff4444; }

/* CANVAS */
#game-canvas { flex: 1; display: block; cursor: crosshair; width: 100%; min-height: 0; }

/* ACTION BAR */
#action-bar {
    height: 44px; min-height: 44px;
    background: linear-gradient(90deg, #07091a 0%, #0d1128 50%, #07091a 100%);
    border-top: 2px solid #1a3a8a;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px; z-index: 100;
}
.action-btn {
    padding: 6px 16px; font-size: 12px; font-weight: 700; letter-spacing: 2px;
    cursor: pointer; background: rgba(20,40,100,0.8); color: #80a0ff;
    border: 1px solid #2a4aaa; border-radius: 3px; transition: all 0.15s; font-family: inherit;
}
.action-btn:hover { background: rgba(40,70,160,0.9); color: #fff; }
.action-btn.danger { background: rgba(80,15,15,0.8); color: #ff8888; border-color: #aa2222; }
.action-btn.danger:hover { background: rgba(140,30,30,0.9); color: #fff; }
.location-label { color: #5080aa; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; flex: 1; text-align: center; }

/* CONTEXT MENU */
.context-menu {
    position: absolute; background: rgba(5,10,25,0.97); border: 2px solid #2a5aee;
    border-radius: 6px; padding: 8px 0; min-width: 160px; z-index: 200;
    box-shadow: 0 8px 32px rgba(0,20,80,0.7);
}
.context-menu.hidden { display: none; }
.ctx-header { padding: 6px 16px 4px; color: #6090cc; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; border-bottom: 1px solid #1a2a4a; margin-bottom: 4px; }
.ctx-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; color: #c0d0ff; font-size: 14px; cursor: pointer;
    transition: background 0.1s;
}
.ctx-item:hover { background: rgba(40,70,160,0.5); color: #fff; }
.ctx-item.red { color: #ff8888; }
.ctx-item.red:hover { background: rgba(120,20,20,0.5); }
.ctx-item.green { color: #80ff80; }
.ctx-item .ctx-icon { font-size: 14px; width: 22px; min-width: 22px; text-align: center; display: flex; align-items: center; justify-content: center; }
.ctx-item .ctx-icon svg { display: block; }

/* DIALOG BOX */
.dialog-box {
    position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%);
    background: rgba(5,10,25,0.97); border: 2px solid #2a4a8a;
    border-radius: 8px; padding: 18px 24px; max-width: 560px; width: 92%;
    z-index: 200; color: #c8d8ff;
}
.dialog-box.hidden { display: none; }
.dialog-speaker { font-size: 12px; color: #6090cc; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.dialog-text { font-size: 15px; line-height: 1.6; margin-bottom: 14px; }
.dialog-choices { display: flex; flex-direction: column; gap: 6px; }
.dialog-choice {
    padding: 8px 14px; background: rgba(20,40,100,0.7); border: 1px solid #2a4aaa;
    border-radius: 4px; color: #90b0ff; cursor: pointer; font-size: 13px;
    transition: all 0.15s; font-family: inherit; text-align: left;
}
.dialog-choice:hover { background: rgba(40,80,180,0.8); color: #fff; }

/* PANELS (booking, shop, inventory, notebook) */
.panel {
    position: absolute; top: 56px; right: 0; bottom: 48px;
    width: 340px; background: rgba(5,10,25,0.98); border-left: 2px solid #2a4a8a;
    z-index: 200; display: flex; flex-direction: column; color: #c8d8ff; overflow: hidden;
}
.panel.hidden { display: none; }
.panel-header {
    padding: 14px 18px; background: rgba(10,20,50,0.9); border-bottom: 1px solid #1a2a4a;
    display: flex; justify-content: space-between; align-items: center;
}
.panel-title { font-size: 16px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: #80aaff; }
.panel-close { background: none; border: none; color: #5070a0; font-size: 20px; cursor: pointer; font-family: inherit; }
.panel-close:hover { color: #ff6060; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track { background: #0a0f20; }
.panel-body::-webkit-scrollbar-thumb { background: #2a4a8a; border-radius: 3px; }

/* Booking panel specifics */
.booking-suspect { background: rgba(20,30,60,0.7); border: 1px solid #2a4a8a; border-radius: 6px; padding: 12px; margin-bottom: 16px; }
.booking-suspect-name { font-size: 17px; font-weight: 700; color: #ffcc88; margin-bottom: 4px; }
.booking-suspect-desc { font-size: 12px; color: #6080a0; }
.charge-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.charge-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(10,20,50,0.6); border: 1px solid #1a2a4a; border-radius: 4px; cursor: pointer; transition: all 0.15s; }
.charge-item:hover { border-color: #3a6aee; }
.charge-item.selected { background: rgba(30,60,140,0.7); border-color: #4a80ff; }
.charge-item input[type=checkbox] { accent-color: #4a80ff; }
.charge-label { font-size: 13px; color: #b0c8ff; }
.charge-severity { font-size: 11px; color: #6080a0; margin-left: auto; }
.booking-evidence { background: rgba(30,20,5,0.6); border: 1px solid #5a4000; border-radius: 4px; padding: 10px; margin-bottom: 14px; }
.evidence-title { font-size: 11px; color: #aa8833; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.evidence-item { font-size: 13px; color: #ffcc88; margin-bottom: 3px; }
.book-btn { width: 100%; padding: 12px; font-size: 15px; font-weight: 700; letter-spacing: 2px; background: rgba(30,80,200,0.8); color: #fff; border: 2px solid #3a6aee; border-radius: 4px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.book-btn:hover { background: #2255cc; }

/* Shop panel specifics */
.shop-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: rgba(15,25,55,0.7); border: 1px solid #1a2a4a; border-radius: 6px; margin-bottom: 8px; }
.shop-item-icon { font-size: 28px; width: 40px; text-align: center; }
.shop-item-info { flex: 1; }
.shop-item-name { font-size: 14px; font-weight: 700; color: #e0e8ff; }
.shop-item-desc { font-size: 11px; color: #6080a0; margin-top: 2px; }
.shop-item-price { font-size: 14px; color: #80cc60; font-weight: 700; }
.shop-buy-btn { padding: 6px 14px; background: rgba(30,80,30,0.8); border: 1px solid #3a8a3a; border-radius: 3px; color: #80ff80; font-size: 12px; cursor: pointer; font-family: inherit; font-weight: 700; transition: all 0.15s; }
.shop-buy-btn:hover { background: rgba(40,120,40,0.9); color: #fff; }
.shop-buy-btn:disabled { opacity: 0.4; cursor: default; }

/* Inventory panel */
.inv-slot { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: rgba(10,20,45,0.6); border: 1px solid #1a2a4a; border-radius: 4px; margin-bottom: 6px; cursor: pointer; transition: all 0.15s; }
.inv-slot:hover { border-color: #3a6aee; background: rgba(20,40,90,0.7); }
.inv-slot.equipped { border-color: #4a80ff; background: rgba(20,50,120,0.7); }
.inv-icon { font-size: 22px; width: 30px; text-align: center; }
.inv-name { font-size: 13px; color: #c0d0ff; font-weight: 700; }
.inv-qty { font-size: 11px; color: #5070a0; margin-left: auto; }
.inv-equipped-tag { font-size: 10px; color: #4a80ff; letter-spacing: 1px; margin-left: 4px; }

/* Notebook */
.notebook-entry { padding: 10px 12px; border-left: 3px solid #2a4a8a; margin-bottom: 10px; background: rgba(10,20,45,0.5); border-radius: 0 4px 4px 0; }
.notebook-entry.arrest { border-left-color: #aa8800; }
.notebook-entry.wrongful { border-left-color: #cc2222; }
.nb-date { font-size: 10px; color: #4060a0; letter-spacing: 1px; }
.nb-text { font-size: 13px; color: #b0c0e0; margin-top: 3px; }

/* NOTIFICATION */
.notification {
    position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
    background: rgba(5,15,40,0.97); border: 2px solid #2a5aee;
    border-radius: 6px; padding: 10px 20px; font-size: 14px; color: #80aaff;
    z-index: 300; letter-spacing: 1px; text-align: center;
    transition: opacity 0.3s; pointer-events: none;
}
.notification.hidden { display: none; }
.notification.warn { border-color: #cc8800; color: #ffcc55; }
.notification.bad { border-color: #cc2222; color: #ff6666; }
.notification.good { border-color: #228822; color: #66ff88; }

/* SITUATION OVERLAY */
.situation-overlay {
    position: absolute; inset: 52px 0 44px 0;
    background: rgba(2,4,12,0.93);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 250; color: #c8d8ff;
}
.situation-overlay.hidden { display: none; }
.situation-title { font-size: 22px; font-weight: 700; color: #ff8844; letter-spacing: 3px; margin-bottom: 6px; text-transform: uppercase; }
.situation-location { font-size: 13px; color: #6090aa; letter-spacing: 2px; margin-bottom: 20px; }
.situation-description { max-width: 480px; text-align: center; font-size: 15px; line-height: 1.7; margin-bottom: 28px; color: #d0e0ff; }
.situation-choices { display: flex; flex-direction: column; gap: 10px; width: 420px; }
.situation-choice {
    padding: 12px 18px; background: rgba(15,30,80,0.8); border: 2px solid #2a4aaa;
    border-radius: 5px; color: #90b0ff; cursor: pointer; font-size: 14px;
    transition: all 0.15s; font-family: inherit; text-align: left;
}
.situation-choice:hover { background: rgba(30,60,140,0.9); border-color: #5080ff; color: #fff; }
.situation-choice.good { border-color: #228833; }
.situation-choice.good:hover { background: rgba(20,80,30,0.9); }
.situation-choice.bad { border-color: #883322; }
.situation-choice.bad:hover { background: rgba(80,20,10,0.9); }

/* GAME OVER OVERLAY */
.game-over-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 500; color: #c8d8ff; text-align: center;
}
.game-over-overlay.hidden { display: none; }
.go-title { font-size: 56px; font-weight: 900; font-family: 'Impact', sans-serif; letter-spacing: 8px; margin-bottom: 12px; }
.go-title.fired { color: #ff4444; text-shadow: 0 0 30px #aa0000; }
.go-title.jailed { color: #ffcc00; text-shadow: 0 0 30px #aa8800; }
.go-title.dead { color: #cc4444; text-shadow: 0 0 30px #880000; }
.go-subtitle { font-size: 18px; color: #7090b0; margin-bottom: 10px; }
.go-reason { font-size: 15px; color: #aaa; max-width: 400px; margin-bottom: 28px; line-height: 1.6; }
.go-stats { background: rgba(10,20,50,0.8); border: 1px solid #2a4a8a; border-radius: 6px; padding: 16px 28px; margin-bottom: 24px; min-width: 280px; }
.go-stat-row { display: flex; justify-content: space-between; font-size: 14px; color: #90b0d0; margin-bottom: 6px; }
.go-stat-val { color: #e0e8ff; font-weight: 700; }
.go-buttons { display: flex; gap: 14px; }

/* BLOOD SPLATTER canvas overlays - handled in JS */
.blood-overlay { position: absolute; pointer-events: none; z-index: 150; }

/* SCROLLBARS */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #050a18; }
::-webkit-scrollbar-thumb { background: #1a3a7a; border-radius: 4px; }

/* UTILITIES */
.hidden { display: none !important; }
.flex { display: flex; }
.center { text-align: center; }
