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

:root {
    --bg: #04050f;
    --bg2: #080a1a;
    --bg3: #0e1028;
    --border: rgba(255, 255, 255, 0.07);
    --gold: #d4a843;
    --gold-soft: rgba(212, 168, 67, 0.12);
    --blue: #4a8fd4;
    --blue-soft: rgba(74, 143, 212, 0.12);
    --text: #e0dff5;
    --text-dim: #6a6990;
    --radius: 16px;
    --spring: #4acd7a;
    --summer: #ffd040;
    --autumn: #e07020;
    --winter: #60a0e0;
}

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(20, 30, 80, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(10, 20, 60, 0.4) 0%, transparent 55%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, 0.55) 0%, transparent 100%),
        radial-gradient(1px 1px at 28% 45%, rgba(255, 255, 255, 0.40) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(255, 255, 255, 0.50) 0%, transparent 100%),
        radial-gradient(1px 1px at 72% 32%, rgba(255, 255, 255, 0.38) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 70%, rgba(255, 255, 255, 0.48) 0%, transparent 100%),
        radial-gradient(1px 1px at 38% 82%, rgba(255, 255, 255, 0.40) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 5% 90%, rgba(255, 255, 255, 0.50) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 22%, rgba(255, 255, 255, 0.42) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 60%, rgba(255, 255, 255, 0.32) 0%, transparent 100%);
}

.app {
    position: relative;
    z-index: 1;
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 20px 48px;
}

/* ── Header ─────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 22px 0 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    font-size: 36px;
    animation: earthSpin 12s linear infinite;
    display: inline-block;
}

@keyframes earthSpin {
    to {
        transform: rotate(360deg);
    }
}

h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #e8d88a, #60a0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.season-btns {
    display: flex;
    gap: 7px;
}

.szn-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
}

.szn-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.szn-btn.active {
    background: var(--gold-soft);
    border-color: rgba(212, 168, 67, 0.5);
    color: var(--gold);
}

/* ── Cards ───────────────────────────────────── */
.card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 14px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-header .card-title {
    margin-bottom: 0;
}

/* ── Layout ──────────────────────────────────── */
.main {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.orbital-section canvas {
    display: block;
    width: 100%;
    border-radius: 12px;
}

.bottom-row {
    display: grid;
    grid-template-columns: 320px 1fr 300px;
    gap: 20px;
}

@media (max-width: 980px) {
    .bottom-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .bottom-row {
        grid-template-columns: 1fr;
    }
}

.globe-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.globe-card canvas {
    display: block;
    border-radius: 50%;
}

.globe-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
}

.legend-item {
    font-size: 10px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 3px;
}

.info-card,
.chart-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Grid in info card */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.info-item {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
}

.info-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: 4px;
}

.info-val {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold);
}

.info-val.accent {
    color: var(--blue);
}

.mt {
    margin-top: 4px;
}

/* ── Sliders ─────────────────────────────────── */
.lat-section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 2px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    box-shadow: 0 0 7px rgba(212, 168, 67, 0.7);
    transition: transform .15s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 6px;
}

.lat-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 7px;
    padding: 4px 9px;
    font-size: 10px;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}

.preset-btn:hover {
    background: var(--gold-soft);
    color: var(--gold);
    border-color: rgba(212, 168, 67, 0.4);
}

/* ── Controls ────────────────────────────────── */
.controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #c49a30, #8a6a18);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(196, 154, 48, 0.3);
    min-width: 44px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(196, 154, 48, 0.4);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 16px;
    cursor: pointer;
    transition: all .2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
}

.speed-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-label {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
}

.speed-slider {
    width: 90px;
}

#speedVal {
    font-size: 12px;
    color: var(--gold);
    min-width: 26px;
}

/* ── Chart ───────────────────────────────────── */
#chartCanvas {
    display: block;
    width: 100%;
    border-radius: 8px;
}

.chart-legend {
    display: flex;
    gap: 14px;
}

.leg-line {
    font-size: 11px;
    color: var(--text-dim);
}

.leg-line.primary {
    color: var(--gold);
}

.leg-line.secondary {
    color: var(--blue);
}

/* Compare toggle */
.compare-section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.compare-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
}

.compare-toggle input[type=checkbox] {
    accent-color: var(--gold);
    width: 14px;
    height: 14px;
}

#compareControls {
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

/* ── Fullscreen button ───────────────────────── */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-fullscreen {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
    padding: 0;
}

.btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
    transform: scale(1.08);
}

.btn-fullscreen svg {
    width: 17px;
    height: 17px;
    display: block;
}