/* ============================================================
   Cards 500 — Dark Bloomberg Terminal Aesthetic
   ============================================================ */

:root {
  --bg: #0D1117;
  --bg2: #161B22;
  --bg-card: #1C2128;
  --bg-card-hover: #252C35;
  --gold: #F5C518;
  --gold-dim: #C49B0E;
  --text: #E6EDF3;
  --text2: #8B949E;
  --green: #3FB950;
  --red: #F85149;
  --border: #30363D;
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dim); }
.gold { color: var(--gold); }
.mono { font-family: var(--mono); }

/* ---- Navigation ---- */
.nav { position: sticky; top: 0; z-index: 100; background: var(--bg2); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-logo { font-size: 20px; font-weight: 700; color: var(--text); }
.nav-logo span { color: var(--gold); }
.nav-badge { font-size: 11px; background: var(--gold); color: #000; padding: 2px 8px; border-radius: 4px; margin-left: 8px; font-weight: 600; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text2); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-link-dim { opacity: 0.5; }

/* ---- Ticker Tape ---- */
.ticker-bar { background: #0B1120; border-bottom: 1px solid var(--border); overflow: hidden; height: 36px; }
.ticker-bottom { border-top: 1px solid var(--border); border-bottom: none; }
.ticker-track { display: flex; align-items: center; height: 100%; }
.ticker-content { display: flex; white-space: nowrap; animation: scroll-left 60s linear infinite; }
.ticker-bottom .ticker-content { animation-duration: 80s; }
.ticker-item { display: inline-flex; align-items: center; gap: 6px; padding: 0 24px; font-family: var(--mono); font-size: 12px; color: var(--gold-dim); }
.ticker-item .sport-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; color: #000; }
.badge-mlb { background: #E31937; color: #fff; }
.badge-nba { background: #1D428A; color: #fff; }
.badge-nfl { background: #013369; color: #fff; }
.badge-nhl { background: #000; color: #fff; border: 1px solid #444; }
.ticker-price { font-weight: 600; color: var(--text); }
.ticker-up { color: var(--green); }
.ticker-down { color: var(--red); }

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

/* ---- Main ---- */
.main { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- Hero ---- */
.hero { padding: 60px 0 40px; text-align: center; }
.hero-content { display: flex; align-items: center; justify-content: center; gap: 40px; max-width: 1200px; margin: 0 auto; }
.hero-center { flex: 1; max-width: 800px; }
.hero-title { font-size: 48px; font-weight: 700; margin-bottom: 8px; }
.hero-subtitle { font-size: 18px; color: var(--text2); margin-bottom: 40px; }
.hero-figures { display: flex; flex-direction: column; gap: 16px; width: 100px; }

/* Silhouettes */
.silhouette { width: 80px; height: 140px; opacity: 0.15; }
.sil-stroke { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw-sil 4s ease forwards; }
.sil-delay .sil-stroke { animation-delay: 1s; }
@keyframes draw-sil { to { stroke-dashoffset: 0; } }

/* ---- Index Cards Grid ---- */
.index-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.index-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: left; transition: border-color 0.2s, transform 0.2s; }
.index-card:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
.index-name { font-size: 12px; color: var(--text2); font-weight: 500; margin-bottom: 8px; }
.index-value { font-family: var(--mono); font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.index-change { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.index-change-pos { color: var(--green); }
.index-change-neg { color: var(--red); }
.index-sub { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* Skeleton loader */
.skeleton-card { pointer-events: none; }
.skeleton-text { background: linear-gradient(90deg, var(--bg2) 25%, var(--bg-card-hover) 50%, var(--bg2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; height: 18px; margin-bottom: 8px; }
.skeleton-row { background: linear-gradient(90deg, var(--bg2) 25%, var(--bg-card-hover) 50%, var(--bg2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; margin-bottom: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Hero App Badges (inline, above composite index) ---- */
.hero-badges { text-align: center; margin: 24px 0 8px; }
.hero-badge-row { display: flex; justify-content: center; gap: 12px; margin-bottom: 8px; }
.hero-store-badge { display: inline-block; position: relative; opacity: 0.45; cursor: default; }
.hero-badge-label { position: absolute; top: -6px; right: -6px; background: var(--gold); color: #000; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.hero-badge-sub { font-size: 13px; color: var(--text2); margin: 4px 0; }
.early-adopter-badge { display: inline-block; background: rgba(245,197,24,0.15); color: var(--gold); font-size: 12px; font-weight: 600; padding: 4px 14px; border-radius: 20px; border: 1px solid rgba(245,197,24,0.3); margin-top: 4px; }

/* ---- Composite Index (hero headline number) ---- */
.composite-index { text-align: center; margin: 32px 0 24px; }
.composite-label { font-size: 16px; color: var(--text2); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.composite-value { font-family: var(--mono); font-size: 56px; font-weight: 700; color: var(--gold); line-height: 1.1; }
.composite-change { margin-top: 8px; font-size: 16px; }

/* ---- Index Explainer ---- */
.index-explainer { font-size: 13px; color: var(--text2); text-align: center; margin: 20px auto 0; max-width: 640px; line-height: 1.6; }

/* ---- Info Tooltip (i) on index cards ---- */
.info-tip { display: inline-block; cursor: help; font-size: 14px; color: var(--text2); margin-left: 4px; opacity: 0.6; vertical-align: middle; }
.info-tip:hover { opacity: 1; color: var(--gold); }

/* ---- Index History Chart ---- */
.index-chart-wrap { margin: 28px auto 0; max-width: 720px; height: 220px; position: relative; }
.index-chart-empty { text-align: center; color: var(--text2); font-size: 14px; padding: 60px 0; }

/* (App badges moved to .hero-badges in hero section) */

/* ---- Market Data ---- */
.market-data { padding: 40px 0; max-width: 1200px; margin: 0 auto; }
.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.market-grid-3 { grid-template-columns: repeat(3, 1fr); }
.section-title { font-size: 20px; margin-bottom: 16px; }
.section-subtitle { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.section-desc { font-size: 12px; color: var(--text2); margin-bottom: 12px; }
.data-table { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.data-row { display: flex; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-row:last-child { border-bottom: none; }
.data-row:hover { background: var(--bg-card-hover); }
.data-player { flex: 1; font-weight: 500; }
.data-meta { color: var(--text2); font-size: 12px; }
.data-price { font-family: var(--mono); font-weight: 600; margin-left: 16px; }
.data-badge { margin-right: 8px; }

/* ---- Pitch ---- */
.pitch { padding: 60px 0; text-align: center; max-width: 1200px; margin: 0 auto; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 32px 24px; }
.feature-card-gold { border-color: rgba(245,197,24,0.3); background: linear-gradient(135deg, rgba(245,197,24,0.06) 0%, var(--bg-card) 100%); }
.feature-icon { font-size: 32px; margin-bottom: 16px; }
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text2); }
.pitch-cta { margin-top: 40px; }

/* ---- Buttons ---- */
.btn { display: inline-block; padding: 10px 24px; border-radius: 8px; font-weight: 600; font-size: 14px; border: none; cursor: pointer; transition: all 0.2s; font-family: var(--font); }
.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover { background: var(--gold-dim); color: #000; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text2); }
.btn-dim { background: var(--bg2); color: var(--text2); cursor: not-allowed; }
.btn-full { width: 100%; text-align: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-green { background: var(--green); color: #000; }
.btn-red { background: var(--red); color: #fff; }

/* ---- Pricing ---- */
.pricing-hero { text-align: center; padding: 60px 0 32px; }
.pricing-hero h1 { font-size: 42px; }
.pricing-cards { display: flex; justify-content: center; gap: 24px; padding: 0 24px 60px; flex-wrap: wrap; }
.price-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 40px 32px; width: 320px; position: relative; }
.price-card-featured { border-color: var(--gold); }
.price-badge { position: absolute; top: -12px; right: 24px; background: var(--gold); color: #000; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 4px; }
.price-tier { font-size: 14px; color: var(--text2); font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.price-amount { font-family: var(--mono); font-size: 42px; font-weight: 700; }
.price-cents { font-size: 20px; }
.price-period { font-size: 16px; color: var(--text2); font-weight: 400; }
.price-savings { color: var(--green); font-size: 13px; font-weight: 600; margin-top: 4px; }
.price-features { list-style: none; margin: 24px 0; }
.price-features li { padding: 6px 0; font-size: 14px; color: var(--text2); }
.price-features li::before { content: "\2713 "; color: var(--green); font-weight: 700; margin-right: 8px; }
.price-amount-wrap { margin-bottom: 4px; }
.price-strike { font-size: 16px; color: var(--text2); text-decoration: line-through; display: block; margin-bottom: 2px; }
.price-early-label { font-size: 12px; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
.price-lock-badge { font-size: 12px; color: var(--text2); background: rgba(245,197,24,0.08); border: 1px solid rgba(245,197,24,0.2); border-radius: 8px; padding: 8px 12px; margin-bottom: 16px; line-height: 1.4; }
.early-banner { max-width: 700px; margin: 0 auto 32px; padding: 16px 24px; background: rgba(245,197,24,0.08); border: 1px solid rgba(245,197,24,0.25); border-radius: 12px; display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--text); line-height: 1.5; }
.early-banner-icon { font-size: 24px; flex-shrink: 0; }

/* ---- Constituents (operator dashboard) ---- */
.const-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.const-header { padding: 12px 16px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; }
.const-header:hover { background: var(--bg-card-hover); }
.const-arrow { transition: transform 0.2s; color: var(--text2); }
.const-arrow.open { transform: rotate(90deg); }
.const-body { display: none; padding: 0 16px 16px; }
.const-body.open { display: block; }
.const-conc { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.const-bar { display: inline-block; height: 8px; background: var(--gold); border-radius: 4px; min-width: 2px; vertical-align: middle; }
.const-footer { font-size: 12px; color: var(--text2); margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }

/* ---- Simple Pages (success/cancel) ---- */
.simple-page { display: flex; justify-content: center; align-items: center; min-height: 60vh; padding: 40px 24px; }
.simple-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 48px; text-align: center; max-width: 480px; }
.simple-icon { font-size: 48px; margin-bottom: 16px; }
.simple-card h1 { font-size: 28px; margin-bottom: 12px; }
.simple-card p { color: var(--text2); margin-bottom: 24px; }
.simple-steps { text-align: left; margin: 24px 0; padding-left: 20px; color: var(--text2); }
.simple-steps li { margin-bottom: 8px; }
.simple-actions { display: flex; gap: 12px; justify-content: center; }

/* ---- Login ---- */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: var(--bg); }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 48px; width: 380px; text-align: center; }
.login-title { font-size: 28px; margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: var(--text2); margin-bottom: 32px; }
.login-back { display: block; margin-top: 24px; font-size: 13px; color: var(--text2); }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 14px; font-family: var(--font); }
.form-input:focus { outline: none; border-color: var(--gold); }
.form-input-sm { width: 240px; padding: 8px 12px; font-size: 13px; }

/* ---- Flash messages ---- */
.flash { padding: 12px 20px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash-error { background: rgba(248,81,73,0.15); color: var(--red); border: 1px solid var(--red); }

/* ---- Operator Dashboard ---- */
.op-container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.op-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.op-tab { padding: 10px 20px; font-size: 14px; font-weight: 500; background: none; border: none; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; font-family: var(--font); }
.op-tab:hover { color: var(--text); }
.op-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-badge { font-size: 11px; background: var(--red); color: #fff; padding: 1px 6px; border-radius: 10px; margin-left: 6px; }
.op-panel { display: none; }
.op-panel.active { display: block; }
.op-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.op-table-wrap { overflow-x: auto; }

/* Operator Tables */
.op-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.op-table th { text-align: left; padding: 10px 12px; background: var(--bg2); color: var(--text2); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.op-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.op-table tr:hover td { background: var(--bg-card); }
.op-table-sm { font-size: 12px; }
.op-table-sm th, .op-table-sm td { padding: 6px 10px; }

/* Stat Cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.stat-label { font-size: 12px; color: var(--text2); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* Badges */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--bg2); color: var(--text2); display: inline-block; }
.badge-green { background: rgba(63,185,80,0.15); color: var(--green); }
.badge-red { background: rgba(248,81,73,0.15); color: var(--red); }

/* Expiry color coding */
.exp-green { color: var(--green); }
.exp-yellow { color: #D29922; }
.exp-red { color: var(--red); font-weight: 600; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; width: 400px; max-width: 90vw; }
.modal h3 { margin-bottom: 20px; }
.modal .form-group { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* Prediction grid (side-by-side tables) */
.pred-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 767px) { .pred-grid { grid-template-columns: 1fr; } }

/* Tier badges */
.badge-blue { background: rgba(56,132,244,0.15); color: #3884F4; }
.badge-orange { background: rgba(210,153,34,0.15); color: #D29922; }
.badge-gray { background: var(--bg2); color: var(--text2); }

/* Spinner */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.2); border-top-color: #000; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.op-empty { color: var(--text2); text-align: center; padding: 40px; }
.op-error { color: var(--red); text-align: center; padding: 40px; }

/* ---- Footer ---- */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 24px; text-align: center; font-size: 13px; color: var(--text2); margin-top: 60px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text2); }

/* ---- Responsive ---- */
@media (max-width: 1023px) {
  .index-grid { grid-template-columns: repeat(2, 1fr); }
  .market-grid { grid-template-columns: 1fr; }
  .market-grid-3 { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-figures { display: none; }
  .composite-value { font-size: 40px; }
}

@media (max-width: 767px) {
  .index-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 32px; }
  .pricing-cards { flex-direction: column; align-items: center; }
  .nav-inner { padding: 0 16px; }
  .nav-links { gap: 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .op-tabs { gap: 0; }
  .op-tab { padding: 10px 12px; font-size: 12px; }
}
