/* ========================================
   LIFE GAME — Main Styles
   Dark RPG Theme
   ======================================== */

:root {
  /* Colors */
  --bg-deep: #0a0a0f;
  --bg-surface: #14141f;
  --bg-elevated: #1a1a2e;
  --border: #1a1a2e;
  --border-light: #2a2a3e;

  --primary-start: #7c3aed;
  --primary-end: #3b82f6;
  --primary: #7c3aed;
  --primary-glow: rgba(124, 58, 237, 0.3);

  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.3);

  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;

  /* Fonts */
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', monospace;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ====== APP CONTAINER ====== */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
    var(--bg-deep);
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ====== SCREENS ====== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  opacity: 0;
  z-index: 1;
  transition: opacity var(--transition-slow);
}

.screen.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  z-index: 2;
}

.screen.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.screen.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

/* ====== TITLE SCREEN ====== */
.title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--space-lg);
  text-align: center;
  padding: var(--space-xl);
  position: relative;
}

.title-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: breathe 4s ease-in-out infinite;
  pointer-events: none;
}

.title-text {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

.subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.title-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  position: relative;
  z-index: 1;
}

.title-footer {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  position: relative;
  z-index: 1;
}

/* ====== TOP BAR ====== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(20, 20, 31, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-mini {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ====== CHARACTER CREATION ====== */
.creation-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: var(--space-xl);
  gap: var(--space-lg);
}

.npc-avatar {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.npc-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  border-radius: 50%;
  animation: breathe 3s ease-in-out infinite;
  pointer-events: none;
}

.npc-icon {
  font-size: 3.5rem;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

.dialogue-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  max-width: 500px;
  width: 100%;
  min-height: 80px;
  position: relative;
}

.dialogue-box::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  border-top: 1px solid var(--border-light);
}

.typewriter {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.typewriter .cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

.answer-area {
  max-width: 500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.options-grid {
  display: grid;
  gap: var(--space-sm);
}

.option-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  font-size: 0.95rem;
}

.option-btn:hover {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.1);
}

.option-btn.selected {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.15);
  box-shadow: 0 0 12px var(--primary-glow);
}

.creation-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: 500px;
  width: 100%;
}

.progress-bar-mini {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

.step-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 30px;
}

/* ====== DASHBOARD ====== */
#screen-dashboard {
  padding-bottom: var(--space-2xl);
}

#screen-dashboard > .card,
#screen-dashboard > .quick-actions {
  margin: var(--space-md) var(--space-lg);
}

/* ====== CHARACTER CARD ====== */
.character-card {
  position: relative;
  overflow: hidden;
}

.character-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.avatar-frame {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-icon {
  font-size: 1.8rem;
}

.char-name {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.char-class {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.xp-section {
  margin-top: var(--space-sm);
}

.xp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.xp-bar {
  height: 8px;
  background: var(--bg-deep);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #fbbf24);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* ====== ANTI-VISION STRIP ====== */
.antivision-strip {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
  padding: var(--space-md) var(--space-lg);
}

.antivision-text {
  color: var(--danger);
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.4;
}

.antivision-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ====== BOSS CARD ====== */
.boss-card {
  border-color: rgba(239, 68, 68, 0.2);
}

.boss-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.boss-icon {
  font-size: 2rem;
}

.boss-info {
  flex: 1;
}

.boss-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--danger);
}

.boss-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hp-bar {
  height: 10px;
  background: var(--bg-deep);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.hp-bar-lg {
  height: 16px;
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--danger), #f87171);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 0 10px var(--danger-glow);
}

.hp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.hp-text-lg {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  text-align: center;
  display: block;
}

.milestones {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.milestone {
  text-align: center;
  padding: var(--space-sm);
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.milestone.completed {
  border-color: var(--success);
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.milestone.active {
  border-color: var(--gold);
  color: var(--gold);
}

.milestone-label {
  display: block;
  margin-top: 2px;
  font-size: 0.65rem;
}

/* ====== QUESTS ====== */
.quests-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.quest-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quest-item:hover {
  border-color: var(--primary);
}

.quest-item.completed {
  opacity: 0.6;
  border-color: var(--success);
}

.quest-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  font-size: 0.8rem;
}

.quest-item.completed .quest-check {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.quest-text {
  flex: 1;
  font-size: 0.95rem;
}

.quest-xp {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
}

/* ====== REVIEW BADGES ====== */
.review-badges {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.review-badge {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text-secondary);
}

.review-badge.due {
  border-color: var(--gold);
  color: var(--gold);
  animation: pulse-border 2s ease-in-out infinite;
}

.review-badge:hover {
  transform: translateY(-2px);
}

/* ====== QUICK ACTIONS ====== */
.quick-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ====== BOSS ARENA ====== */
.boss-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100% - 56px);
  padding: var(--space-xl);
  gap: var(--space-lg);
  text-align: center;
}

.boss-sprite {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boss-sprite-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--danger-glow) 0%, transparent 70%);
  border-radius: 50%;
  animation: breathe 2s ease-in-out infinite;
}

.boss-big-icon {
  font-size: 4rem;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

.boss-arena-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--danger);
}

.boss-arena .hp-bar-lg {
  width: 100%;
  max-width: 400px;
}

.milestones-arena {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  max-width: 400px;
}

.milestone-arena-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.milestone-arena-item.completed {
  border-color: var(--success);
  opacity: 0.7;
}

.milestone-arena-item.active {
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

.milestone-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.milestone-arena-item.completed .milestone-num {
  background: var(--success);
  color: white;
}

.milestone-arena-item.active .milestone-num {
  background: var(--gold);
  color: var(--bg-deep);
}

.boss-actions {
  margin-top: var(--space-md);
}

/* ====== DEATH SCREEN ====== */
.death-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-xl);
  gap: var(--space-lg);
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.1) 0%, transparent 70%);
}

.death-skull {
  font-size: 5rem;
  animation: deathPulse 2s ease-in-out infinite;
}

.death-title {
  font-size: 3rem;
  font-weight: 900;
  color: var(--danger);
  letter-spacing: 0.2em;
  text-shadow: 0 0 30px var(--danger-glow);
}

.death-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.death-vision {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  max-width: 400px;
  color: var(--danger);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.6;
}

.death-warning {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ====== REFLECTION ====== */
.reflection-container {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: var(--space-xl);
  gap: var(--space-lg);
}

.reflection-container h2 {
  text-align: center;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.reflection-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.reflection-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.reflection-form label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ====== REVIEW ====== */
.review-container {
  padding: var(--space-lg);
}

.review-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  text-align: center;
}

.tab.active {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  border-color: transparent;
  color: white;
}

.review-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.review-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.review-form-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ====== STATS ====== */
.stats-container {
  padding: var(--space-lg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-start), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.achievement {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  opacity: 0.4;
  transition: all var(--transition-fast);
}

.achievement.unlocked {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.achievement-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.achievement-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ====== SETTINGS ====== */
.settings-container {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.setting-item label:first-child {
  font-size: 0.95rem;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* Toggle */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-deep);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-secondary);
  top: 2px;
  left: 2px;
  transition: var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: white;
}

/* ====== VICTORY SCREEN ====== */
.victory-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-xl);
  gap: var(--space-lg);
  text-align: center;
}

.victory-crown {
  font-size: 5rem;
  animation: float 2s ease-in-out infinite;
}

.victory-title {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #fbbf24, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px var(--gold-glow);
}

.victory-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.victory-rewards {
  background: var(--bg-surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  font-size: 1.1rem;
  color: var(--gold);
}

/* ====== LEVEL UP SCREEN ====== */
.levelup-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-xl);
  gap: var(--space-lg);
  text-align: center;
  position: relative;
}

.levelup-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: breathe 2s ease-in-out infinite;
}

.levelup-title {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: 1;
}

.levelup-number {
  font-size: 5rem;
  font-weight: 900;
  color: var(--gold);
  z-index: 1;
  text-shadow: 0 0 40px var(--gold-glow);
}

.levelup-ego {
  font-size: 1.2rem;
  color: var(--text-secondary);
  z-index: 1;
}

/* ====== SIDE MENU ====== */
.side-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
}

.side-menu.open {
  display: block;
}

.side-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.2s ease;
}

.side-menu-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 80%;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: var(--space-xl) var(--space-lg);
  animation: slideInLeft 0.3s ease;
}

.side-menu-close {
  margin-bottom: var(--space-xl);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.side-nav-item {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.side-nav-item:hover {
  background: var(--bg-elevated);
}

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 480px) {
  .top-bar {
    padding: var(--space-sm) var(--space-md);
  }

  #screen-dashboard > .card,
  #screen-dashboard > .quick-actions {
    margin: var(--space-sm) var(--space-md);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .milestones {
    grid-template-columns: repeat(2, 1fr);
  }

  .title-text {
    letter-spacing: 0.08em;
  }

  .death-title {
    font-size: 2rem;
  }
}

/* Safari tap fix */
button, .btn {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-appearance: none;
  -moz-appearance: none;
  touch-action: manipulation;
}
