:root {
    --bg: #07131a;
    --bg-alt: #0d1f28;
    --panel: rgba(12, 28, 36, 0.82);
    --line: rgba(255, 255, 255, 0.08);
    --text: #e8f2ef;
    --muted: #9eb5ad;
    --primary: #2d9b73;
    --primary-dark: #1f6f51;
    --accent: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Outfit", system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(45, 155, 115, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 24%),
        linear-gradient(180deg, #061015 0%, #0a171f 45%, #07131a 100%);
    min-height: 100vh;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: rgba(6, 16, 21, 0.78);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #3db88a);
    color: #fff;
    box-shadow: 0 10px 24px rgba(45, 155, 115, 0.35);
}

.brand-text { display: grid; line-height: 1.1; }
.brand-text strong { font-size: 1rem; }
.brand-text small { color: var(--muted); font-size: 0.78rem; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-nav a {
    color: var(--text);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a.is-active {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    padding: 10px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #fff;
}

.setup-banner {
    background: rgba(245, 158, 11, 0.12);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    padding: 12px 0;
    color: #fde68a;
    font-size: 0.95rem;
}

.setup-banner a { color: #fff; }

main { position: relative; z-index: 1; }

.hero {
    padding: 56px 0 32px;
}

.hero-grid,
.split-grid,
.play-layout,
.footer-grid {
    display: grid;
    gap: 28px;
}

.hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    color: #86efac;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

h1, h2, h3 {
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.08;
    margin: 0 0 12px;
}

.hero-copy h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    max-width: 11ch;
}

.hero-copy p,
.section-head p,
.page-hero p {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 58ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 1rem; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3cb98a);
    color: #fff;
    box-shadow: 0 12px 30px rgba(45, 155, 115, 0.28);
}

.btn-primary:hover { box-shadow: 0 16px 34px rgba(45, 155, 115, 0.34); }

.btn-ghost {
    background: rgba(255,255,255,0.04);
    border-color: var(--line);
    color: #fff;
}

.hero-stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.hero-stats div {
    min-width: 92px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
}

.hero-stats strong {
    display: block;
    font-size: 1.5rem;
    font-family: "Space Grotesk", sans-serif;
}

.hero-stats span { color: var(--muted); font-size: 0.9rem; }

.runner-shell,
.side-card,
.feature-card,
.character-card,
.world-card,
.news-card,
.beta-box,
.leaderboard-preview,
.leaderboard-full {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.runner-shell { overflow: hidden; }

.runner-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
    color: var(--muted);
}

.live-dot {
    color: #86efac;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.runner-shell canvas {
    display: block;
    width: 100%;
    height: auto;
    background: linear-gradient(180deg, #123247 0%, #0d2230 55%, #173528 100%);
}

.runner-hint {
    padding: 12px 16px 16px;
    color: var(--muted);
    font-size: 0.88rem;
}

.section {
    padding: 72px 0;
}

.section-alt {
    background: rgba(255,255,255,0.02);
    border-block: 1px solid var(--line);
}

.section-head {
    margin-bottom: 28px;
}

.section-head h2,
.page-hero h1 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.feature-grid,
.card-grid,
.world-grid,
.news-grid {
    display: grid;
    gap: 18px;
}

.feature-grid { grid-template-columns: repeat(4, 1fr); }
.card-grid { grid-template-columns: repeat(4, 1fr); }
.world-grid { grid-template-columns: repeat(4, 1fr); }
.news-grid { grid-template-columns: repeat(3, 1fr); }
.card-grid-large { grid-template-columns: repeat(2, 1fr); }
.world-grid-large { grid-template-columns: repeat(2, 1fr); }

.feature-card,
.character-card,
.world-card,
.news-card {
    padding: 22px;
}

.feature-icon,
.character-icon,
.world-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.character-card,
.character-card-large {
    border-top: 4px solid var(--accent, var(--primary));
}

.world-card,
.world-card-large {
    background:
        linear-gradient(160deg, rgba(255,255,255,0.04), transparent 55%),
        linear-gradient(135deg, var(--from), var(--to));
}

.section-cta { margin-top: 22px; }

.roadmap {
    display: grid;
    gap: 16px;
}

.roadmap-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
}

.roadmap-item span {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    background: rgba(255,255,255,0.06);
}

.roadmap-item.is-done span { background: rgba(45, 155, 115, 0.2); color: #86efac; }
.roadmap-item.is-active {
    border-color: rgba(45, 155, 115, 0.45);
    box-shadow: 0 0 0 1px rgba(45, 155, 115, 0.15) inset;
}

.split-grid {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
}

.leaderboard-preview,
.leaderboard-full {
    overflow: auto;
    padding: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-beta { padding-bottom: 88px; }

.beta-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(45, 155, 115, 0.12), rgba(59, 130, 246, 0.08)),
        var(--panel);
}

.beta-form,
#scoreForm {
    display: grid;
    gap: 12px;
}

input, select, button {
    font: inherit;
}

input, select {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0,0,0,0.22);
    color: #fff;
    padding: 0 14px;
}

.form-message {
    margin: 0;
    font-size: 0.92rem;
}

.form-message.is-ok { color: #86efac; }
.form-message.is-error { color: #fca5a5; }

.page-hero,
.play-hero {
    padding: 42px 0 10px;
}

.play-layout {
    grid-template-columns: 1.3fr 0.7fr;
    align-items: start;
}

.play-controls {
    display: flex;
    gap: 10px;
    padding: 0 16px 16px;
}

.play-sidebar {
    display: grid;
    gap: 16px;
}

.side-card { padding: 20px; }

.tip-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.7;
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    background: rgba(0,0,0,0.18);
}

.footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    padding: 40px 0 24px;
}

.site-footer h3,
.site-footer h4 {
    margin-top: 0;
    font-family: "Space Grotesk", sans-serif;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer li { margin: 8px 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: #fff; }

.platform-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--line);
    font-size: 0.85rem;
}

.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 16px 0 24px;
    color: var(--muted);
    font-size: 0.92rem;
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: .08s; }
.delay-2 { transition-delay: .16s; }
.delay-3 { transition-delay: .24s; }

@media (max-width: 980px) {
    .hero-grid,
    .feature-grid,
    .card-grid,
    .world-grid,
    .news-grid,
    .split-grid,
    .beta-box,
    .play-layout,
    .footer-grid,
    .card-grid-large,
    .world-grid-large {
        grid-template-columns: 1fr;
    }

    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

.nav-user {
    padding: 10px 12px;
    color: #86efac;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-wrap {
    max-width: 480px;
    margin: 0 auto;
}

.auth-card {
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}

.checkbox-line {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
    font-weight: 500 !important;
}

.checkbox-line input {
    width: auto;
    min-height: auto;
}

.auth-alt {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.auth-alt a { color: #86efac; }

@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .site-nav {
        position: absolute;
        top: 76px;
        right: 16px;
        left: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(6, 16, 21, 0.96);
    }
    .site-nav.is-open { display: flex; }
    .feature-grid,
    .card-grid,
    .world-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }
}
