:root {
    --bg-top: #d9f0ff;
    --bg-bottom: #102030;
    --panel: rgba(9, 20, 31, 0.72);
    --panel-border: rgba(255, 255, 255, 0.14);
    --text: #f2fbff;
    --muted: rgba(242, 251, 255, 0.72);
    --accent: #ff9a3d;
    --accent-strong: #ff6224;
    --shadow: 0 28px 70px rgba(4, 11, 18, 0.32);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    overflow: hidden;
    font-family: "Chakra Petch", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.62), transparent 24%),
        radial-gradient(circle at 88% 12%, rgba(255, 154, 61, 0.35), transparent 20%),
        linear-gradient(180deg, var(--bg-top) 0%, #7eb8d3 24%, #244a5d 48%, var(--bg-bottom) 100%);
}

button {
    font: inherit;
}

.app-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.ambient {
    position: fixed;
    border-radius: 50%;
    filter: blur(66px);
    opacity: 0.5;
    pointer-events: none;
}

.ambient-one {
    top: -8vw;
    left: -6vw;
    width: 24vw;
    height: 24vw;
    background: rgba(255, 188, 104, 0.4);
}

.ambient-two {
    right: -8vw;
    bottom: -10vw;
    width: 28vw;
    height: 28vw;
    background: rgba(104, 205, 255, 0.24);
}

.panel,
.intro-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.panel {
    position: absolute;
    z-index: 5;
    border-radius: 26px;
}

.hero-panel {
    top: 20px;
    left: 20px;
    width: min(450px, calc(100vw - 40px));
    padding: 22px 24px;
}

.stats-panel {
    top: 20px;
    right: 20px;
    width: min(250px, calc(100vw - 40px));
    display: grid;
    gap: 12px;
    padding: 16px;
}

.board-panel {
    left: 20px;
    bottom: 20px;
    width: min(340px, calc(100vw - 40px));
    padding: 18px;
}

.event-panel {
    right: 20px;
    bottom: 20px;
    width: min(380px, calc(100vw - 40px));
    padding: 18px;
}

.eyebrow,
.stat-label,
.pill,
.event-item-time,
.leaderboard-rank {
    font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

h1,
h2,
p,
strong {
    margin: 0;
}

h1 {
    font-size: clamp(2rem, 5vw, 4.1rem);
    line-height: 0.92;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.hero-copy {
    margin-top: 14px;
    max-width: 36ch;
    line-height: 1.56;
    color: var(--muted);
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.pill {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.66);
}

.board-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.leaderboard,
.event-feed {
    display: grid;
    gap: 10px;
}

.leaderboard-item,
.event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-rank {
    width: 28px;
    color: rgba(255, 255, 255, 0.62);
}

.leaderboard-main,
.event-item-main {
    flex: 1;
    min-width: 0;
}

.leaderboard-meta,
.event-item-time {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.76rem;
}

.event-item {
    align-items: flex-start;
}

.intro-panel {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    padding: 20px;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.intro-panel.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-card {
    width: min(560px, 100%);
    border-radius: 32px;
    padding: 30px;
}

.intro-card p + p,
.intro-card h2 + p {
    margin-top: 14px;
}

.intro-card p {
    line-height: 1.6;
    color: var(--muted);
}

.start-button {
    margin-top: 22px;
    border: 0;
    border-radius: 999px;
    padding: 15px 22px;
    font-weight: 700;
    color: #0e1d28;
    background: linear-gradient(135deg, #ffd774 0%, var(--accent) 52%, var(--accent-strong) 100%);
    box-shadow: 0 20px 42px rgba(255, 98, 36, 0.34);
    cursor: pointer;
}

@media (max-width: 900px) {
    .hero-panel,
    .stats-panel,
    .board-panel,
    .event-panel {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
    }

    .hero-panel {
        top: 16px;
    }

    .stats-panel {
        top: auto;
        bottom: 16px;
        display: none;
    }

    .board-panel {
        bottom: 16px;
        max-height: 34vh;
        overflow: auto;
    }

    .event-panel {
        display: none;
    }
}