[hidden] {
    display: none !important;
}

:root {
    --bg: #03050d;
    --bg-2: #070c1c;
    --panel: rgba(12, 22, 48, 0.72);
    --line: rgba(110, 180, 255, 0.22);
    --text: #dbe7f5;
    --muted: #93a7c0;
    --cyan: #5fd6ff;
    --cyan-2: #2aa8ff;
    --amber: #ffbe6b;
    --red: #ff6b7d;
    --radius: 14px;
    --max: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Exo 2', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .btn, .eyebrow {
    font-family: 'Orbitron', 'Exo 2', sans-serif;
}

a {
    color: var(--cyan);
}

img {
    max-width: 100%;
}

/* ---------- Nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px max(16px, calc((100vw - var(--max)) / 2));
    background: rgba(3, 5, 13, 0.78);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 15px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 22px;
    margin-left: auto;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
}

.nav-links a:hover {
    color: #fff;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
    color: #021022;
    box-shadow: 0 0 24px rgba(60, 190, 255, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 34px rgba(60, 190, 255, 0.55);
}

.btn-ghost {
    background: rgba(95, 214, 255, 0.08);
    color: #fff;
    border-color: rgba(95, 214, 255, 0.55);
}

.btn-ghost:hover {
    background: rgba(95, 214, 255, 0.18);
}

.btn-small {
    padding: 9px 16px;
    font-size: 12px;
}

.btn-large {
    padding: 18px 44px;
    font-size: 18px;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: calc(100vh - 58px);
    min-height: calc(100svh - 58px);
    display: flex;
    align-items: center;
    overflow: hidden;
}

#heroCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(3, 5, 13, 0.85) 0%, rgba(3, 5, 13, 0.35) 55%, rgba(3, 5, 13, 0.1) 100%),
        linear-gradient(0deg, var(--bg) 0%, rgba(3, 5, 13, 0) 30%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 48px 16px;
}

.hero h1 {
    font-size: clamp(34px, 6vw, 68px);
    line-height: 1.08;
    margin: 0 0 20px;
    font-weight: 900;
    letter-spacing: 1px;
    max-width: 14ch;
}

.hero h1 span {
    color: var(--cyan);
    text-shadow: 0 0 30px rgba(95, 214, 255, 0.45);
}

.lede {
    font-size: clamp(17px, 2vw, 20px);
    max-width: 34em;
    color: #c6d6e8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 30px 0 14px;
}

.hero-note {
    color: var(--muted);
    font-size: 14px;
}

.scroll-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: var(--muted);
    font-size: 30px;
    text-decoration: none;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    50% { transform: translate(-50%, 6px); }
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--amber);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

/* ---------- Invite ---------- */
.invite-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    max-width: var(--max);
    margin: 0 auto 20px;
    padding: 14px 20px;
    border: 1px solid rgba(255, 190, 107, 0.6);
    border-radius: var(--radius);
    background: rgba(60, 35, 5, 0.55);
}

.invite-banner[hidden] {
    display: none;
}

.invite-banner strong {
    color: var(--amber);
}

/* ---------- Sections ---------- */
.section {
    padding: 88px 16px;
}

.section-inner {
    max-width: var(--max);
    margin: 0 auto;
}

.section-inner.narrow {
    max-width: 760px;
}

.section h2 {
    font-size: clamp(26px, 3.6vw, 40px);
    line-height: 1.15;
    margin: 0 0 24px;
    font-weight: 800;
}

.section-lede {
    color: #c3d2e4;
    max-width: 44em;
    margin-bottom: 36px;
}

.story {
    background: radial-gradient(ellipse at 20% 0%, rgba(40, 70, 160, 0.25), transparent 60%), var(--bg-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.story p {
    font-size: 18px;
}

.transmission {
    margin: 32px 0;
    padding: 20px 24px;
    border-left: 3px solid var(--amber);
    background: rgba(255, 190, 107, 0.07);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: 'Courier New', monospace;
    color: #ffe2bd;
    font-size: 16px;
}

.transmission-label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--amber);
    text-transform: uppercase;
}

/* ---------- Cards ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    position: relative;
    padding: 26px 24px 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.6;
}

.card h3 {
    margin: 14px 0 8px;
    font-size: 18px;
    color: #fff;
}

.card p {
    margin: 0;
    color: #b8c8da;
    font-size: 16px;
}

.card-art {
    height: 64px;
    width: auto;
    filter: drop-shadow(0 0 14px rgba(95, 214, 255, 0.35));
}

.card-art.wide {
    height: 52px;
    margin: 6px 0;
}

/* ---------- Screenshots ---------- */
.shots {
    padding-top: 0;
}

.shot-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}

.shot-grid figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #000;
    position: relative;
}

.shot-grid figure:first-child {
    grid-row: span 2;
}

.shot-grid img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shot-grid figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 14px 10px;
    font-size: 14px;
    color: #e6f0fa;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent);
}

/* ---------- Sector map ---------- */
.sector-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
    gap: 24px;
    align-items: start;
}

#sectorCanvas {
    width: 100%;
    aspect-ratio: 46 / 26;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #02040b;
    display: block;
}

.sector-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sector-list button {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(12, 22, 48, 0.5);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.sector-list button:hover,
.sector-list button[aria-pressed='true'] {
    border-color: var(--cyan);
    background: rgba(40, 110, 200, 0.22);
}

.sector-list .sector-name {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.sector-list .sector-meta {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

/* ---------- Controls ---------- */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.control-col {
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.control-col h3 {
    margin: 0 0 14px;
    font-size: 16px;
    color: var(--cyan);
}

.control-col dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: 15px;
}

.control-col dt {
    color: #fff;
    font-weight: 600;
}

.control-col dd {
    margin: 0;
    color: #b8c8da;
}

/* ---------- Multiplayer ---------- */
.multiplayer {
    background: radial-gradient(ellipse at 80% 100%, rgba(255, 150, 60, 0.14), transparent 60%), var(--bg-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.mp-card {
    padding: 28px;
    background: var(--panel);
    border: 1px solid rgba(255, 190, 107, 0.35);
    border-radius: var(--radius);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
    font-weight: 600;
}

input[type='text'] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(0, 10, 30, 0.7);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 15px;
}

input[type='text']:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(95, 214, 255, 0.2);
}

.mp-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.mp-option h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.mp-option p {
    margin: 0 0 14px;
    color: #b8c8da;
    font-size: 15px;
    min-height: 3.2em;
}

.join-row {
    display: flex;
    gap: 10px;
}

#roomCode {
    text-transform: uppercase;
    letter-spacing: 3px;
}

.mp-error {
    color: var(--red);
    min-height: 1.4em;
    margin: 14px 0 0;
}

/* ---------- Final CTA / footer ---------- */
.final-cta {
    text-align: center;
}

.footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px max(16px, calc((100vw - var(--max)) / 2));
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .nav-links {
        display: none;
    }

    .nav .btn {
        margin-left: auto;
    }

    .sector-layout,
    .mp-actions {
        grid-template-columns: 1fr;
    }

    .shot-grid {
        grid-template-columns: 1fr;
    }

    .shot-grid figure:first-child {
        grid-row: auto;
    }

    .section {
        padding: 64px 16px;
    }

    .mp-option p {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .scroll-hint {
        animation: none;
    }
}

.droid-row {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.droid-row img {
    height: 56px;
    width: auto;
}

.droid-row img:nth-child(2) {
    height: 64px;
}

.transmission-from {
    display: block;
    margin-top: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 1px;
    color: #7ff3ff;
}

.optional {
    font-style: normal;
    font-weight: 400;
    color: var(--muted);
    font-size: 14px;
    margin-left: 6px;
}

.host-panel {
    margin-top: 4px;
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed rgba(95, 214, 255, 0.5);
    background: rgba(0, 20, 45, 0.6);
}

.host-panel[hidden] {
    display: none;
}

.host-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.host-code {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 8px;
    color: #fff;
    margin: 4px 0 12px;
    user-select: all;
}

.host-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.host-hint {
    margin: 12px 0 0 !important;
    min-height: 0 !important;
    font-size: 14px !important;
}

.pad-hint {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 60;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(10, 30, 20, 0.9);
    border: 1px solid rgba(159, 255, 176, 0.6);
    color: #c8ffd8;
    font-size: 14px;
}
