/* ============================================================
   GANGSTER OF SMALL TOWN — styles.css
   happystoner5420 Games | 1940s AAA Sandbox
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Oswald:wght@400;600;700&family=Roboto+Condensed:wght@300;400;700&display=swap');

:root {
  --gold: #c9a84c;
  --gold-light: #f0d080;
  --gold-dark: #8a6a1a;
  --red: #8b1a1a;
  --red-light: #c0392b;
  --dark: #0a0a0a;
  --dark2: #111111;
  --dark3: #1a1a1a;
  --dark4: #222222;
  --dark5: #2a2a2a;
  --panel-bg: rgba(10,8,5,0.97);
  --panel-border: #3a2a0a;
  --text-main: #e8d8a0;
  --text-dim: #8a7a50;
  --text-bright: #fff8e0;
  --green: #2a6a2a;
  --green-light: #4a9a4a;
  --blue: #1a3a6a;
  --blue-light: #3a7aaa;
  --heat-cool: #2a6a4a;
  --heat-warm: #8a6a1a;
  --heat-hot: #8a2a1a;
  --heat-critical: #aa1a1a;
  --font-title: 'Special Elite', cursive;
  --font-ui: 'Oswald', sans-serif;
  --font-body: 'Roboto Condensed', sans-serif;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--font-body);
  color: var(--text-main);
  user-select: none;
}

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

/* ===================== MAIN MENU ===================== */
#mainMenu { align-items: stretch; }

.menu-bg {
  flex: 1;
  position: relative;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(80,40,0,0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(60,0,0,0.3) 0%, transparent 50%),
    linear-gradient(160deg, #0a0603 0%, #120e06 40%, #0d0806 70%, #080506 100%);
  overflow: hidden;
}

.menu-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(120,80,0,0.03) 40px, rgba(120,80,0,0.03) 41px),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(120,80,0,0.03) 40px, rgba(120,80,0,0.03) 41px);
  pointer-events: none;
}

.menu-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

.menu-overlay {
  position: absolute; inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='400' height='600' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='600' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

.menu-content {
  position: relative; z-index: 2;
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
  gap: 50px;
}

.game-logo {
  text-align: center;
  filter: drop-shadow(0 0 40px rgba(180,120,0,0.4));
}

.logo-top {
  font-family: var(--font-title);
  font-size: clamp(18px, 3vw, 32px);
  color: var(--text-dim);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.logo-main {
  font-family: var(--font-title);
  font-size: clamp(48px, 9vw, 100px);
  color: var(--gold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 0.9;
  text-shadow:
    0 0 60px rgba(200,150,0,0.6),
    0 0 120px rgba(200,100,0,0.3),
    2px 2px 0 rgba(0,0,0,0.8);
  background: linear-gradient(180deg, #f0d080 0%, #c9a84c 40%, #8a6a1a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-family: var(--font-ui);
  font-size: clamp(12px, 2vw, 18px);
  color: var(--gold-dark);
  letter-spacing: 0.5em;
  margin-top: 10px;
}

.logo-studio {
  font-family: var(--font-body);
  font-size: 13px;
  color: #504030;
  letter-spacing: 0.3em;
  margin-top: 20px;
  text-transform: uppercase;
}

.menu-buttons {
  display: flex; flex-direction: column;
  gap: 12px; align-items: center;
  width: 100%; max-width: 360px;
}

.menu-btn {
  width: 100%; padding: 16px 32px;
  font-family: var(--font-ui);
  font-size: 18px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(40,25,5,0.95) 0%, rgba(25,15,3,0.98) 100%);
  border: 1px solid var(--gold-dark);
  border-top-color: var(--gold);
  cursor: pointer;
  transition: all 0.2s ease;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
}

.menu-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(200,150,0,0.08), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.menu-btn:hover::before { transform: translateX(100%); }

.menu-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(200,150,0,0.3), inset 0 0 20px rgba(200,100,0,0.05);
  transform: translateY(-1px);
}

.menu-btn:active { transform: translateY(1px); }

.menu-btn.primary {
  background: linear-gradient(135deg, rgba(80,40,5,0.98) 0%, rgba(60,25,3,0.99) 100%);
  border-color: var(--gold);
  font-size: 20px;
  box-shadow: 0 0 30px rgba(200,120,0,0.2);
}

.menu-btn.danger { color: #d06060; border-color: #601010; }
.menu-btn.danger:hover {
  color: #ff8080; border-color: #aa2020;
  box-shadow: 0 0 20px rgba(200,0,0,0.3);
}

.btn-icon { font-size: 20px; }

/* ===================== INFO SCREENS ===================== */
.info-screen, .credits-screen {
  flex: 1; display: flex; flex-direction: column;
  align-items: center;
  background: linear-gradient(160deg, #060402 0%, #0e0a05 50%, #060402 100%);
  padding: 40px 20px; gap: 30px; overflow-y: auto;
}

.screen-title {
  font-family: var(--font-title);
  font-size: clamp(32px, 5vw, 56px);
  color: var(--gold);
  letter-spacing: 0.2em;
  text-shadow: 0 0 30px rgba(200,150,0,0.4);
  border-bottom: 1px solid var(--gold-dark);
  padding-bottom: 16px;
  width: 100%; max-width: 1000px; text-align: center;
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; width: 100%; max-width: 1000px;
}

.how-card {
  background: rgba(20,12,3,0.95);
  border: 1px solid var(--panel-border);
  border-top: 2px solid var(--gold-dark);
  padding: 24px; border-radius: 2px;
  transition: border-color 0.2s;
}
.how-card:hover { border-top-color: var(--gold); }

.how-icon {
  width: 60px; height: 60px; margin-bottom: 16px;
  border-radius: 2px; overflow: hidden;
}

.how-card h3 {
  font-family: var(--font-ui);
  color: var(--gold); font-size: 15px;
  letter-spacing: 0.15em; margin-bottom: 10px;
}

.how-card p {
  font-family: var(--font-body);
  color: var(--text-dim); font-size: 14px; line-height: 1.6;
}

.how-card em { color: var(--gold-light); font-style: normal; font-weight: 700; }

.controls-section {
  width: 100%; max-width: 1000px;
}
.controls-section h2 {
  font-family: var(--font-title); color: var(--gold);
  font-size: 24px; margin-bottom: 16px; letter-spacing: 0.2em;
}

.controls-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.ctrl-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(20,12,3,0.8);
  border: 1px solid var(--panel-border);
  padding: 10px 14px; border-radius: 2px;
}

.key {
  background: linear-gradient(135deg, #2a1a05, #1a1005);
  border: 1px solid var(--gold-dark);
  color: var(--gold); font-family: var(--font-ui);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 8px; border-radius: 2px;
  white-space: nowrap;
}

.ctrl-desc { color: var(--text-dim); font-size: 13px; }

/* CREDITS */
.credits-content {
  text-align: center; display: flex;
  flex-direction: column; align-items: center;
  gap: 12px; max-width: 600px; width: 100%;
}
.credits-logo {
  font-family: var(--font-title); font-size: 28px; color: var(--gold);
  letter-spacing: 0.3em;
}
.credits-presents { font-family: var(--font-body); color: var(--text-dim); font-size: 13px; letter-spacing: 0.5em; }
.credits-game { font-family: var(--font-title); font-size: 36px; color: var(--gold-light); }
.credits-year { font-family: var(--font-ui); font-size: 14px; color: var(--text-dim); letter-spacing: 0.3em; }
.credits-divider { width: 60%; border: none; border-top: 1px solid var(--panel-border); margin: 16px 0; }
.credits-role { font-family: var(--font-ui); font-size: 13px; color: var(--text-dim); letter-spacing: 0.2em; margin-top: 10px; }
.credits-name { font-family: var(--font-title); font-size: 22px; color: var(--gold); }
.credits-special { font-family: var(--font-ui); font-size: 18px; color: var(--gold-dark); letter-spacing: 0.2em; margin-top: 12px; }
.credits-copyright { font-family: var(--font-body); font-size: 12px; color: #3a2a10; margin-top: 20px; }
.credits-note { font-family: var(--font-body); font-size: 11px; color: #2a1a08; }

/* ===================== GAME HUD ===================== */
#gameScreen { display: none; flex-direction: column; }
#gameScreen.active { display: flex; }

#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 56px; display: flex; align-items: center;
  background: linear-gradient(180deg, rgba(5,3,1,0.98) 0%, rgba(10,6,2,0.95) 100%);
  border-bottom: 1px solid var(--gold-dark);
  box-shadow: 0 2px 20px rgba(0,0,0,0.8);
  padding: 0 12px; gap: 12px;
}

.hud-left { display: flex; gap: 16px; align-items: center; }
.hud-center { flex: 1; text-align: center; }
.hud-right { display: flex; gap: 8px; align-items: center; }

.hud-stat {
  display: flex; align-items: center; gap: 8px;
  background: rgba(20,12,2,0.8);
  border: 1px solid var(--panel-border);
  padding: 6px 12px; border-radius: 2px;
}

.hud-icon {
  width: 20px; height: 20px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
}

.money-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9' fill='%23c9a84c' stroke='%238a6a1a' stroke-width='1'/%3E%3Ctext x='10' y='14' text-anchor='middle' font-size='11' font-weight='bold' fill='%230a0603'%3E$%3C/text%3E%3C/svg%3E"); }
.heat-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpolygon points='10,1 13,7 19,8 14.5,12.5 16,19 10,15.5 4,19 5.5,12.5 1,8 7,7' fill='%23c0392b' stroke='%238b1a1a' stroke-width='1'/%3E%3C/svg%3E"); }
.rep-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='7' r='4' fill='%23c9a84c'/%3E%3Cpath d='M3 18 Q3 12 10 12 Q17 12 17 18' fill='%23c9a84c'/%3E%3C/svg%3E"); }

.hud-stat span {
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 700;
  color: var(--gold-light); letter-spacing: 0.05em;
}

.game-title-hud {
  font-family: var(--font-title);
  font-size: 16px; color: var(--gold-dark);
  letter-spacing: 0.2em;
}

.time-display {
  font-family: var(--font-ui);
  font-size: 13px; color: var(--text-dim);
  letter-spacing: 0.1em;
}

.hud-btn {
  padding: 8px 14px;
  font-family: var(--font-ui); font-size: 12px;
  font-weight: 700; letter-spacing: 0.12em;
  color: var(--gold-light);
  background: rgba(30,18,4,0.9);
  border: 1px solid var(--gold-dark);
  cursor: pointer; transition: all 0.15s;
  clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
}
.hud-btn:hover { color: var(--gold); border-color: var(--gold); background: rgba(50,28,6,0.95); }
.hud-btn.danger-btn { color: #c06060; border-color: #601010; }
.hud-btn.danger-btn:hover { color: #ff8080; border-color: #aa2020; }

/* ===================== MAP ===================== */
#mapContainer {
  position: fixed; inset: 0; top: 56px;
  overflow: hidden; cursor: grab;
  background: #0a0a08;
}
#mapContainer.dragging { cursor: grabbing; }
#mapCanvas { position: absolute; top: 0; left: 0; }
#npcLayer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

/* ===================== NPC BUBBLES ===================== */
.npc-bubble {
  position: absolute;
  pointer-events: all; cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.1s;
  z-index: 10;
}

.npc-bubble:hover { transform: translate(-50%, -50%) scale(1.15); z-index: 20; }

.bubble-ring {
  position: relative;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 3px solid transparent;
  overflow: visible;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.7));
}

.bubble-ring.gang-type { border-color: var(--gold); box-shadow: 0 0 10px rgba(200,150,0,0.4); }
.bubble-ring.rival-type { border-color: #aa2020; box-shadow: 0 0 10px rgba(170,0,0,0.4); }
.bubble-ring.police-type { border-color: #2050aa; box-shadow: 0 0 10px rgba(30,80,180,0.5); }
.bubble-ring.female-type { border-color: #8060a0; box-shadow: 0 0 10px rgba(130,80,160,0.3); }
.bubble-ring.male-type { border-color: #4a6a8a; box-shadow: 0 0 10px rgba(70,100,140,0.3); }
.bubble-ring.attorney-type { border-color: #8a8a30; box-shadow: 0 0 10px rgba(140,140,40,0.3); }
.bubble-ring.runner-type { border-color: #30aa60; box-shadow: 0 0 10px rgba(40,170,80,0.4); }

.bubble-img {
  width: 48px; height: 48px;
  border-radius: 50%; overflow: hidden;
  background: #1a1208;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

.bubble-img img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  border-radius: 50%;
}

.bubble-img canvas { 
  width: 48px; 
  height: 48px; 
  border-radius: 50%;
  display: block;
}

.bubble-label {
  position: absolute; bottom: -18px; left: 50%;
  transform: translateX(-50%);
  background: rgba(5,3,1,0.9);
  border: 1px solid rgba(100,70,10,0.6);
  color: var(--gold-light);
  font-family: var(--font-ui); font-size: 9px;
  font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 2px;
  white-space: nowrap; max-width: 80px;
  overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}

.bubble-label.police-label { color: #7090e0; }
.bubble-label.rival-label { color: #e07070; }
.bubble-label.runner-label { color: #60e090; }

.bubble-status {
  position: absolute; top: -4px; right: -4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #2a2a2a; border: 2px solid #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px;
}
.status-idle { background: #3a7a3a; }
.status-dealing { background: #c9a84c; }
.status-fighting { background: #aa2020; }
.status-patrolling { background: #2050aa; }
.status-fleeing { background: #aa6020; }
.status-working { background: #30aa60; }

/* ===================== SIDE PANELS ===================== */
.side-panel {
  position: fixed; top: 56px; right: 0;
  width: 340px; height: calc(100vh - 56px);
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  border-top: 2px solid var(--gold-dark);
  z-index: 90; display: flex; flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 30px rgba(0,0,0,0.7);
}

.side-panel.hidden { transform: translateX(100%); pointer-events: none; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(90deg, rgba(20,12,2,0.9) 0%, rgba(15,9,2,0.9) 100%);
  font-family: var(--font-ui); font-size: 14px;
  font-weight: 700; letter-spacing: 0.15em;
  color: var(--gold);
}

.panel-body {
  flex: 1; overflow-y: auto; padding: 16px;
  scrollbar-width: thin; scrollbar-color: var(--gold-dark) transparent;
  display: flex; flex-direction: column; gap: 16px;
}

.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 2px; }

.close-btn {
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 16px; padding: 4px 8px;
  transition: color 0.15s;
}
.close-btn:hover { color: var(--gold); }

.panel-section-title {
  font-family: var(--font-ui); font-size: 12px;
  font-weight: 700; letter-spacing: 0.2em;
  color: var(--gold-dark); text-transform: uppercase;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 6px;
}

.gang-summary, .drug-empire-summary {
  background: rgba(20,12,2,0.6);
  border: 1px solid var(--panel-border);
  padding: 12px; border-radius: 2px;
  display: flex; flex-direction: column; gap: 8px;
}

.gsummary-item {
  display: flex; justify-content: space-between;
  font-family: var(--font-body); font-size: 13px;
  color: var(--text-dim);
}
.gsummary-item span:last-child { color: var(--gold-light); font-weight: 700; }

.gang-list { display: flex; flex-direction: column; gap: 8px; }

.gang-member-card {
  background: rgba(15,9,2,0.8);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--gold-dark);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  transition: border-left-color 0.15s;
  border-radius: 2px;
}
.gang-member-card:hover { border-left-color: var(--gold); }

.member-portrait {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--gold-dark);
  overflow: hidden; flex-shrink: 0; background: #1a1208;
}
.member-portrait img { width: 100%; height: 100%; object-fit: cover; }
.member-portrait canvas { width: 40px; height: 40px; }

.member-info { flex: 1; min-width: 0; }
.member-name { font-family: var(--font-ui); font-size: 13px; color: var(--gold-light); font-weight: 700; }
.member-role { font-family: var(--font-body); font-size: 11px; color: var(--text-dim); }
.member-stats { font-family: var(--font-body); font-size: 10px; color: #604020; margin-top: 2px; }

.member-actions { display: flex; gap: 4px; }
.member-action-btn {
  background: rgba(30,18,4,0.9); border: 1px solid var(--panel-border);
  color: var(--text-dim); font-family: var(--font-ui);
  font-size: 10px; padding: 4px 6px; cursor: pointer;
  transition: all 0.15s; border-radius: 1px;
}
.member-action-btn:hover { color: var(--gold); border-color: var(--gold-dark); }

.hire-section { padding-top: 8px; }

.action-btn {
  width: 100%; padding: 10px 14px;
  font-family: var(--font-ui); font-size: 13px;
  font-weight: 700; letter-spacing: 0.1em;
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(35,20,4,0.95) 0%, rgba(20,12,2,0.98) 100%);
  border: 1px solid var(--gold-dark);
  cursor: pointer; transition: all 0.15s;
  text-transform: uppercase; margin-bottom: 6px;
  border-radius: 2px;
}
.action-btn:hover { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px rgba(200,150,0,0.2); }
.action-btn:active { transform: scale(0.98); }
.action-btn.danger { color: #c06060; border-color: #601010; }
.action-btn.danger:hover { color: #ff8080; border-color: #aa2020; box-shadow: 0 0 12px rgba(200,0,0,0.2); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.hire-btn { border-top: 2px solid var(--gold-dark); }

/* DRUG INVENTORY */
.drug-inventory { display: flex; flex-direction: column; gap: 12px; }

.drug-card {
  background: rgba(15,9,2,0.8);
  border: 1px solid var(--panel-border);
  padding: 14px; border-radius: 2px;
  display: flex; align-items: center; gap: 14px;
}

.drug-icon-wrap {
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.drug-info { flex: 1; }
.drug-name { font-family: var(--font-title); font-size: 16px; color: var(--gold-light); margin-bottom: 4px; }
.drug-stock { font-family: var(--font-body); font-size: 12px; color: var(--text-dim); }
.drug-price { font-family: var(--font-ui); font-size: 14px; color: var(--green-light); font-weight: 700; margin-top: 4px; }

.restock-section { display: flex; flex-direction: column; gap: 6px; }

/* HEAT */
.heat-meter-display {
  background: rgba(15,9,2,0.8);
  border: 1px solid var(--panel-border);
  padding: 16px; border-radius: 2px;
  text-align: center;
}
.heat-label { font-family: var(--font-ui); font-size: 11px; color: var(--text-dim); letter-spacing: 0.2em; margin-bottom: 10px; }
.heat-bar-container {
  height: 12px; background: rgba(5,3,1,0.8);
  border: 1px solid var(--panel-border); border-radius: 2px; overflow: hidden;
  margin-bottom: 8px;
}
.heat-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--heat-cool), var(--heat-warm), var(--heat-hot), var(--heat-critical));
  background-size: 400% 100%;
  transition: width 0.5s ease, background-position 0.5s ease;
}
.heat-level-label { font-family: var(--font-ui); font-size: 18px; font-weight: 700; color: var(--heat-cool); }

.legal-card {
  background: rgba(15,9,2,0.8);
  border: 1px solid var(--panel-border);
  border-left: 3px solid #8a8a30;
  padding: 12px; display: flex; align-items: center;
  gap: 12px; cursor: pointer; border-radius: 2px;
  transition: border-left-color 0.15s;
}
.legal-card:hover { border-left-color: var(--gold); }

.legal-portrait {
  width: 50px; height: 50px; border-radius: 50%;
  background: #1a1208; border: 2px solid #8a8a30;
  flex-shrink: 0; overflow: hidden;
}
.attorney-portrait { background-image: url('attorney.jpg'); background-size: cover; background-position: center; }

.legal-name { font-family: var(--font-ui); font-size: 14px; color: var(--gold-light); font-weight: 700; }
.legal-desc { font-family: var(--font-body); font-size: 12px; color: var(--text-dim); margin: 4px 0; }
.legal-cost { font-family: var(--font-ui); font-size: 13px; color: var(--green-light); }

.bribe-list { display: flex; flex-direction: column; gap: 6px; }
.bribe-btn { border-left: 3px solid #605010; }

/* ===================== MODALS ===================== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(3px);
}
.modal.hidden { display: none; }

.modal-content {
  background: linear-gradient(160deg, #0e0905 0%, #0a0603 100%);
  border: 1px solid var(--gold-dark);
  border-top: 2px solid var(--gold);
  max-width: 520px; width: 92%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 0 60px rgba(0,0,0,0.9), 0 0 30px rgba(150,100,0,0.15);
  border-radius: 2px;
  scrollbar-width: thin; scrollbar-color: var(--gold-dark) transparent;
}

.modal-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(90deg, rgba(20,12,2,0.9) 0%, rgba(10,6,1,0.9) 100%);
  position: sticky; top: 0;
}

.modal-portrait-wrap {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid var(--gold-dark);
  overflow: hidden; flex-shrink: 0;
  background: #1a1208;
  box-shadow: 0 0 20px rgba(150,100,0,0.3);
}

.modal-portrait { width: 100%; height: 100%; background-size: cover; background-position: center; }
.modal-portrait img { width: 100%; height: 100%; object-fit: cover; }
.modal-portrait canvas { width: 80px; height: 80px; }

.modal-close { margin-left: auto; align-self: flex-start; }

.modal-name {
  font-family: var(--font-title); font-size: 22px; color: var(--gold-light);
}
.modal-type {
  font-family: var(--font-ui); font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.15em; text-transform: uppercase; margin-top: 4px;
}
.modal-stats {
  font-family: var(--font-body); font-size: 12px; color: #806040;
  margin-top: 6px; line-height: 1.6;
}

.modal-actions {
  padding: 16px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 8px;
}

.modal-action-btn {
  padding: 12px 8px;
  font-family: var(--font-ui); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(25,15,3,0.9);
  border: 1px solid var(--panel-border);
  cursor: pointer; transition: all 0.15s; border-radius: 2px;
  text-align: center;
}
.modal-action-btn:hover { color: var(--gold); border-color: var(--gold-dark); box-shadow: 0 0 10px rgba(200,150,0,0.2); }
.modal-action-btn.danger { color: #c06060; border-color: #501010; }
.modal-action-btn.danger:hover { color: #ff8080; border-color: #aa2020; }
.modal-action-btn.success { color: #60c080; border-color: #105030; }
.modal-action-btn.success:hover { color: #80ff80; border-color: #208050; }
.modal-action-btn.wide { grid-column: 1 / -1; }

.modal-log {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--panel-border);
}

.log-entry {
  font-family: var(--font-body); font-size: 12px;
  color: var(--text-dim); padding: 4px 0;
  border-bottom: 1px solid rgba(50,30,5,0.4);
  line-height: 1.5;
}
.log-entry.success-log { color: #60c080; }
.log-entry.danger-log { color: #c06060; }
.log-entry.gold-log { color: var(--gold-light); }

/* COURT */
.court-modal { max-width: 600px; }
.court-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: url('judge.jpg') center/cover, #1a1208;
  border: 3px solid #8a8a30; flex-shrink: 0;
}
.court-content {
  padding: 20px;
  font-family: var(--font-body); font-size: 14px;
  color: var(--text-dim); line-height: 1.8;
}
.court-content strong { color: var(--gold-light); }
.court-actions {
  display: flex; flex-direction: column; gap: 8px; padding: 16px;
  border-top: 1px solid var(--panel-border);
}

/* PAUSE */
.pause-content {
  display: flex; flex-direction: column;
  gap: 16px; padding: 32px; align-items: center;
  max-width: 360px;
}
.pause-content h2 {
  font-family: var(--font-title); font-size: 40px; color: var(--gold);
  letter-spacing: 0.3em;
}

/* ===================== NOTIFICATION ===================== */
.notification {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, rgba(20,12,2,0.98) 0%, rgba(15,9,1,0.99) 100%);
  border: 1px solid var(--gold-dark); border-top: 2px solid var(--gold);
  color: var(--gold-light);
  font-family: var(--font-ui); font-size: 15px; font-weight: 700;
  letter-spacing: 0.1em;
  padding: 14px 28px; border-radius: 2px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.8);
  z-index: 300; transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  text-align: center; max-width: 500px; white-space: pre-line;
}
.notification.show { transform: translateX(-50%) translateY(0); }
.notification.hidden { display: none; }
.notification.notif-danger { border-top-color: #aa2020; border-color: #601010; color: #ff8080; }
.notification.notif-success { border-top-color: #20aa50; border-color: #105030; color: #60ff90; }
.notification.notif-info { border-top-color: var(--gold); color: var(--gold-light); }

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(5,3,1,0.5); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.anim-fadein { animation: fadeIn 0.3s ease; }
.anim-slideup { animation: slideUp 0.3s ease; }
.anim-pulse { animation: pulse 1.5s infinite; }
.anim-shake { animation: shake 0.3s ease; }
.anim-float { animation: float 3s ease-in-out infinite; }

/* ===================== MINI-MAP ===================== */
#miniMap {
  position: fixed; bottom: 20px; right: 20px;
  width: 180px; height: 140px;
  background: rgba(5,3,1,0.92);
  border: 1px solid var(--gold-dark);
  border-radius: 2px; z-index: 80;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  overflow: hidden;
}
#miniMapCanvas { width: 100%; height: 100%; }
.minimap-label {
  position: absolute; bottom: 4px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui); font-size: 9px;
  color: var(--text-dim); letter-spacing: 0.2em;
}

/* ===================== FLOATING LABELS ===================== */
.damage-float {
  position: absolute; pointer-events: none;
  font-family: var(--font-ui); font-weight: 700;
  font-size: 18px; z-index: 50;
  animation: floatDamage 1.2s ease forwards;
}
@keyframes floatDamage {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-60px) scale(0.8); opacity: 0; }
}
.dmg-money { color: #c9a84c; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.dmg-damage { color: #c0392b; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.dmg-info { color: #a0c0e0; text-shadow: 0 1px 4px rgba(0,0,0,0.8); font-size: 13px; }

/* LOADING SCREEN */
#loadingScreen {
  position: fixed; inset: 0; z-index: 999;
  background: #030201;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
}
.loading-title {
  font-family: var(--font-title); font-size: 36px;
  color: var(--gold);
  letter-shadow: 0 0 30px rgba(200,150,0,0.5);
}
.loading-bar-wrap {
  width: 300px; height: 4px;
  background: rgba(20,12,2,0.8);
  border: 1px solid var(--panel-border);
  border-radius: 2px; overflow: hidden;
}
.loading-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
  background-size: 200% 100%;
  animation: loadingSlide 1.5s linear infinite;
}
@keyframes loadingSlide {
  0% { background-position: 200% 0; width: 30%; }
  50% { width: 70%; }
  100% { background-position: -200% 0; width: 30%; }
}
.loading-tip { font-family: var(--font-body); font-size: 13px; color: var(--text-dim); text-align: center; max-width: 400px; }

/* GAME OVER */
#gameOverScreen {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.9);
  display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px;
}
#gameOverScreen.show { display: flex; }
.go-title { font-family: var(--font-title); font-size: 72px; color: var(--red-light); letter-spacing: 0.1em; text-shadow: 0 0 60px rgba(180,0,0,0.6); }
.go-sub { font-family: var(--font-ui); font-size: 18px; color: var(--text-dim); letter-spacing: 0.3em; }
.go-stats { font-family: var(--font-body); font-size: 14px; color: var(--text-dim); text-align: center; line-height: 2; }
.go-stats span { color: var(--gold-light); }

/* ===================== CASINO ===================== */
.casino-purchase-card {
  background: rgba(15,9,2,0.9);
  border: 2px solid var(--gold);
  padding: 20px;
  border-radius: 4px;
  text-align: center;
}

.casino-purchase-card h3 {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 12px;
}

.casino-purchase-card p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.5;
}

.casino-stats-preview {
  background: rgba(5,3,1,0.8);
  border: 1px solid var(--panel-border);
  padding: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.casino-stats-preview .stat-item {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 0;
  border-bottom: 1px solid rgba(100,70,20,0.3);
}

.casino-stats-preview .stat-item:last-child {
  border-bottom: none;
}

.casino-stats-preview .stat-item strong {
  color: var(--gold-light);
  float: right;
}

.casino-game-control {
  background: rgba(15,9,2,0.8);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--gold);
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 2px;
}

.game-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.game-name {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-light);
  font-weight: 700;
}

.game-payout {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--gold);
  font-weight: 700;
}

.payout-slider {
  width: 100%;
  height: 6px;
  background: rgba(5,3,1,0.8);
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  margin-bottom: 6px;
}

.payout-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--gold);
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid var(--gold-dark);
}

.payout-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--gold);
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid var(--gold-dark);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim);
}

/* ===================== CASINO MARKER ===================== */
.casino-marker {
  position: absolute;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1000;
  text-align: center;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.casino-marker:hover {
  transform: translate(-50%, -50%) scale(1.15) !important;
}

.casino-marker-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 4px;
  animation: casinoPulse 2s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(200, 150, 50, 0.8),
               0 0 20px rgba(200, 150, 50, 0.4);
}

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

.casino-marker-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  color: #60e090;
  background: rgba(0,0,0,0.9);
  border: 2px solid currentColor;
  border-radius: 3px;
  padding: 4px 8px;
  white-space: nowrap;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.casino-marker:hover .casino-marker-label {
  color: #ffffff;
  background: rgba(50,28,6,0.95);
  border-color: var(--gold);
}
