/* ============================================================
   DESIGN SYSTEM — CSS Variables & Base Styles
   ============================================================ */

:root {
  /* Palette */
  --bg-primary:    #0d0f1a;
  --bg-card:       #1a1d2e;
  --bg-card-hover: #212540;
  --bg-scene:      #12141f;
  --bg-overlay:    rgba(10, 11, 20, 0.88);

  --accent-gold:   #f5c842;
  --accent-green:  #3ddc84;
  --accent-red:    #e05555;
  --accent-blue:   #4d9ef5;
  --accent-purple: #9b6af5;

  --text-primary:  #f0f0f0;
  --text-muted:    #8890aa;
  --text-dim:      #555870;
  --border:        rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.15);

  /* Typography */
  --font-display: 'Georgia', 'Times New Roman', serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Layout */
  --screen-max:    430px;
  --safe-top:      env(safe-area-inset-top, 0px);
  --safe-bottom:   env(safe-area-inset-bottom, 16px);
  --tap-min:       44px;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;

  /* Transitions */
  --transition: 0.2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#game-root {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* Inner container: max width for tablet/desktop, full on mobile */
.game-container {
  width: 100%;
  max-width: var(--screen-max);
  height: 100%;
  position: relative;
  overflow: hidden;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

/* ============================================================
   SCENE BACKGROUNDS
   ============================================================ */

.bg-stadium-dawn {
  background: linear-gradient(180deg, #1a0a3d 0%, #3d1a00 55%, #0d0f1a 100%);
}
.bg-training-ground {
  background: linear-gradient(180deg, #0a1a12 0%, #1a3d1a 40%, #0d1a0d 100%);
}
.bg-office {
  background: linear-gradient(135deg, #0d0a1a 0%, #1a1200 60%, #0d0f1a 100%);
}
.bg-press-room {
  background: linear-gradient(180deg, #0a0a14 0%, #141400 70%, #0d0f1a 100%);
}
.bg-locker-room {
  background: linear-gradient(135deg, #0d1a1a 0%, #0a0d1a 100%);
}
.bg-pitch {
  background: linear-gradient(180deg, #061206 0%, #0d3d10 45%, #082808 75%, #0d0f1a 100%);
}
.bg-transfer-room {
  background: linear-gradient(135deg, #0a0f1a 0%, #001a1a 100%);
}
.bg-stadium-night {
  background: linear-gradient(180deg, #04040d 0%, #0a0a20 30%, #1a1040 60%, #0d0f1a 100%);
}
.bg-tour-europe {
  background: linear-gradient(180deg, #0a1428 0%, #1a2a3d 50%, #0d0f1a 100%);
}
.bg-tour-asia {
  background: linear-gradient(180deg, #1a0a0a 0%, #3d1a1a 50%, #0d0f1a 100%);
}
.bg-tour-americas {
  background: linear-gradient(180deg, #0a1a0a 0%, #1a3d1a 50%, #0d0f1a 100%);
}
.bg-trophy-room {
  background: linear-gradient(180deg, #1a1200 0%, #3d2800 40%, #1a0a00 70%, #0d0f1a 100%);
}
.bg-dark-room {
  background: linear-gradient(135deg, #04040a 0%, #0a0a14 100%);
}

/* ============================================================
   METER BARS
   ============================================================ */

.meter-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.meter-fill.strength{ background: linear-gradient(90deg, #f56d42, #e04020); }
.meter-fill.morale  { background: linear-gradient(90deg, #3ddc84, #2bba6a); }
.meter-fill.board   { background: linear-gradient(90deg, #4d9ef5, #2a80e0); }
.meter-fill.media   { background: linear-gradient(90deg, #f5c842, #e0a820); }
.meter-fill.fan     { background: linear-gradient(90deg, #f54280, #c41f5e); }
.meter-fill.star    { background: linear-gradient(90deg, #9b6af5, #7a4ae0); }

/* ============================================================
   SHARED UI COMPONENTS
   ============================================================ */

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--accent-gold);
  color: #0d0f1a;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  border-radius: var(--radius-md);
  text-align: center;
  transition: opacity var(--transition), transform var(--transition);
  min-height: var(--tap-min);
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }

.btn-secondary {
  display: block;
  padding: 12px 20px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-bright);
  text-align: center;
  transition: background var(--transition);
  min-height: var(--tap-min);
}
.btn-secondary:active { background: var(--bg-card-hover); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-win    { background: rgba(61,220,132,0.2);  color: var(--accent-green); }
.badge-draw   { background: rgba(245,200,66,0.2);  color: var(--accent-gold);  }
.badge-loss   { background: rgba(224,85,85,0.2);   color: var(--accent-red);   }
.badge-league { background: rgba(77,158,245,0.2);  color: var(--accent-blue);  }
.badge-cup    { background: rgba(155,106,245,0.2); color: var(--accent-purple);}

/* ============================================================
   DEBUG OVERLAY
   ============================================================ */

#debug-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#debug-overlay.hidden { display: none; }
.debug-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}
.debug-content h3 { color: var(--accent-gold); margin-bottom: 12px; }
#debug-text { font-size: 11px; color: #aaa; white-space: pre-wrap; line-height: 1.6; }
.debug-content button {
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--accent-red);
  color: white;
  border-radius: 6px;
  font-size: 13px;
}

/* ============================================================
   SCROLLBAR (desktop)
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }
