:root {
    --ink: #26304a;
    --ink-2: #4a5578;
    --cream: #fffdf3;
    --sky-1: #3fb0f5;
    --sky-2: #a7e2ff;
    --grass-1: #83dd5a;
    --grass-2: #57c04d;
    --grass-3: #3c9a41;
    --red: #ff5a5f;
    --yellow: #ffd93b;
    --green: #43c94a;
    --accent: #6c8bff;
    --radius: 22px;
    color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: ui-rounded, "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    line-height: 1.55;
    overflow-x: hidden;
    background: linear-gradient(180deg, var(--sky-1) 0%, #7cccfa 34%, var(--sky-2) 68%, #c8ecff 100%);
}

a { color: inherit; }

.hidden { display: none !important; }

/* ---------- Header ---------- */

.site-header {
    position: relative;
    z-index: 5;
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px clamp(16px, 4vw, 32px) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 1.02rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(160deg, #ff8a5c, #ff3d6e);
    border: 3px solid var(--ink);
    box-shadow: 0 4px 0 var(--ink);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.brand-name {
    font-weight: 900;
    font-size: 1.12rem;
    letter-spacing: -0.01em;
    color: #fff;
    text-shadow: 0 2px 0 var(--ink), 0 4px 8px rgba(38, 48, 74, 0.2);
}

.brand-note {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--ink);
    background: var(--yellow);
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 5px 14px;
    box-shadow: 0 3px 0 var(--ink);
    white-space: nowrap;
}

/* ---------- Hero band / sky ---------- */

.hero-band {
    position: relative;
    overflow: hidden;
    padding: clamp(26px, 5vw, 54px) clamp(16px, 4vw, 32px) clamp(44px, 8vw, 88px);
}

.sky {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.sun {
    position: absolute;
    top: clamp(30px, 7vw, 70px);
    right: clamp(14px, 7vw, 110px);
    width: clamp(66px, 11vw, 118px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 34%, #fff6c0, #ffd23f 58%, #ffab1f 100%);
    box-shadow: 0 0 0 9px rgba(255, 226, 120, 0.35), 0 0 70px 18px rgba(255, 214, 90, 0.5);
}

.sun::before {
    content: "";
    position: absolute;
    inset: -46%;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(255, 226, 120, 0.5) 0deg 6deg, transparent 6deg 30deg);
    animation: sunspin 90s linear infinite;
    z-index: -1;
}

@keyframes sunspin { to { transform: rotate(360deg); } }

.cloud {
    position: absolute;
    background: #fff;
    border-radius: 999px;
    opacity: 0.96;
    filter: drop-shadow(0 10px 0 rgba(120, 180, 220, 0.18));
}

.cloud::before,
.cloud::after {
    content: "";
    position: absolute;
    background: #fff;
    border-radius: 50%;
}

.cloud::before { width: 62%; height: 168%; left: 5%; bottom: 26%; }
.cloud::after { width: 46%; height: 142%; right: 7%; bottom: 28%; }

.cloud-1 { top: 12%; left: -240px; width: 156px; height: 46px; animation: drift 44s linear infinite; }
.cloud-2 { top: 38%; left: -280px; width: 108px; height: 34px; animation: drift 60s linear infinite; animation-delay: -22s; }
.cloud-3 { top: 4%; left: -220px; width: 88px; height: 28px; animation: drift 74s linear infinite; animation-delay: -48s; }

@keyframes drift { to { transform: translateX(calc(100vw + 340px)); } }

.qblock {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: linear-gradient(180deg, #ffd75e, #f2a90c);
    border: 3px solid var(--ink);
    box-shadow: 0 5px 0 var(--ink);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 1.5rem;
    animation: bob 3s ease-in-out infinite;
}

.qblock::after { content: "?"; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22); }
.qblock-1 { left: clamp(10px, 6vw, 110px); top: 52%; }
.qblock-2 { right: clamp(10px, 9vw, 160px); top: 30%; width: 38px; height: 38px; font-size: 1.2rem; animation-delay: -1.5s; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ---------- Hero content ---------- */

.hero {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 780px;
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-block;
    margin: 0 0 16px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--cream);
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 6px 16px;
    box-shadow: 0 3px 0 var(--ink);
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 7vw, 4.1rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 4px 0 var(--ink), 0 10px 18px rgba(38, 48, 74, 0.22);
}

.hero h1 .pop { color: var(--yellow); }

.hero-sub {
    margin: 22px auto 0;
    max-width: 560px;
    font-size: clamp(0.98rem, 2.4vw, 1.1rem);
    font-weight: 600;
    color: var(--ink);
    background: var(--cream);
    border: 3px solid var(--ink);
    border-radius: 18px;
    padding: 15px 20px;
    box-shadow: 0 6px 0 var(--ink);
}

.hero-chips {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.hero-chips li {
    font-size: 0.79rem;
    font-weight: 800;
    color: var(--ink);
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 5px 14px;
    box-shadow: 0 3px 0 var(--ink);
}

/* ---------- Solo / bot fallback toggle ---------- */

.bot-fallback {
    margin: 20px auto 0;
    text-align: center;
}

.bot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: var(--ink);
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 9px 20px;
    text-decoration: none;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.bot-toggle:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.bot-toggle:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.bot-toggle.is-on { background: var(--yellow); }

.bot-fallback-note {
    margin: 10px auto 0;
    max-width: 420px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink);
    opacity: 0.85;
}

/* ---------- Live banner ---------- */

.live-banner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    max-width: calc(100% - 32px);
    margin: 28px auto 0;
    padding: 12px 18px 12px 16px;
    text-decoration: none;
    border-radius: 16px;
    background: linear-gradient(160deg, #ffd93b, #ffb52e);
    border: 3px solid var(--ink);
    box-shadow: 0 5px 0 var(--ink);
    color: var(--ink);
    font-weight: 800;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.live-banner:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }

.live-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 0 rgba(67, 201, 74, 0.6);
    animation: pulse 1.6s ease-out infinite;
    flex: none;
}

.live-text { font-weight: 800; }

.live-cta {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* ---------- Ground divider ---------- */

.ground-divider {
    position: relative;
    z-index: 2;
    line-height: 0;
    margin-top: -1px;
}

.ground-divider svg {
    display: block;
    width: 100%;
    height: clamp(96px, 13vw, 172px);
}

/* ---------- Map ---------- */

.map {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, var(--grass-1), var(--grass-2) 58%, var(--grass-3));
    padding: clamp(26px, 5vw, 52px) clamp(16px, 4vw, 32px) clamp(70px, 10vw, 120px);
}

.map::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(48, 128, 56, 0.16) 2px, transparent 2.6px);
    background-size: 36px 36px;
    opacity: 0.7;
}

.map-title {
    position: relative;
    z-index: 3;
    margin: 0 auto clamp(34px, 5vw, 54px);
    text-align: center;
}

.map-title span {
    display: inline-block;
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--cream);
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 7px 20px;
    box-shadow: 0 4px 0 var(--ink);
}

.pipe {
    position: absolute;
    left: clamp(18px, 7vw, 90px);
    bottom: 0;
    width: 78px;
    height: 84px;
    z-index: 1;
}

.pipe::before {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 0;
    top: 24px;
    background: linear-gradient(90deg, #2fae3a, #8ff08a 42%, #2fae3a);
    border: 3px solid var(--ink);
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.pipe::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 26px;
    background: linear-gradient(90deg, #2fae3a, #9ff79a 42%, #2fae3a);
    border: 3px solid var(--ink);
    border-radius: 9px;
}

.map-wrap {
    position: relative;
    z-index: 3;
    max-width: 1000px;
    margin: 0 auto;
}

.map-rail {
    position: absolute;
    left: 50%;
    top: 40px;
    bottom: 40px;
    width: 0;
    border-left: 6px dashed rgba(255, 255, 255, 0.72);
    transform: translateX(-3px);
}

.game-grid {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(30px, 5vw, 52px);
}

/* ---------- Level card ---------- */

.game-card {
    --accent: #6c8bff;
    position: relative;
    width: calc(50% - 52px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: var(--cream);
    border: 4px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 8px 0 var(--ink), 0 20px 30px rgba(38, 48, 74, 0.16);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.game-card:nth-child(odd) { align-self: flex-start; }
.game-card:nth-child(even) { align-self: flex-end; }

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 0 var(--ink), 0 26px 36px rgba(38, 48, 74, 0.22);
}

.game-card.is-waiting {
    border-color: #2fae3a;
    box-shadow: 0 8px 0 var(--ink), 0 0 0 6px rgba(67, 201, 74, 0.4), 0 20px 30px rgba(38, 48, 74, 0.16);
}

.game-card:only-child {
    align-self: center;
    width: min(560px, 100%);
}

.game-card:only-child .map-node { display: none; }

.map-node {
    position: absolute;
    top: 50%;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    border: 4px solid var(--ink);
    box-shadow: 0 4px 0 var(--ink);
    display: grid;
    place-items: center;
    z-index: 4;
}

.map-node::after {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 2px rgba(38, 48, 74, 0.28);
}

.game-card:nth-child(odd) .map-node { right: -52px; transform: translate(50%, -50%); }
.game-card:nth-child(even) .map-node { left: -52px; transform: translate(-50%, -50%); }

/* ---------- Card cover ---------- */

.card-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    border: 3px solid var(--ink);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 32%, #eaf4ff), #dceeff);
}

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

.cover-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.7rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(150deg, var(--accent), #4a63d8);
}

.waiting-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--yellow);
    border: 3px solid var(--ink);
    color: var(--ink);
    font-size: 0.73rem;
    font-weight: 900;
    box-shadow: 0 3px 0 var(--ink);
}

.waiting-badge .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid var(--ink);
    animation: pulse 1.6s ease-out infinite;
}

/* ---------- Card body ---------- */

.card-body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 2px 4px 4px;
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.card-name {
    margin: 0;
    font-size: 1.34rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.status-pill {
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: var(--red);
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 2px 9px;
}

.mode-pill {
    align-self: flex-start;
    font-size: 0.73rem;
    font-weight: 900;
    color: #fff;
    background: var(--accent);
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 3px 11px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.card-desc {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink-2);
}

.card-tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.card-tags li {
    font-size: 0.71rem;
    font-weight: 800;
    color: var(--ink-2);
    background: #eef4ff;
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 2px 9px;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 6px;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 26px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 900;
    font-size: 0.96rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
    background: linear-gradient(180deg, #6ee07a, #43c94a);
    border: 3px solid var(--ink);
    box-shadow: 0 5px 0 var(--ink);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.play-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); filter: saturate(1.1); }
.play-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

.card-note {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--ink-2);
}

/* ---------- Empty ---------- */

.empty-state {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 460px;
    margin: 10px auto 0;
    padding: 40px 26px;
    background: var(--cream);
    border: 4px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 8px 0 var(--ink);
}

.empty-state h3 { margin: 14px 0 6px; font-size: 1.25rem; }
.empty-state p { margin: 0; color: var(--ink-2); font-weight: 600; }

.empty-art { position: relative; display: inline-block; width: 54px; height: 36px; }
.empty-art i {
    position: absolute;
    top: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--ink);
}
.empty-art i:first-child { left: 0; }
.empty-art i:last-child { right: 0; opacity: 0.8; }

/* ---------- Footer ---------- */

.site-footer {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, var(--grass-3), #2f7d36);
    color: #eafff0;
    text-align: center;
    padding: 26px 20px 42px;
    font-size: 0.86rem;
    font-weight: 700;
}

.site-footer p { margin: 0; }

.grass-tuft {
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    width: 120px;
    height: 20px;
    background:
        radial-gradient(circle at 10px 20px, #57c04d 10px, transparent 11px),
        radial-gradient(circle at 42px 20px, #57c04d 14px, transparent 15px),
        radial-gradient(circle at 76px 20px, #57c04d 11px, transparent 12px),
        radial-gradient(circle at 108px 20px, #57c04d 13px, transparent 14px);
    opacity: 0.9;
}

/* ---------- Motion ---------- */

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(67, 201, 74, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(67, 201, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(67, 201, 74, 0); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .qblock { display: none; }
    .pipe { display: none; }
}

@media (max-width: 760px) {
    .brand-note { display: none; }
    .hero h1 { text-shadow: 0 3px 0 var(--ink); }

    .map-rail { left: 22px; top: 24px; bottom: 24px; transform: translateX(-3px); }

    .game-grid { padding-left: 56px; gap: 26px; }

    .game-card,
    .game-card:nth-child(odd),
    .game-card:nth-child(even) {
        width: 100%;
        align-self: stretch;
    }

    .map-node,
    .game-card:nth-child(odd) .map-node,
    .game-card:nth-child(even) .map-node {
        left: -34px;
        right: auto;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 420px) {
    .game-card { padding: 11px; }
    .card-body { padding: 2px 2px 4px; }
    .play-btn { padding: 0 20px; }
}
