:root {
    color-scheme: dark;
    --ink: #080b1f;
    --panel: #111631;
    --line: rgba(177, 186, 247, 0.18);
    --text: #f7f7ff;
    --muted: #a4acc8;
    --violet: #a58eff;
    --cyan: #54a2ff;
    --gold: #a58eff;
    font-family: Arial, Helvetica, sans-serif;
}
* {
    box-sizing: border-box;
}
html {
    min-width: 320px;
}
body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
}
button,
input {
    font: inherit;
}
button {
    cursor: pointer;
}
a {
    color: inherit;
    text-decoration: none;
}
[hidden] {
    display: none !important;
}
:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 4px;
}
.site-header,
.site-footer {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem clamp(1.25rem, 3vw, 3.5rem);
}
.site-header {
    border-bottom: 1px solid var(--line);
}
.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.brand {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.13rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    white-space: nowrap;
}
.brand span:last-child {
    font-weight: 400;
    letter-spacing: 0.24em;
}
.brand-mark {
    display: inline-block;
    color: var(--violet);
    font-size: 1.55rem;
    margin-right: 0.45rem;
    vertical-align: -0.08em;
}
.header-link,
.text-button {
    color: var(--muted);
    font-size: 0.83rem;
    background: none;
    border: 0;
}
.header-link:hover,
.text-button:hover {
    color: #fff;
}
.world-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
}
.world-divider {
    color: var(--violet);
    margin: 0 0.6rem;
}
.eyebrow {
    font-size: 0.66rem !important;
    letter-spacing: 0.24em !important;
    font-weight: 700 !important;
    color: var(--cyan) !important;
    text-transform: uppercase;
}
.primary-link,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-height: 3.2rem;
    padding: 0.7rem 1.35rem;
    border-radius: 3px;
    font-size: 0.86rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition:
        transform 0.2s,
        background 0.2s,
        border-color 0.2s;
}
.primary-link {
    background: #b5a1ff;
    color: #10142a;
}
.primary-link:hover {
    background: #cec1ff;
    transform: translateY(-2px);
}
.secondary-link {
    color: #e9e6ff;
    background: rgba(185, 170, 255, 0.07);
    border-color: rgba(185, 170, 255, 0.36);
}
.secondary-link:hover {
    background: rgba(185, 170, 255, 0.16);
    border-color: #b5a1ff;
}
.microcopy {
    font-size: 0.74rem !important;
    color: var(--muted) !important;
    line-height: 1.5 !important;
}
.home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.home-stars {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 45%, rgba(70, 54, 142, 0.42), transparent 38%),
        radial-gradient(circle at 25% 85%, rgba(19, 93, 116, 0.24), transparent 35%), #080b1f;
    pointer-events: none;
}
.home-stars:after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.43;
    background-image:
        radial-gradient(#e6e5ff 1px, transparent 1px), radial-gradient(#bbadff 1px, transparent 1px);
    background-size:
        91px 99px,
        137px 127px;
    background-position:
        5px 12px,
        51px 47px;
}
.home-main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    max-width: 1500px;
    width: 100%;
    margin: auto;
    padding: 2.5rem clamp(1.5rem, 7vw, 8rem);
}
.home-copy {
    max-width: 620px;
}
.home-copy h1,
.stage-center h1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(3.3rem, 5.5vw, 5.8rem);
    line-height: 0.99;
    letter-spacing: -0.065em;
    margin: 1.5rem 0;
}
.home-copy > p:not(.eyebrow):not(.microcopy) {
    font-size: clamp(1rem, 1.45vw, 1.22rem);
    line-height: 1.65;
    color: var(--muted);
    max-width: 480px;
}
.home-copy .primary-link {
    margin: 1.4rem 0 0.7rem;
}
.hero-orbit {
    width: min(37vw, 530px);
    aspect-ratio: 1;
    position: relative;
    margin: auto;
    filter: drop-shadow(0 0 65px rgba(137, 112, 255, 0.3));
}
.hero-core {
    position: absolute;
    inset: 31%;
    border-radius: 50%;
    background: radial-gradient(
        circle at 36% 32%,
        #fff 0%,
        #e4e3ff 11%,
        #a795f9 34%,
        #5b5dbd 67%,
        #252056 100%
    );
    box-shadow:
        0 0 20px #b8a7ff,
        0 0 80px #7b69ee,
        0 0 160px #4f51a6;
}
.orbit {
    position: absolute;
    border: 1px solid rgba(206, 201, 255, 0.32);
    border-radius: 50%;
    transform: rotate(-29deg) scaleY(0.51);
}
.orbit-one {
    inset: 12%;
}
.orbit-two {
    inset: -2%;
    transform: rotate(55deg) scaleY(0.34);
    border-color: rgba(117, 217, 240, 0.32);
}
.spark {
    position: absolute;
    width: 11px;
    height: 11px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 18px 7px #aaa3ff;
}
.spark-a {
    top: 22%;
    left: 11%;
}
.spark-b {
    right: 12%;
    bottom: 28%;
    background: #88e9ff;
}
.spark-c {
    right: 30%;
    top: 7%;
    width: 5px;
    height: 5px;
}
.game-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.game-shell {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
    min-height: 620px;
}
.game-stage {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 58%, #242057 0%, #111639 42%, #080c20 80%);
}
.scene,
.scene canvas,
.stage-grain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.scene canvas {
    display: block;
}
.stage-grain {
    pointer-events: none;
    opacity: 0.32;
    background-image: radial-gradient(#d9d4ff 0.7px, transparent 0.7px);
    background-size: 73px 79px;
}
.stage-center {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: min(85%, 590px);
    transform: translate(-50%, -50%);
    text-align: center;
    text-shadow: 0 3px 18px rgba(2, 5, 20, 0.7);
}
.stage-center h1 {
    font-size: clamp(3.1rem, 5vw, 5.6rem);
}
.stage-center h1 em {
    font-style: normal;
    color: #c2b4ff;
}
.stage-center h2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(2.4rem, 4vw, 4rem);
    letter-spacing: -0.055em;
    margin: 1rem 0;
}
.stage-center > p:not(.eyebrow):not(.microcopy):not(.controls-hint) {
    max-width: 440px;
    margin: 0 auto 2rem;
    color: #d2d6ee;
    line-height: 1.6;
}
.stage-center #start-button {
    margin-top: 1.1rem;
}
.controls-hint {
    color: #afb6d6;
    font-size: 0.73rem;
    margin-top: 1.45rem;
}
.stage-corner {
    position: absolute;
    z-index: 2;
    bottom: 1.4rem;
    left: 1.6rem;
    color: #bcc2e4;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
}
.stage-corner span {
    color: var(--violet);
}
.hud {
    position: absolute;
    z-index: 3;
    top: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}
.hud-item {
    display: grid;
    gap: 0.2rem;
    min-width: 90px;
    background: rgba(9, 12, 32, 0.56);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.5rem 0.8rem;
    backdrop-filter: blur(10px);
}
.hud-item span {
    font-size: 0.59rem;
    letter-spacing: 0.14em;
    color: #c0c6e2;
}
.hud-item strong {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}
.hud-button {
    margin-left: auto;
    background: rgba(9, 12, 32, 0.63);
    border: 1px solid var(--line);
    color: #fff;
    border-radius: 4px;
    padding: 0.65rem 1rem;
}
.game-message {
    position: absolute;
    z-index: 3;
    top: 6.4rem;
    left: 1.5rem;
    max-width: min(32rem, calc(100% - 3rem));
    margin: 0;
    padding: 0.65rem 0.85rem;
    color: #e6e9ff;
    background: rgba(9, 12, 32, 0.72);
    border-left: 2px solid var(--cyan);
    font-size: 0.76rem;
    line-height: 1.4;
    pointer-events: none;
}
.game-message:empty {
    display: none;
}
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}
.result #final-score {
    color: var(--cyan);
    font-size: 1.4rem;
}
.side-panel {
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #171b3b, #11152e 70%);
    border-left: 1px solid var(--line);
}
.side-intro {
    padding: 3.1rem 2rem 2rem;
    border-bottom: 1px solid var(--line);
}
.side-intro h2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2rem;
    line-height: 1.12;
    letter-spacing: -0.045em;
    margin: 1.1rem 0;
}
.side-intro > p:not(.eyebrow):not(.microcopy) {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}
.side-intro .team-code {
    margin: 1.25rem 0 0.25rem;
    color: var(--text) !important;
}
.team-code strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--violet);
    font-size: 1rem;
    letter-spacing: 0.08em;
}
.side-intro .secondary-link {
    margin-top: 0.7rem;
    width: 100%;
    font-size: 0.75rem;
}
.ranking {
    padding: 1.6rem 2rem;
    flex: 1;
}
.ranking-head h3 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.3rem;
    margin: 0.2rem 0 1.4rem;
}
.ranking ol {
    padding: 0;
    margin: 0;
    list-style: none;
}
.ranking li {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 0;
    font-size: 0.8rem;
}
.ranking li .rank-number {
    color: var(--violet);
    font-weight: 700;
    width: 1.5rem;
}
.ranking li .rank-name {
    flex: 1;
}
.ranking li .rank-score {
    font-weight: 700;
    color: #e3dbff;
    font-variant-numeric: tabular-nums;
}
.ranking-empty {
    color: var(--muted);
    line-height: 1.5;
}
.ranking-note {
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.5;
}
@media (max-width: 900px) {
    .game-shell {
        grid-template-columns: 1fr;
    }
    .game-stage {
        min-height: min(720px, calc(100svh - 70px));
    }
    .side-panel {
        border-left: 0;
        border-top: 1px solid var(--line);
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .side-intro {
        border-bottom: 0;
        border-right: 1px solid var(--line);
    }
    .home-main {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}
@media (max-width: 620px) {
    .site-header,
    .site-footer {
        padding: 1rem 1.25rem;
    }
    .world-label {
        display: none;
    }
    .home-main {
        display: flex;
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 1.8rem 1.5rem 4rem;
    }
    .hero-orbit {
        width: min(65vw, 270px);
        margin: 0 auto;
    }
    .home-copy h1 {
        font-size: clamp(3.3rem, 13vw, 5rem);
    }
    .game-stage {
        min-height: 620px;
    }
    .stage-center {
        width: 91%;
    }
    .stage-center h1 {
        font-size: 3.1rem;
    }
    .side-panel {
        display: block;
    }
    .side-intro {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 2rem 1.5rem;
    }
    .ranking {
        padding: 1.5rem;
    }
    .stage-corner {
        display: none;
    }
    .site-footer {
        font-size: 0.58rem;
    }
    .hud {
        top: 0.8rem;
        left: 0.8rem;
        right: 0.8rem;
        gap: 0.4rem;
    }
    .hud-item {
        min-width: 76px;
    }
    .hud-button {
        padding: 0.58rem 0.7rem;
    }
    .game-message {
        top: 5.2rem;
        left: 0.8rem;
        max-width: calc(100% - 1.6rem);
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *:before,
    *:after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.brand-logo {
    display: block;
    width: 90px;
    height: 35px;
    object-fit: cover;
    object-position: left center;
}
.brand > span {
    font-size: 0.95rem;
}
.home-copy {
    max-width: 610px;
}
.scene {
    touch-action: none;
    transition: opacity 0.25s ease;
}
.game-stage.is-overlay .scene {
    opacity: 0.12;
}
.game-stage.is-overlay .stage-grain {
    opacity: 0.12;
}
.game-stage.is-overlay .game-message {
    display: none;
}
.game-stage.is-overlay .stage-center {
    background: rgba(11, 14, 39, 0.5);
    border: 1px solid rgba(165, 142, 255, 0.18);
    padding: 2rem 1rem;
    border-radius: 6px;
    backdrop-filter: blur(8px);
}
