@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;700&display=swap');

/* Base Styles & Dynamic Background */
body {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #0f0c29);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #f8f9fa;
    touch-action: manipulation;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.title-glow {
    text-shadow: 0 0 20px rgba(13, 110, 253, 0.5);
    background: -webkit-linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-warning {
    background: -webkit-linear-gradient(45deg, #f6d365 0%, #fda085 100%);
    background: linear-gradient(45deg, #f6d365 0%, #fda085 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Classes */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* Transitions */
.slide-transition {
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
}

.d-none {
    display: none !important;
}

.slide-transition.d-none {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

/* Timer Bar */
.timer-container {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

#timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.6);
    border-radius: 10px;
    /* Transition handled by JS, but applying ease-linear for smoothness */
}
#timer-bar.bg-danger {
    background: linear-gradient(90deg, #ff0844 0%, #ffb199 100%);
    box-shadow: 0 0 15px rgba(255, 8, 68, 0.6);
}

/* Option Buttons */
#options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 1.5vh, 15px);
}

@media (max-width: 576px) {
    #options-container {
        grid-template-columns: 1fr;
    }
}

.option-btn {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 2vh, 1.1rem);
    font-weight: 600;
    padding: clamp(0.6rem, 1.8vh, 1.2rem);
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.option-btn::after {
    content: '';
    position: absolute;
    top: -15px; bottom: -15px; left: -15px; right: -15px;
    background: transparent;
}

.option-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.option-btn:active:not(:disabled) {
    transform: translateY(2px) scale(0.98);
}

.option-btn.selected {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    color: #1a1a2e;
    border-color: transparent;
    box-shadow: 0 0 20px rgba(161, 140, 209, 0.6);
}

/* Animated Inputs & primary buttons */
.input-glass {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: white !important;
    border-radius: 12px;
}
.input-glass::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}
.input-glass:focus {
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.25) !important;
    border-color: #4facfe !important;
}

.btn-vibrant {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
    color: white;
}
.btn-vibrant:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.6);
    color: white;
}

/* Results Formatting */
.score-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
}

.rank-item {
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.2) !important;
}
.rank-item.is-me {
    background: rgba(79, 172, 254, 0.15) !important;
    border-color: rgba(79, 172, 254, 0.4);
}

/* Animations */
.pop-in {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.blink {
    animation: blinker 1.5s linear infinite;
}
@keyframes blinker {
    50% { opacity: 0.5; }
}

/* Lock Overlay */
#locked-overlay {
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

#locked-overlay i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: lockBounce 2s infinite ease-in-out;
}

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

/* One Page Dashboard Natively Embedded Result States */

/* I answered this correctly — bright green glow */
.disabled-correct-mine {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #0d1a0f !important;
    font-weight: 800 !important;
    box-shadow: 0 0 24px rgba(56, 239, 125, 0.7) !important;
    z-index: 10;
}

/* This was the correct answer but I didn't pick it — neutral gold */
.disabled-correct {
    background: rgba(255, 193, 7, 0.15) !important;
    border: 2px solid rgba(255, 193, 7, 0.5) !important;
    color: rgba(255, 220, 100, 0.9) !important;
    font-weight: 700 !important;
    opacity: 0.9;
}

/* Wrong option not picked — fade out */
.disabled-wrong {
    opacity: 0.35;
    background: rgba(255,255,255,0.02) !important;
    border-color: rgba(255,255,255,0.06) !important;
}

/* I picked this but it was wrong — red */
.disabled-wrong-picked {
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(255, 8, 68, 0.6) !important;
}

/* In-game error banner */
#error-banner {
    transition: transform 0.4s cubic-bezier(0.25, 1.25, 0.5, 1), opacity 0.4s ease, visibility 0.4s;
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
}
#error-banner.show-banner {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}
#error-banner .alert {
    border-radius: 50px !important;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid rgba(220, 53, 69, 0.6) !important;
    background: rgba(30, 10, 10, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ff8a90 !important;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.4);
}

.animate-pulse-fast {
    animation: firePulse 1.5s infinite ease-in-out;
}

@keyframes firePulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.15); opacity: 1; filter: saturate(1.5) drop-shadow(0 0 10px rgba(255,69,0,0.8)); }
}

.floating-points {
    position: absolute;
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
    pointer-events: none;
    animation: floatUpFade 2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes floatUpFade {
    0% { transform: translateY(15px) scale(0.5); opacity: 0; }
    20% { transform: translateY(0) scale(1.2); opacity: 1; }
    80% { transform: translateY(-10px) scale(1); opacity: 1; }
    100% { transform: translateY(-20px) scale(0.8); opacity: 0; }
}

.is-me {
    background-color: rgba(13, 110, 253, 0.15) !important;
    border-color: rgba(13, 110, 253, 0.5) !important;
    color: #ffffff !important;
}

/* ── Hamburger Menu ─────────────────────────────────────────── */

.menu-item-btn {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    color: rgba(255,255,255,0.9);
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1rem, 2.8vh, 1.2rem);
    font-weight: 600;
    padding: clamp(0.85rem, 2.2vh, 1.1rem) 1.2rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}
.menu-item-btn:hover,
.menu-item-btn:focus {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.18);
    outline: none;
}
.menu-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: rgba(79,172,254,0.12);
    color: #4facfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ── Sound Sliders ──────────────────────────────────────────── */
.sound-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: clamp(0.75rem, 2vh, 1rem);
}
.sound-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.sound-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    box-shadow: 0 0 8px rgba(79,172,254,0.6);
    cursor: pointer;
}
.sound-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    box-shadow: 0 0 8px rgba(79,172,254,0.6);
    cursor: pointer;
    border: none;
}
/* Bootstrap switch accent colour */
#toggle-music:checked,
#toggle-sfx:checked {
    background-color: #4facfe;
    border-color: #4facfe;
}
