:root {
    --rose: #f2a7c3;
    --rose-light: #fad4e4;
    --red-light: #e09492;
    --lavender: #c9b8f0;
    --lav-light: #e8e0fb;
    --mauve: #b48ecf;
    --cream: #fdf6ff;
    --text-dark: #3d2a4e;
    --text-mid: #6b4d82;
    --text-soft: #9c7ab8;
    --border: rgba(180, 142, 207, 0.22);
    --card-bg: rgba(255, 255, 255, 0.62);
    --glass: rgba(255, 255, 255, 0.45);

    /* transition for smooth theme switching */
    --theme-transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* ── DARK MODE ── */
body.dark {
    --rose: #f2a7c3;
    --rose-light: #3d1f2e;
    --red-light: #e09492;
    --lavender: #c9b8f0;
    --lav-light: #251840;
    --mauve: #c9a6e8;
    --cream: #120d1c;
    --text-dark: #ede0ff;
    --text-mid: #c4aee8;
    --text-soft: #7a5fa0;
    --border: rgba(180, 142, 207, 0.16);
    --card-bg: rgba(30, 20, 48, 0.78);
    --glass: rgba(30, 20, 48, 0.55);
}

body.dark .bg {
    background:
        radial-gradient(ellipse 70% 55% at 5% 15%, rgba(180, 80, 130, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 55% 70% at 95% 85%, rgba(120, 80, 200, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse 45% 45% at 50% 50%, rgba(30, 15, 55, 0.95) 0%, transparent 100%),
        #120d1c;
}

body.dark .season-card {
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

body.dark .hero-status {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

body.dark .feature-pill {
    background: rgba(40, 25, 65, 0.7);
}

body.dark .ip-display {
    background: rgba(20, 12, 36, 0.6);
}

body.dark #chat-messages {
    background: rgba(18, 10, 32, 0.7) !important;
}

body.dark input[type="text"] {
    background: rgba(20, 12, 36, 0.6) !important;
    color: var(--text-dark) !important;
}

body.dark input[type="text"]::placeholder {
    color: var(--text-soft);
    opacity: 0.7;
}

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle {
    background: var(--glass);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 1rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: var(--theme-transition), transform 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'VT323', monospace;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: rgba(180, 142, 207, 0.5);
    color: var(--mauve);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* smooth transition on everything that uses variables */
body,
.bg,
.season-card,
.connect-card,
.about-card,
.hero-status,
nav,
.nav-ip,
.theme-toggle,
.feature-pill,
.ip-display,
.season-badge,
.status-version,
.section-label,
#chat-messages,
input[type="text"],
.copy-btn {
    transition: var(--theme-transition);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── BACKGROUND ── */
.bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 70% 55% at 5% 15%, rgba(242, 167, 195, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse 55% 70% at 95% 85%, rgba(201, 184, 240, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 45% 45% at 50% 50%, rgba(248, 238, 255, 0.9) 0%, transparent 100%),
        #fdf6ff;
}

/* grain */
.bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
    background-size: 200px;
    opacity: 0.5;
}

/* ── SPARKLES ── */
.sparkles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    border-radius: 50%;
    animation: floatUp linear infinite;
    opacity: 0;
}

.sparkle:nth-child(1) {
    left: 7%;
    bottom: -10px;
    background: var(--rose);
    width: 5px;
    height: 5px;
    animation-duration: 13s;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    left: 18%;
    bottom: -10px;
    background: var(--lavender);
    width: 4px;
    height: 4px;
    animation-duration: 17s;
    animation-delay: 3s;
}

.sparkle:nth-child(3) {
    left: 33%;
    bottom: -10px;
    background: var(--rose);
    width: 6px;
    height: 6px;
    animation-duration: 11s;
    animation-delay: 6s;
}

.sparkle:nth-child(4) {
    left: 50%;
    bottom: -10px;
    background: var(--mauve);
    width: 4px;
    height: 4px;
    animation-duration: 15s;
    animation-delay: 1s;
}

.sparkle:nth-child(5) {
    left: 66%;
    bottom: -10px;
    background: var(--lavender);
    width: 5px;
    height: 5px;
    animation-duration: 19s;
    animation-delay: 8s;
}

.sparkle:nth-child(6) {
    left: 79%;
    bottom: -10px;
    background: var(--rose);
    width: 4px;
    height: 4px;
    animation-duration: 12s;
    animation-delay: 4s;
}

.sparkle:nth-child(7) {
    left: 91%;
    bottom: -10px;
    background: var(--mauve);
    width: 6px;
    height: 6px;
    animation-duration: 16s;
    animation-delay: 10s;
}

.sparkle:nth-child(8) {
    left: 25%;
    bottom: -10px;
    background: var(--lavender);
    width: 3px;
    height: 3px;
    animation-duration: 14s;
    animation-delay: 5s;
}

.sparkle:nth-child(9) {
    left: 44%;
    bottom: -10px;
    background: var(--rose);
    width: 5px;
    height: 5px;
    animation-duration: 18s;
    animation-delay: 7s;
}

.sparkle:nth-child(10) {
    left: 73%;
    bottom: -10px;
    background: var(--lavender);
    width: 4px;
    height: 4px;
    animation-duration: 13s;
    animation-delay: 12s;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.65;
    }

    90% {
        opacity: 0.35;
    }

    100% {
        transform: translateY(-105vh) rotate(360deg);
        opacity: 0;
    }
}

/* ── LAYOUT ── */
.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 100px;
    position: relative;
    z-index: 1;
}

/* ── NAV ── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 30px 0 0;
    opacity: 0;
    animation: fadeDown 0.7s ease forwards 0.1s;
}

.nav-logo {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-dark);
}

.nav-logo .accent {
    color: var(--rose);
}

.nav-ip {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--text-soft);
    background: var(--glass);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 5px 16px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
    margin-left: auto;
}

.nav-ip:hover {
    color: var(--mauve);
    border-color: rgba(180, 142, 207, 0.5);
}

/* ── HERO ── */
.hero {
    padding: 72px 0 56px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 40px;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 0.3s;
}

.hero-eyebrow {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    letter-spacing: 0.18em;
    color: var(--text-soft);
    display: block;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.hero h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(3.2rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1.0;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, var(--mauve) 0%, var(--rose) 55%, var(--lavender) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-mid);
    line-height: 1.75;
    max-width: 520px;
}

/* Status blob on the right */
.hero-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 28px 28px 24px;
    backdrop-filter: blur(16px);
    min-width: 160px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(180, 142, 207, 0.1);
    flex-shrink: 0;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    margin: 0 auto 4px;
    transition: background 0.4s, box-shadow 0.4s;
}

.status-dot.online {
    background: #6dcc7f;
    box-shadow: 0 0 10px rgba(109, 204, 127, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--rose);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.65;
        transform: scale(0.85);
    }
}

.status-label {
    font-family: 'VT323', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: var(--text-soft);
    text-transform: uppercase;
}

.status-players {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.status-players.loading {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    color: var(--text-soft);
    animation: blink 1.2s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

.status-sub {
    font-size: 0.8rem;
    color: var(--text-soft);
    font-style: italic;
}

.status-version {
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    background: var(--lav-light);
    border-radius: 999px;
    padding: 3px 12px;
    margin-top: 4px;
}

/* ── SECTION LABEL ── */
.section-label {
    font-family: 'VT323', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── SEASON CARD ── */
.season-wrap {
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.55s;
    margin-bottom: 28px;
}

.season-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 36px 40px;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 32px rgba(180, 142, 207, 0.1), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    position: relative;
    overflow: hidden;
}

/* decorative corner glow */
.season-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 167, 195, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.season-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--rose-light), var(--lav-light));
    border: 1.5px solid rgba(242, 167, 195, 0.4);
    border-radius: 999px;
    padding: 5px 16px;
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    color: var(--mauve);
    margin-bottom: 20px;
}

.season-badge .live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rose);
    box-shadow: 0 0 5px var(--rose);
    animation: pulse 1.5s ease-in-out infinite;
}

.season-card h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.season-card .season-desc {
    font-size: 0.975rem;
    color: var(--text-mid);
    line-height: 1.75;
    max-width: 520px;
    margin-bottom: 28px;
}

.season-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.85rem;
    color: var(--text-mid);
    font-weight: 600;
}

/* ── CONNECT CARD ── */
.connect-wrap {
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.7s;
    margin-bottom: 28px;
}

.connect-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 32px 40px;
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.connect-left h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.connect-left p {
    font-size: 0.875rem;
    color: var(--text-soft);
}

.connect-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ip-display {
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    color: var(--text-mid);
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 10px 20px;
}

.copy-btn {
    background: linear-gradient(135deg, var(--lavender), var(--rose));
    border: none;
    border-radius: 12px;
    padding: 11px 24px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.copy-btn:hover {
    opacity: 0.88;
    transform: scale(1.03);
}

.copy-btn:active {
    transform: scale(0.97);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #a8e6b0, #6dcc7f);
}

/* ── ABOUT CARD ── */
.about-wrap {
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.85s;
    margin-bottom: 28px;
}

.about-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 36px 40px;
    backdrop-filter: blur(16px);
}

.about-card h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.about-card p {
    font-size: 0.95rem;
    color: var(--text-mid);
    line-height: 1.8;
    margin-bottom: 12px;
}

.about-card p:last-child {
    margin-bottom: 0;
}

.about-card strong {
    color: var(--mauve);
    font-weight: 600;
}

/* ── FOOTER ── */
footer {
    text-align: center;
    padding-top: 40px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 1s;
}

footer p {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: var(--text-soft);
    letter-spacing: 0.1em;
}

/* ── PIXEL DIVIDER ── */
.divider {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 0 0 28px;
    opacity: 0;
    animation: fadeUp 0.7s ease forwards 0.48s;
}

.divider span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.divider span:nth-child(1) {
    background: var(--rose-light);
}

.divider span:nth-child(2) {
    background: var(--rose);
}

.divider span:nth-child(3) {
    background: var(--mauve);
}

.divider span:nth-child(4) {
    background: var(--lavender);
}

.divider span:nth-child(5) {
    background: var(--lav-light);
}

.divider span:nth-child(6) {
    background: var(--lavender);
}

.divider span:nth-child(7) {
    background: var(--mauve);
}

.divider span:nth-child(8) {
    background: var(--rose);
}

.divider span:nth-child(9) {
    background: var(--rose-light);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── RESPONSIVE ── */
@media (max-width: 650px) {
    nav {
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-logo {
        flex: 1;
    }

    .nav-ip {
        font-size: 0.85rem;
        padding: 4px 12px;
    }

    .theme-toggle {
        padding: 4px 10px;
    }

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

    .hero-status {
        flex-direction: row;
        justify-content: space-around;
        min-width: unset;
        width: 100%;
    }

    .season-card,
    .connect-card,
    .about-card {
        padding: 26px 22px;
    }

    .connect-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .connect-right {
        width: 100%;
    }

    .ip-display {
        font-size: 1.2rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    #chat-send {
        width: 100%;
        min-width: unset;
    }

    #chat-name,
    #chat-input {
        flex: 1;
    }
}