/* ===== Design tokens ===== */
:root {
    --primary-red: #c41e1e;
    --primary-red-hover: #e62e2e;
    --dark-green: #121f12;
    --leaf-green: #243d23;
    --leaf-green-hover: #2d4d2c;
    --gold: #e0b84a;
    --text-white: #f2f2f0;
    --text-muted: #b8c4b8;
    --footer-bg: #0a0f0a;
    --border-dark: #0a0a0a;
    --card-border: rgba(196, 30, 30, 0.65);
    --hero-fade: rgba(18, 31, 18, 0.92);
    --hero-glow: rgba(45, 87, 44, 0.35);
    --title-glow: rgba(196, 30, 30, 0.25);
    --success: #1e7a3a;
    --error: #8b1e1e;
    --footer-text: #9a9a9a;
    --radius-sm: 8px;
    --radius-md: 12px;
    --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.45);
    --shadow-ip: 0 6px 0 var(--border-dark);
    --max-content: 960px;
    --space-section: clamp(2.5rem, 6vw, 4rem);
    --font-display: "VT323", "Courier New", monospace;
    --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --theme-transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* ===== Pink mode (rose garden) ===== */
html.pink-mode {
    --primary-red: #e85a8c;
    --primary-red-hover: #ff7aab;
    --dark-green: #1a1218;
    --leaf-green: #3a2432;
    --leaf-green-hover: #4a2e40;
    --gold: #f0b8c8;
    --text-white: #fff5f8;
    --text-muted: #d4b8c4;
    --footer-bg: #120c10;
    --border-dark: #1a0a12;
    --card-border: rgba(232, 90, 140, 0.55);
    --hero-fade: rgba(26, 18, 24, 0.94);
    --hero-glow: rgba(232, 90, 140, 0.28);
    --title-glow: rgba(255, 122, 171, 0.4);
    --success: #c45a8c;
    --error: #b83a5c;
    --footer-text: #b89aa8;
    --shadow-card: 0 12px 28px rgba(80, 20, 50, 0.4);
}

/* ===== Reset / base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--dark-green);
    color: var(--text-white);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: var(--theme-transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3 {
    line-height: 1.15;
}

/* ===== Site controls (pink + language) ===== */
.site-controls {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pink-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.4rem 0.7rem;
    border: 2px solid var(--border-dark);
    border-radius: var(--radius-sm);
    background: var(--leaf-green);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pink-toggle:hover {
    color: var(--text-white);
    background: var(--leaf-green-hover);
}

.pink-toggle[aria-pressed="true"] {
    background: var(--primary-red);
    color: var(--text-white);
    box-shadow: 0 0 14px var(--title-glow);
}

.pink-toggle-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.lang-switcher {
    display: inline-flex;
    gap: 0;
    border: 2px solid var(--border-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    background: var(--leaf-green);
}

/* Fallback if an older HTML wrapper is missing (cache mismatch) */
body > .lang-switcher {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

.lang-btn {
    appearance: none;
    border: none;
    margin: 0;
    padding: 0.45rem 0.75rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn + .lang-btn {
    border-left: 1px solid rgba(0, 0, 0, 0.35);
}

.lang-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.06);
}

.lang-btn.is-active {
    background: var(--primary-red);
    color: var(--text-white);
}

.lang-btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
    z-index: 1;
}

/* ===== Focus styles ===== */
:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

/* ===== Header / hero ===== */
header {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, var(--hero-fade) 100%),
        radial-gradient(ellipse at 50% 20%, var(--hero-glow), transparent 60%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.12) 3px,
            rgba(0, 0, 0, 0.12) 4px
        ),
        var(--dark-green);
    min-height: min(70vh, 560px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 4px solid var(--primary-red);
    padding: clamp(2rem, 5vw, 3.5rem) 1.25rem;
    transition: var(--theme-transition);
}

.hero {
    max-width: 42rem;
    width: 100%;
}

.pixel-rose {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
    animation: float 3s ease-in-out infinite;
}

.pixel-rose img {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}

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

.pixel-font {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 12vw, 5rem);
    letter-spacing: 0.08em;
    margin: 0;
    color: var(--primary-red);
    text-shadow:
        3px 3px 0 var(--border-dark),
        0 0 24px var(--title-glow);
    font-weight: 400;
}

html.pink-mode .pixel-rose img {
    filter: drop-shadow(0 6px 12px rgba(80, 20, 50, 0.45)) hue-rotate(-8deg) saturate(1.15);
}

.motto {
    font-style: italic;
    color: var(--gold);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    margin: 0.5rem 0 0;
}

.hero-lead {
    margin: 0.85rem auto 0;
    max-width: 36rem;
    font-size: clamp(0.95rem, 2.4vw, 1.05rem);
    color: var(--text-white);
}

/* ===== Server status ===== */
.status-container {
    margin-top: 1.25rem;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.dot {
    height: 12px;
    width: 12px;
    flex-shrink: 0;
    background-color: #666;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.dot.online {
    background-color: #2ecc71;
    box-shadow: 0 0 10px #2ecc71;
}

.dot.offline {
    background-color: #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

.dot.unknown {
    background-color: #888;
}

#player-count {
    color: var(--gold);
}

/* ===== Copy IP button ===== */
.server-ip {
    display: inline-block;
    background: var(--primary-red);
    color: var(--text-white);
    padding: 0.85rem 1.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-top: 1.25rem;
    cursor: pointer;
    border: 3px solid var(--border-dark);
    border-radius: 4px;
    box-shadow: var(--shadow-ip);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.server-ip:hover {
    background: var(--primary-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 0 var(--border-dark);
}

.server-ip:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--border-dark);
}

.server-ip.copied {
    background: var(--success);
}

.click-info {
    margin: 0.65rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Main content ===== */
main {
    padding-bottom: var(--space-section);
}

.section-title {
    text-align: center;
    color: var(--gold);
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3rem);
    margin: var(--space-section) 1rem 1.5rem;
    font-weight: 400;
    letter-spacing: 0.04em;
}

/* ===== Server cards ===== */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.server-card {
    background: var(--leaf-green);
    border: 2px solid var(--card-border);
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.server-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-red);
    background: var(--leaf-green-hover);
}

.server-card h3 {
    font-family: var(--font-display);
    font-size: 1.85rem;
    margin: 0.35rem 0 0.65rem;
    color: var(--text-white);
    font-weight: 400;
    letter-spacing: 0.03em;
}

.server-card p {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.card-icon {
    font-size: 2.75rem;
    line-height: 1;
}

.plugin-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.plugin-list li {
    padding: 0.55rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.92rem;
}

.plugin-list li:last-child {
    border-bottom: none;
}

/* ===== Rules ===== */
.rules-container {
    max-width: min(800px, calc(100% - 2.5rem));
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.28);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-left: 6px solid var(--primary-red);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.rules-container ol,
.rules-container ul {
    margin: 0;
    padding-left: 1.35rem;
}

.rules-container li {
    margin-bottom: 0.85rem;
    color: var(--text-white);
}

.rules-container li:last-child {
    margin-bottom: 0;
}

.rules-container p {
    margin: 0 0 0.85rem;
}

.rules-container strong {
    color: var(--gold);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem 1.25rem;
    background: var(--footer-bg);
    font-size: 0.9rem;
    color: var(--footer-text);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--theme-transition);
}

footer p {
    margin: 0;
}

/* ===== Toast notification ===== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 999;
    background: var(--success);
    color: var(--text-white);
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: 0.03em;
    max-width: calc(100% - 2rem);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast.is-error {
    background: var(--error);
}

/* ===== Selection ===== */
::selection {
    background: var(--primary-red);
    color: var(--text-white);
}

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

    .pixel-rose {
        animation: none;
    }

    .server-ip,
    .server-card,
    .toast,
    .dot {
        transition: none;
    }

    .server-card:hover,
    .server-ip:hover {
        transform: none;
    }
}

/* ===== Small screens ===== */
@media (max-width: 480px) {
    .site-controls {
        top: 0.65rem;
        right: 0.65rem;
        gap: 0.35rem;
    }

    .pink-toggle-text {
        /* Icon-only on very small screens */
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .pink-toggle {
        padding: 0.4rem 0.55rem;
    }

    .server-ip {
        width: 100%;
        max-width: 20rem;
        padding: 0.75rem 1rem;
    }

    .rules-container {
        border-left-width: 4px;
    }
}

/* ===== Section nav + driftsside ===== */
.site-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 0.85rem 1rem;
    background: #0e180e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html.pink-mode .site-nav {
    background: #140c12;
}

.site-nav a {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    color: var(--text-white);
    text-decoration: underline;
    text-underline-offset: 0.25rem;
}

.footer-links {
    margin: 0.75rem 0 0;
}

.footer-links a {
    color: var(--gold);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.docs-block {
    max-width: min(960px, calc(100% - 2.5rem));
    margin: 0 auto 1.5rem;
}

.docs-block p,
.docs-block li {
    color: var(--text-white);
}

.docs-block a {
    color: var(--gold);
}

.docs-table-wrap {
    overflow-x: auto;
    max-width: min(960px, calc(100% - 2.5rem));
    margin: 0 auto 1.5rem;
    -webkit-overflow-scrolling: touch;
}

table.docs {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.docs th,
table.docs td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
    padding: 0.55rem 0.45rem;
    vertical-align: top;
}

table.docs th {
    color: var(--gold);
    font-weight: 600;
}

table.docs code,
.docs-block code,
pre.diagram code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84em;
}

pre.diagram {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.35);
    padding: 1rem 1.1rem;
    border-radius: var(--radius-sm);
    border-left: 6px solid var(--primary-red);
    color: var(--text-white);
    font-size: 0.82rem;
    line-height: 1.45;
}
