/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #0d0d1a;
    --bg-secondary: #0a0a14;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --border: #2d1f3d;
    --border-light: #251a35;
    --text-primary: #e8e8e8;
    --text-secondary: #9a8eb0;
    --text-muted: #5e5478;
    --green: #00d4aa;
    --green-bg: rgba(0,212,170,0.1);
    --red: #e63946;
    --red-bg: rgba(230,57,70,0.1);
    --gold: #d4a017;
    --gold-bg: rgba(212,160,23,0.1);
    --blue: #4a9eff;
    --blue-bg: rgba(74,158,255,0.1);
    --color-our: #d4a017;
    --color-domi: #4a9eff;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* ── Loading ── */
.loading-overlay {
    position: fixed; inset: 0; background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.3s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border); border-top-color: var(--gold);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header ── */
.header-bar {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 2px 20px rgba(212,160,23,0.15);
}
.header-top {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 10px 20px; flex-wrap: wrap; gap: 8px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h1 { font-size: 1.2rem; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; color: var(--text-muted); }
.nav-link {
    color: var(--text-secondary); text-decoration: none;
    padding: 4px 10px; border-radius: 4px;
    border: 1px solid var(--border); font-size: 0.75rem;
}
.nav-link:hover { color: var(--text-primary); border-color: var(--gold); }

.badge {
    font-size: 0.65rem; font-weight: 700;
    padding: 2px 8px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-our { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold); }
.badge-domi { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue); }

.compare-bar {
    padding: 6px 20px; font-size: 0.75rem; color: var(--text-muted);
    border-top: 1px solid var(--border-light);
}
.compare-bar strong { color: var(--text-secondary); }

/* ── Container ── */
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 24px;
}
.bot-column { display: flex; flex-direction: column; gap: 12px; }
.bot-header {
    font-size: 1rem; font-weight: 700;
    padding: 10px 16px; border-radius: 8px;
    display: flex; align-items: center; gap: 10px;
}
.bot-header .bot-sub { font-size: 0.7rem; font-weight: 400; opacity: 0.6; }
.bot-our { background: var(--gold-bg); color: var(--gold); border-left: 3px solid var(--gold); }
.bot-domi { background: var(--blue-bg); color: var(--blue); border-left: 3px solid var(--blue); }

.stat-cards {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px; padding: 12px 14px;
}
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-value { font-size: 1.1rem; font-weight: 700; }

/* ── Sections ── */
.section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px; padding: 20px; margin-bottom: 20px;
}
.section h2 { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Chart ── */
.chart-container { height: 300px; position: relative; }

/* ── Two Column Layout ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.col-header {
    font-size: 0.8rem; font-weight: 600; margin-bottom: 8px;
    padding: 6px 10px; border-radius: 4px;
}
.col-our { color: var(--gold); border-left: 3px solid var(--gold); background: var(--gold-bg); }
.col-domi { color: var(--blue); border-left: 3px solid var(--blue); background: var(--blue-bg); }

/* ── Tables ── */
.mini-table {
    width: 100%; border-collapse: collapse; font-size: 0.75rem;
}
.mini-table th {
    text-align: left; padding: 6px 8px;
    font-weight: 600; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-size: 0.65rem; text-transform: uppercase;
}
.mini-table td {
    padding: 6px 8px; border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.mini-table tr:hover td { background: var(--bg-card-hover); }
.mini-table .empty { text-align: center; color: var(--text-muted); padding: 20px; }

/* ── Colors ── */
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.neutral { color: var(--text-muted) !important; }

.outcome-win { color: var(--green); font-weight: 600; }
.outcome-be { color: var(--gold); font-weight: 600; }
.outcome-loss { color: var(--red); font-weight: 600; }

/* ── Direction badges ── */
.dir-long { color: var(--green); font-weight: 600; }
.dir-short { color: var(--red); font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .stats-grid, .two-col { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .header-left h1 { font-size: 1rem; }
}
