:root {
    --h: 190;
    --ink: hsl(var(--h) 70% 97%);
    --muted: hsl(var(--h) 30% 80% / .72);
    --line: hsl(var(--h) 70% 88% / .16);
    --accent: hsl(var(--h) 100% 68%);
    --accent2: hsl(calc(var(--h) + 35) 95% 58%);
    --bg0: hsl(var(--h) 50% 18%);
    --bg1: hsl(calc(var(--h) + 25) 60% 6%);
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    margin: 0;
    padding: max(15px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) max(15px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
    background: radial-gradient(120% 90% at 50% 0%, var(--bg0), var(--bg1)), #07060f;
    background-attachment: fixed;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
    color: var(--ink);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Ad splash ---------- */
#ad {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(120% 90% at 50% 20%, #1a2340, #0a0d1a 70%);
    overflow: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#ad.ready {
    cursor: pointer;
}
#ad.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#adCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: blur(34px) brightness(0.55) saturate(1.4);
    transform: scale(1.12) translateZ(0);
    z-index: 0;
}
#adGlass {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(12, 16, 32, 0.34);
}
#adVideo {
    position: relative;
    z-index: 2;
    max-width: 92%;
    max-height: 92%;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.85);
}
#adPlayButton {
    position: absolute;
    z-index: 3;
    padding: 12px 40px;
    font-size: 20px;
    font-weight: bold;
    background-color: #2ecc71;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
#adPlayButton:hover {
    background-color: #27ae60;
    transform: scale(1.05);
}
#adHint {
    position: absolute;
    z-index: 3;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 26px;
    border-radius: 999px;
    font-size: 16px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.55);
    animation: adHintPulse 1.6s ease-in-out infinite;
}
@keyframes adHintPulse {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}
#adPlayButton.hidden,
#adHint.hidden {
    display: none;
}

/* ---------- Mode selector ---------- */
.container {
    width: 100%;
    max-width: 800px;
    min-height: 450px;
    background: linear-gradient(160deg, hsl(var(--h) 45% 20% / .94), hsl(calc(var(--h) + 30) 50% 9% / .96));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 40px 90px -30px #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    border: 1px solid var(--line);
    position: relative;
    z-index: 1;
    margin: 15px;
}
#menu.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Animated blurred background shapes */
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.bg .shape {
    position: absolute;
    top: 0;
    left: 0;
    filter: blur(56px);
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}
@media (prefers-reduced-motion: reduce) {
    .bg .shape {
        filter: blur(64px);
    }
}

/* Typography */
#menu h1 {
    font-size: clamp(26px, 5vw, 36px);
    color: var(--ink);
    margin: 0 0 8px 0;
    text-shadow: 0 0 24px hsl(var(--h) 100% 60% / .35), 0 2px 0 hsl(var(--h) 60% 8% / .6);
    text-align: center;
}
#menu p {
    font-size: clamp(14px, 3vw, 16px);
    color: var(--muted);
    margin: 0 0 25px 0;
    font-weight: bold;
    text-align: center;
}

/* Mode cards */
.cards-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 540px;
    justify-content: center;
    flex-direction: row;
}
.mode-card {
    flex: 1;
    background: linear-gradient(160deg, hsl(var(--h) 45% 20% / .9), hsl(calc(var(--h) + 30) 50% 9% / .92));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    color: var(--ink);
    box-shadow: 0 20px 40px -24px #000;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    touch-action: manipulation;
}
.mode-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 25px hsl(var(--h) 100% 55% / .28);
    border-color: var(--accent);
}
.mode-card:active {
    transform: translateY(0) scale(0.98);
}
.mode-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}
.mode-title {
    font-size: clamp(18px, 4vw, 20px);
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 6px;
}
.mode-desc {
    font-size: clamp(12px, 2.5vw, 13px);
    color: var(--muted);
    line-height: 1.3;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    .cards-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    .container {
        padding: 25px 15px;
        min-height: auto;
    }
    .bg .shape {
        filter: blur(55px);
    }
}
