/* ═══════════════════════════════════════════════════════════
   HeroBond Design System v1.0
   Shared tokens, typography, buttons, cards, and utilities.
   Import in every page: <link rel="stylesheet" href="/css/design-system.css">
   ═══════════════════════════════════════════════════════════ */

/* ── Google Fonts (preloaded by each page, kept here for reference) ── */
/* Cinzel 400,500,600,700,800,900 — all UI text */

:root {
  /* ── Backgrounds ── */
  --bg:           #08090c;
  --bg-warm:      #0a0a0f;
  --surface:      #10121a;
  --panel:        #13151e;
  --panel-raised: #181a24;
  --overlay:      rgba(0, 0, 0, 0.85);

  /* ── Borders ── */
  --border:       rgba(255, 255, 255, 0.06);
  --border-mid:   rgba(255, 255, 255, 0.10);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-accent:rgba(240, 136, 62, 0.25);

  /* ── Text ── */
  --text:         #ffffff;
  --text-bright:  #f0f0f0;
  --text-body:    #c8ccd4;
  --text-muted:   #8890a0;
  --text-dim:     #555e70;
  --text-orange:  #f0b070;

  /* ── Brand / Accent ── */
  --orange:       #f0883e;
  --orange-dark:  #d06a20;
  --orange-light: #ffaa55;
  --red:          #e04050;
  --red-dark:     #bb2030;
  --green:        #44ee88;
  --green-dark:   #22bb55;
  --blue:         #55bbff;
  --blue-dark:    #2288dd;
  --purple:       #aa44ee;
  --purple-dark:  #7722bb;
  --gold:         #ffd700;
  --gold-dark:    #cc9900;

  /* ── Class Colors ── */
  --cls-warrior:  #dd7733;
  --cls-assassin: #aa44ee;
  --cls-tank:     #44aaee;
  --cls-mage:     #ee3366;
  --cls-ranger:   #44cc55;
  --cls-necro:    #66ddaa;

  /* ── Spacing (4px base) ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;

  /* ── Border Radius ── */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-full: 50%;

  /* ── Shadows ── */
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md:    0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg:    0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow:  0 0 12px;
  --shadow-glow-strong: 0 0 24px;

  /* ── Transitions ── */
  --ease-out:     cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast:       0.12s;
  --t-normal:     0.2s;
  --t-slow:       0.35s;

  /* ── Z-Index layers ── */
  --z-base:       1;
  --z-hud:        10;
  --z-dropdown:   50;
  --z-modal:      100;
  --z-overlay:    200;
  --z-toast:      300;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  color: var(--text-body);
  background: var(--bg);
  line-height: 1.4;
  user-select: none;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════ */

/* Display — hero headings, splash titles */
.t-display {
  font-family: 'Cinzel', serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.1;
  color: var(--text);
  text-transform: uppercase;
}

/* H1 — section titles, page headers */
.t-h1 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.2;
  color: var(--text);
  text-transform: uppercase;
}

/* H2 — card titles, player names */
.t-h2 {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.3;
  color: var(--text);
  text-transform: uppercase;
}

/* H3 — subtitles, button text */
.t-h3 {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.3;
  color: var(--text);
  text-transform: uppercase;
}

/* Body — descriptions, chat, paragraphs */
.t-body {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-body);
}

/* Label — stats, badges, field labels */
.t-label {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.3;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Micro — chips, timestamps, tiny labels */
.t-micro {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.2;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Mono — timers, countdowns, numeric displays */
.t-mono {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1;
}

/* Gradient text helper */
.t-gradient {
  background: linear-gradient(135deg, var(--orange), #ff5544);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.t-gold {
  background: linear-gradient(135deg, var(--gold), #ffaa33);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */

/* Shared button base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: var(--r-md);
  padding: 12px 28px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-normal) var(--ease-out),
              background var(--t-normal) var(--ease-out),
              border-color var(--t-normal) var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.97);
}

/* Primary — main CTAs, enroll, play */
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  box-shadow: 0 4px 20px rgba(240, 136, 62, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(240, 136, 62, 0.4);
}

/* Secondary — cancel, back, alt actions */
.btn-secondary {
  background: transparent;
  border: 2px solid var(--border-hover);
  color: var(--text-body);
}
.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

/* Ghost — inline actions, stat buttons, chat actions */
.btn-ghost {
  background: rgba(240, 136, 62, 0.08);
  border: 1px solid var(--border-accent);
  color: var(--text-orange);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 16px;
}
.btn-ghost:hover {
  background: rgba(240, 136, 62, 0.16);
  border-color: rgba(240, 136, 62, 0.5);
  box-shadow: 0 0 12px rgba(240, 136, 62, 0.15);
}

/* Danger — delete, leave, destructive */
.btn-danger {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: 0 4px 20px rgba(224, 64, 80, 0.2);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(224, 64, 80, 0.35);
}

/* Success — equip, confirm, accept */
.btn-success {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #000;
  box-shadow: 0 4px 20px rgba(68, 238, 136, 0.2);
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(68, 238, 136, 0.35);
}

/* Info — upgrade, secondary positive */
.btn-info {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  box-shadow: 0 4px 20px rgba(85, 187, 255, 0.2);
}
.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(85, 187, 255, 0.35);
}

/* Size variants */
.btn-sm {
  font-size: 11px;
  padding: 8px 16px;
  letter-spacing: 1px;
}
.btn-lg {
  font-size: 15px;
  padding: 14px 36px;
  letter-spacing: 2px;
}
.btn-block {
  width: 100%;
}

/* Icon-only button */
.btn-icon {
  padding: 10px;
  min-width: 40px;
  min-height: 40px;
}

/* Disabled state */
.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  pointer-events: none;
  transform: none !important;
}

/* ═══════════════════════════════════════
   CARDS & PANELS
   ═══════════════════════════════════════ */

/* Surface card — default container */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  transition: border-color var(--t-normal) var(--ease-out),
              transform var(--t-normal) var(--ease-out);
}
.card:hover {
  border-color: var(--border-mid);
}
.card-interactive:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
}

/* Elevated panel */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
}

/* Raised panel (higher elevation) */
.panel-raised {
  background: var(--panel-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: var(--sp-3);
}

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal) var(--ease-out);
}
.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  max-width: 480px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--t-slow) var(--ease-out);
}
.modal-overlay.visible .modal {
  transform: translateY(0);
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: var(--sp-4);
}

.modal-close {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: var(--sp-1);
  transition: color var(--t-fast);
}
.modal-close:hover {
  color: var(--text);
}

/* ═══════════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════════ */
.bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--t-normal) var(--ease-out);
}
.bar-hp     .bar-fill { background: linear-gradient(90deg, #22dd66, #44ee88); }
.bar-hp-mid .bar-fill { background: linear-gradient(90deg, #ddcc22, #eedd44); }
.bar-hp-low .bar-fill { background: linear-gradient(90deg, #dd3333, #ee5555); }
.bar-xp     .bar-fill { background: linear-gradient(90deg, #2266cc, #3399ff); }
.bar-gold   .bar-fill { background: linear-gradient(90deg, var(--orange), #ffcc44); }
.bar-season .bar-fill { background: linear-gradient(90deg, var(--purple), #cc66ff); }

.bar-lg { height: 12px; border-radius: 6px; }
.bar-lg .bar-fill { border-radius: 6px; }

/* ═══════════════════════════════════════
   BADGES & CHIPS
   ═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-xs);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
}
.badge-orange  { background: rgba(240, 136, 62, 0.15); color: var(--orange-light); border: 1px solid rgba(240, 136, 62, 0.3); }
.badge-green   { background: rgba(68, 238, 136, 0.12); color: var(--green);        border: 1px solid rgba(68, 238, 136, 0.25); }
.badge-red     { background: rgba(224, 64, 80, 0.12);  color: var(--red);          border: 1px solid rgba(224, 64, 80, 0.25); }
.badge-blue    { background: rgba(85, 187, 255, 0.12); color: var(--blue);         border: 1px solid rgba(85, 187, 255, 0.25); }
.badge-purple  { background: rgba(170, 68, 238, 0.12); color: var(--purple);       border: 1px solid rgba(170, 68, 238, 0.25); }
.badge-gold    { background: rgba(255, 215, 0, 0.12);  color: var(--gold);         border: 1px solid rgba(255, 215, 0, 0.25); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.chip .val {
  color: var(--gold);
  font-weight: 700;
}

/* ═══════════════════════════════════════
   STAT DISPLAY
   ═══════════════════════════════════════ */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* ═══════════════════════════════════════
   CURRENCY ROW (top bar)
   ═══════════════════════════════════════ */
.currency-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.currency-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.currency-item img {
  width: 22px;
  height: 22px;
}

/* ═══════════════════════════════════════
   TABS
   ═══════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-md);
  padding: 3px;
}
.tab {
  flex: 1;
  padding: 10px 16px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
  text-align: center;
}
.tab:hover {
  color: var(--text-muted);
}
.tab.active {
  background: var(--panel-raised);
  color: var(--orange);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════ */
.input {
  width: 100%;
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--t-fast);
}
.input::placeholder {
  color: var(--text-dim);
}
.input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(240, 136, 62, 0.1);
}

/* ═══════════════════════════════════════
   TOAST / ALERTS
   ═══════════════════════════════════════ */
.toast {
  position: fixed;
  top: var(--sp-4);
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: var(--z-toast);
  padding: 10px 24px;
  border-radius: var(--r-md);
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: transform var(--t-slow) var(--ease-out);
  pointer-events: none;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
}
.toast-success { background: rgba(68, 238, 136, 0.9); color: #000; }
.toast-error   { background: rgba(224, 64, 80, 0.9);  color: #fff; }
.toast-warning { background: rgba(240, 200, 50, 0.9); color: #000; }
.toast-info    { background: rgba(85, 187, 255, 0.9); color: #000; }

/* ═══════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ═══════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════ */
.flex       { display: flex; }
.flex-col   { display: flex; flex-direction: column; }
.flex-center{ display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════
   GRADIENTS (reusable)
   ═══════════════════════════════════════ */
.gradient-primary { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); }
.gradient-danger  { background: linear-gradient(135deg, var(--red), var(--red-dark)); }
.gradient-success { background: linear-gradient(135deg, var(--green), var(--green-dark)); }
.gradient-info    { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); }
.gradient-purple  { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); }
.gradient-gold    { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); }

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.12; transform: scale(1); }
  50%      { opacity: 0.22; transform: scale(1.08); }
}

.anim-fade-in  { animation: fadeIn var(--t-slow) var(--ease-out) both; }
.anim-slide-up { animation: slideUp var(--t-slow) var(--ease-out) both; }
.anim-pulse    { animation: pulse 2s ease-in-out infinite; }

/* ═══════════════════════════════════════
   FLOATING BACKGROUND (Rush Royale style)
   ═══════════════════════════════════════ */
.floating-bg-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
/* Tile always behind content via z-index:-1 in JS */
