/* ============================================================
   BASE.CSS — STUMPED Design System Tokens & Reset
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  /* Background scale */
  --bg-deep:      #0e0e13;
  --bg-base:      #131318;
  --bg-surface:   #1b1b20;
  --bg-elevated:  #2a292f;
  --bg-input:     #35343a;

  /* Text */
  --text-primary:   #f0eff8;
  --text-secondary: #e4e1e9;
  --text-muted:     #bccac1;
  --text-faint:     rgba(188, 202, 193, 0.4);

  /* Brand / Orange accent */
  --accent:         #f97316;
  --accent-light:   #fb923c;
  --accent-glow:    rgba(249, 115, 22, 0.25);

  /* Mode accents */
  --fantasy-primary:  #7f77dd;
  --fantasy-bg:       rgba(127, 119, 221, 0.1);
  --auction-primary:  #fac775;
  --auction-bg:       rgba(250, 199, 117, 0.1);
  --trading-primary:  #1d9e75;
  --trading-bg:       rgba(29, 158, 117, 0.1);

  /* Status */
  --success:      #68dbae;
  --success-bg:   rgba(104, 219, 174, 0.1);
  --danger:       #ffb4ab;
  --danger-bg:    rgba(255, 180, 171, 0.1);
  --warning:      #ef9f27;
  --warning-bg:   rgba(239, 159, 39, 0.1);

  /* Borders */
  --border:           rgba(61, 73, 67, 0.15);
  --border-strong:    rgba(61, 73, 67, 0.3);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Sizing */
  --sidebar-width: 256px;
  --topbar-height: 64px;
  --ticker-height: 44px;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-pill:9999px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:   0 10px 25px rgba(0,0,0,0.4);
  --shadow-lg:   0 25px 50px rgba(0,0,0,0.5);
  --shadow-glow: 0 20px 30px -5px var(--accent-glow);

  /* Transitions */
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-secondary);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-input); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Typography helpers ── */
.mono { font-family: var(--font-mono); }
.text-xs   { font-size: 10px; }
.text-sm   { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 18px; }
.text-xl   { font-size: 24px; }
.text-2xl  { font-size: 30px; }
.text-3xl  { font-size: 36px; }
.text-4xl  { font-size: 48px; }
.text-5xl  { font-size: 60px; }
.text-6xl  { font-size: 72px; }

.uppercase { text-transform: uppercase; letter-spacing: 1px; }
.font-bold    { font-weight: 700; }
.font-black   { font-weight: 900; }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-faint   { color: var(--text-faint); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

/* ── Utility ── */
.hidden   { display: none !important; }
.flex     { display: flex; }
.grid     { display: grid; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.overflow-hidden { overflow: hidden; }

/* ── Animations ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-pulse { animation: pulse 2s infinite; }
.animate-spin  { animation: spin 0.8s linear infinite; }
.animate-slide-up { animation: slideUp 0.3s ease; }
.animate-fade-in  { animation: fadeIn 0.2s ease; }

/* ── Page transition ── */
.page-enter { animation: slideUp 0.25s ease; }

/* ── Live dot ── */
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--danger);
  animation: pulse 2s infinite;
}
.live-dot.green {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  animation: slideUp 0.3s ease;
  max-width: 320px;
  box-shadow: var(--shadow-md);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* ── Loading spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ── Logo mark ── */
.logo-mark {
  background: var(--accent-light);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(12deg);
  flex-shrink: 0;
}
.logo-text {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}
