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

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
    color: white;
    overflow: hidden; /* prevent scrollbars from the video */
}

/* Video background styling */
.background-video {
    background-color: black;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    object-fit: cover;
}

.content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

h1 {
    font-size: 3em;
    color: #ffdf2a;
    text-shadow: 0 0 10px rgba(255, 233, 106, 0.8);
    padding: 0 20px;
}

p {
    max-width: 600px;
    font-size: 1.2em;
    margin: 20px 0;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    padding: 0 20px;
}

.btn {
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    text-align: center;
    background: rgba(0, 212, 255, 0.4);
    border: 1px solid rgba(0, 212, 255, 1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
    color: #00d4ff;
    position: relative;
    overflow: hidden;
}

/* Animated gradient background for the glow */
.btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, #00d4ff, #0066ff, #00ffdd, #00d4ff);
    background-size: 300% 300%;
    animation: gradientMove 6s ease infinite;
    filter: blur(30px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::before {
    opacity: 1;
}

/* On hover, make the button glow more */
.btn:hover {
    color: #fff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 1), 0 0 60px rgba(0, 212, 255, 0.8);
    border: 2px solid rgb(73, 224, 255);
    scale: 1.0625;
}

    /* ---------- Mode selection styles ---------- */
.mode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-top: 28px;
}

.mode-grid {
    display: flex;
    gap: 20px;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    max-width: 820px;
}

/* mode-card is now a focusable div (role="radio") so we can place inputs inside */
.mode-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    width: 320px;
    min-height: 160px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(210, 215, 223, 0.1);
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    color: #e6f7ff;
    text-align: left;
    outline: none;
}

.mode-card .mode-top {
    display:flex;
    flex-direction:column;
    gap:6px;
}

.mode-card .mode-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffdf2a;
}

.mode-card .mode-sub {
    font-size: 0.95rem;
    color: #dbefff;
    opacity: 0.9;
}

.mode-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.mode-card[aria-checked="true"],
.mode-card.selected {
    border-color: rgba(0,212,255,0.95);
    box-shadow: 0 18px 40px rgba(0,212,255,0.10);
    transform: translateY(-8px) scale(1.01);
    background: linear-gradient(180deg, rgba(3, 13, 29, 0.35), rgba(3, 12, 28, 0.45));
}

.mode-card:focus-visible {
    box-shadow: 0 0 0 4px rgba(0,212,255,0.12);
}

/* Toggles container at bottom of each card */
.toggles {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 6px;
    width: 100%;
}

/* For PvP: show toggles side-by-side; for singleplayer the container will just have one toggle */
.toggles.row { display:flex; }

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    font-size: 0.9rem;
    color: #e6f7ff;
}

/* Switch appearance */
.switch {
    --w: 44px;
    --h: 24px;
    width: var(--w);
    height: var(--h);
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    position: relative;
    transition: background 150ms ease, box-shadow 150ms ease;
    flex: 0 0 var(--w);
}
.switch .knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(var(--h) - 4px);
    height: calc(var(--h) - 4px);
    border-radius: 50%;
    background: #fff;
    transition: left 150ms ease, transform 120ms ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* checked state */
.switch.checked {
    background: linear-gradient(90deg, #00d4ff, #0066ff);
    box-shadow: 0 6px 18px rgba(0,212,255,0.18);
}
.switch.checked .knob { left: calc(100% - (var(--h) - 2px)); }

/* Make underlying checkbox visually hidden but accessible */
.toggle input[type="checkbox"] {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    white-space: nowrap;
}

/* smaller screens: stack */
@media (max-width: 720px) {
    body {
        overflow-y: auto;
    }
    .content {
        height: auto;
        min-height: 100%;
        padding: 40px 0;
    }
    h1 {
        font-size: 2em;
    }
    p {
        font-size: 1rem;
    }
    .mode-grid {
        flex-direction: column;
        padding: 0 24px;
        align-items: center;
    }
    .mode-card {
        width: 100%;
        max-width: 400px;
    }
    .toggles { justify-content: space-between; }
    .toggles.row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.prepare-row {
    margin-top: 12px;
}

/* small helper to ensure inputs don't trigger card click */
.toggle, .toggle * { pointer-events: auto; }
/* Keyframes for the gradient animation */
@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
