* { box-sizing: border-box; }
:root {
    --pixel-font: "Minecraft", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --neon: #22f3c8;
    --neon-soft: rgba(34,243,200,0.28);
    --neon-softer: rgba(34,243,200,0.18);
}

@font-face {
    font-family: "Minecraft";
    src: url("./assets/fonts/Minecraft.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "RetroByte";
    src: url("./assets/fonts/RetroByte.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "StarCrush";
    src: url("./assets/fonts/Star Crush.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Trebuc";
    src: url("./assets/fonts/trebuc.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
html { scroll-behavior: smooth; height: 100%; overflow: hidden; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: rgba(255, 255, 255, 0.92);
    background: #000000;
    min-height: 100%;
    overflow: hidden;
}

.startup-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 260ms ease;
}

.startup-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.startup-video {
    width: min(10vw, 110px);
    height: min(10vh, 85px);
    object-fit: contain;
    image-rendering: pixelated;
    border-radius: 12px;
}

#game-root {
    position: relative;
    z-index: 2;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(1400px 900px at 50% 50%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.82) 100%);
    mix-blend-mode: multiply;
    z-index: 0;
}

.site-header { display: none; }

main { padding: 24px; }
.app {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.section {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.section:last-of-type { border-bottom: none; }

.hero { text-align: center; }
.hero-center { min-height: calc(100vh - 160px); display: flex; align-items: center; justify-content: center; gap: 16px; }
.hero-center h1 { margin: 0; }
.type { font-size: clamp(64px, 14vw, 160px); font-weight: 800; letter-spacing: -1px; }
.hover-color { color: #0b1020; transition: color 180ms ease, text-shadow 180ms ease; }
.hover-color:hover { color: #ef4444; text-shadow: 0 2px 24px rgba(239, 68, 68, 0.35); }
.icon-bar {
    position: sticky;
    top: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
    padding: 6px 8px;
    min-height: 52px;
    z-index: 1100;
}
.icon {
    color: #000000;
    text-decoration: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    position: relative;
    z-index: 1;
    transition: color 160ms ease, transform 220ms cubic-bezier(.22,1,.36,1);
}
.icon:hover { color: #b22222; transform: translateY(-1px); filter: drop-shadow(0 0 6px rgba(178,34,34,0.55)); }
.icon.active { color: #e85c5c; filter: drop-shadow(0 0 6px rgba(232,92,92,0.55)); }
.icon.active:hover { color: #e85c5c; filter: drop-shadow(0 0 8px rgba(232,92,92,0.65)); }
.bubble {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 14px;
    background: rgba(178,34,34,0.25);
    border: 2px solid rgba(178,34,34,0.65);
    box-shadow: 0 6px 14px rgba(178,34,34,0.20);
    transition: transform 480ms cubic-bezier(.2,.8,.2,1), width 480ms cubic-bezier(.2,.8,.2,1), height 480ms cubic-bezier(.2,.8,.2,1), border-radius 480ms cubic-bezier(.2,.8,.2,1);
    will-change: transform, width, height;
    transform-origin: center;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
}
@media (max-width: 640px) {
    .tabs { flex-wrap: wrap; }
    body {
        background:
            radial-gradient(900px 560px at 55% 45%, rgba(20, 210, 190, 0.12) 0%, rgba(0, 0, 0, 0) 62%),
            radial-gradient(720px 520px at 30% 60%, rgba(120, 90, 255, 0.12) 0%, rgba(0, 0, 0, 0) 64%),
            linear-gradient(180deg, #030712 0%, #050a1a 55%, #030712 100%);
    }
}

.confetti {
    position: fixed;
    top: -10px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    animation: fall 1.5s ease-in forwards;
}
@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.split-bg { display: none; }

.split-bg::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-image:
        radial-gradient(#1f2937 1px, transparent 1px),
        radial-gradient(#1f2937 1px, transparent 1px);
    background-size: 18px 18px, 18px 18px;
    background-position: 0 0, 9px 9px;
    opacity: 0.12;
    pointer-events: none;
}

@media (max-width: 640px) {
    .split-bg { display: none; }
}

/* (Dock removed) */

.crt {
    position: fixed;
    inset: 0;
}
#game-root {
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    transition: opacity 400ms ease, transform 520ms cubic-bezier(.22,1,.36,1);
}

#game-root canvas {
    position: relative;
    z-index: 2;
}
.crt canvas {
    display: block;
    width: 100%;
    height: 100%;
}
#game-root, .crt, .crt canvas { cursor: none !important; }

.icon-bar, .bubble, .hero, .section, .app { display: none; }

.site-title {
    position: fixed;
    top: 16px;
    left: 24px;
    z-index: 1200;
    font-family: var(--pixel-font);
    font-weight: 400;
    font-size: clamp(20px, 2vw, 28px);
    color: var(--neon);
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px var(--neon-soft), 0 0 18px var(--neon-softer);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(34,243,200,0.22);
    border-radius: 6px;
    padding: 8px 12px;
}

.overlay-ui {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1400;
    font-family: var(--pixel-font);
}

.reflex-window {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 92vw);
    background-color: #f3deb0;
    border: 2px solid #1b4c92;
    border-radius: 8px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
    z-index: 5;
    pointer-events: auto;
    color: #0b1731;
    overflow: hidden;
}

.reflex-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    color: #0b0b0b;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    font-family: "Tahoma", "Segoe UI", sans-serif;
    position: relative;
    z-index: 2;
    cursor: move;
}

.reflex-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #7f0020;
    text-shadow: 0 0 10px rgba(127, 0, 32, 0.45);
}

.reflex-close {
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: #f26b6b;
    color: #ffffff;
    border-radius: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
    padding: 0;
}

.reflex-body {
    padding: 12px;
    background: transparent;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    font-family: var(--pixel-font);
    position: relative;
    z-index: 2;
}

.reflex-flow-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.reflex-flow-canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
}

.reflex-status {
    font-size: 12px;
    margin-bottom: 8px;
    color: #112044;
}

.reflex-stage {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f4f7ff;
    border: 2px inset #95a9cf;
    border-radius: 6px;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.reflex-column {
    display: grid;
    justify-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.reflex-cube {
    width: 36px;
    height: 36px;
    background: #1f2937;
    border: 2px solid #0b1120;
    box-shadow: inset 0 0 0 2px #5b6475;
}

.reflex-cube.is-active {
    background: #34d399;
    box-shadow: inset 0 0 0 2px #0f5c42;
}

.reflex-cpu.is-active {
    background: #f87171;
    box-shadow: inset 0 0 0 2px #7f1d1d;
}

.reflex-label {
    font-size: 10px;
    color: #1c2c4b;
}

.reflex-prompt {
    display: grid;
    grid-template-columns: repeat(3, 22px);
    grid-template-rows: repeat(3, 22px);
    place-items: center;
    font-size: 18px;
    letter-spacing: 0;
    color: #1c2c4b;
    opacity: 0.35;
    transform: translateY(2px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.reflex-prompt.is-active {
    opacity: 1;
    transform: translateY(0);
    color: #0b1020;
}

.reflex-arrow {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: #1c2c4b;
    opacity: 0.55;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(0,0,0,0.08);
}

.reflex-arrow.is-hot {
    color: #c4001f;
    opacity: 1;
    text-shadow: 0 0 8px rgba(196, 0, 31, 0.35);
}

.reflex-arrow-up { grid-column: 2; grid-row: 1; }
.reflex-arrow-right { grid-column: 3; grid-row: 2; }
.reflex-arrow-down { grid-column: 2; grid-row: 3; }
.reflex-arrow-left { grid-column: 1; grid-row: 2; }

.reflex-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.reflex-flash {
    position: absolute;
    inset: 0;
    background: #000000;
    opacity: 0;
}

.reflex-slash {
    position: absolute;
    left: -40%;
    top: 50%;
    width: 180%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ffffff, #ff5667, transparent);
    opacity: 0;
    transform: translateY(-50%) rotate(-12deg);
    box-shadow: 0 0 10px rgba(255, 86, 103, 0.7);
}

.reflex-stage.finisher-play .reflex-flash {
    animation: reflexFlash 420ms ease;
}

.reflex-stage.finisher-play .reflex-slash {
    animation: reflexSlash 520ms ease;
    animation-delay: 120ms;
}

.reflex-stage.finisher-player .reflex-player-col {
    animation: reflexTeleportRight 520ms ease;
    z-index: 1;
}

.reflex-stage.finisher-player .reflex-cpu-col {
    z-index: 2;
}

.reflex-stage.finisher-cpu .reflex-cpu-col {
    animation: reflexTeleportLeft 520ms ease;
    z-index: 1;
}

.reflex-stage.finisher-cpu .reflex-player-col {
    z-index: 2;
}

.reflex-stage.finisher-player .reflex-cpu,
.reflex-stage.finisher-cpu .reflex-player {
    animation: reflexSlice 520ms ease;
}

@keyframes reflexFlash {
    0% { opacity: 0; }
    15% { opacity: 0.95; }
    32% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes reflexSlash {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateX(-20%) rotate(-12deg);
    }
    35% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) translateX(20%) rotate(-12deg);
    }
}

@keyframes reflexTeleportRight {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    20% {
        opacity: 0;
    }
    45% {
        opacity: 0;
        transform: translateX(140px);
    }
    65% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateX(140px);
    }
}

@keyframes reflexTeleportLeft {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    20% {
        opacity: 0;
    }
    45% {
        opacity: 0;
        transform: translateX(-140px);
    }
    65% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateX(-140px);
    }
}

@keyframes reflexSlice {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
        filter: saturate(1);
    }
    45% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    70% {
        transform: translateX(6px) rotate(-6deg);
        opacity: 0.5;
        filter: saturate(1.4);
    }
    100% {
        transform: translateX(10px) rotate(-8deg);
        opacity: 0.2;
    }
}

@keyframes reflexWavePan {
    0% {
        background-position: 0 0;
    }
    50% {
        background-position: 120px 40px;
    }
    100% {
        background-position: 240px 0;
    }
}

.reflex-metrics {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-top: 10px;
    color: #1d2b49;
}

.reflex-result {
    margin-top: 6px;
    font-size: 12px;
    color: #10203d;
}

.reflex-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.reflex-hint {
    font-size: 9px;
    color: #2a3b5f;
}

.reflex-difficulty {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    color: #2a3b5f;
}

.reflex-difficulty-label {
    font-size: 9px;
    color: #2a3b5f;
}

.reflex-difficulty-select {
    background: #f6ecd1;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    padding: 3px 6px;
    font-family: var(--pixel-font);
    font-size: 9px;
    color: #1b2b42;
}

.reflex-button {
    background: #2b7bff;
    color: #ffffff;
    border: 1px solid #1c4b9d;
    border-radius: 4px;
    color: #1c2c4b;
    opacity: 0.6;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(0,0,0,0.12);
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 4px;
}

.reflex-arrow.is-idle {
    color: #c4001f;
    opacity: 0.85;
    text-shadow: 0 0 8px rgba(196, 0, 31, 0.25);
}

.reflex-button:hover {
    background: #2369db;
}
/* In-world PIXI links replace the HTML overlay links */
.overlay-ui { display: none; }

.overlay-link {
    pointer-events: auto;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    text-shadow:
        0 0 10px rgba(34,243,200,0.22),
        0 0 22px rgba(34,243,200,0.12),
        0 10px 36px rgba(0, 0, 0, 0.72);
    display: inline-block;
    transition: transform 200ms ease, color 160ms ease, text-shadow 160ms ease;
}

.overlay-left {
    position: absolute;
    left: clamp(28px, 6vw, 72px);
    font-weight: 400;
    font-size: clamp(26px, 5vw, 54px);
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.93);
    mix-blend-mode: screen;
}

.overlay-left-1 { top: 34vh; }
.overlay-left-2 { top: 44vh; }
.overlay-left-3 { top: 54vh; }

.overlay-center {
    position: absolute;
    left: 50%;
    top: 6vh;
    transform: translateX(-50%);
    font-weight: 800;
    font-size: clamp(18px, 2.8vw, 36px);
    color: rgba(255,255,255,0.92);
    border-radius: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.overlay-link:hover {
    transform: translateY(-6px) scale(1.02);
    color: #eafffb;
    text-shadow: 0 10px 34px rgba(34, 243, 200, 0.10);
}

.overlay-link:focus-visible {
    outline: 2px solid rgba(234, 255, 251, 0.85);
    outline-offset: 6px;
    border-radius: 8px;
}

.vines,
.vine,
.vine-layer,
#vines,
img[alt*="vine" i],
img[src*="vine" i],
canvas.vines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: auto;
    z-index: 600;
    pointer-events: none;
    transform-origin: top center;
    transform: translateY(-8px) scale(0.72);
    opacity: 0.9;
    filter: saturate(0.9) brightness(0.95);
    will-change: transform;
}

/* Subtle idle sway so motion feels organic even when mouse stops */
.vines,
.vine,
.vine-layer,
#vines,
canvas.vines {
    animation: vine-idle-sway 4.6s ease-in-out infinite;
}

@keyframes vine-idle-sway {
    0%   { transform: translateY(-8px) scale(0.72) rotate(-0.35deg); }
    50%  { transform: translateY(-8px) scale(0.72) rotate(0.35deg); }
    100% { transform: translateY(-8px) scale(0.72) rotate(-0.35deg); }
}

.vines svg,
.vine svg,
#vines svg {
    width: 100%;
    height: auto;
}

.vines path,
.vine path,
#vines path,
.vines line,
.vine line,
#vines line {
    vector-effect: non-scaling-stroke;
    stroke-width: 1.25 !important;
}

@media (max-width: 640px) {
    .overlay-left {
        left: 18px;
        font-size: clamp(16px, 6vw, 26px);
    }

    .overlay-left-1 { top: 34vh; }
    .overlay-left-2 { top: 44vh; }
    .overlay-left-3 { top: 54vh; }

    .vines,
    .vine,
    .vine-layer,
    #vines,
    img[alt*="vine" i],
    img[src*="vine" i],
    canvas.vines {
        transform: translateY(-10px) scale(0.62);
        opacity: 0.88;
        will-change: transform;
    }
}