/* ============================================================
   Spectacular 500 — CSS v2
   Mobile-first redesign. Colors identical to v1. All legacy
   class names preserved — drop-in replacement for style.css.
   ============================================================ */

/* --- Google Font: Orbitron for display numbers --- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&display=swap');

/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Brand colors — UNCHANGED from v1 */
  --bg: #030008;
  --panel: #0b0714;
  --panel2: #111827;
  --green: #39ff14;
  --pink: #ff2bd6;
  --yellow: #ffe600;
  --cyan: #00e5ff;
  --muted: #b6a9c9;
  --red: #ff1744;

  /* Computed / glow variants */
  --green-glow:  rgba(57,255,20,0.18);
  --pink-glow:   rgba(255,43,214,0.18);
  --cyan-glow:   rgba(0,229,255,0.15);
  --yellow-glow: rgba(255,230,0,0.14);
  --red-glow:    rgba(255,23,68,0.18);

  /* Borders */
  --border:        rgba(255,255,255,0.1);
  --border-green:  rgba(57,255,20,0.3);
  --border-pink:   rgba(255,43,214,0.28);
  --border-cyan:   rgba(0,229,255,0.28);
  --border-yellow: rgba(255,230,0,0.3);

  /* Text */
  --text:     #f5f3ff;
  --text-dim: #ddd2ef;

  /* Layout */
  --tape-h: 42px;
  --nav-h:  58px;
  --content-max: 1400px;
  --side-pad: clamp(14px, 5vw, 72px);

  /* Radius */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   26px;
  --r-pill: 999px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse 90% 60% at 15% 10%, #1a0528 0%, #030008 55%, #000 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin-top: 0; }
p { margin-top: 0; }
img { max-width: 100%; }

/* ============================================================
   TICKER TAPE
   ============================================================ */
.ticker-tape {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #000;
  border-bottom: 2px solid var(--green);
  box-shadow: 0 0 20px var(--green-glow), 0 2px 16px rgba(0,0,0,0.9);
  overflow: hidden;
  height: var(--tape-h);
  display: flex;
  align-items: center;
}

/* Legacy inner span — kept for compatibility */
.ticker-tape > span:not(.ticker-scroll):not(.ticker-fixed-label) {
  display: inline-block;
  padding-left: 100%;
  animation: tape 360s linear infinite;
  color: var(--green);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  text-shadow: 0 0 10px var(--green);
  font-weight: 800;
}
@keyframes tape { 0%{transform:translateX(0)} 100%{transform:translateX(-100%)} }

/* v21 + architecture */
.ticker-fixed-label {
  flex: 0 0 auto;
  display: flex !important;
  align-items: center;
  height: var(--tape-h);
  padding: 0 16px;
  color: var(--yellow) !important;
  background: #000;
  border-right: 1px solid var(--border-yellow);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px rgba(255,230,0,0.8);
  animation: none !important;
  transform: none !important;
}

.ticker-window {
  flex: 1 1 auto;
  overflow: hidden;
  height: var(--tape-h);
  display: flex;
  align-items: center;
}

.ticker-scroll {
  display: inline-flex !important;
  align-items: center;
  gap: 14px;
  min-width: max-content;
  padding-left: 0 !important;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 900;
  font-size: 0.82rem;
  animation: tickerLoop 420s linear infinite !important;
  will-change: transform;
}
.ticker-tape:hover .ticker-scroll { animation-play-state: paused !important; }

@keyframes tickerLoop {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 10px;
  white-space: nowrap;
  animation: none !important;
}
.ticker-item.up   { color: var(--green) !important; text-shadow: 0 0 8px var(--green-glow); }
.ticker-item.down { color: #ff4d6d !important; text-shadow: 0 0 8px rgba(255,77,109,0.6); }
.ticker-item.flat { color: var(--cyan) !important; }
.ticker-item b    { color: var(--yellow) !important; font-size: 0.72em; opacity: 0.88; }
.ticker-price     { color: #fff !important; opacity: 0.95; }
.ticker-change    { font-weight: 900; }
.ticker-item em   { font-style: normal; color: var(--muted) !important; opacity: 0.8; font-size: 0.85em; }
.ticker-sep       { color: var(--cyan) !important; opacity: 0.45; margin: 0 6px; }

/* ============================================================
   TOP NAV BAR
   ============================================================ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--side-pad);
  height: var(--nav-h);
  background: rgba(3,0,8,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--tape-h);
  z-index: 20;
}

.brand {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-shadow: 0 0 18px rgba(57,255,20,0.55);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; opacity: 0.85; }

.topbar nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.topbar nav a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.topbar nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

/* --- Mobile hamburger toggle --- */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* --- Mobile overlay nav --- */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3,0,8,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: block;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 16px 40px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 320px;
  text-align: center;
  text-decoration: none;
  transition: all 0.15s ease;
}
.mobile-nav a:hover, .mobile-nav a:active {
  background: rgba(57,255,20,0.08);
  border-color: var(--border-green);
  color: var(--green);
  text-decoration: none;
}
.mobile-nav .mn-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--muted);
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 720px) {
  .topbar nav { display: none; }
  .nav-toggle  { display: flex; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--r-pill);
  padding: 11px 22px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}
.button:hover { text-decoration: none; filter: brightness(1.12); transform: translateY(-1px); }
.button:active { transform: translateY(0); filter: brightness(0.95); }

.neon-green  { background: var(--green);  color: #041000; box-shadow: 0 0 20px var(--green-glow),  0 2px 8px rgba(0,0,0,0.4); }
.neon-pink   { background: var(--pink);   color: #fff;    box-shadow: 0 0 20px var(--pink-glow),   0 2px 8px rgba(0,0,0,0.4); }
.neon-yellow { background: var(--yellow); color: #160e00; box-shadow: 0 0 20px var(--yellow-glow), 0 2px 8px rgba(0,0,0,0.4); }
.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.24);
}
.ghost:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.06); }

.button.small { font-size: 0.75rem; padding: 7px 14px; }
.button.neon-yellow.small { background: var(--yellow); color: #130e00; box-shadow: 0 0 12px var(--yellow-glow); }

/* ============================================================
   HERO (HOME PAGE)
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr;
  gap: 28px;
  padding: clamp(32px, 5vw, 72px) var(--side-pad) 28px;
  align-items: center;
}

.eyebrow {
  color: var(--yellow);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
  text-shadow: 0 0 8px var(--yellow-glow);
}

.hero h1 {
  font-family: 'Orbitron', ui-monospace, monospace;
  font-size: clamp(1.8rem, 5vw, 5.2rem);
  line-height: 0.92;
  margin: 0.1em 0 0.35em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 14px var(--pink-glow), 0 0 40px rgba(255,43,214,0.15);
}

.subtitle {
  max-width: 820px;
  color: var(--text-dim);
  font-size: 1.03rem;
  line-height: 1.65;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ============================================================
   PANELS / CARDS
   ============================================================ */
.glow-card, .panel {
  background: linear-gradient(160deg, rgba(22,14,34,0.97) 0%, rgba(7,3,14,0.97) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xl);
  box-shadow: 0 0 32px rgba(255,43,214,0.08), 0 4px 24px rgba(0,0,0,0.5);
  padding: clamp(16px, 3vw, 26px);
}

.panel h2 {
  margin: 0 0 16px;
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255,230,0,0.4);
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  font-weight: 900;
}
.panel h3 { color: var(--cyan); margin: 0 0 10px; font-size: 0.97rem; }

.index-card { text-align: center; }

/* ============================================================
   SCOREBOARD GRID (HOME)
   ============================================================ */
.scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 18px var(--side-pad) 60px;
}
.big  { grid-column: span 2; }
.wide { grid-column: span 2; }

/* ============================================================
   RANK / METRIC ROWS
   ============================================================ */
.rank-row, .metric-line {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.rank-row:last-child, .metric-line:last-child { border-bottom: none; }

.rank { font-weight: 900; color: var(--pink); font-size: 1.05rem; }
.rank-row strong, .metric-line strong { color: var(--green); font-weight: 900; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard {
  padding: clamp(20px, 4vw, 40px) var(--side-pad) 80px;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

.dashboard h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #fff;
  text-shadow: 0 0 20px var(--pink-glow);
  margin-bottom: 22px;
}

/* ============================================================
   SIM TIME BANNER
   ============================================================ */
.sim-time-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border-cyan);
  background: linear-gradient(90deg, rgba(0,229,255,0.06), rgba(255,43,214,0.06));
  border-radius: var(--r-xl);
  padding: 18px 22px;
  margin-bottom: 22px;
}
.sim-time-banner strong {
  display: block;
  color: var(--green);
  font-size: 1.2rem;
  font-family: 'Orbitron', ui-monospace, monospace;
  text-shadow: 0 0 10px var(--green-glow);
  margin-bottom: 4px;
}
.sim-time-banner p { margin: 0; color: var(--text-dim); font-size: 0.85rem; line-height: 1.5; }

/* ============================================================
   PORTFOLIO METRICS
   ============================================================ */
.portfolio-metrics, .admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.metric strong {
  display: block;
  font-size: 1.85rem;
  color: var(--green);
  font-family: 'Orbitron', ui-monospace, monospace;
  margin: 4px 0 8px;
  text-shadow: 0 0 14px var(--green-glow);
  font-weight: 900;
}
.metric p { margin: 0; font-size: 0.82rem; }

/* ============================================================
   TRADE FORM — IMPROVED
   ============================================================ */
.trade-form {
  display: grid;
  grid-template-columns: 160px 1fr 120px auto;
  gap: 12px;
  align-items: end;
}

.trade-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trade-form select,
.trade-form input[type="number"],
.trade-form input[type="text"],
.trade-form input[readonly] {
  background: rgba(5,1,10,0.9);
  color: #fff;
  border: 1px solid rgba(90,73,105,0.7);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.94rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.trade-form select:focus,
.trade-form input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0,229,255,0.15);
}

/* Shares owned / trade cost info box */
.trade-info-box {
  background: rgba(0,229,255,0.05);
  border: 1px solid var(--border-cyan);
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: 0.87rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 10px;
  display: none;
}
.trade-info-box.visible { display: block; }
.trade-info-box strong  { color: var(--cyan); }
.trade-info-highlight   { color: var(--green);  font-weight: 900; }
.trade-info-warn        { color: var(--yellow); font-weight: 700; }
.trade-info-danger      { color: #ff4a78;       font-weight: 700; }

/* "Sell All" / "Max" quick-fill row */
.trade-quick-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.trade-quick-label { color: var(--muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }

.trade-note {
  margin: 12px 0 0;
  color: var(--yellow);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ============================================================
   TEACHING / CHECKLIST BOXES
   ============================================================ */
.teaching-box {
  border-left: 4px solid var(--yellow);
  background: linear-gradient(135deg, rgba(255,230,0,0.06), rgba(255,230,0,0.02));
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 18px;
  margin: 16px 0;
}
.teaching-box h3 {
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 10px;
}
.teaching-box p, .teaching-box li {
  color: var(--text-dim);
  line-height: 1.65;
  font-size: 0.92rem;
  margin: 0 0 6px;
}
.teaching-box ul { margin: 6px 0 0; padding-left: 20px; }
.teaching-box li + li { margin-top: 4px; }

/* Checklist box — green variant */
.checklist-box {
  background: linear-gradient(135deg, rgba(57,255,20,0.05), rgba(57,255,20,0.02));
  border: 1px solid var(--border-green);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin: 16px 0;
}
.checklist-box h3 {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
  text-shadow: 0 0 8px var(--green-glow);
}
.checklist-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(57,255,20,0.1);
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.checklist-item:last-child { border-bottom: none; }
.ci-icon { color: var(--green); flex-shrink: 0; margin-top: 1px; font-size: 1em; }
.checklist-item strong { color: var(--cyan); }

/* Info callout — cyan */
.info-callout {
  background: rgba(0,229,255,0.05);
  border: 1px solid var(--border-cyan);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 0.87rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 12px 0;
}
.info-callout strong { color: var(--cyan); }

/* Shares owned callout on company page */
.shares-owned-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(57,255,20,0.06);
  border: 1px solid var(--border-green);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.shares-owned-callout strong {
  color: var(--green);
  font-size: 1.1rem;
  font-family: 'Orbitron', ui-monospace, monospace;
}
.shares-owned-callout span { color: var(--muted); }

/* ============================================================
   NOTICES / ALERTS
   ============================================================ */
.notice {
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notice.good { background: rgba(57,255,20,0.1);  border: 1px solid var(--border-green); color: var(--green); }
.notice.bad  { background: rgba(255,23,68,0.1);  border: 1px solid rgba(255,23,68,0.35); color: #ff7a7a; }

/* ============================================================
   LABELS, BADGES, MEGA, PILLS
   ============================================================ */
.label, .small-muted { color: var(--muted); font-size: 0.86rem; }

.mega {
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  font-weight: 900;
  font-family: 'Orbitron', ui-monospace, monospace;
  color: var(--green);
  text-shadow: 0 0 20px var(--green-glow);
  line-height: 1;
  margin: 8px 0;
}

.pill {
  display: inline-block;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 4px 10px;
  margin: 2px 2px;
  color: #fff;
  background: rgba(255,255,255,0.06);
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  border: 1px solid var(--border-yellow);
  color: var(--yellow);
  border-radius: var(--r-pill);
  padding: 7px 12px;
  background: var(--yellow-glow);
  font-weight: 800;
  font-size: 0.82rem;
}

.trend {
  font-weight: 900;
  border-radius: var(--r-pill);
  padding: 3px 8px;
  display: inline-block;
  margin-left: 4px;
  font-size: 0.88em;
}
.trend.up   { color: var(--green); background: rgba(57,255,20,0.1);  border: 1px solid rgba(57,255,20,0.3); }
.trend.down { color: #ff4a78;      background: rgba(255,23,68,0.1);  border: 1px solid rgba(255,23,68,0.3); }
.trend.flat { color: var(--yellow);background: rgba(255,230,0,0.07); border: 1px solid rgba(255,230,0,0.25); }

.muted { color: var(--muted); }

/* Gain/loss text classes */
.gain-positive { color: var(--green); font-weight: 800; }
.gain-negative { color: #ff4a78;      font-weight: 800; }
.gain-flat     { color: var(--yellow); font-weight: 800; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
}
table { width: 100%; border-collapse: collapse; }

th {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-cyan);
  text-align: left;
  white-space: nowrap;
  background: rgba(0,229,255,0.04);
}
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.portfolio-holdings-table td,
.portfolio-holdings-table th { white-space: nowrap; }

.holding-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ============================================================
   COMPANY PAGE
   ============================================================ */
.company-page .article-body { font-size: 1.02rem; line-height: 1.65; }

.company-header {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin-bottom: 20px;
}

.leader-box {
  border: 1px solid var(--border-yellow);
  background: rgba(255,230,0,0.04);
  border-radius: var(--r-xl);
  padding: 20px;
}
.leader-box h2 {
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
}

.price-chart {
  height: 200px;
  border: 1px solid var(--border-green);
  border-radius: var(--r-lg);
  background: rgba(0,0,0,0.4);
  padding: 10px;
  overflow: hidden;
}

/* Quote metric grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.04);
  padding: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.metric-card:hover {
  border-color: var(--border-cyan);
  background: rgba(0,229,255,0.04);
}
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.metric-card strong {
  display: block;
  color: var(--green);
  font-size: 1.12rem;
  font-weight: 900;
  font-family: 'Orbitron', ui-monospace, monospace;
  margin: 4px 0;
  text-shadow: 0 0 8px rgba(57,255,20,0.3);
}
.metric-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.mini-metrics span {
  background: rgba(255,255,255,0.05);
  border-radius: var(--r-sm);
  padding: 6px 8px;
}

/* ============================================================
   RESEARCH PAGE
   ============================================================ */
.research-tools {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.research-tools input,
.research-tools select {
  background: rgba(5,1,10,0.9);
  color: #fff;
  border: 1px solid rgba(90,73,105,0.7);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.15s;
  width: 100%;
}
.research-tools input:focus,
.research-tools select:focus { outline: none; border-color: var(--cyan); }

.research-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.research-cta h2 { margin: 0 0 4px; }
.research-cta p  { margin: 0; color: var(--text-dim); font-size: 0.87rem; }

/* ============================================================
   COMPANY CARDS
   ============================================================ */
.company-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.company-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--border-pink);
  background: rgba(255,43,214,0.04);
  border-radius: var(--r-lg);
  padding: 14px;
  color: var(--text);
  transition: all 0.15s ease;
  min-height: 150px;
}
.company-card:hover {
  border-color: var(--pink);
  box-shadow: 0 0 22px var(--pink-glow);
  transform: translateY(-2px);
  text-decoration: none;
}
.company-card strong { color: var(--green); font-size: 1.05rem; }
.company-card .trend { float: right; }

/* ============================================================
   NEWS
   ============================================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 12px;
}

.news-card {
  border: 1px solid var(--border-cyan);
  border-radius: var(--r-lg);
  padding: 14px;
  background: rgba(0,229,255,0.04);
  transition: all 0.15s;
}
.news-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 18px var(--cyan-glow);
}
.news-card h3 { margin: 0.2rem 0 0.5rem; color: var(--cyan); font-size: 0.96rem; line-height: 1.3; }
.news-card h3 a { color: var(--cyan); text-decoration: none; }
.news-card h3 a:hover { text-decoration: underline; }
.news-meta {
  font-size: 0.73rem;
  color: var(--yellow);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.news-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.article-body { font-size: 1.05rem; line-height: 1.7; color: #eee4ff; margin: 20px 0; }
.news-page h1 { font-size: clamp(2rem, 4vw, 3.6rem); }

/* ============================================================
   LEADERBOARD
   ============================================================ */
.leaderboard-page .scoreboard-grid { grid-template-columns: 1fr; }
.full-list .rank-row { grid-template-columns: 70px 1fr repeat(3, 130px); }

/* ============================================================
   MOST HELD CARDS
   ============================================================ */
.most-held-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  align-items: stretch;
}
.most-held-card {
  display: block;
  text-decoration: none;
  color: var(--text-dim);
  border: 1px solid var(--border-green);
  border-radius: var(--r-lg);
  padding: 14px;
  background: linear-gradient(180deg, rgba(57,255,20,0.06), rgba(0,0,0,0.3));
  min-height: 130px;
  overflow: hidden;
  transition: all 0.12s ease;
}
.most-held-card:hover {
  border-color: var(--green);
  box-shadow: 0 0 20px var(--green-glow);
  transform: translateY(-2px);
  text-decoration: none;
}
.mh-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 6px; }
.mh-top strong { color: var(--cyan); font-size: 1.1rem; letter-spacing: 0.04em; }
.mh-name { color: #fff; font-weight: 700; font-size: 0.85rem; line-height: 1.2; min-height: 2em; margin-bottom: 8px; }
.mh-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 0.82rem; align-items: center; }
.mh-grid span { color: var(--muted); }
.mh-grid b    { color: var(--green); text-align: right; }

/* ============================================================
   STOCK PILLS
   ============================================================ */
.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.stock-pill {
  border: 1px solid var(--border-green);
  border-radius: var(--r-md);
  padding: 10px 12px;
  background: rgba(57,255,20,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  transition: all 0.12s;
  color: #fff;
  text-decoration: none;
}
.stock-pill:hover { border-color: var(--green); background: rgba(57,255,20,0.1); }

/* ============================================================
   INDEX CARD LINK (HOME)
   ============================================================ */
.index-card-link { display: block; color: #fff; text-decoration: none; }
.index-card-link:hover {
  transform: translateY(-3px);
  transition: 0.15s ease;
  box-shadow: 0 0 36px var(--green-glow), 0 0 36px var(--pink-glow);
  text-decoration: none;
}

/* ============================================================
   INSTRUCTIONS PAGE
   ============================================================ */
.instruction p, .instruction li { line-height: 1.7; color: #e9dcff; }

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.instruction-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.15s;
}
.instruction-card:hover { border-color: var(--border-cyan); }
.instruction-card h3 { color: var(--cyan); margin: 0 0 8px; font-size: 1rem; }
.instruction-card p  { margin: 0; font-size: 0.9rem; color: var(--text-dim); line-height: 1.55; }

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #020a00;
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--green-glow);
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.vocab-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  background: rgba(255,255,255,0.03);
}
.vocab-card dt { color: var(--yellow); font-weight: 900; font-size: 0.88rem; margin-bottom: 4px; }
.vocab-card dd { margin: 0; color: var(--text-dim); font-size: 0.86rem; line-height: 1.5; }

/* ============================================================
   MISC
   ============================================================ */
pre {
  white-space: pre-wrap;
  background: rgba(2,0,3,0.85);
  border: 1px solid #30243b;
  border-radius: var(--r-md);
  padding: 14px;
  overflow: auto;
  font-size: 0.87rem;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero                   { grid-template-columns: 1fr; }
  .scoreboard-grid        { grid-template-columns: 1fr 1fr; }
  .big, .wide             { grid-column: span 2; }
  .company-header         { grid-template-columns: 1fr; }
  .full-list .rank-row    { grid-template-columns: 40px 1fr auto; }
  .hide-mobile            { display: none; }
  .trade-form             { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .scoreboard-grid        { grid-template-columns: 1fr; }
  .big, .wide             { grid-column: auto; }
  .trade-form             { grid-template-columns: 1fr; }
  .research-tools         { grid-template-columns: 1fr; }
  .sim-time-banner,
  .research-cta           { grid-template-columns: 1fr; }
  .portfolio-holdings-table td,
  .portfolio-holdings-table th { white-space: normal; }
  .most-held-grid         { grid-template-columns: 1fr 1fr; }
  .company-list           { grid-template-columns: 1fr; }
  .full-list .rank-row    { grid-template-columns: 40px 1fr; }
  .actions                { flex-direction: column; align-items: flex-start; }
  .holding-actions        { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .most-held-grid         { grid-template-columns: 1fr; }
  .metric-grid            { grid-template-columns: 1fr 1fr; }
  .portfolio-metrics      { grid-template-columns: 1fr; }
  .instruction-grid       { grid-template-columns: 1fr; }
  .vocab-grid             { grid-template-columns: 1fr; }
  .hero h1                { font-size: 1.9rem; }
}

/* ============================================================
   LEGACY COMPATIBILITY — keep every class from v1 working
   ============================================================ */
/* These were in v1 but are now no longer needed; kept as stubs
   so any PHP that outputs them doesn't break layout. */
.clickable-news { position: relative; }
.news-link      { display: block; color: inherit; text-decoration: none; }

/* v20–v21 ticker stubs — overridden above but preserved */
.ticker-label  { color: var(--yellow); margin-right: 24px; }
.ticker-item b { color: var(--yellow) !important; }

/* ============================================================
   Spectacular 500 — UI System v3
   Visual cleanup pass:
   - More symmetrical page grids
   - Equal-width cards / columns
   - Cleaner spacing rhythm
   - Stronger page structure while preserving existing palette
   ============================================================ */

:root {
  --content-max: 1360px;
  --side-pad: clamp(18px, 3.2vw, 46px);
  --section-gap: clamp(16px, 2vw, 22px);
  --card-gap: clamp(12px, 1.5vw, 18px);
  --panel-pad: clamp(18px, 2.25vw, 28px);
  --surface-1: rgba(16, 10, 28, 0.96);
  --surface-2: rgba(9, 5, 18, 0.96);
  --surface-3: rgba(255,255,255,0.035);
}

body {
  background:
    radial-gradient(circle at 16% 8%, rgba(255,43,214,0.12), transparent 34rem),
    radial-gradient(circle at 84% 14%, rgba(0,229,255,0.10), transparent 30rem),
    radial-gradient(circle at 50% 110%, rgba(57,255,20,0.07), transparent 38rem),
    linear-gradient(180deg, #05010b 0%, #030008 42%, #020006 100%);
}

.hero,
.dashboard,
.scoreboard-grid {
  width: min(100%, var(--content-max));
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Navigation polish ---------- */
.topbar {
  padding-left: var(--side-pad);
  padding-right: var(--side-pad);
}

.topbar nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.mobile-nav a {
  min-width: min(320px, 100%);
  text-align: center;
}

/* ---------- Global rhythm ---------- */
.dashboard {
  display: grid;
  gap: var(--section-gap);
  padding-top: clamp(22px, 3vw, 36px);
}

.dashboard > * {
  min-width: 0;
}

.dashboard > .panel,
.dashboard > .company-header,
.dashboard > .portfolio-metrics,
.dashboard > .sim-time-banner,
.dashboard > .notice {
  margin-bottom: 0 !important;
}

.dashboard h1 {
  margin: 0;
  padding: 4px 0 2px;
  letter-spacing: -0.02em;
}

.site-footer {
  width: min(100%, var(--content-max));
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Panel system ---------- */
.glow-card,
.panel,
.leader-box {
  background:
    linear-gradient(145deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.015) inset,
    0 16px 40px rgba(0,0,0,0.38),
    0 0 28px rgba(255,43,214,0.06);
}

.panel,
.glow-card {
  padding: var(--panel-pad);
}

.panel {
  min-width: 0;
}

.panel h2 {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
}

.panel > :last-child,
.leader-box > :last-child,
.teaching-box > :last-child,
.checklist-box > :last-child,
.info-callout > :last-child {
  margin-bottom: 0;
}

.article-body,
.subtitle,
.panel p,
.news-card p,
.company-card p {
  max-width: 82ch;
}

/* ---------- Home page: balanced hero and cards ---------- */
.hero {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 32px);
  padding-top: clamp(30px, 4vw, 54px);
  padding-bottom: 22px;
}

.hero > * {
  min-width: 0;
}

.scoreboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap);
  align-items: stretch;
  padding-top: 18px;
  padding-bottom: 64px;
}

.scoreboard-grid > * {
  min-width: 0;
  height: 100%;
}

.big,
.wide {
  grid-column: auto;
}

/* ---------- Simulation / dashboard ---------- */
.sim-time-banner {
  min-height: 120px;
  border-radius: var(--r-xl);
  padding: clamp(18px, 2vw, 24px);
}

.portfolio-metrics,
.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
}

.portfolio-metrics > *,
.admin-grid > * {
  min-width: 0;
  height: 100%;
}

.metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}

.trade-form {
  grid-template-columns: minmax(130px, 0.8fr) minmax(280px, 1.8fr) minmax(110px, 0.7fr) minmax(168px, 0.9fr);
  gap: var(--card-gap);
}

.trade-form .button {
  min-height: 46px;
}

.trade-quick-row {
  margin-top: 10px;
}

.shares-owned-callout,
.info-callout,
.trade-info-box,
.trade-note {
  border-radius: var(--r-lg);
}

/* ---------- Tables ---------- */
.table-wrap {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  border-radius: var(--r-lg);
}

table {
  overflow: hidden;
}

th {
  background: rgba(0,229,255,0.06);
}

td {
  background: rgba(255,255,255,0.01);
}

tr:hover td {
  background: rgba(255,255,255,0.045);
}

/* ---------- Company page ---------- */
.company-header {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--section-gap);
  align-items: stretch;
}

.company-header > * {
  min-width: 0;
  height: 100%;
}

.company-page .company-header > .panel,
.company-page .company-header > .leader-box {
  min-height: 100%;
}

.leader-box {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--panel-pad);
}

.price-chart {
  min-height: 220px;
  height: auto;
  display: flex;
  align-items: center;
}

.price-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}

.metric-grid > * {
  min-width: 0;
  height: 100%;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
}

.metric-card p {
  max-width: none;
}

/* ---------- Research / lists ---------- */
.research-cta {
  gap: var(--card-gap);
}

.research-tools {
  gap: var(--card-gap);
}

.company-list,
.research-company-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
  align-items: stretch;
}

.company-list > *,
.research-company-grid > * {
  min-width: 0;
  height: 100%;
}

.company-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 182px;
  padding: 16px;
}

.company-card .trend {
  float: none;
  margin-left: auto;
}

.news-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
  align-items: stretch;
}

.news-grid > * {
  min-width: 0;
  height: 100%;
}

.news-grid > .small-muted {
  grid-column: 1 / -1;
  height: auto;
}

.news-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 16px;
}

.news-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card p {
  max-width: none;
}

/* ---------- Educational / instructions ---------- */
.instruction-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap);
  align-items: stretch;
}

.instruction-grid > * {
  min-width: 0;
  height: 100%;
}

.instruction-card {
  min-height: 152px;
  display: flex;
  flex-direction: column;
}

.vocab-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
  align-items: stretch;
}

.vocab-grid > * {
  min-width: 0;
  height: 100%;
}

.vocab-card {
  min-height: 124px;
  display: flex;
  flex-direction: column;
}

.checklist-box,
.teaching-box {
  padding: clamp(16px, 2vw, 22px);
}

/* ---------- Shared home/index supporting grids ---------- */
.most-held-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}

.most-held-grid > * {
  min-width: 0;
  height: 100%;
}

.stock-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}

/* ---------- Small utility polish ---------- */
.small-muted {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 12px;
}

.pill,
.trend {
  display: inline-flex;
  align-items: center;
}

.actions {
  gap: 12px;
}

/* ---------- Responsive redesign ---------- */
@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-list,
  .research-company-grid,
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .most-held-grid,
  .stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hero,
  .scoreboard-grid,
  .company-header,
  .portfolio-metrics,
  .admin-grid,
  .instruction-grid {
    grid-template-columns: 1fr;
  }

  .sim-time-banner,
  .research-cta {
    grid-template-columns: 1fr;
  }

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

  .metric {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .dashboard {
    gap: 16px;
  }

  .metric-grid,
  .company-list,
  .research-company-grid,
  .news-grid,
  .vocab-grid,
  .most-held-grid,
  .stock-grid,
  .trade-form,
  .research-tools {
    grid-template-columns: 1fr;
  }

  .panel,
  .glow-card,
  .leader-box {
    padding: clamp(16px, 4vw, 20px);
  }

  .sim-time-banner {
    min-height: auto;
  }

  .portfolio-holdings-table td,
  .portfolio-holdings-table th {
    white-space: nowrap;
  }
}


/* ============================================================
   Spectacular 500 — UI System v4
   Full-site graphical cleanup with a rebuilt home page.
   Keeps the existing neon palette and ticker while tightening
   spacing, page rhythm, card symmetry, and responsive behavior.
   ============================================================ */

:root {
  --content-max: 1380px;
  --side-pad: clamp(18px, 3.25vw, 48px);
  --home-gap: clamp(16px, 2vw, 22px);
  --home-pad: clamp(18px, 2.4vw, 30px);
  --panel-border-soft: rgba(255,255,255,0.12);
  --panel-border-bright: rgba(0,229,255,0.24);
}

.page-shell {
  width: min(100%, var(--content-max));
  margin-inline: auto;
  padding-inline: var(--side-pad);
}

.nav-join-button {
  min-height: 38px !important;
  padding: 7px 16px !important;
  font-size: 0.8rem !important;
}

/* ---------- Home: hero ---------- */
.home-page .topbar {
  border-bottom-color: rgba(255,255,255,0.12);
}

.home-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--home-gap);
  align-items: stretch;
  padding-top: clamp(26px, 4vw, 48px);
  padding-bottom: var(--home-gap);
}

.home-hero > * {
  min-width: 0;
}

.home-hero-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 100%;
  padding: clamp(22px, 3vw, 34px);
  border-color: rgba(255,43,214,0.22);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,43,214,0.14), transparent 21rem),
    radial-gradient(circle at 100% 100%, rgba(0,229,255,0.08), transparent 22rem),
    linear-gradient(150deg, rgba(22,14,34,0.98), rgba(7,3,14,0.98));
}

.home-hero-card h1 {
  font-family: 'Orbitron', ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(2rem, 4.3vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 14px;
  text-shadow: 0 0 20px rgba(255,43,214,0.22), 0 0 46px rgba(0,229,255,0.08);
}

.home-hero-card .subtitle {
  max-width: none;
  color: var(--text-dim);
  font-size: 1.02rem;
  line-height: 1.72;
  margin-bottom: 0;
}

.home-actions {
  margin-top: 0;
}

.home-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.home-feature-chip {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.035);
}

.home-feature-chip span {
  color: var(--yellow);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.home-feature-chip strong {
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.35;
}

.home-hero-stack {
  display: grid;
  grid-template-rows: minmax(250px, auto) minmax(0, 1fr);
  gap: var(--home-gap);
  min-height: 100%;
}

.home-index-card {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  min-height: 250px;
  padding: clamp(22px, 3vw, 34px);
  border-color: rgba(57,255,20,0.28);
  background:
    radial-gradient(circle at 92% 12%, rgba(57,255,20,0.18), transparent 16rem),
    radial-gradient(circle at 12% 88%, rgba(0,229,255,0.10), transparent 18rem),
    linear-gradient(145deg, rgba(16,19,28,0.98), rgba(5,3,12,0.98));
}

.home-index-card .label {
  color: var(--yellow);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.home-index-card .mega {
  font-family: 'Orbitron', ui-monospace, Menlo, Consolas, monospace;
  color: var(--green);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 0 24px rgba(57,255,20,0.28);
}

.home-index-card #indexChange a {
  color: var(--cyan);
  font-weight: 800;
}

.home-index-note {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 700;
}

.market-snapshot-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.market-snapshot-panel #marketBoxes {
  display: grid;
  gap: 0;
  min-height: 0;
}

.market-snapshot-panel .metric-line {
  grid-template-columns: 16px 1fr auto;
  min-height: 50px;
}

/* ---------- Home: quick start strip ---------- */
.home-teaching-strip {
  padding-top: 0;
  padding-bottom: var(--home-gap);
}

.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--home-gap);
  align-items: stretch;
}

.quick-start-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 228px;
  padding: clamp(18px, 2.2vw, 25px);
  border: 1px solid rgba(0,229,255,0.18);
  border-radius: var(--r-xl);
  background:
    linear-gradient(145deg, rgba(15,12,28,0.96), rgba(7,4,15,0.96));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.01) inset,
    0 12px 32px rgba(0,0,0,0.30);
}

.quick-start-card:nth-child(1) { border-color: rgba(57,255,20,0.24); }
.quick-start-card:nth-child(2) { border-color: rgba(0,229,255,0.24); }
.quick-start-card:nth-child(3) { border-color: rgba(255,230,0,0.24); }

.qsc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 1.35rem;
}

.quick-start-card h3 {
  color: var(--cyan);
  margin: 2px 0 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.quick-start-card p {
  color: var(--text-dim);
  line-height: 1.68;
  margin: 0;
  max-width: none;
}

/* ---------- Home: dashboard sections ---------- */
.home-main {
  display: grid;
  gap: var(--home-gap);
  padding-bottom: clamp(42px, 5vw, 72px);
}

.home-market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--home-gap);
  align-items: stretch;
}

.home-score-panel {
  display: flex;
  flex-direction: column;
  min-height: 310px;
}

.home-score-panel > div:last-child {
  flex: 1 1 auto;
}

.home-score-panel .rank-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
}

.home-score-panel .rank-row > div:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--home-gap);
  align-items: stretch;
}

.home-feature-grid > .panel {
  min-width: 0;
  min-height: 100%;
}

.home-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.home-section-heading h2 {
  margin-bottom: 8px;
}

.home-section-heading p {
  margin-bottom: 0;
}

.home-section-heading-inline {
  align-items: center;
}

.home-news-panel,
.home-stats-panel,
.home-most-held {
  display: flex;
  flex-direction: column;
}

.home-news-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

.home-news-grid .news-card {
  min-height: 0;
}

.home-news-grid .news-card p {
  line-height: 1.55;
}

.home-stats-panel #gameStats {
  display: grid;
  gap: 0;
}

.home-stats-panel .metric-line {
  grid-template-columns: 16px 1fr auto;
  min-height: 52px;
}

.home-stats-callout {
  margin-top: auto;
}

.home-most-held .most-held-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--home-gap);
}

.home-most-held .small-muted {
  grid-column: 1 / -1;
}

/* ---------- Broader site cleanup ---------- */
.dashboard {
  padding-top: clamp(22px, 3vw, 36px);
}

.dashboard > h1,
.news-page h1 {
  letter-spacing: -0.025em;
}

.dashboard > h1 {
  margin-bottom: 2px;
}

.dashboard > .subtitle {
  max-width: 90ch;
}

.panel,
.glow-card,
.leader-box,
.instruction-card,
.company-card,
.news-card,
.most-held-card,
.vocab-card {
  -webkit-font-smoothing: antialiased;
}

.research-tools input,
.research-tools select,
.trade-form select,
.trade-form input[type="number"],
.trade-form input[type="text"],
.trade-form input[readonly],
.admin-grid input,
.admin-grid select {
  min-height: 46px;
}

.news-page .panel,
.index-page .panel,
.leaderboard-page .panel {
  min-width: 0;
}

.news-page .article-body {
  padding-top: 4px;
}

.leaderboard-page .full-list .rank-row {
  min-height: 56px;
}

.research-desc {
  line-height: 1.55;
}

.company-card .mini-metrics {
  margin-top: auto;
}

/* ---------- Responsive home page ---------- */
@media (max-width: 1240px) {
  .home-market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-most-held .most-held-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .home-hero,
  .home-feature-grid {
    grid-template-columns: 1fr;
  }

  .home-hero-stack {
    grid-template-rows: auto auto;
  }

  .home-feature-strip {
    grid-template-columns: 1fr;
  }

  .quick-start-grid {
    grid-template-columns: 1fr;
  }

  .quick-start-card {
    min-height: 0;
  }

  .home-news-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding-inline: clamp(14px, 4vw, 18px);
  }

  .home-market-grid,
  .home-most-held .most-held-grid {
    grid-template-columns: 1fr;
  }

  .home-score-panel {
    min-height: 0;
  }

  .home-section-heading,
  .home-section-heading-inline {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-hero-card h1 {
    font-size: clamp(1.85rem, 8vw, 3rem);
  }
}

@media (max-width: 540px) {
  .home-hero {
    padding-top: 18px;
  }

  .home-hero-card,
  .home-index-card,
  .quick-start-card {
    padding: 17px;
  }

  .home-index-card .mega {
    font-size: 2.65rem;
  }

  .home-actions .button {
    width: 100%;
  }
}

/* ---------- v4 secondary-page refinements ---------- */
.research-count {
  margin: 14px 0 16px;
  font-weight: 700;
}

.research-browser-panel {
  display: flex;
  flex-direction: column;
}

.leaderboard-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.leaderboard-intro h2 {
  margin-bottom: 8px;
}

.leaderboard-label-row {
  display: grid;
  grid-template-columns: 70px 1fr repeat(3, 130px);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.leaderboard-row {
  grid-template-columns: 70px 1fr repeat(3, 130px);
}

.index-price-chart {
  height: 320px;
}

.index-teaching-panel {
  border-left-color: var(--green);
}

.news-article-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.news-company-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.news-article-body {
  padding: 8px 0 4px;
}

.news-investor-question {
  margin-top: 10px;
}

.news-action-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-grid form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 10px 0;
}

.admin-grid input[type="date"],
.admin-grid input:not([type]) {
  background: rgba(5,1,10,0.9);
  color: #fff;
  border: 1px solid rgba(90,73,105,0.7);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.94rem;
  width: 100%;
}

.admin-grid input[type="date"]:focus,
.admin-grid input:not([type]):focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0,229,255,0.15);
}

@media (max-width: 980px) {
  .leaderboard-label-row,
  .leaderboard-row {
    grid-template-columns: 54px 1fr 130px;
  }
}

@media (max-width: 720px) {
  .leaderboard-row {
    grid-template-columns: 44px 1fr;
  }

  .index-price-chart {
    height: 260px;
  }
}
