/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    height: 100vh;
    color: #333;
    overflow: hidden;
    margin: 0;
    padding: 0;
    padding-bottom: 85px; /* Account for smaller footer height + marquee lights clearance */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    padding-bottom: 30px; /* Extra padding to ensure marquee lights are visible */
    height: calc(100vh - 85px); /* Subtract footer height + clearance */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

/* Header Styles - Hidden by default */
.header {
    display: none;
}

/* Footer Styles */
.footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-nav {
    position: relative;
    z-index: 20;
}

.footer-title {
    text-align: center;
    color: #4a5568;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    flex: 1;
}

/* Marquee Light Container */
.marquee-lights {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

/* Start Screen positioning for marquee lights - removed conflicting display rule */
#start-screen {
    position: relative;
}

/* Game Screen simple layout - removed conflicting display rule */


/* Game Stats Footer */
.game-stats-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* Top Lights */
.lights-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lights-top li {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: -3px;
    box-shadow: 0 0 10px currentColor, inset 0 0 5px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Bottom Lights */
.lights-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lights-bottom li {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    bottom: -3px;
    box-shadow: 0 0 10px currentColor, inset 0 0 5px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Left Lights */
.lights-left {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lights-left li {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    left: -3px;
    box-shadow: 0 0 10px currentColor, inset 0 0 5px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Right Lights */
.lights-right {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lights-right li {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    right: -3px;
    box-shadow: 0 0 10px currentColor, inset 0 0 5px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Light Colors */
.light-red { color: #ff4757; background: #ff4757; }
.light-orange { color: #ff6348; background: #ff6348; }
.light-yellow { color: #feca57; background: #feca57; }
.light-green { color: #48ca61; background: #48ca61; }
.light-blue { color: #0abde3; background: #0abde3; }
.light-purple { color: #9c88ff; background: #9c88ff; }
.light-pink { color: #ff9ff3; background: #ff9ff3; }
.light-cyan { color: #54a0ff; background: #54a0ff; }

/* Individual Light Animations for Chasing Effect - Evenly Spaced Around Perimeter */
/* Top Lights (39 lights) - Left to Right */
.lights-top li:nth-child(1) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0s; }
.lights-top li:nth-child(2) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.05s; }
.lights-top li:nth-child(3) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.1s; }
.lights-top li:nth-child(4) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.15s; }
.lights-top li:nth-child(5) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.2s; }
.lights-top li:nth-child(6) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.25s; }
.lights-top li:nth-child(7) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.3s; }
.lights-top li:nth-child(8) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.35s; }
.lights-top li:nth-child(9) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.4s; }
.lights-top li:nth-child(10) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.45s; }
.lights-top li:nth-child(11) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.5s; }
.lights-top li:nth-child(12) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.55s; }
.lights-top li:nth-child(13) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.6s; }
.lights-top li:nth-child(14) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.65s; }
.lights-top li:nth-child(15) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.7s; }
.lights-top li:nth-child(16) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.75s; }
.lights-top li:nth-child(17) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.8s; }
.lights-top li:nth-child(18) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.85s; }
.lights-top li:nth-child(19) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.9s; }
.lights-top li:nth-child(20) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.95s; }
.lights-top li:nth-child(21) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.0s; }
.lights-top li:nth-child(22) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.05s; }
.lights-top li:nth-child(23) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.1s; }
.lights-top li:nth-child(24) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.15s; }
.lights-top li:nth-child(25) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.2s; }
.lights-top li:nth-child(26) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.25s; }
.lights-top li:nth-child(27) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.3s; }
.lights-top li:nth-child(28) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.35s; }
.lights-top li:nth-child(29) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.4s; }
.lights-top li:nth-child(30) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.45s; }
.lights-top li:nth-child(31) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.5s; }
.lights-top li:nth-child(32) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.55s; }
.lights-top li:nth-child(33) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.6s; }
.lights-top li:nth-child(34) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.65s; }
.lights-top li:nth-child(35) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.7s; }
.lights-top li:nth-child(36) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.75s; }
.lights-top li:nth-child(37) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.8s; }
.lights-top li:nth-child(38) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.85s; }
.lights-top li:nth-child(39) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.9s; }

/* Right Lights (15 lights) - Top to Bottom */
.lights-right li:nth-child(1) { animation: lightChase 5s infinite ease-in-out; animation-delay: 1.95s; }
.lights-right li:nth-child(2) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.0s; }
.lights-right li:nth-child(3) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.05s; }
.lights-right li:nth-child(4) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.1s; }
.lights-right li:nth-child(5) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.15s; }
.lights-right li:nth-child(6) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.2s; }
.lights-right li:nth-child(7) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.25s; }
.lights-right li:nth-child(8) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.3s; }
.lights-right li:nth-child(9) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.35s; }
.lights-right li:nth-child(10) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.4s; }
.lights-right li:nth-child(11) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.45s; }
.lights-right li:nth-child(12) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.5s; }
.lights-right li:nth-child(13) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.55s; }
.lights-right li:nth-child(14) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.6s; }
.lights-right li:nth-child(15) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.65s; }

/* Bottom Lights (39 lights) - Right to Left */
.lights-bottom li:nth-child(1) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.7s; }
.lights-bottom li:nth-child(2) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.75s; }
.lights-bottom li:nth-child(3) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.8s; }
.lights-bottom li:nth-child(4) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.85s; }
.lights-bottom li:nth-child(5) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.9s; }
.lights-bottom li:nth-child(6) { animation: lightChase 5s infinite ease-in-out; animation-delay: 2.95s; }
.lights-bottom li:nth-child(7) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.0s; }
.lights-bottom li:nth-child(8) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.05s; }
.lights-bottom li:nth-child(9) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.1s; }
.lights-bottom li:nth-child(10) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.15s; }
.lights-bottom li:nth-child(11) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.2s; }
.lights-bottom li:nth-child(12) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.25s; }
.lights-bottom li:nth-child(13) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.3s; }
.lights-bottom li:nth-child(14) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.35s; }
.lights-bottom li:nth-child(15) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.4s; }
.lights-bottom li:nth-child(16) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.45s; }
.lights-bottom li:nth-child(17) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.5s; }
.lights-bottom li:nth-child(18) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.55s; }
.lights-bottom li:nth-child(19) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.6s; }
.lights-bottom li:nth-child(20) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.65s; }
.lights-bottom li:nth-child(21) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.7s; }
.lights-bottom li:nth-child(22) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.75s; }
.lights-bottom li:nth-child(23) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.8s; }
.lights-bottom li:nth-child(24) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.85s; }
.lights-bottom li:nth-child(25) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.9s; }
.lights-bottom li:nth-child(26) { animation: lightChase 5s infinite ease-in-out; animation-delay: 3.95s; }
.lights-bottom li:nth-child(27) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.0s; }
.lights-bottom li:nth-child(28) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.05s; }
.lights-bottom li:nth-child(29) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.1s; }
.lights-bottom li:nth-child(30) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.15s; }
.lights-bottom li:nth-child(31) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.2s; }
.lights-bottom li:nth-child(32) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.25s; }
.lights-bottom li:nth-child(33) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.3s; }
.lights-bottom li:nth-child(34) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.35s; }
.lights-bottom li:nth-child(35) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.4s; }
.lights-bottom li:nth-child(36) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.45s; }
.lights-bottom li:nth-child(37) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.5s; }
.lights-bottom li:nth-child(38) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.55s; }
.lights-bottom li:nth-child(39) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.6s; }

/* Left Lights (15 lights) - Bottom to Top */
.lights-left li:nth-child(1) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.65s; }
.lights-left li:nth-child(2) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.7s; }
.lights-left li:nth-child(3) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.75s; }
.lights-left li:nth-child(4) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.8s; }
.lights-left li:nth-child(5) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.85s; }
.lights-left li:nth-child(6) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.9s; }
.lights-left li:nth-child(7) { animation: lightChase 5s infinite ease-in-out; animation-delay: 4.95s; }
.lights-left li:nth-child(8) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0s; }
.lights-left li:nth-child(9) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.05s; }
.lights-left li:nth-child(10) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.1s; }
.lights-left li:nth-child(11) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.15s; }
.lights-left li:nth-child(12) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.2s; }
.lights-left li:nth-child(13) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.25s; }
.lights-left li:nth-child(14) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.3s; }
.lights-left li:nth-child(15) { animation: lightChase 5s infinite ease-in-out; animation-delay: 0.35s; }

@keyframes lightChase {
    0%, 90% { 
        opacity: 0.3; 
        transform: scale(0.8);
        box-shadow: 0 0 5px currentColor, inset 0 0 3px rgba(255, 255, 255, 0.2);
    }
    10%, 80% { 
        opacity: 1; 
        transform: scale(1.2);
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor, inset 0 0 8px rgba(255, 255, 255, 0.5);
    }
}



.game-stats {
    position: relative;
    z-index: 10;
}

.home-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 25px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 25;
}

.home-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: #667eea;
}

.home-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(1.1);
}

.home-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}



.game-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
}

/* Global Game Stats Footer */
.game-stats-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, 
        #ff4757 0%,      /* red */
        #ff6348 12.5%,   /* orange */
        #feca57 25%,     /* yellow */
        #48ca61 37.5%,   /* green */
        #0abde3 50%,     /* blue */
        #9c88ff 62.5%,   /* purple */
        #ff9ff3 75%,     /* pink */
        #54a0ff 87.5%,   /* cyan */
        #ff4757 100%     /* red (loop) */
    );
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding: 11px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-nav-left,
.footer-nav-right {
    flex: 0 0 auto;
}

.footer-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.footer-nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Specific styling for home button */
#footer-home-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#footer-home-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    min-width: 100px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a5568;
}

/* Screen Management - Ensure consistent visibility across all devices */
.screen {
    display: none !important;
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
    min-height: 0;
}

.screen.active {
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
}

/* Start Screen */
.welcome-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #4a5568;
}

.welcome-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.game-options {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
    text-align: left;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-weight: 600;
    color: #4a5568;
}

.option-group select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s;
}

.option-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-2px);
}

/* Game Screen */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
    flex-shrink: 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.timer-display {
    display: none;
}

.question-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    z-index: 2;
    min-height: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Liquid timer filling effect - realistic water */
.question-content::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, 
        rgba(64, 224, 208, 0.2) 0%,
        rgba(64, 224, 208, 0.4) 50%,
        rgba(64, 224, 208, 0.6) 100%);
    transition: height 30s linear;
    z-index: -1;
    border-radius: 0 0 15px 15px;
}

/* Water surface wave layers */
.question-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: 
        /* Top wave layer */
        radial-gradient(ellipse at center bottom, transparent 0%, rgba(64, 224, 208, 0.3) 70%),
        /* Main water body */
        linear-gradient(180deg, 
            rgba(64, 224, 208, 0.1) 0%,
            rgba(64, 224, 208, 0.3) 50%,
            rgba(64, 224, 208, 0.5) 100%);
    
    /* Create the wave effect using CSS transforms */
    background-size: 200% 100%, 100% 100%;
    background-position: 0% 100%, 0% 100%;
    animation: waterWaves 3s ease-in-out infinite;
}

/* Create multiple wave layers with different frequencies */
.question-content.timer-active::before {
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(64, 224, 208, 0.15) 0%,
        rgba(64, 224, 208, 0.35) 30%,
        rgba(64, 224, 208, 0.55) 70%,
        rgba(64, 224, 208, 0.75) 100%);
    animation: liquidRise 30s linear, waveClip 2.5s ease-in-out infinite;
    border-radius: 0 0 15px 15px;
}

/* Bubble effects in the liquid - Using marquee light colors */
.question-content.timer-active .liquid-bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3);
}

/* Deep Sky Blue bubbles - positioned to be inside liquid as it rises */
.question-content.timer-active .bubble-blue-1 {
    width: 8px;
    height: 8px;
    bottom: 0%;
    left: 15%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(0, 191, 255, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3s infinite ease-in-out;
    animation-delay: 2s;
}

.question-content.timer-active .bubble-blue-2 {
    width: 6px;
    height: 6px;
    bottom: 0%;
    left: 85%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(0, 191, 255, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 2.8s infinite ease-in-out;
    animation-delay: 8s;
}

.question-content.timer-active .bubble-blue-3 {
    width: 11px;
    height: 11px;
    bottom: 0%;
    left: 45%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(30, 144, 255, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.5s infinite ease-in-out;
    animation-delay: 15s;
}

/* Hot Pink bubbles */
.question-content.timer-active .bubble-pink-1 {
    width: 12px;
    height: 12px;
    bottom: 0%;
    left: 35%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 20, 147, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 2.5s infinite ease-in-out;
    animation-delay: 5s;
}

.question-content.timer-active .bubble-pink-2 {
    width: 7px;
    height: 7px;
    bottom: 0%;
    left: 75%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 105, 180, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 4.1s infinite ease-in-out;
    animation-delay: 22s;
}

.question-content.timer-active .bubble-pink-3 {
    width: 9px;
    height: 9px;
    bottom: 0%;
    left: 62%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 20, 147, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.2s infinite ease-in-out;
    animation-delay: 12s;
}

/* Turquoise bubbles */
.question-content.timer-active .bubble-turquoise-1 {
    width: 6px;
    height: 6px;
    bottom: 0%;
    left: 60%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(0, 206, 209, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 4s infinite ease-in-out;
    animation-delay: 7s;
}

.question-content.timer-active .bubble-turquoise-2 {
    width: 13px;
    height: 13px;
    bottom: 0%;
    left: 25%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(64, 224, 208, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 2.9s infinite ease-in-out;
    animation-delay: 18s;
}

.question-content.timer-active .bubble-turquoise-3 {
    width: 5px;
    height: 5px;
    bottom: 0%;
    left: 88%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(0, 206, 209, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.7s infinite ease-in-out;
    animation-delay: 3s;
}

/* Purple bubbles */
.question-content.timer-active .bubble-purple-1 {
    width: 10px;
    height: 10px;
    bottom: 0%;
    left: 80%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(153, 50, 204, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.5s infinite ease-in-out;
    animation-delay: 10s;
}

.question-content.timer-active .bubble-purple-2 {
    width: 8px;
    height: 8px;
    bottom: 0%;
    left: 15%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(138, 43, 226, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 4.3s infinite ease-in-out;
    animation-delay: 25s;
}

.question-content.timer-active .bubble-purple-3 {
    width: 14px;
    height: 14px;
    bottom: 0%;
    left: 55%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(153, 50, 204, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 2.7s infinite ease-in-out;
    animation-delay: 6s;
}

/* Orange Red bubbles */
.question-content.timer-active .bubble-orange-1 {
    width: 7px;
    height: 7px;
    bottom: 0%;
    left: 25%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 99, 71, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 2.8s infinite ease-in-out;
    animation-delay: 13s;
}

.question-content.timer-active .bubble-orange-2 {
    width: 11px;
    height: 11px;
    bottom: 0%;
    left: 42%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 69, 0, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.6s infinite ease-in-out;
    animation-delay: 20s;
}

.question-content.timer-active .bubble-orange-3 {
    width: 9px;
    height: 9px;
    bottom: 0%;
    left: 78%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 99, 71, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.1s infinite ease-in-out;
    animation-delay: 4s;
}

/* Additional small bubbles for density */
.question-content.timer-active .bubble-small-1 {
    width: 4px;
    height: 4px;
    bottom: 0%;
    left: 18%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(30, 144, 255, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 4.5s infinite ease-in-out;
    animation-delay: 16s;
}

.question-content.timer-active .bubble-small-2 {
    width: 5px;
    height: 5px;
    bottom: 0%;
    left: 70%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 105, 180, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.2s infinite ease-in-out;
    animation-delay: 9s;
}

.question-content.timer-active .bubble-small-3 {
    width: 4px;
    height: 4px;
    bottom: 0%;
    left: 68%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(64, 224, 208, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 2.9s infinite ease-in-out;
    animation-delay: 27s;
}

.question-content.timer-active .bubble-small-4 {
    width: 3px;
    height: 3px;
    bottom: 0%;
    left: 38%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(138, 43, 226, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 4.8s infinite ease-in-out;
    animation-delay: 1s;
}

.question-content.timer-active .bubble-small-5 {
    width: 5px;
    height: 5px;
    bottom: 0%;
    left: 92%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 69, 0, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.3s infinite ease-in-out;
    animation-delay: 24s;
}

.question-content.timer-active .bubble-small-6 {
    width: 4px;
    height: 4px;
    bottom: 0%;
    left: 8%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(0, 191, 255, 0.4));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 4.1s infinite ease-in-out;
    animation-delay: 11s;
}

/* Extra micro bubbles for maximum effect */
.question-content.timer-active .bubble-micro-1 {
    width: 2px;
    height: 2px;
    bottom: 0%;
    left: 33%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(255, 20, 147, 0.35));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 5.2s infinite ease-in-out;
    animation-delay: 14s;
}

.question-content.timer-active .bubble-micro-2 {
    width: 3px;
    height: 3px;
    bottom: 0%;
    left: 58%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(0, 206, 209, 0.35));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 4.7s infinite ease-in-out;
    animation-delay: 26s;
}

.question-content.timer-active .bubble-micro-3 {
    width: 2px;
    height: 2px;
    bottom: 0%;
    left: 82%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(153, 50, 204, 0.35));
    animation: bubbleRiseWithLiquid 30s linear infinite, bubbleFloat 3.8s infinite ease-in-out;
    animation-delay: 17s;
}

.question-content.timer-active::after {
    opacity: 1;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(180deg, 
        rgba(64, 224, 208, 0.1) 0%,
        rgba(64, 224, 208, 0.25) 50%,
        rgba(64, 224, 208, 0.4) 100%);
    animation: liquidRise 30s linear, waveClipSecondary 3.2s ease-in-out infinite;
    border-radius: 0 0 15px 15px;
}

/* Add a wavy surface element */
.question-content.timer-active .wavy-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(64, 224, 208, 0.8) 5%,
        rgba(64, 224, 208, 0.9) 10%,
        rgba(64, 224, 208, 0.7) 15%,
        rgba(64, 224, 208, 0.8) 20%,
        rgba(64, 224, 208, 0.9) 25%,
        rgba(64, 224, 208, 0.6) 30%,
        rgba(64, 224, 208, 0.8) 35%,
        rgba(64, 224, 208, 0.9) 40%,
        rgba(64, 224, 208, 0.7) 45%,
        rgba(64, 224, 208, 0.8) 50%,
        rgba(64, 224, 208, 0.9) 55%,
        rgba(64, 224, 208, 0.6) 60%,
        rgba(64, 224, 208, 0.8) 65%,
        rgba(64, 224, 208, 0.9) 70%,
        rgba(64, 224, 208, 0.7) 75%,
        rgba(64, 224, 208, 0.8) 80%,
        rgba(64, 224, 208, 0.9) 85%,
        rgba(64, 224, 208, 0.6) 90%,
        rgba(64, 224, 208, 0.8) 95%,
        transparent 100%);
    
    border-radius: 50% 50% 0 0;
    transform: scaleY(2);
    animation: waterSurfaceRise 30s linear, wavyMotion 2.5s ease-in-out infinite;
    z-index: -1;
}

@keyframes surfaceWave {
    0%, 100% {
        background-position: 0% top, 0% 0%;
    }
    50% {
        background-position: 100% top, 0% 0%;
    }
}

@keyframes waterWaves {
    0%, 100% {
        background-position: 0% 100%, 20% 100%, 0% 100%;
    }
    25% {
        background-position: 10% 100%, 30% 100%, 15% 100%;
    }
    50% {
        background-position: 20% 100%, 10% 100%, 30% 100%;
    }
    75% {
        background-position: 30% 100%, 40% 100%, 10% 100%;
    }
}

@keyframes waterWaves2 {
    0%, 100% {
        background-position: 100% 100%, 80% 100%, 100% 100%;
    }
    33% {
        background-position: 80% 100%, 60% 100%, 70% 100%;
    }
    66% {
        background-position: 60% 100%, 90% 100%, 40% 100%;
    }
}

@keyframes waterWaves3 {
    0%, 100% {
        background-position: 50% 100%, 70% 100%, 30% 100%;
    }
    50% {
        background-position: 70% 100%, 30% 100%, 80% 100%;
    }
}

@keyframes liquidRise {
    0% {
        height: 0%;
    }
    100% {
        height: 100%;
    }
}

@keyframes waveSurface {
    0% {
        background-position: 0% top;
    }
    100% {
        background-position: 400% top;
    }
}

@keyframes waterSurfaceRise {
    0% {
        top: 100%;
    }
    100% {
        top: 0%;
    }
}

@keyframes wavyMotion {
    0%, 100% {
        transform: scaleY(2) translateX(0px);
        border-radius: 60% 40% 30% 70%;
    }
    25% {
        transform: scaleY(1.8) translateX(5px);
        border-radius: 30% 60% 70% 40%;
    }
    50% {
        transform: scaleY(2.2) translateX(-3px);
        border-radius: 70% 30% 40% 60%;
    }
    75% {
        transform: scaleY(1.9) translateX(7px);
        border-radius: 40% 70% 60% 30%;
    }
}

@keyframes waveClip {
    0% {
        clip-path: polygon(
            0% 100%,
            0% 12%,
            2% 10%,
            4% 8%,
            6% 7%,
            8% 6%,
            10% 7%,
            12% 8%,
            14% 11%,
            16% 14%,
            18% 16%,
            20% 17%,
            22% 16%,
            24% 14%,
            26% 11%,
            28% 8%,
            30% 6%,
            32% 5%,
            34% 6%,
            36% 8%,
            38% 11%,
            40% 15%,
            42% 18%,
            44% 20%,
            46% 20%,
            48% 18%,
            50% 15%,
            52% 11%,
            54% 8%,
            56% 6%,
            58% 6%,
            60% 8%,
            62% 11%,
            64% 15%,
            66% 18%,
            68% 19%,
            70% 18%,
            72% 15%,
            74% 11%,
            76% 8%,
            78% 6%,
            80% 6%,
            82% 8%,
            84% 11%,
            86% 14%,
            88% 16%,
            90% 17%,
            92% 16%,
            94% 14%,
            96% 11%,
            98% 9%,
            100% 8%,
            100% 100%
        );
    }
    25% {
        clip-path: polygon(
            0% 100%,
            0% 8%,
            2% 9%,
            4% 11%,
            6% 14%,
            8% 16%,
            10% 17%,
            12% 16%,
            14% 14%,
            16% 11%,
            18% 8%,
            20% 6%,
            22% 5%,
            24% 6%,
            26% 8%,
            28% 11%,
            30% 15%,
            32% 18%,
            34% 20%,
            36% 20%,
            38% 18%,
            40% 15%,
            42% 11%,
            44% 8%,
            46% 6%,
            48% 6%,
            50% 8%,
            52% 11%,
            54% 15%,
            56% 18%,
            58% 19%,
            60% 18%,
            62% 15%,
            64% 11%,
            66% 8%,
            68% 6%,
            70% 6%,
            72% 8%,
            74% 11%,
            76% 14%,
            78% 16%,
            80% 17%,
            82% 16%,
            84% 14%,
            86% 11%,
            88% 8%,
            90% 6%,
            92% 6%,
            94% 8%,
            96% 11%,
            98% 14%,
            100% 16%,
            100% 100%
        );
    }
    50% {
        clip-path: polygon(
            0% 100%,
            0% 16%,
            2% 14%,
            4% 11%,
            6% 8%,
            8% 6%,
            10% 6%,
            12% 8%,
            14% 11%,
            16% 15%,
            18% 18%,
            20% 19%,
            22% 18%,
            24% 15%,
            26% 11%,
            28% 8%,
            30% 6%,
            32% 6%,
            34% 8%,
            36% 11%,
            38% 14%,
            40% 16%,
            42% 17%,
            44% 16%,
            46% 14%,
            48% 11%,
            50% 8%,
            52% 6%,
            54% 6%,
            56% 8%,
            58% 11%,
            60% 15%,
            62% 18%,
            64% 20%,
            66% 20%,
            68% 18%,
            70% 15%,
            72% 11%,
            74% 8%,
            76% 6%,
            78% 6%,
            80% 8%,
            82% 11%,
            84% 15%,
            86% 18%,
            88% 19%,
            90% 18%,
            92% 15%,
            94% 11%,
            96% 8%,
            98% 6%,
            100% 5%,
            100% 100%
        );
    }
    75% {
        clip-path: polygon(
            0% 100%,
            0% 5%,
            2% 6%,
            4% 8%,
            6% 11%,
            8% 15%,
            10% 18%,
            12% 19%,
            14% 18%,
            16% 15%,
            18% 11%,
            20% 8%,
            22% 6%,
            24% 6%,
            26% 8%,
            28% 11%,
            30% 14%,
            32% 16%,
            34% 17%,
            36% 16%,
            38% 14%,
            40% 11%,
            42% 8%,
            44% 6%,
            46% 6%,
            48% 8%,
            50% 11%,
            52% 15%,
            54% 18%,
            56% 20%,
            58% 20%,
            60% 18%,
            62% 15%,
            64% 11%,
            66% 8%,
            68% 6%,
            70% 6%,
            72% 8%,
            74% 11%,
            76% 15%,
            78% 18%,
            80% 19%,
            82% 18%,
            84% 15%,
            86% 11%,
            88% 8%,
            90% 6%,
            92% 5%,
            94% 6%,
            96% 8%,
            98% 11%,
            100% 14%,
            100% 100%
        );
    }
    100% {
        clip-path: polygon(
            0% 100%,
            0% 12%,
            2% 10%,
            4% 8%,
            6% 7%,
            8% 6%,
            10% 7%,
            12% 8%,
            14% 11%,
            16% 14%,
            18% 16%,
            20% 17%,
            22% 16%,
            24% 14%,
            26% 11%,
            28% 8%,
            30% 6%,
            32% 5%,
            34% 6%,
            36% 8%,
            38% 11%,
            40% 15%,
            42% 18%,
            44% 20%,
            46% 20%,
            48% 18%,
            50% 15%,
            52% 11%,
            54% 8%,
            56% 6%,
            58% 6%,
            60% 8%,
            62% 11%,
            64% 15%,
            66% 18%,
            68% 19%,
            70% 18%,
            72% 15%,
            74% 11%,
            76% 8%,
            78% 6%,
            80% 6%,
            82% 8%,
            84% 11%,
            86% 14%,
            88% 16%,
            90% 17%,
            92% 16%,
            94% 14%,
            96% 11%,
            98% 9%,
            100% 8%,
            100% 100%
        );
    }
}

@keyframes waveClipSecondary {
    0% {
        clip-path: polygon(
            0% 100%,
            0% 10%,
            4% 12%,
            8% 15%,
            12% 17%,
            16% 18%,
            20% 17%,
            24% 15%,
            28% 12%,
            32% 9%,
            36% 7%,
            40% 6%,
            44% 7%,
            48% 9%,
            52% 12%,
            56% 15%,
            60% 17%,
            64% 18%,
            68% 17%,
            72% 15%,
            76% 12%,
            80% 9%,
            84% 7%,
            88% 6%,
            92% 7%,
            96% 9%,
            100% 12%,
            100% 100%
        );
    }
    33% {
        clip-path: polygon(
            0% 100%,
            0% 18%,
            4% 17%,
            8% 15%,
            12% 12%,
            16% 9%,
            20% 7%,
            24% 6%,
            28% 7%,
            32% 9%,
            36% 12%,
            40% 15%,
            44% 17%,
            48% 18%,
            52% 17%,
            56% 15%,
            60% 12%,
            64% 9%,
            68% 7%,
            72% 6%,
            76% 7%,
            80% 9%,
            84% 12%,
            88% 15%,
            92% 17%,
            96% 18%,
            100% 17%,
            100% 100%
        );
    }
    66% {
        clip-path: polygon(
            0% 100%,
            0% 6%,
            4% 7%,
            8% 9%,
            12% 12%,
            16% 15%,
            20% 17%,
            24% 18%,
            28% 17%,
            32% 15%,
            36% 12%,
            40% 9%,
            44% 7%,
            48% 6%,
            52% 7%,
            56% 9%,
            60% 12%,
            64% 15%,
            68% 17%,
            72% 18%,
            76% 17%,
            80% 15%,
            84% 12%,
            88% 9%,
            92% 7%,
            96% 6%,
            100% 7%,
            100% 100%
        );
    }
    100% {
        clip-path: polygon(
            0% 100%,
            0% 10%,
            4% 12%,
            8% 15%,
            12% 17%,
            16% 18%,
            20% 17%,
            24% 15%,
            28% 12%,
            32% 9%,
            36% 7%,
            40% 6%,
            44% 7%,
            48% 9%,
            52% 12%,
            56% 15%,
            60% 17%,
            64% 18%,
            68% 17%,
            72% 15%,
            76% 12%,
            80% 9%,
            84% 7%,
            88% 6%,
            92% 7%,
            96% 9%,
            100% 12%,
            100% 100%
        );
    }
}

/* Bubble animation keyframes */
@keyframes bubbleRise1 {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
        transform: translateY(-10px) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-150px) scale(1.1);
    }
    90% {
        opacity: 0.2;
        transform: translateY(-280px) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(-320px) scale(0);
    }
}

@keyframes bubbleRise2 {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    15% {
        opacity: 0.8;
        transform: translateY(-8px) scale(1);
    }
    45% {
        opacity: 0.6;
        transform: translateY(-120px) scale(1.2);
    }
    85% {
        opacity: 0.3;
        transform: translateY(-250px) scale(0.9);
    }
    100% {
        opacity: 0;
        transform: translateY(-300px) scale(0);
    }
}

@keyframes bubbleRise3 {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    8% {
        opacity: 0.6;
        transform: translateY(-12px) scale(1);
    }
    60% {
        opacity: 0.4;
        transform: translateY(-180px) scale(1.15);
    }
    92% {
        opacity: 0.1;
        transform: translateY(-310px) scale(0.7);
    }
    100% {
        opacity: 0;
        transform: translateY(-350px) scale(0);
    }
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    75% {
        transform: translateX(3px);
    }
}

@keyframes bubbleRiseWithLiquid {
    0% {
        bottom: 0%;
        opacity: 0;
        transform: scale(0.8);
    }
    5% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
    95% {
        opacity: 0.3;
        transform: scale(1.1);
    }
    100% {
        bottom: 95%;
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Warning state when time is running low */
.question-content.timer-warning::before {
    background: 
        linear-gradient(90deg, 
            transparent 0%, 
            rgba(255, 69, 0, 0.2) 25%, 
            rgba(255, 69, 0, 0.3) 50%, 
            rgba(255, 69, 0, 0.2) 75%, 
            transparent 100%),
        linear-gradient(180deg, 
            rgba(255, 69, 0, 0.2) 0%,
            rgba(255, 69, 0, 0.4) 50%,
            rgba(255, 69, 0, 0.6) 100%);
    
    background-size: 300% 20px, 100% 100%;
    animation: liquidRise 30s linear, surfaceWaveWarning 1.5s ease-in-out infinite;
}

.question-content.timer-warning::after {
    background: 
        radial-gradient(ellipse 200% 50px at 50% 100%, rgba(255, 69, 0, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse 300% 30px at 30% 100%, rgba(255, 69, 0, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 250% 40px at 70% 100%, rgba(255, 69, 0, 0.45) 0%, transparent 50%);
    
    animation: 
        waterWavesWarning 2s ease-in-out infinite,
        waterWaves2 2.5s ease-in-out infinite reverse,
        waterWaves3 1.8s ease-in-out infinite;
}

@keyframes surfaceWaveWarning {
    0%, 100% {
        background-position: 0% top, 0% 0%;
    }
    50% {
        background-position: 150% top, 0% 0%;
    }
}

@keyframes waterWavesWarning {
    0%, 100% {
        background-position: 0% 100%, 20% 100%, 0% 100%;
    }
    20% {
        background-position: 15% 100%, 35% 100%, 20% 100%;
    }
    40% {
        background-position: 30% 100%, 10% 100%, 40% 100%;
    }
    60% {
        background-position: 45% 100%, 50% 100%, 15% 100%;
    }
    80% {
        background-position: 60% 100%, 25% 100%, 55% 100%;
    }
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

/* Center the main question content while keeping meta at top */
.question-content {
    align-items: stretch;
}

.question-text {
    flex: 0 0 auto;
    margin-bottom: auto;
}

.answer-options {
    margin: auto 0;
}

.question-tools {
    flex: 0 0 auto;
    margin-top: auto;
}

.episode-tag, .question-type {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.episode-tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.question-type {
    background: rgba(118, 75, 162, 0.1);
    color: #764ba2;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.4;
    color: #2d3748;
    margin-bottom: 15px;
    text-align: center;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.answer-options {
    display: grid;
    gap: 8px;
    max-width: 800px;
    margin: 0 auto;
    padding-top: 20px;
    position: relative;
    z-index: 5;
    flex: 0 1 auto;
    overflow-y: auto;
    min-height: 0;
    max-height: 35vh;
}

.answer-option {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    text-align: left;
    font-size: 1rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.answer-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.answer-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.answer-option.correct {
    border-color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
}

.answer-option.incorrect {
    border-color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
}

.fill-answer {
    display: flex;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
    align-items: center;
}

.fill-answer input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
}

.fill-answer input:focus {
    outline: none;
    border-color: #667eea;
}

.question-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
    position: relative;
    z-index: 15;
    flex-shrink: 0;
    padding: 10px 0;
}

.tool-tag {
    padding: 6px 12px;
    background: rgba(118, 75, 162, 0.1);
    color: #764ba2;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Hint System Styles */
.hint-button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #2d3748;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
    position: relative;
    z-index: 15;
    margin: 0 auto;
    display: block;
}

.hint-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

.hint-button:active {
    transform: translateY(0);
}

.hint-used-message {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    z-index: 5;
}

/* Episode Hint Styles */
.episode-hint-container {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 15px;
    margin-top: 10px;
    position: relative;
    z-index: 5;
}

.episode-hint-item {
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #2d3748;
}

.episode-hint-item:last-child {
    margin-bottom: 0;
}

.episode-hint-item strong {
    color: #b8860b;
    font-weight: 600;
}

/* Results Screen */
.results-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.results-content h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #4a5568;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(102, 126, 234, 0.1);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid transparent;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.name-entry {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.name-entry input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

.save-score-section {
    margin-bottom: 30px;
    text-align: center;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

/* Leaderboard */
.leaderboard-content {
    max-width: 900px;
    margin: 0 auto;
}

.leaderboard-content h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #4a5568;
}

.leaderboard-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.leaderboard-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.leaderboard-table table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.leaderboard-table td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.leaderboard-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.rank-medal {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    margin-right: 10px;
}

.rank-1 { background: #ffd700; }
.rank-2 { background: #c0c0c0; }
.rank-3 { background: #cd7f32; }

.leaderboard-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.feedback-header {
    margin-bottom: 20px;
}

.feedback-result {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.feedback-result.correct {
    color: #48bb78;
}

.feedback-result.incorrect {
    color: #e53e3e;
}

.feedback-points {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

.feedback-explanation {
    margin: 20px 0;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    text-align: left;
}

.feedback-explanation p {
    line-height: 1.6;
    color: #4a5568;
}

.feedback-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

/* Game Stats Footer (shown on all devices) */
.game-stats-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 12px 20px;
    margin-top: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    border: 1px solid rgba(102, 126, 234, 0.15);
    position: relative;
    z-index: 10;
}

.game-stats-mobile .stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    min-width: auto;
    flex: 1;
    justify-content: center;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.game-stats-mobile .stat-label {
    font-size: 0.75rem;
    color: #667eea;
    margin-bottom: 0;
    font-weight: 600;
}

.game-stats-mobile .stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #4a5568;
}

/* Home Button in Mobile Footer */
.home-btn-mobile {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    text-decoration: none;
    color: #8a2be2;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    flex-shrink: 0;
}

.home-btn-mobile:hover {
    background: rgba(138, 43, 226, 0.2);
    border-color: rgba(138, 43, 226, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.3);
    text-decoration: none;
    color: #8a2be2;
}

.home-logo-mobile {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.home-text-mobile {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* iPad Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 8px;
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }
    
    /* Ensure marquee lights are visible and sized appropriately on iPad */
    .marquee-lights {
        top: 3px;
        left: 3px;
        right: 3px;
        bottom: 3px;
    }
    
    .lights-top li,
    .lights-bottom li,
    .lights-left li,
    .lights-right li {
        width: 14px;
        height: 14px;
        border: 1.5px solid rgba(255, 255, 255, 0.2);
    }
    
    .header {
        display: none; /* Hide entire header on iPad */
    }
    
    .footer-title {
        font-size: 1.4rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .game-stats {
        display: none; /* Hide header stats on iPad */
    }
    
    .game-stats-mobile {
        display: flex; /* Show mobile stats footer on iPad */
        gap: 10px;
        padding: 12px 18px;
        margin-top: 15px;
        border-radius: 18px;
    }
    
    .game-stats-mobile .stat {
        padding: 8px 12px;
        gap: 6px;
    }
    
    .game-stats-mobile .stat-label {
        font-size: 0.8rem;
    }
    
    .game-stats-mobile .stat-value {
        font-size: 1rem;
        font-weight: 700;
    }
    
    .home-btn-mobile {
        padding: 8px 14px;
        gap: 6px;
        font-size: 0.85rem;
    }
    
    .home-logo-mobile {
        width: 20px;
        height: 20px;
    }
    
    .home-text-mobile {
        display: inline; /* Show text on iPad */
    }
    
    .stat {
        padding: 8px;
        min-width: 80px;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .screen {
        padding: 15px;
        min-height: 0;
        overflow: hidden;
        max-height: calc(100vh - 140px);
    }
    
    .welcome-content h2 {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }
    
    .welcome-content p {
        font-size: 1rem;
        margin-bottom: 20px;
        line-height: 1.4;
    }
    
    .question-content {
        gap: 12px;
        min-height: 0;
        overflow: hidden;
        align-items: stretch;
    }
    
    .question-text {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .answer-options {
        gap: 6px;
        overflow-y: auto;
        max-height: 30vh;
        flex: 0 1 auto;
        min-height: 0;
        padding-top: 15px;
    }
    
    .answer-option {
        padding: 10px 12px;
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .question-meta {
        margin-bottom: 8px;
    }
    
    .episode-tag, .question-type {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    
    .question-tools {
        margin-top: 8px;
        gap: 6px;
    }
    
    .hint-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .episode-hint-container {
        padding: 12px;
        margin-top: 8px;
    }
    
    .episode-hint-item {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .progress-bar {
        height: 5px;
        margin-bottom: 12px;
    }
    
    .final-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .stat-number {
        font-size: 2rem;
    }
    
    .results-content h2 {
        font-size: 2rem;
        margin-bottom: 25px;
    }
    
    .results-content {
        overflow-y: auto;
        max-height: 100%;
    }
    
    .modal-content {
        padding: 25px;
        max-width: 500px;
    }
    
    .feedback-result {
        font-size: 1.6rem;
    }
    
    .feedback-explanation {
        margin: 15px 0;
        padding: 15px;
    }
    
    .leaderboard-content h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    .name-entry {
        margin-bottom: 20px;
    }
    
    .name-entry input {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* iPhone Marquee Light Optimization */
@media (max-width: 767px) {
    /* Hide every other bulb on top and bottom for iPhone */
    .lights-top li:nth-child(2n) {
        display: none;
    }
    
    .lights-bottom li:nth-child(2n) {
        display: none;
    }
    
    /* Keep all side lights visible on iPhone */
    .lights-left li,
    .lights-right li {
        display: block;
    }
}

/* Mobile Responsive Design */
@media (max-width: 767px) {
    .container {
        padding: 10px;
    }
    
    .header {
        display: none; /* Hide header on mobile too */
    }
    
    .footer-title {
        font-size: 1.6rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .home-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .home-text {
        display: none;
    }
    
    .home-logo {
        width: 28px;
        height: 28px;
    }
    
    .game-stats {
        display: none; /* Hide header stats on mobile */
    }
    
    .game-stats-mobile {
        display: flex; /* Show mobile stats on mobile */
        flex-direction: row; /* Keep horizontal layout on mobile */
        gap: 6px;
        padding: 10px 12px;
        margin-top: 12px;
        border-radius: 16px;
    }
    
    .game-stats-mobile .stat {
        min-width: auto;
        flex: 1;
        padding: 6px 4px;
        gap: 3px;
    }
    
    .game-stats-mobile .stat-label {
        font-size: 0.7rem;
    }
    
    .game-stats-mobile .stat-value {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .home-btn-mobile {
        padding: 6px 8px;
        gap: 4px;
        font-size: 0.7rem;
    }
    
    .home-logo-mobile {
        width: 16px;
        height: 16px;
    }
    
    .home-text-mobile {
        display: none; /* Hide text on very small screens */
    }
    
    .welcome-content h2 {
        font-size: 2rem;
    }
    
    .final-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .leaderboard-table {
        font-size: 0.9rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 8px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    animation: slideIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.answer-option {
    animation: fadeIn 0.3s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}