:root {
    --bg: #080b14;
    --panel: rgba(16, 21, 36, 0.9);
    --panel-soft: rgba(255, 255, 255, 0.045);
    --line: rgba(168, 181, 215, 0.2);
    --text: #f5f7ff;
    --muted: #aab4cc;
    --gold: #f4c04e;
    --green: #40d39c;
    --red: #ff7777;
    --purple: #9b7cff;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
    margin: 0;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 15% 0%, rgba(116, 76, 255, 0.16), transparent 34rem),
        radial-gradient(circle at 90% 35%, rgba(38, 191, 154, 0.1), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: 'League Spartan', system-ui, sans-serif;
    line-height: 1.55;
    overflow-x: hidden;
}

a { color: var(--gold); }
.nav {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 14px clamp(16px, 4vw, 42px);
    background: rgba(8, 11, 20, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}
.brand { color: var(--text); text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.brand span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { padding: 7px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: rgba(244, 192, 78, .1); }
.nav-links .cta { color: #191506; background: var(--gold); font-weight: 800; }

.hero { max-width: 1120px; margin: 0 auto; padding: clamp(42px, 8vw, 86px) 20px 28px; text-align: center; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 14px auto 12px; max-width: 820px; font-size: clamp(36px, 6vw, 68px); line-height: 1.02; letter-spacing: -.035em; }
.hero p { max-width: 760px; margin: 0 auto; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button { display: inline-block; padding: 11px 17px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 700; }
.button.primary { border-color: transparent; color: #191506; background: var(--gold); }

.shell { max-width: 1240px; margin: 0 auto; padding: 0 20px 70px; }
.notice { margin: 18px 0 22px; padding: 17px 19px; border: 1px solid rgba(244, 192, 78, .3); border-radius: 13px; background: rgba(244, 192, 78, .07); color: #f6e4af; }
.notice strong { color: var(--gold); }
.status { min-height: 22px; margin: 8px 0 18px; color: var(--muted); font-size: 14px; }
.status.error { color: #ffaaaa; }
.status.loading::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat, .panel, .cycle-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.16); }
.stat { padding: 15px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 5px; color: var(--text); font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.panel { margin-top: 18px; padding: clamp(16px, 3vw, 26px); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel h2 { margin: 0; font-size: clamp(20px, 3vw, 28px); }
.panel-note { color: var(--muted); font-size: 13px; }
.chart-wrap { position: relative; height: clamp(360px, 52vw, 650px); }
.chart-wrap.small { height: clamp(270px, 36vw, 470px); }
canvas { display: block; width: 100% !important; height: 100% !important; }

.cycle-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.cycle-card { padding: 15px; }
.cycle-card h3 { margin: 0 0 12px; font-size: 18px; color: var(--gold); }
.cycle-card dl { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; margin: 0; font-size: 13px; }
.cycle-card dt { color: var(--muted); }
.cycle-card dd { margin: 0; text-align: right; font-weight: 700; }
.positive { color: var(--green); }
.negative { color: var(--red); }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border: 1px solid var(--line); text-align: center; }
th { color: var(--gold); background: rgba(244, 192, 78, .06); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr { cursor: pointer; transition: background .15s ease; }
tbody tr:hover, tbody tr[aria-selected="true"] { background: rgba(155, 124, 255, .12); }
tbody td:first-child { text-align: left; color: var(--text); font-weight: 800; }
.source { margin-top: 20px; color: var(--muted); font-size: 12px; }
.source code { color: #d5dcf2; overflow-wrap: anywhere; }
.footer { max-width: 1240px; margin: 0 auto; padding: 0 20px 38px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 900px) {
    .grid, .cycle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .nav { align-items: flex-start; flex-direction: column; gap: 8px; }
    .nav-links { justify-content: flex-start; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
    .nav-links a { flex: 0 0 auto; }
    .grid, .cycle-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat { padding: 12px; }
    .stat-value { font-size: 17px; }
    .hero { padding-top: 48px; }
    .shell { padding-left: 12px; padding-right: 12px; }
    .panel { padding: 13px; }
}
@media (max-width: 390px) {
    .grid, .cycle-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
