/* ============================================================
   CITY LIFE RPG — Complete Stylesheet
   ============================================================ */

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark:    #0D0D0F;
  --bg-panel:   rgba(10, 10, 15, 0.92);
  --bg-card:    rgba(255,255,255,0.05);
  --accent:     #4FC3F7;
  --accent2:    #FF6B6B;
  --success:    #69F0AE;
  --warning:    #FFD740;
  --danger:     #FF1744;
  --text:       #E8E8E8;
  --text-dim:   #888;
  --border:     rgba(255,255,255,0.1);
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius:     8px;
  --shadow:     0 4px 20px rgba(0,0,0,0.5);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* ── Canvas ──────────────────────────────────────────────────── */
#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
  outline: none;
}

/* ── Loading Screen ──────────────────────────────────────────── */
#loading-screen {
  position: fixed; inset: 0; z-index: 2000;
  background: radial-gradient(ellipse at center, #1A1A2E 0%, #0D0D0F 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
#loading-screen.hidden   { display: none; }

.loading-content { text-align: center; width: 90%; max-width: 480px; }

.game-title {
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #4FC3F7, #FF6B6B, #69F0AE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  margin-bottom: 8px;
}

.loading-subtitle {
  color: var(--text-dim);
  font-size: 1.1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.loading-bar-container {
  width: 100%; height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.loading-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4FC3F7, #FF6B6B);
  border-radius: 2px;
  transition: width 0.4s ease;
}
#loading-text { color: var(--text-dim); font-size: 0.85rem; }

/* ── Character Creator ───────────────────────────────────────── */
#character-creator {
  position: fixed; inset: 0; z-index: 1500;
  background: var(--bg-dark);
  overflow-y: auto;
  padding: 20px;
}
#character-creator.hidden { display: none; }

.creator-container { max-width: 900px; margin: 0 auto; }

.creator-header { text-align: center; margin-bottom: 30px; padding: 20px 0; }
.creator-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #4FC3F7, #FF6B6B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.creator-subtitle { color: var(--text-dim); margin-top: 8px; }

.creator-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 640px) { .creator-body { grid-template-columns: 1fr; } }

.creator-preview {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.char-preview-box {
  width: 180px; height: 260px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

.char-preview-figure { display: flex; flex-direction: column; align-items: center; }
.preview-head {
  width: 60px; height: 60px; border-radius: 50%;
  background: #E0AC69;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.preview-eyes { display: flex; gap: 12px; margin-top: -4px; }
.preview-eye  { width: 8px; height: 8px; background: #222; border-radius: 50%; }
.preview-hair {
  width: 60px; height: 20px;
  background: #1A1A1A;
  border-radius: 10px 10px 0 0;
  position: absolute; top: -8px; left: 0;
}
.preview-body {
  width: 50px; height: 80px;
  background: #607D8B;
  border-radius: 8px;
  margin-top: 6px;
}

.preview-stats { width: 100%; }
.prev-stat {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; margin-bottom: 4px;
}
.prev-stat span:first-child { width: 60px; color: var(--text-dim); font-size: 10px; }
.prev-stat span:last-child  { width: 24px; text-align: right; }
.mini-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }

.creator-options { display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }

.creator-section h3 { font-size: 0.9rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }

.name-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 1rem;
  outline: none;
}
.name-input:focus { border-color: var(--accent); }

.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch.selected  { border-color: var(--accent); transform: scale(1.2); }
.color-swatch:hover     { transform: scale(1.1); }

.option-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.option-btn {
  padding: 6px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); cursor: pointer;
  font-size: 0.85rem; transition: all 0.15s;
}
.option-btn:hover    { border-color: var(--accent); }
.option-btn.selected { background: var(--accent); color: #000; border-color: var(--accent); }

.build-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.build-card {
  padding: 12px 14px; flex: 1 1 160px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all 0.15s;
}
.build-card:hover    { border-color: var(--accent); }
.build-card.selected { border-color: var(--accent); background: rgba(79,195,247,0.1); }
.build-label { font-weight: 700; margin-bottom: 4px; }
.build-desc  { font-size: 0.78rem; color: var(--text-dim); }

.creator-footer { border-top: 1px solid var(--border); padding-top: 24px; }
.creator-lore {
  background: var(--bg-card); padding: 14px; border-radius: var(--radius);
  font-size: 0.88rem; color: var(--text-dim); margin-bottom: 20px;
  line-height: 1.6;
}

.start-btn {
  display: block; width: 100%; padding: 16px;
  background: linear-gradient(135deg, #4FC3F7, #0288D1);
  border: none; border-radius: var(--radius);
  color: #000; font-size: 1.1rem; font-weight: 700;
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.1em;
  transition: transform 0.15s, box-shadow 0.15s;
}
.start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79,195,247,0.4); }
.start-btn:active { transform: translateY(0); }

/* ── HUD ─────────────────────────────────────────────────────── */
#hud {
  position: fixed; inset: 0; pointer-events: none;
  z-index: 100;
}
#hud.hidden { display: none; }

/* Stats Row */
#hud-stats {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 20px; align-items: center;
  background: var(--bg-panel); padding: 6px 20px;
  border-radius: 24px; border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  font-weight: 600; font-size: 0.95rem;
}
#hud-money { color: var(--warning); }
#hud-time  { color: var(--accent); }
#hud-day   { color: var(--text-dim); }

/* Bars */
#hud-bars {
  position: absolute; top: 60px; left: 16px;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.bar-group { display: flex; align-items: center; gap: 8px; }
.bar-label { width: 28px; font-size: 10px; color: var(--text-dim); font-weight: 700; text-align: right; }
.bar {
  width: 120px; height: 8px;
  background: rgba(255,255,255,0.12);
  border-radius: 4px; overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.bar-fill.health { background: linear-gradient(90deg, #F44336, #FF5722); width: 100%; }
.bar-fill.energy { background: linear-gradient(90deg, #1565C0, #4FC3F7); width: 100%; }
.bar-fill.rep    { background: linear-gradient(90deg, #2E7D32, #69F0AE); width: 50%; }

/* Wanted Stars */
#wanted-level {
  position: absolute; top: 60px; right: 16px;
  display: flex; gap: 4px;
}
.wanted-star {
  font-size: 20px;
  color: rgba(255,255,255,0.15);
  transition: color 0.3s;
  text-shadow: none;
}
.wanted-star.active  { color: #FFD740; text-shadow: 0 0 8px #FFD740; }
.wanted-star.flashing { animation: star-flash 0.5s ease infinite alternate; }
@keyframes star-flash { from { color: #FFD740; } to { color: #FF1744; } }

/* Minimap */
#minimap-container {
  position: absolute; bottom: 80px; right: 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  width: 160px; height: 160px;
}
#minimap { display: block; width: 160px; height: 160px; }
#minimap-label {
  position: absolute; bottom: 4px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px; color: rgba(255,255,255,0.5);
  letter-spacing: 0.2em;
}

/* Crosshair */
#crosshair {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 20px; color: rgba(255,255,255,0.8);
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
  pointer-events: none; line-height: 1;
}

/* Interaction Prompt */
#interaction-prompt {
  position: absolute; bottom: 45%;
  left: 50%; transform: translateX(-50%);
  background: var(--bg-panel); padding: 8px 20px;
  border-radius: 24px; border: 1px solid var(--accent);
  display: flex; gap: 8px; align-items: center;
  font-size: 0.9rem; backdrop-filter: blur(6px);
  animation: prompt-pulse 2s ease infinite;
}
#interaction-prompt.hidden { display: none; }
#interaction-key {
  background: var(--accent); color: #000;
  padding: 2px 8px; border-radius: 4px;
  font-weight: 700; font-size: 0.8rem;
}
@keyframes prompt-pulse { 0%,100%{opacity:1}50%{opacity:0.7} }

/* Notifications */
#notifications {
  position: absolute; top: 120px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 300px; pointer-events: none;
}
.notification {
  padding: 10px 16px; border-radius: var(--radius);
  border-left: 3px solid;
  background: var(--bg-panel); backdrop-filter: blur(8px);
  font-size: 0.85rem; line-height: 1.4;
  opacity: 0; transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
}
.notification.visible  { opacity: 1; transform: translateX(0); }
.notification.fade-out { opacity: 0; transform: translateX(20px); }
.notif-info    { border-color: var(--accent); }
.notif-success { border-color: var(--success); }
.notif-warning { border-color: var(--warning); }
.notif-danger  { border-color: var(--danger); }
.notif-event   { border-color: #FF9800; background: rgba(10,10,15,0.95); }

/* Location Name */
#location-name {
  position: absolute; top: 100px; left: 50%; transform: translateX(-50%);
  background: var(--bg-panel); padding: 6px 18px; border-radius: 20px;
  font-size: 0.85rem; color: var(--accent); border: 1px solid var(--border);
  opacity: 0; transition: opacity 0.4s;
  pointer-events: none;
}
#location-name.visible { opacity: 1; }

/* Hotbar */
#hotbar {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
  background: var(--bg-panel); padding: 6px;
  border-radius: 12px; border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.hotbar-slot {
  width: 48px; height: 48px; border-radius: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; transition: border-color 0.15s;
}
.hotbar-slot.active { border-color: var(--accent); background: rgba(79,195,247,0.1); }
.slot-icon { font-size: 20px; }
.slot-num  { font-size: 9px; color: var(--text-dim); position: absolute; bottom: 2px; right: 4px; }

/* Damage numbers */
.damage-number {
  position: fixed;
  color: #FF5722; font-size: 1.4rem; font-weight: 900;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  pointer-events: none;
  opacity: 0; transform: translateY(0);
  z-index: 200;
  transition: opacity 0.2s;
}
.damage-number.floating {
  opacity: 1;
  animation: float-up 1.2s ease forwards;
}
@keyframes float-up {
  0%   { opacity:1; transform: translateY(0); }
  100% { opacity:0; transform: translateY(-60px); }
}

/* Hurt overlay */
.hurt-overlay {
  position: fixed; inset: 0;
  background: rgba(255, 0, 0, 0);
  pointer-events: none; z-index: 150;
  transition: background 0.15s;
}
.hurt-overlay.flash { background: rgba(255, 0, 0, 0.25); }

/* Rain overlay */
.rain-overlay {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: repeating-linear-gradient(
    170deg,
    rgba(100,150,255,0) 0px,
    rgba(100,150,255,0) 2px,
    rgba(100,150,255,0.06) 2px,
    rgba(100,150,255,0.06) 3px
  );
}
.rain-overlay.storm {
  background: repeating-linear-gradient(
    170deg,
    rgba(100,150,255,0) 0px,
    rgba(100,150,255,0) 1px,
    rgba(100,150,255,0.12) 1px,
    rgba(100,150,255,0.12) 2px
  );
}

/* ── Menus & Panels ──────────────────────────────────────────── */
.menu-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.menu-overlay.hidden { display: none; }

.menu-panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  box-shadow: var(--shadow); max-width: 360px; width: 100%;
  max-height: 90vh; overflow-y: auto;
}
.menu-panel.wide { max-width: 680px; }

.menu-panel h2 {
  font-size: 1.4rem; font-weight: 900;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 20px; text-align: center;
  color: var(--accent);
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 14px;
}
.panel-header h2 { margin-bottom: 0; }

.menu-btn {
  display: block; width: 100%; padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 0.95rem; cursor: pointer;
  margin-bottom: 10px; text-align: left;
  transition: all 0.15s;
}
.menu-btn:hover { border-color: var(--accent); background: rgba(79,195,247,0.08); }
.menu-btn.danger { border-color: rgba(255,23,68,0.3); color: var(--danger); }
.menu-btn.danger:hover { border-color: var(--danger); background: rgba(255,23,68,0.1); }
.menu-btn.disabled { opacity: 0.4; cursor: not-allowed; }

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

/* ── Inventory ───────────────────────────────────────────────── */
.inv-stats {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 20px;
}
.stats-header {
  font-size: 1.1rem; margin-bottom: 14px; color: var(--accent);
}
.stat-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.stat-row  { display: flex; align-items: center; gap: 10px; }
.stat-name { width: 90px; font-size: 0.82rem; color: var(--text-dim); text-transform: capitalize; }
.stat-bar  { flex: 1; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4FC3F7, #0288D1); transition: width 0.3s; }
.stat-val  { width: 30px; text-align: right; font-size: 0.82rem; font-weight: 600; }

.char-info { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.82rem; }
.char-info span { background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 12px; }

.inv-section { margin-bottom: 20px; }
.inv-section h3 { font-size: 0.95rem; color: var(--accent); margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }

.item-grid { display: flex; flex-direction: column; gap: 8px; }
.item-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  transition: border-color 0.15s;
}
.item-card.equipped { border-color: var(--accent); }
.item-icon { font-size: 1.8rem; flex-shrink: 0; }
.item-info { flex: 1; }
.item-name { font-weight: 600; margin-bottom: 2px; }
.item-qty  { font-size: 0.8rem; color: var(--text-dim); }
.item-stat { font-size: 0.78rem; color: var(--success); }
.item-value { font-size: 0.78rem; color: var(--warning); }
.item-actions { display: flex; flex-direction: column; gap: 6px; }
.item-btn { padding: 4px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 0.78rem; cursor: pointer; transition: all 0.15s; }
.item-btn:hover { border-color: var(--accent); }
.danger-btn:hover { border-color: var(--danger); }
.empty-text { color: var(--text-dim); font-style: italic; }

.rel-grid  { display: flex; flex-direction: column; gap: 6px; }
.rel-row   { display: flex; align-items: center; gap: 8px; }
.rel-name  { width: 100px; font-size: 0.82rem; }
.rel-fill  { height: 8px; border-radius: 4px; transition: width 0.3s; }
.rel-val   { font-size: 0.78rem; color: var(--text-dim); }

/* ── Phone ───────────────────────────────────────────────────── */
.phone-overlay {
  position: fixed; bottom: 80px; right: 16px; z-index: 400;
}
.phone-overlay.hidden { display: none; }

.phone {
  background: #1A1A2A;
  border-radius: 24px; overflow: hidden;
  width: 220px; box-shadow: 0 8px 40px rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.1);
}
.phone-screen { padding: 16px; }
.phone-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; font-size: 0.85rem; color: var(--text-dim);
}
.phone-name { font-weight: 700; color: var(--accent); }
.phone-apps { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.phone-app {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; padding: 10px 6px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid transparent;
  font-size: 1.5rem; transition: all 0.15s;
}
.phone-app span { font-size: 0.65rem; color: var(--text-dim); }
.phone-app:hover { border-color: var(--accent); background: rgba(79,195,247,0.08); }

/* ── Dialog ──────────────────────────────────────────────────── */
#dialog-box {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  width: 90%; max-width: 600px; z-index: 300;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
  display: flex; gap: 14px;
}
#dialog-box.hidden { display: none; }

.dialog-portrait { flex-shrink: 0; text-align: center; }
#dialog-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: #333; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin-bottom: 4px;
}
#dialog-name { font-size: 0.78rem; color: var(--accent); font-weight: 600; }

.dialog-content { flex: 1; }
#dialog-text    { font-size: 0.9rem; line-height: 1.5; margin-bottom: 12px; color: var(--text); }
#dialog-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-choice {
  padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); font-size: 0.82rem; cursor: pointer;
  transition: all 0.15s;
}
.dialog-choice:hover { border-color: var(--accent); background: rgba(79,195,247,0.1); }

/* ── Shop ────────────────────────────────────────────────────── */
.shop-money-bar {
  background: rgba(255,215,64,0.1); border: 1px solid rgba(255,215,64,0.2);
  border-radius: var(--radius); padding: 8px 14px; margin-bottom: 16px;
  font-size: 0.9rem;
}
.shop-section { margin-bottom: 20px; }
.shop-section h3 { font-size: 0.9rem; color: var(--accent); margin-bottom: 10px; }
.shop-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.shop-card  {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s;
}
.shop-card:hover { border-color: var(--accent); }
.shop-icon { font-size: 2rem; text-align: center; }
.shop-info { flex: 1; }
.shop-item-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; }
.shop-price { color: var(--warning); font-weight: 700; font-size: 0.9rem; }
.shop-qty   { font-size: 0.75rem; color: var(--text-dim); }
.shop-buy-btn, .shop-sell-btn {
  padding: 6px; background: var(--accent); border: none; border-radius: 6px;
  color: #000; font-weight: 700; font-size: 0.82rem; cursor: pointer;
  transition: opacity 0.15s;
}
.shop-sell-btn { background: var(--warning); }
.shop-buy-btn:hover, .shop-sell-btn:hover { opacity: 0.85; }

/* ── Death Screen ────────────────────────────────────────────── */
.death-screen {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
  animation: death-fade 1s ease forwards;
}
@keyframes death-fade { from { background: rgba(0,0,0,0); } to { background: rgba(0,0,0,0.9); } }
.death-content { text-align: center; padding: 40px; }
.death-title {
  font-size: 5rem; font-weight: 900;
  color: var(--danger); text-shadow: 0 0 40px var(--danger);
  animation: death-pulse 2s ease infinite;
}
@keyframes death-pulse { 0%,100%{opacity:1}50%{opacity:0.7} }
.death-sub   { color: var(--text-dim); font-size: 1.2rem; margin: 10px 0 20px; }
.death-stats { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 30px; }

/* ── Contact / News / Business Lists ────────────────────────── */
.contacts-list { display: flex; flex-direction: column; gap: 10px; }
.contact-row   { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border-radius: var(--radius); padding: 10px; }
.contact-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.contact-name  { font-weight: 600; }
.contact-job   { font-size: 0.78rem; color: var(--text-dim); text-transform: capitalize; }
.contact-rel   { font-size: 0.78rem; }

.map-locations { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.map-loc-item  { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-card); border-radius: var(--radius); cursor: pointer; border: 1px solid var(--border); }
.map-loc-item:hover { border-color: var(--accent); }
.map-coord     { margin-left: auto; font-size: 0.75rem; color: var(--text-dim); }
.map-hint      { font-size: 0.8rem; color: var(--text-dim); font-style: italic; }

.job-list      { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.job-row       { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border-radius: var(--radius); padding: 10px 14px; }
.job-row.locked { opacity: 0.5; }
.job-info      { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.job-info strong { font-size: 0.9rem; }
.job-info span   { font-size: 0.8rem; color: var(--warning); }
.job-info small  { font-size: 0.75rem; color: var(--text-dim); }
.current-job   { background: rgba(79,195,247,0.08); border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }

.business-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.biz-option    { background: var(--bg-card); border-radius: var(--radius); padding: 10px 14px; display: flex; gap: 12px; align-items: center; }
.biz-option strong { flex: 1; }
.biz-option span   { font-size: 0.8rem; color: var(--warning); }

.news-content p { padding: 8px 0; border-bottom: 1px solid var(--border); line-height: 1.6; }

.save-preview { background: var(--bg-card); border-radius: var(--radius); padding: 12px; margin: 16px 0; line-height: 1.8; }

.setting-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.setting-row label { color: var(--text-dim); }
.setting-row input[type="range"] { flex: 1; cursor: pointer; }

/* ── Mobile Controls ─────────────────────────────────────────── */
#mobile-controls {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
}
#mobile-controls.hidden { display: none; }

#joystick-left, #joystick-right {
  position: absolute; bottom: 20px;
  width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  pointer-events: all;
}
#joystick-left  { left: 20px; }
#joystick-right { right: 140px; }

.joystick-knob {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.4);
  transition: transform 0.05s;
  pointer-events: none;
}

#action-buttons {
  position: absolute; right: 16px; bottom: 100px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  pointer-events: all;
}
.action-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.2);
  color: var(--text); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.action-btn:active { background: rgba(79,195,247,0.3); }

#mobile-menu-btns {
  position: absolute; top: 16px; right: 16px;
  display: flex; gap: 8px; pointer-events: all;
}
.mobile-menu-btn {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text); font-size: 1.2rem; cursor: pointer;
  backdrop-filter: blur(6px);
}

/* ── Tutorial ────────────────────────────────────────────────── */
#tutorial {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  z-index: 400; width: 90%; max-width: 480px;
}
#tutorial.hidden { display: none; }
.tutorial-bubble {
  background: rgba(10,10,20,0.95); border: 1px solid var(--accent);
  border-radius: 12px; padding: 16px 20px;
  box-shadow: 0 0 20px rgba(79,195,247,0.2);
}
#tutorial-text { font-size: 0.9rem; line-height: 1.6; margin-bottom: 12px; }
#tutorial-next {
  padding: 8px 20px; background: var(--accent); border: none;
  border-radius: 20px; color: #000; font-weight: 700; cursor: pointer;
  font-size: 0.85rem; transition: opacity 0.15s;
}
#tutorial-next:hover { opacity: 0.85; }

/* ── Scrollbars ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── Utilities ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* Touch highlights off for game elements */
* { -webkit-tap-highlight-color: transparent; }

/* ── Responsive adjustments ──────────────────────────────────── */
@media (max-width: 480px) {
  #hud-bars .bar { width: 80px; }
  #minimap-container { width: 120px; height: 120px; bottom: 90px; right: 12px; }
  #minimap { width: 120px; height: 120px; }
  .menu-panel { padding: 16px; }
}

@media (hover: none) {
  /* Mobile-specific touch optimizations */
  .menu-btn, .dialog-choice, .shop-buy-btn { min-height: 44px; }
}
