/* ==========================================================================
   Guess the Number - Background
   Floating number bubbles + gradient (light) → dark navy (dark mode)
   ========================================================================== */

/* ---- CSS variables ---- */
:root {
    --bg-guess-base1: #FFF8F0;
    --bg-guess-base2: #FFF5EB;
}
[data-theme="dark"] {
    --bg-guess-base1: #1A1A2E;
    --bg-guess-base2: #16213E;
}

/* Main background layer */
.game-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* Multi-layer gradient background */
.game-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 50% 50%,
            rgba(var(--color-secondary-rgb), 0.12) 0%,
            transparent 50%
        ),
        radial-gradient(ellipse at 30% 0%,
            rgba(var(--color-accent-rgb), 0.08) 0%,
            transparent 40%
        ),
        radial-gradient(ellipse at 70% 100%,
            rgba(var(--color-primary-rgb), 0.1) 0%,
            transparent 40%
        ),
        radial-gradient(ellipse at 0% 50%,
            rgba(var(--color-primary-rgb), 0.05) 0%,
            transparent 30%
        ),
        radial-gradient(ellipse at 100% 50%,
            rgba(var(--color-secondary-rgb), 0.08) 0%,
            transparent 30%
        ),
        linear-gradient(135deg, var(--bg-guess-base1) 0%, var(--bg-guess-base2) 100%);
    animation: bgPulse 8s ease-in-out infinite;
}

/* Number bubbles container */
.bg-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Number bubbles */
.bg-bubble {
    position: absolute;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--color-primary);
    opacity: 0.06;
    animation: bubbleFloat linear infinite;
    user-select: none;
}

.bg-bubble:nth-child(1) { content: '7'; left: 10%; top: 20%; font-size: 80px; animation-duration: 15s; }
.bg-bubble:nth-child(2) { content: '3'; left: 25%; top: 60%; font-size: 60px; color: var(--color-secondary); animation-duration: 18s; animation-delay: -5s; }
.bg-bubble:nth-child(3) { content: '9'; left: 45%; top: 30%; font-size: 100px; animation-duration: 20s; animation-delay: -10s; }
.bg-bubble:nth-child(4) { content: '1'; left: 70%; top: 70%; font-size: 50px; color: var(--color-accent); animation-duration: 12s; animation-delay: -3s; }
.bg-bubble:nth-child(5) { content: '5'; left: 85%; top: 25%; font-size: 70px; animation-duration: 16s; animation-delay: -8s; }
.bg-bubble:nth-child(6) { content: '2'; left: 60%; top: 15%; font-size: 45px; color: var(--color-secondary); animation-duration: 14s; animation-delay: -7s; }

/* Question mark decoration */
.bg-question {
    position: absolute;
    font-family: var(--font-display);
    font-size: 120px;
    font-weight: 700;
    color: var(--color-primary);
    opacity: 0.04;
    animation: questionPulse 6s ease-in-out infinite;
}

.bg-question:nth-child(7) {
    right: 5%;
    bottom: 10%;
    transform: rotate(-15deg);
}

.bg-question:nth-child(8) {
    left: 5%;
    top: 50%;
    transform: rotate(10deg);
    font-size: 80px;
    color: var(--color-secondary);
}

/* Dot grid */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(var(--color-accent-rgb), 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.4;
}

/* Animations */
@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.95; }
}

@keyframes bubbleFloat {
    0%   { transform: translateY(0) rotate(0deg); }
    25%  { transform: translateY(-30px) rotate(5deg); }
    50%  { transform: translateY(-20px) rotate(0deg); }
    75%  { transform: translateY(-35px) rotate(-5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

@keyframes questionPulse {
    0%, 100% { transform: scale(1) rotate(var(--rotate, 0deg)); opacity: 0.04; }
    50%      { transform: scale(1.05) rotate(var(--rotate, 0deg)); opacity: 0.06; }
}

/* Mobile */
@media (max-width: 768px) {
    .bg-bubble   { font-size: 50px !important; }
    .bg-question { font-size: 60px !important; }
    .bg-grid     { background-size: 40px 40px; }
}
