
        :root {
            --bg-color: #0d0c22; 
            --court-color: #1c1a3a; 
            --lines-color: #00f6ff; 
            --block-color: #462255; 
            --block-text: #ffffff; 
            --ball-color: #ff8c00; 
            --ball-orange: #ff8c00; 
            --rim-color: #f90059; 
            --net-color: #f0f0f0; 
            --button-up-bg: #00f6ff; 
            --button-down-bg: #f90059; 
            --submit-bg: #9d4edd; 
            --hud-bg: rgba(0, 0, 0, 0.4); 
            --hud-text: #ffffff;
        }
        
        * { box-sizing: border-box; }
        
        body { 
            font-family: 'Righteous', 'Nunito', sans-serif; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            height: 100vh; 
            margin: 0; 
            background: linear-gradient(45deg, #0d0c22, #29265f); 
            overflow: hidden; 
            user-select: none; 
        }
        
        .game-wrapper { 
            position: relative; 
            display: none; /* Hidden by default */
            justify-content: center; 
            align-items: center; 
            gap: 30px; 
            width: 100vw; 
            height: 100vh; 
        }

        .game-wrapper.show {
            display: flex;
        }
        
        /* Single Player Container - matches multiplayer layout */
        .singleplayer-container {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: 100%;
            max-width: 1200px;
            background: rgba(29, 27, 52, 0.95);
            border-radius: 30px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }

        /* Player Header - same as multiplayer */
        .singleplayer-container .player-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 30px;
            background: rgba(0, 0, 0, 0.3);
            border-bottom: 2px solid #00f6ff;
        }

        .singleplayer-container .player-avatar {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .singleplayer-container .game-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            overflow: hidden;
            background: rgba(70, 34, 85, 0.8);
            border: 3px solid #00f6ff;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .singleplayer-container .game-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .singleplayer-container .avatar-placeholder {
            font-size: 24px;
            color: #888;
        }

        .singleplayer-container .player-name {
            font-size: 24px;
            font-weight: bold;
            color: #00f6ff;
        }

        .singleplayer-container .player-hud {
            display: flex;
            gap: 20px;
            align-items: center;
        }

        /* Single player scoreboard - horizontal layout */
        .singleplayer-container .scoreboard {
            display: flex;
            flex-direction: row;
            gap: 20px;
            align-items: center;
        }

        .singleplayer-container .score-display,
        .singleplayer-container .level-display {
            font-size: 20px;
            font-weight: bold;
            color: #fff;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 10px;
        }

        /* Player Game Area for Single Player */
        .singleplayer-container .player-game-area {
            flex: 1;
            display: flex;
            height: calc(100% - 100px);
            background: linear-gradient(180deg, 
                rgba(13, 12, 34, 0.8) 0%, 
                rgba(28, 26, 58, 0.9) 40%, 
                rgba(70, 34, 85, 0.8) 100%);
            border: 2px solid var(--court-color);
            border-radius: 15px;
            overflow: visible;
            padding: 10px;
        }

        .singleplayer-container .player-calculator {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 20px;
            background: transparent;
        }

        .singleplayer-container .player-game {
            flex: 2;
            position: relative;
        }
        
        /* Game container styling for single player */
        .singleplayer-container #game-container {
            width: 100%;
            height: 100%;
            position: relative;
            background: transparent;
            overflow: visible;
        }

        /* HUD in calculator area */
        .singleplayer-container .hud {
            width: 100%;
            margin-bottom: 20px;
        }

        .singleplayer-container .hearts-container {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .singleplayer-container .timer {
            background-color: var(--hud-bg);
            border: 2px solid var(--lines-color);
            color: var(--hud-text);
            font-size: 24px;
            font-weight: bold;
            padding: 15px;
            border-radius: 50%;
            text-align: center;
            width: 80px;
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
        }

        /* Controls in calculator area */
        .singleplayer-container #controls {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
        }

        .singleplayer-container #start-ball-btn {
            margin-bottom: 20px;
            width: 150px;
        }

        .singleplayer-container .calculator-controls {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 3px solid #00f6ff;
            border-radius: 20px;
            padding: 20px;
            width: fit-content;
            max-width: 300px;
            display: flex;
            flex-direction: column;
            margin: 0 auto;
        }
        
        .screen { 
            position: absolute; 
            top: 0; 
            left: 0; 
            width: 100%; 
            height: 100%; 
            display: flex; 
            flex-direction: column; 
            justify-content: center; 
            align-items: center; 
            background: rgba(13, 12, 34, 0.8); 
            color: white; 
            z-index: 100; 
            opacity: 1; 
            transition: opacity 0.5s ease-in-out; 
        }
        
        .screen.hidden { 
            opacity: 0; 
            pointer-events: none; 
        }
        
        .screen h1 { 
            font-size: 4em; 
            text-shadow: 0 0 15px var(--lines-color); 
        }
        
        .screen p { 
            font-family: 'Nunito', sans-serif; 
            font-size: 1.2em; 
            max-width: 80%; 
            text-align: center; 
        }
        
        .screen-button { 
            font-family: 'Righteous', cursive; 
            font-size: 2em; 
            padding: 15px 40px; 
            margin-top: 20px; 
            border: 3px solid var(--lines-color); 
            border-radius: 50px; 
            background: transparent; 
            color: var(--lines-color); 
            text-shadow: 0 0 10px var(--lines-color); 
            cursor: pointer; 
            transition: background-color 0.2s, color 0.2s; 
            animation: pulse 2s infinite; 
        }
        
        .screen-button:hover { 
            background-color: var(--lines-color); 
            color: var(--bg-color); 
            text-shadow: none; 
        }
        
        /* Old game-container styling - now handled by new layout */
        
        #game-container.shake { 
            animation: screen-shake 0.4s; 
        }
        
        /* Old sidebar styling - not needed with new layout */
        
        #hud { 
            width: 100%; 
        }
        
        #scoreboard { 
            background-color: var(--hud-bg); 
            border-radius: 10px; 
            border: 2px solid var(--lines-color); 
            display: flex; 
            justify-content: space-around; 
            padding: 10px 20px; 
            color: var(--hud-text); 
            font-size: 1.3em; 
            text-shadow: 0 0 5px var(--lines-color); 
        }
        
        #score-display.popping { 
            animation: score-pop 0.3s ease-out; 
        }
        
        
        #level-up-display { 
            position: absolute; 
            top: 50%; 
            left: 50%; 
            transform: translate(-50%, -50%); 
            color: white; 
            font-size: 3em; 
            text-shadow: 3px 3px 5px #000; 
            z-index: 30; 
            opacity: 0; 
            pointer-events: none; 
        }
        
        #level-up-display.active { 
            animation: level-up-fade 1.5s ease-in-out; 
        }
        
        /* Play tube styling - consolidated */

        /* Tube top ellipse for realistic 3D perspective */
        #play-tube::before {
            content: '';
            position: absolute;
            top: -6px;
            left: 0;
            width: 100px;
            height: 12px;
            background: radial-gradient(ellipse at center, rgba(0, 246, 255, 0.15) 0%, rgba(0, 246, 255, 0.10) 50%, rgba(0, 246, 255, 0.05) 100%);
            border-radius: 50%;
            box-shadow: 
                inset 0 2px 6px rgba(0, 246, 255, 0.2),
                0 0 8px rgba(0, 246, 255, 0.15);
        }

        /* Tube bottom ellipse for realistic 3D perspective */
        #play-tube::after {
            content: '';
            position: absolute;
            bottom: -6px;
            left: 0;
            width: 100px;
            height: 12px;
            background: radial-gradient(ellipse at center, rgba(0, 246, 255, 0.15) 0%, rgba(0, 246, 255, 0.10) 50%, rgba(0, 246, 255, 0.05) 100%);
            border-radius: 50%;
            box-shadow: 
                inset 0 -2px 6px rgba(0, 246, 255, 0.2),
                0 0 8px rgba(0, 246, 255, 0.15);
        }
        
        #ball { 
            position: absolute; 
            z-index: 10; 
            transition: transform 0.1s linear;
            font-size: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 50px;
            height: 50px;
        }
        
        #ball.rotating { 
            animation: ball-rotation 2.5s linear infinite; 
        }
        
        #ball.swishing { 
            animation: ball-swish-animation 1.2s cubic-bezier(0.15, 0.25, 0.35, 0.85) forwards; 
        }
        
        /* Ball Release Box with Bottom Trap Door */
        
        
        #obstacles-container { 
            position: relative; 
            width: 100%; 
            height: 100%; 
        }
        
        .gate-obstacle { 
            position: absolute; 
            width: 100%; 
            left: 0;
            display: flex; 
            justify-content: center; 
            align-items: center; 
            z-index: 5; 
            padding: 0 3px; 
            gap: 2px; 
        }
        
        .gate-box { 
            min-width: 32px; 
            width: 32px; 
            height: 32px; 
            background: linear-gradient(45deg, #3a1c4b, #5f2c78); 
            color: var(--block-text); 
            border-radius: 0; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            font-family: 'Nunito', sans-serif; 
            font-weight: 800; 
            font-size: 1em; 
            box-shadow: 0 3px 0 #2c1438, 0 6px 8px rgba(0,0,0,0.3); 
            opacity: 1; 
            transition: transform 0.3s, opacity 0.3s; 
        }
        
        .gate-box:first-child { 
            border-radius: 6px 0 0 6px; 
        }
        
        .gate-box:last-child { 
            border-radius: 0 6px 6px 0; 
        }
        
        .gate-box.destroyed { 
            animation: box-destroy 1.2s ease-out forwards; 
            z-index: 20;
        }
        
        .gate-box.destroyed:nth-child(1) { 
            animation: box-destroy-left 1.2s ease-out forwards; 
        }
        
        .gate-box.destroyed:nth-child(2) { 
            animation: box-destroy-right 1.2s ease-out forwards; 
        }
        
        .gate-box.destroyed:nth-child(3) { 
            animation: box-destroy-center 1.2s ease-out forwards; 
        }
        
        .gate-box.destroyed:nth-child(4) { 
            animation: box-destroy-left 1.2s ease-out forwards; 
        }
        
        .gate-box.destroyed:nth-child(5) { 
            animation: box-destroy-right 1.2s ease-out forwards; 
        }
        
        .gate-box.correct { 
            animation: box-correct 0.4s ease-out forwards; 
        }
        
        .answer-box { 
            background: rgba(0,0,0,0.2); 
            border: 2px dashed var(--block-text); 
        }
        
        /* Old hoop-assembly style - removed to avoid conflicts */
        
        /* Basketball Hoop Design */
        /* Old backboard style - removed to avoid conflicts */
        
        /* Backboard center line decoration */
        #backboard::before, #player1-backboard::before, #player2-backboard::before { 
            content: ''; 
            position: absolute; 
            top: 50%; 
            left: 50%; 
            transform: translate(-50%, -50%); 
            width: 3px; 
            height: 60%; 
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4)); 
            border-radius: 2px; 
            box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.3); 
        }
        
        /* Old hoop style - removed to avoid conflicts */
        
        .rim { 
            position: absolute; 
            top: 0; 
            left: 50%; 
            transform: translateX(-50%); 
            width: 90px; 
            height: 18px; 
            border: 4px solid #f12f10; 
            border-radius: 50%; 
            box-sizing: border-box; 
            background: transparent; 
            box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), inset 0 -2px 4px rgba(0, 0, 0, 0.3), 0 3px 6px rgba(0, 0, 0, 0.2); 
        }
        
        /* Old rim-front duplicate removed */
        
        /* Old rim-back duplicate removed */
        
        .net {
            position: absolute;
            top: -2px; /* Connect to TOP of back rim */
            left: 50%;
            transform: translateX(-50%) translateY(-2px); /* Match back rim offset */
            width: 90px; /* Match rim width */
            height: 75px;
            transform-style: preserve-3d;
            pointer-events: none;
        }
        
        /* Old net-back and net-front duplicates removed */

        /* Vertical strings with realistic cone shape */
        .net-string {
            position: absolute;
            width: 2px;
            height: 75px;
            background: linear-gradient(180deg, #fff 0%, #ddd 100%);
            opacity: 0.9;
            transform-origin: top center;
            top: 0; /* Start at net container top which is at rim bottom */
        }
        
        /* Only animate the bottom part of strings */
        .net-string::after {
            content: '';
            position: absolute;
            top: 30%; /* Start animation below attachment point */
            left: 0;
            width: 100%;
            height: 70%;
            background: inherit;
            transform-origin: top center;
            animation: stringWave 2s ease-in-out infinite;
        }

        /* Position strings around the rim circumference - following elliptical curve */
        .net-string:nth-child(1) { 
            left: 5px; 
            top: 8.5px; /* Lower on far left of ellipse */
            transform: rotate(-12deg);
        }
        .net-string:nth-child(1)::after {
            animation-delay: 0s;
        }
        
        .net-string:nth-child(2) { 
            left: 15px; 
            top: 7.5px; /* Slightly lower */
            transform: rotate(-9deg);
        }
        .net-string:nth-child(2)::after {
            animation-delay: 0.1s;
        }
        
        .net-string:nth-child(3) { 
            left: 25px; 
            top: 6.5px; /* Near the top of ellipse */
            transform: rotate(-6deg);
        }
        .net-string:nth-child(3)::after {
            animation-delay: 0.2s;
        }
        
        .net-string:nth-child(4) { 
            left: 35px; 
            top: 5.5px; /* Top of ellipse */
            transform: rotate(-3deg);
        }
        .net-string:nth-child(4)::after {
            animation-delay: 0.3s;
        }
        
        .net-string:nth-child(5) { 
            left: 44px; 
            top: 5.5px; /* Top center of ellipse */
            transform: rotate(0deg);
        }
        .net-string:nth-child(5)::after {
            animation-delay: 0.4s;
        }
        
        .net-string:nth-child(6) { 
            left: 53px; 
            top: 5.5px; /* Top of ellipse */
            transform: rotate(3deg);
        }
        .net-string:nth-child(6)::after {
            animation-delay: 0.5s;
        }
        
        .net-string:nth-child(7) { 
            left: 63px; 
            top: 6.5px; /* Starting to go lower */
            transform: rotate(6deg);
        }
        .net-string:nth-child(7)::after {
            animation-delay: 0.6s;
        }
        
        .net-string:nth-child(8) { 
            left: 73px; 
            top: 7.5px; /* Lower on the ellipse */
            transform: rotate(9deg);
        }
        .net-string:nth-child(8)::after {
            animation-delay: 0.7s;
        }
        
        .net-string:nth-child(9) { 
            left: 83px; 
            top: 8.5px; /* Lowest point on far right */
            transform: rotate(12deg);
        }
        .net-string:nth-child(9)::after {
            animation-delay: 0.8s;
        }

        /* Horizontal net rings - elliptical shape */
        .net-horizontal {
            position: absolute;
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, #fff 10%, #fff 90%, transparent 100%);
            opacity: 0.8;
            border-radius: 50%;
            transform: rotateX(60deg);
        }

        /* Create cone shape with decreasing ring sizes */
        .net-horizontal:nth-child(10) { 
            top: 8px; 
            width: 86px;
            left: 2px;
            transform: rotateX(60deg);
        }
        .net-horizontal:nth-child(11) { 
            top: 16px; 
            width: 80px;
            left: 5px;
            transform: rotateX(60deg);
        }
        .net-horizontal:nth-child(12) { 
            top: 24px; 
            width: 74px;
            left: 8px;
            transform: rotateX(60deg);
        }
        .net-horizontal:nth-child(13) { 
            top: 32px; 
            width: 68px;
            left: 11px;
            transform: rotateX(60deg);
        }
        .net-horizontal:nth-child(14) { 
            top: 40px; 
            width: 62px;
            left: 14px;
            transform: rotateX(60deg);
        }
        .net-horizontal:nth-child(15) { 
            top: 48px; 
            width: 56px;
            left: 17px;
            transform: rotateX(60deg);
        }
        .net-horizontal:nth-child(16) { 
            top: 56px; 
            width: 50px;
            left: 20px;
            transform: rotateX(60deg);
        }
        .net-horizontal:nth-child(17) { 
            top: 64px; 
            width: 44px;
            left: 23px;
            transform: rotateX(60deg);
        }
        
        .net.net-swish { 
            animation: net-swish-animation 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; 
        }
        
        
        #controls { 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            gap: 20px; 
            transition: opacity 0.3s; 
        }
        
        #controls.disabled { 
            opacity: 0.5; 
            pointer-events: none; 
        }
        
        #particle-container { 
            position: absolute; 
            top: 0; 
            left: 0; 
            width: 100%; 
            height: 100%; 
            pointer-events: none; 
            overflow: hidden; 
        }
        
        .particle { 
            position: absolute; 
            width: 10px; 
            height: 10px; 
            background-color: var(--lines-color); 
            border-radius: 50%; 
            animation: particle-burst 0.8s ease-out forwards; 
        }
        
        .control-button, #submit-btn { 
            border: none; 
            color: white; 
            cursor: pointer; 
            transition: all 0.1s ease-out; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            font-family: 'Righteous', cursive; 
        }
        
        .control-button { 
            width: 60px; 
            height: 60px; 
            border-radius: 50%; 
            font-size: 2em; 
        }
        
        #up-btn { 
            background-color: var(--button-up-bg); 
            color: var(--bg-color); 
            box-shadow: 0 6px 0 #00aab1, 0 8px 10px rgba(0,0,0,0.4); 
        }
        
        #down-btn { 
            background-color: var(--button-down-bg); 
            box-shadow: 0 6px 0 #a3003c, 0 8px 10px rgba(0,0,0,0.4); 
        }
        
        .control-button:active { 
            transform: translateY(4px); 
        }
        
        #up-btn:active { 
            box-shadow: 0 2px 0 #00aab1; 
        }
        
        #down-btn:active { 
            box-shadow: 0 2px 0 #a3003c; 
        }

        /* Calculator Interface */
        .input-interface {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .calculator-display {
            width: 180px;
            margin-bottom: 10px;
            display: flex;
            justify-content: center;
        }

        #calculator-input {
            width: 180px;
            height: 50px;
            font-size: 1.8em;
            text-align: center;
            background: rgba(0, 0, 0, 0.3);
            border: 2px solid #00f6ff;
            border-radius: 8px;
            color: white;
            font-family: 'Righteous', cursive;
            box-sizing: border-box;
        }

        .calculator-keypad {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            width: 100%;
            max-width: 180px;
        }

        .calc-btn {
            width: 50px;
            height: 50px;
            border: none;
            border-radius: 8px;
            font-size: 1.4em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.1s ease-out;
            font-family: 'Righteous', cursive;
        }

        .calc-btn.number {
            background: linear-gradient(145deg, #00f6ff, #00aab1);
            color: #1a1a3a;
            box-shadow: 0 4px 0 #007a7f, 0 6px 8px rgba(0,0,0,0.3);
        }

        .calc-btn.number:active {
            transform: translateY(2px);
            box-shadow: 0 2px 0 #007a7f;
        }

        .calc-btn.action {
            background: linear-gradient(145deg, #ff4757, #c44569);
            color: white;
            box-shadow: 0 4px 0 #a3003c, 0 6px 8px rgba(0,0,0,0.3);
        }

        .calc-btn.action:active {
            transform: translateY(2px);
            box-shadow: 0 2px 0 #a3003c;
        }

        #calc-submit {
            background: linear-gradient(145deg, #2ed573, #1e90ff);
            box-shadow: 0 4px 0 #0066cc, 0 6px 8px rgba(0,0,0,0.3);
        }

        #calc-submit:active {
            box-shadow: 0 2px 0 #0066cc;
        }
        
        #submit-btn { 
            width: 100px; 
            height: 50px; 
            border-radius: 20px; 
            font-size: 1.3em; 
            letter-spacing: 1px; 
            background-color: var(--submit-bg); 
            box-shadow: 0 6px 0 #6e2f9e, 0 8px 10px rgba(0,0,0,0.4); 
        }
        
        #submit-btn:active { 
            transform: translateY(4px); 
            box-shadow: 0 2px 0 #6e2f9e; 
        }

        #start-ball-btn {
            width: 140px;
            height: 60px;
            background: linear-gradient(135deg, #007bff, #0056b3);
            font-weight: bold;
            font-size: 1.4em;
            border-radius: 10px;
            box-shadow: 0 6px 0 #004085, 0 8px 15px rgba(0, 123, 255, 0.4);
            transition: all 0.2s ease;
            text-transform: uppercase;
            letter-spacing: 2px;
            border: none;
            color: white;
            cursor: pointer;
            font-family: 'Righteous', cursive;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #start-ball-btn:hover {
            background: linear-gradient(135deg, #0056b3, #004085);
            box-shadow: 0 6px 0 #003060, 0 10px 20px rgba(0, 123, 255, 0.5);
            transform: translateY(-2px);
        }

        #start-ball-btn:active {
            transform: translateY(4px);
            box-shadow: 0 2px 0 #004085;
        }
        
        /* Animations */
        @keyframes pulse { 
            50% { transform: scale(1.05); } 
        }

        @keyframes answer-box-highlight {
            0% { 
                background-color: var(--block-color);
                box-shadow: 0 0 0 rgba(0, 246, 255, 0);
                transform: scale(1);
            }
            25% { 
                background-color: #00f6ff;
                color: #0d0c22;
                box-shadow: 0 0 20px rgba(0, 246, 255, 0.6);
                transform: scale(1.1);
            }
            50% { 
                background-color: var(--block-color);
                color: white;
                box-shadow: 0 0 15px rgba(0, 246, 255, 0.4);
                transform: scale(1.05);
            }
            75% { 
                background-color: #00f6ff;
                color: #0d0c22;
                box-shadow: 0 0 10px rgba(0, 246, 255, 0.3);
                transform: scale(1.08);
            }
            100% { 
                background-color: var(--block-color);
                color: white;
                box-shadow: 0 0 5px rgba(0, 246, 255, 0.2);
                transform: scale(1);
            }
        }

        .answer-box.highlighting {
            animation: answer-box-highlight 2s ease-in-out infinite;
        }

        @keyframes equation-appear {
            0% {
                opacity: 0;
                transform: scale(0.3) translateY(-50px);
            }
            50% {
                opacity: 0.8;
                transform: scale(1.1) translateY(0px);
            }
            100% {
                opacity: 1;
                transform: scale(1) translateY(0px);
            }
        }

        .gate-obstacle.appearing {
            animation: equation-appear 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }
        
        @keyframes score-pop { 
            50% { transform: scale(1.3); } 
        }
        
        @keyframes screen-shake { 
            0%, 100% { transform: translateX(0); } 
            25% { transform: translateX(-10px); } 
            75% { transform: translateX(10px); } 
        }
        
        @keyframes ball-rotation {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        @keyframes ball-swish-animation { 
            0% { transform: translateX(-50%) translateY(0) rotate(0deg); }
            25% { transform: translateX(-50%) translateY(25px) rotate(90deg) scale(1.1, 0.95); }
            50% { transform: translateX(-50%) translateY(55px) rotate(180deg) scale(1.05, 0.92); }
            75% { transform: translateX(-50%) translateY(85px) rotate(270deg) scale(1.02, 0.98); }
            100% { transform: translateX(-50%) translateY(120px) rotate(360deg) scale(1, 1); }
        }
        
        @keyframes stringWave {
            0%, 100% { 
                transform: translateX(0) scaleY(1);
            }
            25% { 
                transform: translateX(1px) scaleY(1.02);
            }
            75% { 
                transform: translateX(-1px) scaleY(1.02);
            }
        }


        .net.net-swish {
            animation: netScore 0.6s ease-out;
        }

        .net.net-swish .net-string {
            animation: stringBounce 0.6s ease-out;
        }

        .net.net-swish .net-horizontal {
            animation: ringExpand 0.6s ease-out;
        }

        @keyframes netScore {
            0% { 
                transform: translateX(-50%) scale(1) translateY(0);
            }
            30% { 
                transform: translateX(-50%) scale(1.05) translateY(10px);
            }
            60% {
                transform: translateX(-50%) scale(0.95) translateY(15px);
            }
            100% { 
                transform: translateX(-50%) scale(1) translateY(0);
            }
        }

        @keyframes stringBounce {
            0% { 
                opacity: 0.9;
            }
            50% { 
                opacity: 1;
                filter: brightness(1.2);
            }
            100% { 
                opacity: 0.9;
            }
        }

        @keyframes ringExpand {
            0% { 
                transform: rotateX(60deg) scale(1);
            }
            50% { 
                transform: rotateX(60deg) scale(1.1);
            }
            100% { 
                transform: rotateX(60deg) scale(1);
            }
        }
        
        @keyframes level-up-fade {
            0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
            50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
            100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
        }
        
        @keyframes particle-burst { 
            to { transform: var(--transform-end); opacity: 0; } 
        }
        
        @keyframes box-destroy {
            0% { 
                transform: translate(0px, 0px) rotate(0deg); 
                opacity: 1; 
            }
            100% { 
                transform: translate(0px, 600px) rotate(360deg); 
                opacity: 1; 
            }
        }
        
        @keyframes box-destroy-left {
            0% { 
                transform: translate(0px, 0px) rotate(0deg); 
                opacity: 1; 
            }
            100% { 
                transform: translate(-30px, 600px) rotate(-360deg); 
                opacity: 1; 
            }
        }
        
        @keyframes box-destroy-right {
            0% { 
                transform: translate(0px, 0px) rotate(0deg); 
                opacity: 1; 
            }
            100% { 
                transform: translate(30px, 600px) rotate(360deg); 
                opacity: 1; 
            }
        }
        
        @keyframes box-destroy-center {
            0% { 
                transform: translate(0px, 0px) rotate(0deg); 
                opacity: 1; 
            }
            100% { 
                transform: translate(0px, 600px) rotate(720deg); 
                opacity: 1; 
            }
        }
        
        @keyframes box-correct {
            0% { 
                transform: scale(1); 
                background: linear-gradient(45deg, #3a1c4b, #5f2c78);
                box-shadow: 0 3px 0 #2c1438, 0 6px 8px rgba(0,0,0,0.3);
            }
            50% { 
                transform: scale(1.15); 
                background: linear-gradient(45deg, #00ff88, #00f6ff);
                box-shadow: 0 0 25px rgba(0, 255, 136, 0.8), 0 0 35px rgba(0, 246, 255, 0.6);
                color: #000;
            }
            100% { 
                transform: scale(1); 
                background: linear-gradient(45deg, #00ff88, #00f6ff);
                box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
                color: #000;
            }
        }

        /* Timer Styles */
        #timer-display {
            font-size: 2em;
            font-weight: bold;
            color: #00f6ff;
            text-shadow: 0 0 10px rgba(0, 246, 255, 0.5);
            margin: 20px auto;
            transition: all 0.3s ease;
            width: 120px;
            height: 120px;
            border: 4px solid #00f6ff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 246, 255, 0.1);
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.3), inset 0 0 20px rgba(0, 246, 255, 0.1);
        }

        #timer-display.warning {
            color: #ff6600;
            text-shadow: 0 0 15px rgba(255, 102, 0, 0.8);
            animation: timer-pulse 1s ease-in-out infinite;
            border-color: #ff6600;
            background: rgba(255, 102, 0, 0.1);
            box-shadow: 0 0 20px rgba(255, 102, 0, 0.5), inset 0 0 20px rgba(255, 102, 0, 0.1);
        }

        @keyframes timer-pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        /* Hearts Container */
        #hearts-container {
            display: flex;
            gap: 10px;
            margin-top: 20px;
            justify-content: center;
            align-items: center;
        }

        /* Heart Styles */
        .heart {
            font-size: 2.5em;
            transition: all 0.3s ease;
            text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
            animation: heart-beat 1.5s ease-in-out infinite;
        }

        .heart.breaking {
            animation: heart-break 0.5s ease-out forwards;
        }

        .heart.broken {
            filter: grayscale(100%);
            opacity: 0.3;
            animation: none;
        }

        @keyframes heart-beat {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        @keyframes heart-break {
            0% { 
                transform: scale(1) rotate(0deg);
                filter: grayscale(0%);
            }
            50% { 
                transform: scale(1.3) rotate(-10deg);
                filter: grayscale(50%);
            }
            100% { 
                transform: scale(0.8) rotate(0deg);
                filter: grayscale(100%);
                opacity: 0.3;
            }
        }

        /* Flash effect for losing heart */
        .flash-damage {
            animation: damage-flash 0.5s ease-out;
        }

        @keyframes damage-flash {
            0%, 100% { background-color: transparent; }
            50% { background-color: rgba(255, 0, 0, 0.2); }
        }

        /* Level Map Styles */
        #level-map-screen {
            z-index: 100;
        }

        #level-map-container {
            position: relative;
            width: 90%;
            max-width: 800px;
            height: calc(100vh - 300px);
            max-height: 450px;
            margin: 20px auto;
            margin-bottom: 150px;
            background: rgba(255, 255, 255, 0.02);
            border-radius: 30px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            overflow: hidden;
            backdrop-filter: blur(40px) saturate(1.5);
            animation: container-breathe 8s ease-in-out infinite;
        }

        @keyframes container-breathe {
            0%, 100% { 
                background: rgba(255, 255, 255, 0.02);
                border-color: rgba(255, 255, 255, 0.08);
            }
            50% { 
                background: rgba(255, 255, 255, 0.04);
                border-color: rgba(255, 255, 255, 0.12);
            }
        }

        .level-path {
            position: relative;
            width: 100%;
            height: 100%;
        }


        .map-header {
            position: absolute;
            top: 30px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10;
            text-align: center;
        }

        .map-title {
            font-size: 0.9em;
            font-weight: 300;
            color: rgba(255, 255, 255, 0.6);
            letter-spacing: 4px;
            text-transform: uppercase;
        }

        #level-path-svg {
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: 1;
        }

        .path-line {
            stroke: rgba(255, 255, 255, 0.1);
            stroke-width: 2;
            fill: none;
            stroke-dasharray: 5, 10;
            stroke-linecap: round;
            transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .path-line.unlocked {
            stroke: rgba(255, 255, 255, 0.4);
            stroke-width: 2;
            stroke-dasharray: none;
        }

        #level-nodes {
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: 2;
        }

        .level-node {
            position: absolute;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: #1a1a2e;
            border: 2px solid rgba(255, 255, 255, 0.2);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            backdrop-filter: blur(10px);
            z-index: 3;
        }

        .level-node:nth-child(1) { animation: float 6s ease-in-out infinite; }
        .level-node:nth-child(2) { animation: float 6s ease-in-out 1s infinite; }
        .level-node:nth-child(3) { animation: float 6s ease-in-out 2s infinite; }
        .level-node:nth-child(4) { animation: float 6s ease-in-out 3s infinite; }
        .level-node:nth-child(5) { animation: float 6s ease-in-out 4s infinite; }

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

        .level-node.locked {
            background: #0a0a0f;
            border-color: rgba(255, 255, 255, 0.1);
            cursor: not-allowed;
            opacity: 0.6;
        }

        .level-node.current {
            border-color: rgba(255, 255, 255, 0.8);
            background: #2a2a3e;
            animation: current-pulse 2s ease-in-out infinite;
        }

        @keyframes current-pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .level-node.completed {
            background: #1e3a2e;
            border-color: rgba(255, 255, 255, 0.6);
        }

        .level-node.selected {
            transform: scale(1.2);
            border-color: rgba(255, 255, 255, 1);
            background: #3a3a4e;
        }


        .level-node:hover:not(.locked) {
            transform: scale(1.1);
            border-color: rgba(255, 255, 255, 0.5);
            background: #2a2a3e;
        }

        .level-number {
            font-size: 1.5em;
            font-weight: 300;
            color: rgba(255, 255, 255, 0.9);
            line-height: 1;
        }

        .level-node.locked .level-number {
            color: rgba(255, 255, 255, 0.4);
        }

        .level-stars {
            display: flex;
            gap: 2px;
            margin-top: 3px;
        }

        .level-star {
            font-size: 0.5em;
            color: rgba(255, 255, 255, 0.8);
        }

        .level-star.empty {
            color: rgba(255, 255, 255, 0.2);
        }

        .level-map-buttons {
            position: absolute;
            bottom: 50px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 20px;
            z-index: 10;
        }

        .map-button {
            padding: 15px 30px;
            border-radius: 30px;
            font-size: 1.1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
        }

        #back-to-menu-button {
            background: linear-gradient(135deg, #462255, #1c1a3a);
            border: 2px solid #666;
            color: white;
        }

        #back-to-menu-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        }

        .play-button {
            background: linear-gradient(135deg, #00f6ff, #00a8cc);
            color: #0d0c22;
            box-shadow: 0 4px 15px rgba(0, 246, 255, 0.4);
        }

        .play-button:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 246, 255, 0.5);
        }

        .play-button:disabled {
            background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
            color: #666;
            cursor: not-allowed;
            opacity: 0.6;
            box-shadow: none;
        }

        .play-button.active {
            animation: pulse-glow 2s ease-in-out infinite;
        }

        @keyframes pulse-glow {
            0%, 100% { box-shadow: 0 4px 15px rgba(0, 246, 255, 0.4); }
            50% { box-shadow: 0 6px 25px rgba(0, 246, 255, 0.8); }
        }

        .reset-button {
            background: linear-gradient(135deg, #ff6b00, #ff4444);
            color: white;
            box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
        }

        .reset-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 68, 68, 0.5);
        }

        /* Popup Styles */
        .popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }

        .popup-overlay.hidden {
            display: none;
        }

        .popup-overlay:not(.hidden) {
            opacity: 1;
            pointer-events: auto;
        }

        .popup-container {
            background: #1a1a2e;
            border-radius: 20px;
            padding: 40px;
            max-width: 400px;
            width: 90%;
            text-align: center;
            border: 2px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            transform: scale(0.9);
            transition: transform 0.3s ease;
        }
        
        .popup-container.level-stats-container {
            padding: 20px 40px 40px;
        }

        .popup-overlay:not(.hidden) .popup-container {
            transform: scale(1);
        }

        .popup-title {
            color: #00f6ff;
            font-size: 1.8em;
            margin-bottom: 20px;
            text-shadow: 0 0 10px rgba(0, 246, 255, 0.5);
        }

        .popup-message {
            color: rgba(255, 255, 255, 0.8);
            font-size: 1.1em;
            margin-bottom: 30px;
            line-height: 1.5;
        }

        .popup-buttons {
            display: flex;
            gap: 20px;
            justify-content: center;
        }

        .popup-button {
            padding: 12px 30px;
            border-radius: 25px;
            font-size: 1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
            min-width: 100px;
        }

        .popup-button.cancel {
            background: linear-gradient(135deg, #462255, #1c1a3a);
            border: 2px solid #666;
            color: white;
        }

        .popup-button.confirm {
            background: linear-gradient(135deg, #ff4444, #cc0000);
            color: white;
            box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
        }

        .popup-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        }

        /* Level Stats Popup */
        .level-stats-container {
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
        }


        .stats-content {
            margin: 20px 0;
        }

        .stats-section {
            margin-bottom: 25px;
        }

        .stats-section h3 {
            color: #00f6ff;
            font-size: 1.2em;
            margin-bottom: 15px;
            text-shadow: 0 0 5px rgba(0, 246, 255, 0.5);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        .stat-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .stat-label {
            color: #aaa;
            font-size: 0.9em;
        }

        .stat-value {
            color: white;
            font-weight: bold;
        }

        .attempts-tabs-container {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 8px;
            overflow: hidden;
        }

        .attempts-tabs {
            display: flex;
            flex-wrap: wrap;
            background: rgba(255, 255, 255, 0.05);
            padding: 5px;
            gap: 5px;
            max-height: 80px;
            overflow-y: auto;
        }

        .attempt-tab {
            padding: 8px 15px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9em;
            color: #aaa;
        }

        .attempt-tab:hover {
            background: rgba(255, 255, 255, 0.15);
            color: white;
        }

        .attempt-tab.active {
            background: #00f6ff;
            color: #0d0c22;
            border-color: #00f6ff;
            font-weight: bold;
        }

        .attempt-tab .tab-score {
            font-size: 0.8em;
            opacity: 0.8;
        }

        .attempts-content {
            padding: 15px;
            max-height: 200px;
            overflow-y: auto;
        }

        .attempt-details {
            display: none;
        }

        .attempt-details.active {
            display: block;
        }
        
        /* Limit visible equations to 3 */
        .attempt-details.active .question-item:nth-child(n+5) {
            display: none;
        }
        
        /* Show all equations when there are more than 3 */
        .attempt-details.active.show-all-questions {
            max-height: 120px;
            overflow-y: auto;
            padding-right: 5px;
        }
        
        .attempt-details.active.show-all-questions .question-item {
            display: flex !important;
        }

        .attempt-info {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            font-size: 0.9em;
            color: #aaa;
        }

        .question-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .question-item:last-child {
            border-bottom: none;
        }

        .question-text {
            color: #ddd;
            font-size: 0.9em;
        }

        .question-result {
            font-weight: bold;
        }

        .question-result.correct {
            color: #00ff88;
        }

        .question-result.incorrect {
            color: #ff4444;
        }

        .back-button {
            position: absolute;
            top: 20px;
            left: 20px;
            background: linear-gradient(135deg, #462255, #1c1a3a);
            border: 2px solid #00f6ff;
            color: white;
            padding: 10px 20px;
            border-radius: 30px;
            font-size: 1.1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
        }

        .back-button:hover {
            background: linear-gradient(135deg, #5a2e69, #2a285a);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        }

        /* Game Setup Styles */
        .step-indicators {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 20px auto 30px;
            max-width: 500px;
        }

        .step-indicator {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            opacity: 0.5;
            transition: all 0.3s ease;
        }

        .step-indicator.active {
            opacity: 1;
        }

        .step-indicator.completed {
            opacity: 1;
        }

        .step-number {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #462255;
            border: 2px solid #666;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.2em;
            color: white;
            transition: all 0.3s ease;
        }

        .step-indicator.active .step-number {
            background: #00f6ff;
            border-color: #00f6ff;
            color: #0d0c22;
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.5);
        }

        .step-indicator.completed .step-number {
            background: #00ff88;
            border-color: #00ff88;
            color: #0d0c22;
        }

        .step-label {
            font-size: 0.9em;
            color: #aaa;
            transition: all 0.3s ease;
        }

        .step-indicator.active .step-label,
        .step-indicator.completed .step-label {
            color: white;
        }

        .step-connector {
            width: 60px;
            height: 2px;
            background: #666;
            margin: 0 10px;
            margin-bottom: 20px;
            transition: all 0.3s ease;
        }

        .step-connector.completed {
            background: #00ff88;
        }

        .setup-container {
            width: 90%;
            max-width: 600px;
            margin: 20px auto;
            background: rgba(0, 0, 0, 0.7);
            border: 2px solid #00f6ff;
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 0 30px rgba(0, 246, 255, 0.3);
            min-height: 350px;
            max-height: 450px;
            overflow-y: auto;
        }

        .setup-step {
            display: none;
        }

        .setup-step.active {
            display: block;
            animation: stepFadeIn 0.3s ease-out;
        }

        @keyframes stepFadeIn {
            from {
                opacity: 0;
                transform: translateX(20px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .setup-hint {
            color: #aaa;
            font-size: 0.9em;
            margin-top: 10px;
            text-align: center;
        }

        .step-buttons {
            display: flex;
            justify-content: space-between;
            gap: 20px;
            position: relative;
        }

        .step-buttons .step-back-button,
        .step-buttons .step-next-button {
            display: none;
        }

        .step-buttons .step-back-button.active,
        .step-buttons .step-next-button.active {
            display: block;
        }

        .step-back-button, .step-next-button {
            padding: 15px 30px;
            border-radius: 30px;
            font-size: 1.1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
        }

        .step-back-button {
            background: linear-gradient(135deg, #462255, #1c1a3a);
            border: 2px solid #666;
            color: white;
        }

        .step-next-button {
            background: linear-gradient(135deg, #00f6ff, #00a8cc);
            color: #0d0c22;
            box-shadow: 0 4px 15px rgba(0, 246, 255, 0.4);
        }

        .step-next-button.finish {
            background: linear-gradient(135deg, #00ff88, #00cc66);
            box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
        }

        .step-back-button:hover, .step-next-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        }

        .setup-section {
            margin-bottom: 30px;
        }

        .setup-section h2 {
            color: #00f6ff;
            margin-bottom: 15px;
            text-shadow: 0 0 10px rgba(0, 246, 255, 0.5);
            font-size: 1.5em;
        }

        .player-setup {
            display: flex;
            align-items: center;
            gap: 30px;
            justify-content: center;
        }

        .player-image-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
        }

        .image-preview {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 3px solid #00f6ff;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.5);
            overflow: hidden;
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.3);
            position: relative;
        }

        .image-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .image-placeholder {
            font-size: 2em;
            color: #666;
        }

        .image-input {
            display: none;
        }

        .image-upload-btn {
            background: linear-gradient(145deg, #00f6ff, #0099cc);
            color: white;
            padding: 10px 20px;
            border-radius: 20px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s ease;
            border: none;
            font-size: 0.9em;
        }

        .image-upload-btn:hover {
            background: linear-gradient(145deg, #0099cc, #00f6ff);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 246, 255, 0.4);
        }

        .player-name-container {
            flex: 1;
        }

        .setup-input {
            width: 100%;
            padding: 15px;
            font-size: 1.2em;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid #00f6ff;
            border-radius: 10px;
            color: white;
            text-align: center;
            transition: all 0.3s ease;
        }

        .setup-input:focus {
            outline: none;
            background: rgba(255, 255, 255, 0.2);
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.5);
        }

        .difficulty-options {
            display: flex;
            gap: 15px;
            justify-content: center;
            flex-wrap: nowrap;
        }

        .difficulty-btn {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 2px solid #666;
            border-radius: 15px;
            padding: 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            min-width: 120px;
            flex: 1;
        }

        .difficulty-btn.active {
            border-color: #00f6ff;
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.5);
        }

        .difficulty-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
        }

        .difficulty-icon {
            font-size: 2em;
        }

        .difficulty-name {
            font-size: 1.3em;
            font-weight: bold;
            color: white;
        }

        .difficulty-desc {
            font-size: 0.9em;
            color: #aaa;
            text-align: center;
        }

        .time-options, .range-options {
            display: flex;
            gap: 15px;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* Equation Types Styling */
        .equation-types-container {
            display: flex;
            flex-direction: column;
            gap: 15px;
            max-width: 450px;
            margin: 0 auto;
            max-height: 250px;
            overflow-y: auto;
            padding-right: 5px;
        }

        .equation-types-container::-webkit-scrollbar {
            width: 6px;
        }

        .equation-types-container::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 3px;
        }

        .equation-types-container::-webkit-scrollbar-thumb {
            background: #00f6ff;
            border-radius: 3px;
        }

        .equation-type-option {
            display: flex;
            align-items: center;
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 2px solid #666;
            border-radius: 12px;
            padding: 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            min-height: 60px;
        }

        .equation-type-option:hover {
            border-color: #00f6ff;
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(0, 246, 255, 0.3);
        }

        .equation-type-checkbox {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .equation-type-checkbox:checked + .equation-type-label::before {
            content: '✓';
            position: absolute;
            left: -40px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            background: linear-gradient(145deg, #00f6ff, #00a8cc);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #0d0c22;
            font-weight: bold;
            font-size: 1em;
        }

        .equation-type-checkbox:not(:checked) + .equation-type-label::before {
            content: '';
            position: absolute;
            left: -40px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            background: rgba(0, 0, 0, 0.5);
            border: 2px solid #666;
            border-radius: 4px;
        }

        .equation-type-checkbox:checked ~ .equation-type-label {
            color: #00f6ff;
        }

        .equation-type-label {
            display: flex;
            flex-direction: column;
            gap: 3px;
            margin-left: 40px;
            color: white;
            position: relative;
        }

        .equation-example {
            font-size: 1.2em;
            font-weight: bold;
            font-family: 'Righteous', cursive;
            letter-spacing: 1px;
        }

        .equation-desc {
            font-size: 0.85em;
            color: #aaa;
            font-family: 'Nunito', sans-serif;
        }

        .result-options {
            display: flex;
            gap: 15px;
            justify-content: center;
            flex-wrap: nowrap;
        }

        .time-btn, .range-btn, .result-btn {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 2px solid #666;
            color: white;
            padding: 15px 25px;
            border-radius: 10px;
            font-size: 1.2em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .time-btn.active, .range-btn.active, .result-btn.active {
            border-color: #00f6ff;
            box-shadow: 0 0 15px rgba(0, 246, 255, 0.5);
        }

        .time-btn:hover, .range-btn:hover, .result-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
        }

        .result-input {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 2px solid #00f6ff;
            color: white;
            padding: 15px 25px;
            border-radius: 10px;
            font-size: 1.2em;
            font-weight: bold;
            text-align: center;
            width: 120px;
            box-shadow: 0 0 15px rgba(0, 246, 255, 0.5);
            transition: all 0.3s ease;
        }

        .result-input:focus {
            outline: none;
            box-shadow: 0 0 25px rgba(0, 246, 255, 0.8);
            transform: translateY(-2px);
        }

        .result-input:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.6);
        }

        .range-input-group {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
        }

        .range-input-group label {
            color: white;
            font-size: 1.1em;
            font-weight: bold;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        .range-input {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 2px solid #00f6ff;
            color: white;
            padding: 12px 20px;
            border-radius: 10px;
            font-size: 1.2em;
            font-weight: bold;
            text-align: center;
            width: 100px;
            box-shadow: 0 0 15px rgba(0, 246, 255, 0.5);
            transition: all 0.3s ease;
        }

        .range-input:focus {
            outline: none;
            box-shadow: 0 0 25px rgba(0, 246, 255, 0.8);
            transform: translateY(-2px);
        }

        .range-input:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.6);
        }

        /* Hide default browser spin buttons completely */
        .range-input::-webkit-outer-spin-button,
        .range-input::-webkit-inner-spin-button,
        .result-input::-webkit-outer-spin-button,
        .result-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .range-input[type="number"],
        .result-input[type="number"] {
            -moz-appearance: textfield;
        }

        /* Custom Number Stepper Design */
        .number-stepper {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .stepper-container {
            position: relative;
            display: flex;
            align-items: center;
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border-radius: 12px;
            padding: 2px;
            box-shadow: 0 0 15px rgba(0, 246, 255, 0.5);
            border: 2px solid #00f6ff;
            transition: all 0.3s ease;
        }

        .stepper-container:hover {
            box-shadow: 0 0 25px rgba(0, 246, 255, 0.7);
            transform: translateY(-1px);
        }

        .stepper-container:focus-within {
            box-shadow: 0 0 30px rgba(0, 246, 255, 0.9);
            transform: translateY(-2px);
        }

        .stepper-container .range-input,
        .stepper-container .result-input {
            border: none;
            background: transparent;
            margin: 0;
            padding: 12px 15px;
            width: 80px;
            text-align: center;
            box-shadow: none;
            border-radius: 10px 0 0 10px;
        }

        .stepper-container .range-input:focus,
        .stepper-container .result-input:focus {
            box-shadow: none;
            transform: none;
            background: rgba(0, 246, 255, 0.1);
        }

        .stepper-buttons {
            display: flex;
            flex-direction: column;
            height: 100%;
            min-height: 46px;
        }

        .stepper-btn {
            background: linear-gradient(145deg, #00f6ff, #0099cc);
            border: none;
            width: 32px;
            height: 23px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            position: relative;
            overflow: hidden;
        }

        .stepper-up {
            border-radius: 0 10px 0 0;
            border-bottom: 1px solid rgba(0, 0, 0, 0.2);
        }

        .stepper-down {
            border-radius: 0 0 10px 0;
            border-top: 1px solid rgba(255, 255, 255, 0.2);
        }

        .stepper-icon {
            font-size: 12px;
            font-weight: bold;
            color: #1c1a3a;
            text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
            transition: all 0.2s ease;
        }

        .stepper-btn:hover {
            background: linear-gradient(145deg, #33ffff, #00ccff);
            transform: scale(1.05);
            box-shadow: 0 0 10px rgba(0, 246, 255, 0.8);
        }

        .stepper-btn:hover .stepper-icon {
            transform: scale(1.2);
            color: #0d0c22;
        }

        .stepper-btn:active {
            background: linear-gradient(145deg, #0099cc, #006699);
            transform: scale(0.95);
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .stepper-btn:active .stepper-icon {
            transform: scale(1.1);
        }

        .stepper-btn:disabled {
            background: linear-gradient(145deg, #666, #444);
            cursor: not-allowed;
            opacity: 0.5;
        }

        .stepper-btn:disabled:hover {
            transform: none;
            box-shadow: none;
        }

        /* Ripple effect for button clicks */
        .stepper-btn::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.6);
            transform: translate(-50%, -50%);
            transition: width 0.3s ease, height 0.3s ease;
        }

        .stepper-btn:active::before {
            width: 40px;
            height: 40px;
        }

        /* Enhanced range input group layout */
        .range-input-group {
            display: flex;
            align-items: flex-end;
            justify-content: center;
            gap: 30px;
            flex-wrap: wrap;
        }

        .range-input-group label {
            color: white;
            font-size: 1.1em;
            font-weight: bold;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
            margin-bottom: 5px;
        }


        .setup-buttons {
            display: flex;
            justify-content: space-between;
            margin-top: 40px;
            gap: 20px;
        }

        .setup-back-button {
            background: linear-gradient(135deg, #462255, #1c1a3a);
            border: 2px solid #00f6ff;
            color: white;
            padding: 15px 30px;
            border-radius: 30px;
            font-size: 1.1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .setup-start-button {
            background: linear-gradient(135deg, #00f6ff, #00a8cc);
            border: none;
            color: #0d0c22;
            padding: 15px 40px;
            border-radius: 30px;
            font-size: 1.2em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 246, 255, 0.4);
        }

        .setup-back-button:hover, .setup-start-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        }

        /* ===== MULTIPLAYER STYLES ===== */

        /* Mode Selection Screen */
        .mode-options {
            display: flex;
            gap: 40px;
            justify-content: center;
            margin: 40px auto;
            flex-wrap: wrap;
        }

        .mode-button {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 3px solid #666;
            border-radius: 20px;
            color: white;
            padding: 30px;
            min-width: 250px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        .mode-button:hover {
            border-color: #00f6ff;
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.5);
            transform: translateY(-5px);
        }

        .mode-icon {
            font-size: 3em;
            margin-bottom: 15px;
        }

        .mode-title {
            font-size: 1.5em;
            font-weight: bold;
            margin-bottom: 10px;
            color: #00f6ff;
        }

        .mode-description {
            font-size: 1em;
            color: #ccc;
            line-height: 1.4;
        }

        .back-button {
            background: linear-gradient(135deg, #462255, #1c1a3a);
            border: 2px solid #00f6ff;
            color: white;
            padding: 15px 30px;
            border-radius: 30px;
            font-size: 1.1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 30px;
        }

        .back-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        }

        /* Multiplayer Setup Screen */
        .multiplayer-setup-container {
            display: flex;
            gap: 40px;
            justify-content: center;
            align-items: flex-start;
            margin: 40px auto;
            max-width: 900px;
        }

        .player-setup-section {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 2px solid #666;
            border-radius: 20px;
            padding: 15px;
            min-width: 300px;
            text-align: center;
        }

        .player-setup-section h2 {
            color: #00f6ff;
            font-size: 1.8em;
            margin-bottom: 20px;
            text-shadow: 0 0 10px rgba(0, 246, 255, 0.5);
        }

        .player-config {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .player-info {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .controls-label {
            background: rgba(0, 246, 255, 0.1);
            border: 1px solid #00f6ff;
            border-radius: 10px;
            padding: 10px;
            font-size: 0.9em;
            color: #00f6ff;
        }

        .vs-divider {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 20px;
            height: 100%;
            align-self: center;
        }

        .vs-text {
            background: linear-gradient(135deg, #f90059, #ff6600);
            color: white;
            border-radius: 50%;
            width: 80px;
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2em;
            font-weight: bold;
            box-shadow: 0 0 20px rgba(249, 0, 89, 0.5);
            animation: vs-pulse 2s ease-in-out infinite;
        }

        @keyframes vs-pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .multiplayer-setup-buttons {
            display: flex;
            justify-content: space-between;
            gap: 20px;
        }

        /* Multiplayer-specific Setup Styles */
        .multiplayer-players-setup {
            display: flex;
            gap: 20px;
            justify-content: center;
            align-items: flex-start;
            width: 100%;
        }

        .multiplayer-players-setup .player-setup-section {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 2px solid #666;
            border-radius: 15px;
            padding: 15px;
            min-width: 0; /* Override the global min-width */
            width: 40%; /* Each player section takes 40% of container */
            text-align: center;
            box-sizing: border-box;
        }

        .multiplayer-players-setup .player-setup-section h3 {
            color: #00f6ff;
            font-size: 1.3em;
            margin-bottom: 15px;
            text-align: center;
        }

        .multiplayer-players-setup .vs-divider {
            color: #ffffff;
            font-size: 1.5em;
            text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
            animation: vs-pulse 2s ease-in-out infinite alternate;
            margin: 0 20px;
            flex-shrink: 0;
        }

        .multiplayer-players-setup .player-image-container {
            margin-bottom: 15px;
        }

        .multiplayer-players-setup .image-preview {
            width: 80px;
            height: 80px;
            margin: 0 auto 10px;
        }

        .multiplayer-players-setup .setup-input {
            font-size: 0.9em;
            padding: 8px 12px;
        }

        /* Duration buttons styling - same as other option buttons */
        .duration-options {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            margin: 20px 0;
        }

        .duration-btn {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 2px solid #666;
            border-radius: 12px;
            padding: 12px 20px;
            color: white;
            font-family: 'Righteous', sans-serif;
            font-size: 1em;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 100px;
        }

        .duration-btn:hover {
            border-color: var(--button-up-bg);
            box-shadow: 0 0 15px rgba(0, 246, 255, 0.3);
            transform: translateY(-2px);
        }

        .duration-btn.active {
            border-color: var(--button-up-bg);
            background: linear-gradient(145deg, #00f6ff, #0084a8);
            color: black;
            font-weight: bold;
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.5);
        }

        /* Responsive styles for multiplayer setup */
        @media (max-width: 768px) {
            .multiplayer-players-setup {
                flex-direction: column;
                gap: 20px;
                align-items: center;
            }

            .multiplayer-players-setup .player-setup-section {
                width: 80%;
                max-width: 280px;
            }

            .multiplayer-players-setup .vs-divider {
                transform: rotate(90deg);
                margin: 10px 0;
            }
        }

        .start-button {
            background: linear-gradient(135deg, #00f6ff, #00a8cc);
            border: none;
            color: #0d0c22;
            padding: 15px 40px;
            border-radius: 30px;
            font-size: 1.2em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 246, 255, 0.4);
        }

        .start-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 246, 255, 0.6);
        }

        /* Multiplayer Game Layout */
        .multiplayer-game-wrapper {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: linear-gradient(45deg, #0d0c22, #29265f);
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .multiplayer-game-wrapper.hidden {
            display: none;
        }

        .multiplayer-container {
            display: flex;
            width: 100%;
            height: 100%;
            gap: 0;
            position: relative;
            margin: 0;
            box-sizing: border-box;
        }

        /* Multiplayer Game Timer */
        .multiplayer-game-timer {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 100;
            text-align: center;
            background: linear-gradient(145deg, rgba(0, 0, 0, 0.9), rgba(28, 26, 58, 0.9));
            border: 3px solid #00f6ff;
            border-radius: 20px;
            padding: 15px 30px;
            box-shadow: 0 0 30px rgba(0, 246, 255, 0.5);
            backdrop-filter: blur(10px);
            width: auto;
            min-width: 200px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .game-timer-display {
            font-family: 'Righteous', sans-serif;
            font-size: 2.5em;
            font-weight: bold;
            color: #00f6ff;
            text-shadow: 0 0 15px rgba(0, 246, 255, 0.8);
            margin-bottom: 5px;
            letter-spacing: 2px;
        }

        .game-timer-label {
            font-family: 'Righteous', sans-serif;
            font-size: 0.9em;
            color: #ffffff;
            opacity: 0.8;
            font-weight: bold;
            letter-spacing: 1px;
        }

        /* Add warning styles for low time */
        .game-timer-display.warning {
            color: #ff6b35;
            text-shadow: 0 0 15px rgba(255, 107, 53, 0.8);
        }

        .multiplayer-game-timer.warning {
            border-color: #ff6b35;
            box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
            animation: pulse-warning 1s ease-in-out infinite alternate;
        }

        @keyframes pulse-warning {
            0% { transform: translateX(-50%) scale(1); }
            100% { transform: translateX(-50%) scale(1.05); }
        }

        /* Battle Dashboard Styles */
        .battle-dashboard {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            z-index: 100;
            background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(13, 12, 34, 0.95));
            border-bottom: 3px solid #00f6ff;
            box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            padding: 15px 20px;
        }

        .battle-timer {
            position: absolute;
            top: 75px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 99;
            text-align: center;
            background: rgba(0, 0, 0, 0.8);
            border: 2px solid #00f6ff;
            border-radius: 10px;
            padding: 15px 16px 8px 16px;
            backdrop-filter: blur(5px);
        }

        .battle-timer .game-timer-display {
            font-family: 'Righteous', sans-serif;
            font-size: 1.8em;
            font-weight: bold;
            color: #00f6ff;
            text-shadow: 0 0 15px rgba(0, 246, 255, 0.8);
            margin-bottom: 2px;
        }

        .battle-timer .game-timer-label {
            font-family: 'Righteous', sans-serif;
            font-size: 0.75em;
            color: #ffffff;
            opacity: 0.8;
            font-weight: bold;
            letter-spacing: 1px;
        }

        .battle-timer.warning {
            border-color: #ff6b35;
            box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
        }

        .battle-timer.warning .game-timer-display {
            color: #ff6b35;
            text-shadow: 0 0 15px rgba(255, 107, 53, 0.8);
        }

        .battle-scores {
            display: flex;
            align-items: center;
            justify-content: space-between;
            max-width: 900px;
            margin: 0 auto 0 auto;
        }

        .player-battle-info {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            min-width: 170px;
        }

        .battle-avatar {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .player1-battle .battle-avatar {
            flex-direction: row;
        }

        .player2-battle .battle-avatar {
            flex-direction: row-reverse;
        }

        .battle-avatar .game-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            border: 3px solid;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5em;
        }

        .player1-battle .game-avatar {
            border-color: #00f6ff;
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.6);
        }

        .player2-battle .game-avatar {
            border-color: #f90059;
            box-shadow: 0 0 20px rgba(249, 0, 89, 0.6);
        }

        .battle-player-name {
            font-family: 'Righteous', sans-serif;
            font-size: 1.1em;
            font-weight: bold;
            color: #ffffff;
            text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
        }


        .vs-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            flex-grow: 1;
            max-width: 300px;
        }

        .score-comparison {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
            font-family: 'Righteous', sans-serif;
            font-size: 2.5em;
            font-weight: bold;
        }

        .battle-score {
            min-width: 80px;
            text-align: center;
            text-shadow: 0 0 20px currentColor;
            transition: all 0.3s ease;
        }

        .player1-score {
            color: #00f6ff;
        }

        .player2-score {
            color: #f90059;
        }

        .battle-score.leading {
            transform: scale(1.1);
            text-shadow: 0 0 30px currentColor;
            animation: score-leading 1s ease-in-out infinite alternate;
        }

        .vs-divider {
            color: #ffffff;
            font-size: 0.8em;
            text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
            animation: vs-pulse 2s ease-in-out infinite alternate;
        }

        @keyframes pulse-glow {
            0% { transform: scale(1); opacity: 0.9; }
            100% { transform: scale(1.02); opacity: 1; }
        }

        @keyframes score-leading {
            0% { transform: scale(1.1); }
            100% { transform: scale(1.15); }
        }

        @keyframes vs-pulse {
            0% { transform: scale(1); }
            100% { transform: scale(1.05); }
        }

        /* Battle Dashboard Warning State */
        .battle-dashboard.warning .game-timer-display {
            color: #ff6b35;
            text-shadow: 0 0 15px rgba(255, 107, 53, 0.8);
        }

        .battle-dashboard.warning {
            border-bottom-color: #ff6b35;
            animation: dashboard-warning 1s ease-in-out infinite alternate;
        }

        @keyframes dashboard-warning {
            0% { box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8); }
            100% { box-shadow: 0 5px 25px rgba(255, 107, 53, 0.5); }
        }

        /* Adjust multiplayer container to account for battle dashboard */
        .multiplayer-game-wrapper .multiplayer-container {
            padding-top: 70px;
        }

        .player-side {
            flex: 1;
            display: flex;
            flex-direction: column;
            height: 100%;
            background: linear-gradient(145deg, #0d0c22, #1c1a3a);
        }

        .player1-side {
            border-right: 3px solid #00f6ff;
        }

        .player2-side {
            border-left: 3px solid #f90059;
        }

        .center-divider {
            width: 6px;
            background: linear-gradient(180deg, #00f6ff, #f90059);
            position: relative;
        }

        .center-divider::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 20px;
            height: 20px;
            background: radial-gradient(circle, #fff, #00f6ff);
            border-radius: 50%;
            box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
        }

        /* Player Headers */
        .player-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background: rgba(0, 0, 0, 0.3);
            border-bottom: 2px solid var(--lines-color);
        }

        .player1-side .player-header {
            border-bottom-color: #00f6ff;
        }

        .player2-side .player-header {
            border-bottom-color: #f90059;
        }

        .player-avatar {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .game-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 3px solid #00f6ff;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(145deg, #1c1a3a, #462255);
            overflow: hidden;
        }

        .player2-side .game-avatar {
            border-color: #f90059;
        }

        .game-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .avatar-placeholder {
            font-size: 1.5em;
        }

        .player-name {
            font-size: 1.3em;
            font-weight: bold;
            color: white;
        }

        .player-hud {
            display: flex;
            gap: 20px;
            align-items: center;
        }

        /* Multiplayer scoreboard styling */
        .multiplayer-game-wrapper .scoreboard {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        /* Multiplayer score and level display styling */
        .multiplayer-game-wrapper .score-display, 
        .multiplayer-game-wrapper .level-display {
            font-size: 1.1em;
            font-weight: bold;
            color: white;
        }

        .hearts-container {
            display: flex;
            gap: 5px;
        }

        .heart {
            font-size: 1.5em;
            transition: all 0.3s ease;
        }

        .heart.broken {
            opacity: 0.3;
            filter: grayscale(100%);
        }

        .timer {
            font-size: 1.3em;
            font-weight: bold;
            color: #00f6ff;
            padding: 8px 15px;
            background: rgba(0, 246, 255, 0.1);
            border: 2px solid #00f6ff;
            border-radius: 10px;
        }

        .player2-side .timer {
            color: #f90059;
            border-color: #f90059;
            background: rgba(249, 0, 89, 0.1);
        }

        .timer.warning {
            animation: timer-warning 1s ease-in-out infinite;
        }

        @keyframes timer-warning {
            0%, 100% { 
                background: rgba(249, 0, 89, 0.1);
                border-color: #f90059;
            }
            50% { 
                background: rgba(249, 0, 89, 0.3);
                border-color: #ff6600;
            }
        }

        /* Player Game Areas */
        .player-game-area {
            flex: 1;
            display: flex;
            height: 100%;
        }


        .player1-calculator, .player2-calculator {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 20px;
        }

        /* Multiplayer HUD styles - same as single player */
        #player1-hud, #player2-hud {
            width: 100%;
            margin-bottom: 20px;
            padding-top: 20px;
        }

        #player1-hearts-container, #player2-hearts-container {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        #player1-timer-display, #player2-timer-display {
            background-color: var(--hud-bg);
            border: 2px solid var(--lines-color);
            color: var(--hud-text);
            font-size: 24px;
            font-weight: bold;
            padding: 15px;
            border-radius: 50%;
            text-align: center;
            width: 80px;
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto;
        }

        #player2-timer-display {
            border-color: #f90059;
        }

        .player1-game, .player2-game {
            flex: 2;
            position: relative;
        }


        /* Calculator Controls for Multiplayer */
        .calculator-controls {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 3px solid #00f6ff;
            border-radius: 20px;
            padding: 20px;
            max-width: 300px;
            width: 100%;
            display: flex;
            flex-direction: column;
        }

        .player2-side .calculator-controls {
            border-color: #f90059;
        }

        .calculator-display {
            margin-bottom: 20px;
            flex-shrink: 0;
        }

        .calculator-display input {
            width: 100%;
            height: 60px;
            font-size: 1.8em;
            font-weight: bold;
            text-align: center;
            background: rgba(0, 0, 0, 0.5);
            border: 2px solid #666;
            border-radius: 10px;
            color: white;
            padding: 10px;
        }

        .calculator-keypad {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            flex: 1;
        }

        .calc-btn {
            height: 50px;
            font-size: 1.2em;
            font-weight: bold;
            border: 2px solid #666;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .calc-btn.number {
            background: linear-gradient(145deg, #00f6ff, #00a8cc);
            color: #0d0c22;
        }

        .player2-side .calc-btn.number {
            background: linear-gradient(145deg, #f90059, #cc0044);
            color: white;
        }

        .calc-btn.action {
            background: linear-gradient(145deg, #9d4edd, #7209b7);
            color: white;
        }

        .calc-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        }

        .calc-btn:active {
            transform: translateY(0);
        }

        /* Game Containers for Multiplayer - Copy exact styling from single player */
        .multiplayer-game-wrapper #player1-game-container,
        .multiplayer-game-wrapper #player2-game-container {
            width: 100%;
            height: 100%;
            position: relative;
            background: linear-gradient(180deg, 
                rgba(13, 12, 34, 0.8) 0%, 
                rgba(28, 26, 58, 0.9) 40%, 
                rgba(70, 34, 85, 0.8) 100%);
            border: 2px solid var(--court-color);
            border-radius: 15px;
            overflow: hidden;
            margin: 10px;
        }

        /* Ball styling - exact copy from single player */
        #player1-ball, #player2-ball {
            position: absolute;
            z-index: 10;
            transition: transform 0.1s linear;
            font-size: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 50px;
            height: 50px;
        }

        #player1-ball.rotating, #player2-ball.rotating {
            animation: ball-rotation 2.5s linear infinite;
        }

        #player1-ball.swishing, #player2-ball.swishing {
            animation: ball-swish-animation 1.2s cubic-bezier(0.15, 0.25, 0.35, 0.85) forwards;
        }

        /* Play tube - exact copy from single player */
        #player1-play-tube, #player2-play-tube {
            position: absolute;
            top: 100px;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            bottom: 140px;
            background: linear-gradient(to bottom, rgba(0, 246, 255, 0.08) 0%, rgba(0, 246, 255, 0.03) 50%, rgba(0, 246, 255, 0.08) 100%);
            border-left: 2px solid rgba(0, 246, 255, 0.25);
            border-right: 2px solid rgba(0, 246, 255, 0.25);
            box-shadow: inset 0 0 20px rgba(0, 246, 255, 0.1), 0 0 15px rgba(0, 246, 255, 0.15);
        }

        /* Tube top ellipse for realistic 3D perspective */
        #player1-play-tube::before, #player2-play-tube::before {
            content: '';
            position: absolute;
            top: -6px;
            left: 0;
            width: 100px;
            height: 12px;
            background: radial-gradient(ellipse at center, rgba(0, 246, 255, 0.15) 0%, rgba(0, 246, 255, 0.10) 50%, rgba(0, 246, 255, 0.05) 100%);
            border-radius: 50%;
            box-shadow: 
                inset 0 2px 6px rgba(0, 246, 255, 0.2),
                0 0 8px rgba(0, 246, 255, 0.15);
        }

        /* Tube bottom ellipse for realistic 3D perspective */
        #player1-play-tube::after, #player2-play-tube::after {
            content: '';
            position: absolute;
            bottom: -6px;
            left: 0;
            width: 100px;
            height: 12px;
            background: radial-gradient(ellipse at center, rgba(0, 246, 255, 0.15) 0%, rgba(0, 246, 255, 0.10) 50%, rgba(0, 246, 255, 0.05) 100%);
            border-radius: 50%;
            box-shadow: 
                inset 0 -2px 6px rgba(0, 246, 255, 0.2),
                0 0 8px rgba(0, 246, 255, 0.15);
        }

        /* Obstacles container */
        #player1-obstacles-container, #player2-obstacles-container {
            position: relative;
            width: 100%;
            height: 100%;
        }

        /* Hoop assembly - exact copy from single player */
        #player1-hoop-assembly, #player2-hoop-assembly {
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 120px;
        }

        /* Basketball Hoop Design - exact copy from single player */
        #player1-backboard, #player2-backboard {
            position: absolute;
            bottom: 35px;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            height: 80px;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 8px;
        }

        #player1-backboard::before, #player2-backboard::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 3px;
            height: 60%;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4));
            border-radius: 2px;
            box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.3);
        }

        #player1-hoop, #player2-hoop {
            position: absolute;
            top: 35px;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 80px;
        }

        #player1-rim-back, #player1-rim-front, #player2-rim-back, #player2-rim-front {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 90px;
            height: 18px;
            border: 4px solid #f12f10;
            border-radius: 50%;
            box-sizing: border-box;
            background: transparent;
            box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), inset 0 -2px 4px rgba(0, 0, 0, 0.3), 0 3px 6px rgba(0, 0, 0, 0.2);
        }

        #player1-rim-front, #player2-rim-front {
            z-index: 12;
        }

        #player1-rim-back, #player2-rim-back {
            z-index: 8;
            opacity: 0.7;
            transform: translateX(-50%) translateY(-2px);
        }

        #player1-net-back, #player1-net-front, #player2-net-back, #player2-net-front {
            position: absolute;
            top: -2px; /* Connect to TOP of back rim */
            left: 50%;
            transform: translateX(-50%) translateY(-2px); /* Match back rim offset */
            width: 90px; /* Match rim width */
            height: 75px;
            transform-style: preserve-3d;
            pointer-events: none;
        }

        #player1-net-back, #player2-net-back {
            z-index: 9; /* Behind the ball but in front of back rim */
        }

        #player1-net-front, #player2-net-front {
            display: none; /* No longer needed */
        }

        /* Vertical strings with realistic cone shape */
        #player1-net-back .net-string, #player2-net-back .net-string {
            position: absolute;
            width: 2px;
            height: 75px;
            background: linear-gradient(180deg, #fff 0%, #ddd 100%);
            opacity: 0.9;
            transform-origin: top center;
            top: 0; /* Start at net container top which is at rim bottom */
        }

        /* Only animate the bottom part of strings */
        #player1-net-back .net-string::after, #player2-net-back .net-string::after {
            content: '';
            position: absolute;
            top: 30%; /* Start animation below attachment point */
            left: 0;
            width: 100%;
            height: 70%;
            background: inherit;
            transform-origin: top center;
            animation: stringWave 2s ease-in-out infinite;
        }

        /* Position strings around the rim circumference - following elliptical curve */
        #player1-net-back .net-string:nth-child(1), #player2-net-back .net-string:nth-child(1) { 
            left: 5px; 
            top: 8.5px; /* Lower on far left of ellipse */
            transform: rotate(-12deg);
        }
        #player1-net-back .net-string:nth-child(1)::after, #player2-net-back .net-string:nth-child(1)::after {
            animation-delay: 0s;
        }
        
        #player1-net-back .net-string:nth-child(2), #player2-net-back .net-string:nth-child(2) { 
            left: 15px; 
            top: 7.5px; /* Slightly lower */
            transform: rotate(-9deg);
        }
        #player1-net-back .net-string:nth-child(2)::after, #player2-net-back .net-string:nth-child(2)::after {
            animation-delay: 0.1s;
        }
        
        #player1-net-back .net-string:nth-child(3), #player2-net-back .net-string:nth-child(3) { 
            left: 25px; 
            top: 6.5px; /* Near the top of ellipse */
            transform: rotate(-6deg);
        }
        #player1-net-back .net-string:nth-child(3)::after, #player2-net-back .net-string:nth-child(3)::after {
            animation-delay: 0.2s;
        }
        
        #player1-net-back .net-string:nth-child(4), #player2-net-back .net-string:nth-child(4) { 
            left: 35px; 
            top: 5.5px; /* Top of ellipse */
            transform: rotate(-3deg);
        }
        #player1-net-back .net-string:nth-child(4)::after, #player2-net-back .net-string:nth-child(4)::after {
            animation-delay: 0.3s;
        }
        
        #player1-net-back .net-string:nth-child(5), #player2-net-back .net-string:nth-child(5) { 
            left: 44px; 
            top: 5.5px; /* Top center of ellipse */
            transform: rotate(0deg);
        }
        #player1-net-back .net-string:nth-child(5)::after, #player2-net-back .net-string:nth-child(5)::after {
            animation-delay: 0.4s;
        }
        
        #player1-net-back .net-string:nth-child(6), #player2-net-back .net-string:nth-child(6) { 
            left: 53px; 
            top: 5.5px; /* Top of ellipse */
            transform: rotate(3deg);
        }
        #player1-net-back .net-string:nth-child(6)::after, #player2-net-back .net-string:nth-child(6)::after {
            animation-delay: 0.5s;
        }
        
        #player1-net-back .net-string:nth-child(7), #player2-net-back .net-string:nth-child(7) { 
            left: 63px; 
            top: 6.5px; /* Starting to go lower */
            transform: rotate(6deg);
        }
        #player1-net-back .net-string:nth-child(7)::after, #player2-net-back .net-string:nth-child(7)::after {
            animation-delay: 0.6s;
        }
        
        #player1-net-back .net-string:nth-child(8), #player2-net-back .net-string:nth-child(8) { 
            left: 73px; 
            top: 7.5px; /* Lower on the ellipse */
            transform: rotate(9deg);
        }
        #player1-net-back .net-string:nth-child(8)::after, #player2-net-back .net-string:nth-child(8)::after {
            animation-delay: 0.7s;
        }
        
        #player1-net-back .net-string:nth-child(9), #player2-net-back .net-string:nth-child(9) { 
            left: 83px; 
            top: 8.5px; /* Lowest point on far right */
            transform: rotate(12deg);
        }
        #player1-net-back .net-string:nth-child(9)::after, #player2-net-back .net-string:nth-child(9)::after {
            animation-delay: 0.8s;
        }

        /* Horizontal net rings - elliptical shape */
        #player1-net-back .net-horizontal, #player2-net-back .net-horizontal {
            position: absolute;
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, #fff 10%, #fff 90%, transparent 100%);
            opacity: 0.8;
            border-radius: 50%;
            transform: rotateX(60deg);
        }

        /* Create cone shape with decreasing ring sizes */
        #player1-net-back .net-horizontal:nth-child(10), #player2-net-back .net-horizontal:nth-child(10) { 
            top: 8px; 
            width: 86px;
            left: 2px;
        }
        #player1-net-back .net-horizontal:nth-child(11), #player2-net-back .net-horizontal:nth-child(11) { 
            top: 15px; 
            width: 80px;
            left: 5px;
        }
        #player1-net-back .net-horizontal:nth-child(12), #player2-net-back .net-horizontal:nth-child(12) { 
            top: 22px; 
            width: 74px;
            left: 8px;
        }
        #player1-net-back .net-horizontal:nth-child(13), #player2-net-back .net-horizontal:nth-child(13) { 
            top: 29px; 
            width: 68px;
            left: 11px;
        }
        #player1-net-back .net-horizontal:nth-child(14), #player2-net-back .net-horizontal:nth-child(14) { 
            top: 36px; 
            width: 62px;
            left: 14px;
        }
        #player1-net-back .net-horizontal:nth-child(15), #player2-net-back .net-horizontal:nth-child(15) { 
            top: 43px; 
            width: 56px;
            left: 17px;
        }
        #player1-net-back .net-horizontal:nth-child(16), #player2-net-back .net-horizontal:nth-child(16) { 
            top: 50px; 
            width: 50px;
            left: 20px;
        }
        #player1-net-back .net-horizontal:nth-child(17), #player2-net-back .net-horizontal:nth-child(17) { 
            top: 57px; 
            width: 44px;
            left: 23px;
        }

        /* Apply same styling to single player elements */
        .game-wrapper #game-container {
            width: 100%;
            height: 100%;
            position: relative;
            background: linear-gradient(180deg, 
                rgba(13, 12, 34, 0.8) 0%, 
                rgba(28, 26, 58, 0.9) 40%, 
                rgba(70, 34, 85, 0.8) 100%);
            border: 2px solid var(--court-color);
            border-radius: 15px;
            overflow: hidden;
        }

        /* Burger Menu Button Styles */
        .menu-button {
            width: 40px;
            height: 40px;
            background: rgba(0, 0, 0, 0.7);
            border: 2px solid var(--lines-color);
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
            flex-shrink: 0;
            padding: 0;
        }

        /* Single player menu button in header */
        .singleplayer-container .player-hud .menu-button {
            margin-left: 15px;
        }

        /* Multiplayer menu button in battle dashboard */
        .battle-dashboard .menu-button {
            position: absolute;
            top: 15px;
            right: 20px;
        }

        .menu-button:hover {
            background: rgba(0, 246, 255, 0.2);
            transform: scale(1.1);
            box-shadow: 0 4px 15px rgba(0, 246, 255, 0.4);
        }

        .menu-button:active {
            transform: scale(0.95);
        }

        /* Burger Lines Animation */
        .burger-lines {
            display: flex;
            flex-direction: column;
            width: 20px;
            height: 14px;
            justify-content: space-between;
        }

        .burger-lines span {
            width: 100%;
            height: 2px;
            background: var(--lines-color);
            transition: all 0.3s ease;
            border-radius: 1px;
        }

        .menu-button:hover .burger-lines span {
            background: #fff;
        }

        /* Right Sidebar Styles */
        .right-sidebar {
            position: fixed;
            top: 0;
            right: 0;
            width: 100vw;
            height: 100vh;
            z-index: 10000;
            display: flex;
            justify-content: flex-end;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .right-sidebar:not(.hidden) {
            pointer-events: all;
            opacity: 1;
        }

        .sidebar-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(3px);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .right-sidebar:not(.hidden) .sidebar-overlay {
            opacity: 1;
        }

        .sidebar-content {
            width: 300px;
            height: 100vh;
            background: linear-gradient(135deg, 
                rgba(13, 12, 34, 0.95) 0%, 
                rgba(28, 26, 58, 0.95) 40%, 
                rgba(70, 34, 85, 0.95) 100%);
            border-left: 2px solid var(--lines-color);
            box-shadow: -5px 0 25px rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            transform: translateX(100%);
            transition: transform 0.3s ease;
            position: relative;
            z-index: 1;
        }

        .right-sidebar:not(.hidden) .sidebar-content {
            transform: translateX(0);
        }

        .sidebar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            border-bottom: 2px solid var(--lines-color);
            background: rgba(0, 0, 0, 0.3);
        }

        .sidebar-title {
            color: var(--lines-color);
            font-size: 1.2em;
            font-weight: bold;
            margin: 0;
            font-family: 'Righteous', cursive;
        }

        .close-sidebar-btn {
            width: 30px;
            height: 30px;
            background: rgba(255, 68, 68, 0.8);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .close-sidebar-btn:hover {
            background: rgba(255, 68, 68, 1);
            transform: scale(1.1);
        }

        .sidebar-menu {
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .sidebar-menu-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 15px 20px;
            background: rgba(0, 0, 0, 0.3);
            border: 2px solid transparent;
            border-radius: 10px;
            color: #fff;
            font-size: 1.1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: left;
            font-family: 'Righteous', cursive;
        }

        .sidebar-menu-item:hover {
            background: rgba(0, 246, 255, 0.2);
            border-color: var(--lines-color);
            transform: translateX(-5px);
            box-shadow: 5px 0 15px rgba(0, 246, 255, 0.3);
        }

        .sidebar-menu-item:active {
            transform: translateX(-3px) scale(0.98);
        }

        .menu-icon {
            font-size: 1.3em;
            width: 24px;
            text-align: center;
        }

        .menu-text {
            flex: 1;
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            .sidebar-content {
                width: 250px;
            }
        }

        /* Pause Popup Styles */
        .pause-container {
            max-width: 400px;
            text-align: center;
        }

        .pause-container .popup-title {
            color: var(--lines-color);
            margin-bottom: 20px;
            font-size: 2em;
        }

        .pause-container .popup-message {
            color: #fff;
            font-size: 1.1em;
            margin-bottom: 30px;
            line-height: 1.5;
        }

        /* Single player ball styling */
        /* Duplicate ball style removed - using the 50px size defined earlier */

        /* Single player play tube - matches multiplayer */
        #play-tube {
            position: absolute;
            top: 100px;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            bottom: 140px;
            background: linear-gradient(to bottom, rgba(0, 246, 255, 0.08) 0%, rgba(0, 246, 255, 0.03) 50%, rgba(0, 246, 255, 0.08) 100%);
            border-left: 2px solid rgba(0, 246, 255, 0.25);
            border-right: 2px solid rgba(0, 246, 255, 0.25);
            box-shadow: inset 0 0 20px rgba(0, 246, 255, 0.1), 0 0 15px rgba(0, 246, 255, 0.15);
        }

        /* Single player obstacles container */
        #obstacles-container {
            position: relative;
            width: 100%;
            height: 100%;
        }

        /* Single player hoop assembly */
        /* Single player hoop-assembly - matches multiplayer */
        #hoop-assembly {
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 120px;
        }

        /* Single player backboard styling - matches multiplayer */
        #backboard {
            position: absolute;
            bottom: 35px;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            height: 80px;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 8px;
        }

        /* Single player hoop styling - matches multiplayer */
        #hoop {
            position: absolute;
            top: 35px;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 80px;
        }

        /* Single player rim styling - matches multiplayer */
        #rim-back, #rim-front {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 90px;
            height: 18px;
            border: 4px solid #f12f10;
            border-radius: 50%;
            box-sizing: border-box;
            background: transparent;
            box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), inset 0 -2px 4px rgba(0, 0, 0, 0.3), 0 3px 6px rgba(0, 0, 0, 0.2);
        }

        #rim-front {
            z-index: 12;
        }

        #rim-back {
            z-index: 8;
            opacity: 0.7;
            transform: translateX(-50%) translateY(-2px);
        }

        /* Single player net styling - matches multiplayer */
        #net-back, #net-front {
            position: absolute;
            top: -2px; /* Connect to TOP of back rim */
            left: 50%;
            transform: translateX(-50%) translateY(-2px); /* Match back rim offset */
            width: 90px; /* Match rim width */
            height: 75px;
            transform-style: preserve-3d;
            pointer-events: none;
        }

        #net-back {
            z-index: 9; /* Behind the ball but in front of back rim */
        }

        #net-front {
            display: none; /* No longer needed */
        }

        /* Single player net strings - matches multiplayer */
        #net-back .net-string {
            position: absolute;
            width: 2px;
            height: 75px;
            background: linear-gradient(180deg, #fff 0%, #ddd 100%);
            opacity: 0.9;
            transform-origin: top center;
            top: 0; /* Start at net container top which is at rim bottom */
        }

        /* Only animate the bottom part of strings */
        #net-back .net-string::after {
            content: '';
            position: absolute;
            top: 30%; /* Start animation below attachment point */
            left: 0;
            width: 100%;
            height: 70%;
            background: inherit;
            transform-origin: top center;
            animation: stringWave 2s ease-in-out infinite;
        }

        /* Position strings around the rim circumference - following elliptical curve */
        #net-back .net-string:nth-child(1) { 
            left: 5px; 
            top: 8.5px; /* Lower on far left of ellipse */
            transform: rotate(-12deg);
        }
        #net-back .net-string:nth-child(1)::after {
            animation-delay: 0s;
        }
        
        #net-back .net-string:nth-child(2) { 
            left: 15px; 
            top: 7.5px; /* Slightly lower */
            transform: rotate(-9deg);
        }
        #net-back .net-string:nth-child(2)::after {
            animation-delay: 0.1s;
        }
        
        #net-back .net-string:nth-child(3) { 
            left: 25px; 
            top: 6.5px; /* Near the top of ellipse */
            transform: rotate(-6deg);
        }
        #net-back .net-string:nth-child(3)::after {
            animation-delay: 0.2s;
        }
        
        #net-back .net-string:nth-child(4) { 
            left: 35px; 
            top: 5.5px; /* Top of ellipse */
            transform: rotate(-3deg);
        }
        #net-back .net-string:nth-child(4)::after {
            animation-delay: 0.3s;
        }
        
        #net-back .net-string:nth-child(5) { 
            left: 44px; 
            top: 5.5px; /* Top center of ellipse */
            transform: rotate(0deg);
        }
        #net-back .net-string:nth-child(5)::after {
            animation-delay: 0.4s;
        }
        
        #net-back .net-string:nth-child(6) { 
            left: 53px; 
            top: 5.5px; /* Top of ellipse */
            transform: rotate(3deg);
        }
        #net-back .net-string:nth-child(6)::after {
            animation-delay: 0.5s;
        }
        
        #net-back .net-string:nth-child(7) { 
            left: 63px; 
            top: 6.5px; /* Starting to go lower */
            transform: rotate(6deg);
        }
        #net-back .net-string:nth-child(7)::after {
            animation-delay: 0.6s;
        }
        
        #net-back .net-string:nth-child(8) { 
            left: 73px; 
            top: 7.5px; /* Lower on the ellipse */
            transform: rotate(9deg);
        }
        #net-back .net-string:nth-child(8)::after {
            animation-delay: 0.7s;
        }
        
        #net-back .net-string:nth-child(9) { 
            left: 83px; 
            top: 8.5px; /* Lowest point on far right */
            transform: rotate(12deg);
        }
        #net-back .net-string:nth-child(9)::after {
            animation-delay: 0.8s;
        }

        /* Horizontal net rings - elliptical shape */
        #net-back .net-horizontal {
            position: absolute;
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, #fff 10%, #fff 90%, transparent 100%);
            opacity: 0.8;
            border-radius: 50%;
            transform: rotateX(60deg);
        }

        /* Create cone shape with decreasing ring sizes */
        #net-back .net-horizontal:nth-child(10) { 
            top: 8px; 
            width: 86px;
            left: 2px;
        }
        #net-back .net-horizontal:nth-child(11) { 
            top: 15px; 
            width: 80px;
            left: 5px;
        }
        #net-back .net-horizontal:nth-child(12) { 
            top: 22px; 
            width: 74px;
            left: 8px;
        }
        #net-back .net-horizontal:nth-child(13) { 
            top: 29px; 
            width: 68px;
            left: 11px;
        }
        #net-back .net-horizontal:nth-child(14) { 
            top: 36px; 
            width: 62px;
            left: 14px;
        }
        #net-back .net-horizontal:nth-child(15) { 
            top: 43px; 
            width: 56px;
            left: 17px;
        }
        #net-back .net-horizontal:nth-child(16) { 
            top: 50px; 
            width: 50px;
            left: 20px;
        }
        #net-back .net-horizontal:nth-child(17) { 
            top: 57px; 
            width: 44px;
            left: 23px;
        }

        /* Duplicate net horizontal styling removed - using the correct cone-shaped rings defined above */

        .start-ball-btn {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #00f6ff, #00a8cc);
            border: none;
            color: #0d0c22;
            padding: 12px 25px;
            border-radius: 25px;
            font-size: 1.1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 246, 255, 0.4);
        }

        .player2-side .start-ball-btn {
            background: linear-gradient(135deg, #f90059, #cc0044);
            color: white;
            box-shadow: 0 4px 15px rgba(249, 0, 89, 0.4);
        }

        .start-ball-btn:hover {
            transform: translateX(-50%) translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 246, 255, 0.6);
        }

        .player2-side .start-ball-btn:hover {
            box-shadow: 0 6px 20px rgba(249, 0, 89, 0.6);
        }

        /* Responsive Design for Multiplayer */
        @media (max-width: 1200px) {
            .multiplayer-setup-container {
                flex-direction: column;
                gap: 30px;
                align-items: center;
            }

            .vs-divider {
                margin: 0;
                transform: rotate(90deg);
            }
        }

        @media (max-width: 768px) {
            .player-game-area {
                flex-direction: column;
            }

            .player1-calculator, .player2-calculator {
                flex: none;
                height: 200px;
            }

            .player1-game, .player2-game {
                flex: 1;
            }

            .mode-options {
                flex-direction: column;
                align-items: center;
            }

            .mode-button {
                min-width: 200px;
            }
        }

        /* Multiplayer Start Popup */
        .multiplayer-start-container {
            background: linear-gradient(145deg, #1c1a3a, #462255);
            border: 3px solid #00f6ff;
            border-radius: 20px;
            padding: 40px;
            text-align: center;
            max-width: 600px;
            width: 90%;
        }

        .players-ready {
            display: flex;
            justify-content: space-around;
            align-items: center;
            margin: 30px 0;
            gap: 20px;
        }

        .player-ready {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .ready-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            border: 4px solid #00f6ff;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(145deg, #1c1a3a, #462255);
            overflow: hidden;
            box-shadow: 0 0 20px rgba(0, 246, 255, 0.3);
        }

        .ready-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .ready-name {
            font-size: 1.3em;
            font-weight: bold;
            color: white;
        }

        .ready-status {
            font-size: 1.1em;
            color: #00ff88;
            font-weight: bold;
            text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
        }

        .vs-ready {
            background: linear-gradient(135deg, #f90059, #ff6600);
            color: white;
            border-radius: 50%;
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5em;
            font-weight: bold;
            box-shadow: 0 0 20px rgba(249, 0, 89, 0.5);
            animation: vs-ready-pulse 1.5s ease-in-out infinite;
        }

        @keyframes vs-ready-pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(249, 0, 89, 0.8); }
        }

        .start-round-btn {
            background: linear-gradient(135deg, #00f6ff, #00a8cc);
            border: none;
            color: #0d0c22;
            padding: 20px 50px;
            border-radius: 40px;
            font-size: 1.4em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 6px 20px rgba(0, 246, 255, 0.4);
            margin-top: 20px;
            text-transform: uppercase;
        }

        .start-round-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(0, 246, 255, 0.6);
            background: linear-gradient(135deg, #00a8cc, #00f6ff);
        }

        /* Countdown Overlay */
        .countdown-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .countdown-overlay.hidden {
            display: none;
        }

        .countdown-display {
            font-size: 8em;
            font-weight: bold;
            color: #00f6ff;
            text-shadow: 0 0 30px rgba(0, 246, 255, 0.8);
            animation: countdown-pulse 1s ease-in-out;
        }

        .countdown-text {
            font-size: 2em;
            font-weight: bold;
            color: white;
            margin-top: 20px;
            text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
        }

        @keyframes countdown-pulse {
            0% { 
                transform: scale(1.5);
                opacity: 0;
            }
            50% { 
                transform: scale(1.2);
                opacity: 1;
            }
            100% { 
                transform: scale(1);
                opacity: 1;
            }
        }

        .countdown-display.go {
            color: #00ff88;
            text-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
        }

        .countdown-display.final {
            animation: countdown-final 1s ease-in-out;
        }

        @keyframes countdown-final {
            0% { 
                transform: scale(1.5);
                opacity: 1;
            }
            70% { 
                transform: scale(1.8);
                opacity: 1;a
            }
            100% { 
                transform: scale(2);
                opacity: 0;
            }
        }

        /* Celebration Popup Styles */
        .celebration-container {
            max-width: 600px;
            background: linear-gradient(135deg, var(--court-color) 0%, #0d0c22 100%);
            border: 3px solid var(--lines-color);
            border-radius: 20px;
            padding: 40px;
            text-align: center;
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 40px rgba(0, 246, 255, 0.4), inset 0 0 60px rgba(0, 246, 255, 0.1);
        }
        
        .celebration-container::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: repeating-linear-gradient(
                45deg,
                transparent,
                transparent 20px,
                rgba(0, 246, 255, 0.03) 20px,
                rgba(0, 246, 255, 0.03) 40px
            );
            pointer-events: none;
            animation: court-lines-move 20s linear infinite;
        }
        
        @keyframes court-lines-move {
            0% { transform: translate(0, 0); }
            100% { transform: translate(40px, 40px); }
        }

        .celebration-content {
            position: relative;
            z-index: 2;
        }

        .celebration-title {
            font-size: 3em;
            margin-bottom: 20px;
            color: var(--lines-color);
            text-shadow: 0 0 20px rgba(0, 246, 255, 0.8), 0 4px 8px rgba(0, 0, 0, 0.5);
            animation: celebration-bounce 2s ease-in-out infinite;
            font-family: 'Righteous', sans-serif;
            text-transform: uppercase;
            letter-spacing: 3px;
        }

        .celebration-confetti {
            font-size: 2em;
            position: absolute;
            top: 20px;
            right: 20px;
            animation: confetti-fall 3s ease-in-out infinite;
        }

        .winner-section {
            margin: 30px 0;
        }

        .winner-avatar-container {
            position: relative;
            display: inline-block;
            margin-bottom: 20px;
        }

        .celebration-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 6px solid var(--ball-orange);
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 140, 0, 0.1);
            backdrop-filter: blur(10px);
            animation: winner-glow 2s ease-in-out infinite alternate;
            box-shadow: 0 0 30px rgba(255, 140, 0, 0.5);
        }

        .celebration-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }

        .celebration-avatar .avatar-placeholder {
            font-size: 3em;
        }

        .winner-crown {
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 2.5em;
            animation: crown-bounce 1.5s ease-in-out infinite;
            filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
        }

        .winner-name {
            font-size: 2.5em;
            color: var(--ball-orange);
            text-shadow: 0 0 15px rgba(255, 140, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
            margin: 0;
            font-family: 'Righteous', sans-serif;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .final-scores {
            margin: 30px 0;
            padding: 20px;
            background: rgba(0, 246, 255, 0.05);
            border: 2px solid rgba(0, 246, 255, 0.3);
            border-radius: 15px;
            backdrop-filter: blur(10px);
            box-shadow: inset 0 0 20px rgba(0, 246, 255, 0.1);
        }

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

        .final-score-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            flex: 1;
        }

        .final-player-info {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .final-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            border: 3px solid rgba(255, 255, 255, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.1);
        }

        .final-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }

        .final-avatar .avatar-placeholder {
            font-size: 1.5em;
        }

        .final-player-name {
            color: #fff;
            font-size: 1.2em;
            font-weight: bold;
        }

        .final-score {
            font-size: 2.5em;
            font-weight: bold;
            color: var(--ball-orange);
            text-shadow: 0 0 10px rgba(255, 140, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
            font-family: 'Righteous', sans-serif;
        }

        .vs-final {
            font-size: 1.5em;
            color: #fff;
            font-weight: bold;
            opacity: 0.7;
        }

        .celebration-buttons {
            display: flex;
            gap: 20px;
            justify-content: center;
            margin-top: 30px;
        }

        .celebration-btn {
            padding: 15px 30px;
            font-size: 1.1em;
            font-weight: bold;
            border: 2px solid transparent;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            font-family: 'Righteous', cursive;
            letter-spacing: 1px;
        }

        .celebration-btn.play-again {
            background: linear-gradient(135deg, var(--bg-color), var(--court-color));
            color: var(--lines-color);
            border-color: var(--lines-color);
            text-shadow: 0 0 8px rgba(0, 246, 255, 0.5);
        }

        .celebration-btn.play-again:hover {
            background: var(--lines-color);
            color: var(--bg-color);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 246, 255, 0.6);
            text-shadow: none;
        }

        .celebration-btn.exit-game {
            background: linear-gradient(135deg, var(--bg-color), var(--court-color));
            color: var(--rim-color);
            border-color: var(--rim-color);
            text-shadow: 0 0 8px rgba(249, 0, 89, 0.5);
        }

        .celebration-btn.exit-game:hover {
            background: var(--rim-color);
            color: #fff;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(249, 0, 89, 0.6);
            text-shadow: none;
        }

        .celebration-btn.view-answers {
            background: linear-gradient(135deg, var(--bg-color), var(--court-color));
            color: #fff;
            border-color: var(--block-color);
            text-shadow: 0 0 8px rgba(70, 34, 85, 0.5);
        }

        .celebration-btn.view-answers:hover {
            background: var(--block-color);
            color: #fff;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(70, 34, 85, 0.6);
            text-shadow: none;
        }

        /* Animations */
        @keyframes celebration-bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        @keyframes confetti-fall {
            0% { transform: translateY(0) rotate(0deg); }
            100% { transform: translateY(20px) rotate(360deg); }
        }

        @keyframes winner-glow {
            0% { 
                box-shadow: 0 0 30px rgba(255, 140, 0, 0.5), 0 0 60px rgba(0, 246, 255, 0.2); 
                border-color: var(--ball-orange);
            }
            100% { 
                box-shadow: 0 0 50px rgba(255, 140, 0, 0.8), 0 0 80px rgba(0, 246, 255, 0.4); 
                border-color: var(--lines-color);
            }
        }

        @keyframes crown-bounce {
            0%, 100% { transform: translateX(-50%) translateY(0); }
            50% { transform: translateX(-50%) translateY(-5px); }
        }

        /* Answers Review Popup Styles */
        .answers-container {
            max-width: 700px;
            max-height: 80vh;
            overflow-y: auto;
            position: relative;
        }

        .close-button-top-right {
            position: absolute;
            top: 15px;
            right: 15px;
            width: 30px;
            height: 30px;
            background: rgba(255, 68, 68, 0.8);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            transition: all 0.3s ease;
        }

        .close-button-top-right:hover {
            background: rgba(255, 68, 68, 1);
            transform: scale(1.1);
        }

        .close-button-top-right:active {
            transform: scale(0.95);
        }

        .player-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.2);
        }

        .player-tab {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 20px;
            background: transparent;
            border: none;
            border-bottom: 3px solid transparent;
            color: rgba(255, 255, 255, 0.7);
            font-size: 1.1em;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: -2px;
        }

        .player-tab:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.1);
        }

        .player-tab.active {
            color: #fff;
            border-bottom-color: var(--button-up-bg);
            background: rgba(255, 255, 255, 0.1);
        }

        .tab-avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .tab-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .tab-avatar .avatar-placeholder {
            font-size: 1em;
        }

        .answers-content {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 10px;
            padding: 20px;
        }

        .player-answers {
            display: none;
        }

        .player-answers.active {
            display: block;
        }

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

        .answers-header h3 {
            color: #fff;
            margin: 0 0 10px 0;
            font-size: 1.5em;
        }

        .answers-stats {
            display: flex;
            gap: 20px;
            flex-wrap: wrap;
        }

        .stat-item {
            background: rgba(255, 255, 255, 0.1);
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.9em;
            color: #fff;
        }

        .answers-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-height: 400px;
            overflow-y: auto;
        }

        .answer-item {
            background: rgba(255, 255, 255, 0.1);
            padding: 15px;
            border-radius: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .answer-item:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        .answer-item.correct {
            border-left: 4px solid #4ade80;
        }

        .answer-item.incorrect {
            border-left: 4px solid #f87171;
        }

        .answer-equation {
            font-size: 1.2em;
            font-weight: bold;
            color: #fff;
        }

        .answer-status {
            font-size: 1.5em;
        }

        .answer-time {
            font-size: 0.9em;
            color: rgba(255, 255, 255, 0.7);
            margin-left: 10px;
        }

        /* Scrollbar styling for answers list */
        .answers-list::-webkit-scrollbar {
            width: 6px;
        }

        .answers-list::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
        }

        .answers-list::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.3);
            border-radius: 3px;
        }

        .answers-list::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.5);
        }


/* Multiple Choice Styles */
.multiple-choice-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(29, 26, 58, 0.9);
    border-radius: 15px;
    border: 2px solid var(--lines-color);
    animation: slideUp 0.3s ease-out;
}

.multiple-choice-container h3 {
    color: var(--lines-color);
    font-size: 1.2em;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.mc-option-btn {
    width: 200px;
    padding: 15px 25px;
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(145deg, #462255, #29265f);
    color: white;
    border: 2px solid var(--lines-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Righteous', sans-serif;
}

.mc-option-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: linear-gradient(145deg, #5a2d6d, #3a377f);
    box-shadow: 0 0 20px rgba(0, 246, 255, 0.5);
}

.mc-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.mc-option-btn.correct {
    background: linear-gradient(145deg, #00c851, #00a040);
    border-color: #00ff00;
    animation: correctPulse 0.5s ease;
}

.mc-option-btn.incorrect {
    background: linear-gradient(145deg, #ff4444, #cc0000);
    border-color: #ff0000;
    animation: incorrectShake 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================== Turn-Based System Styles ================== */

/* Active player styling */
.active-player {
    opacity: 1 \!important;
    border: 3px solid var(--lines-color) \!important;
    box-shadow: 0 0 25px rgba(0, 246, 255, 0.6) \!important;
    animation: activePlayerPulse 2s ease-in-out infinite;
}

/* Inactive player styling */
.inactive-player {
    opacity: 0.4 \!important;
    border: 2px solid rgba(255, 255, 255, 0.2) \!important;
    box-shadow: none \!important;
    filter: grayscale(50%);
    pointer-events: none; /* Disable interactions for inactive player */
}

/* Active player pulse animation */
@keyframes activePlayerPulse {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(0, 246, 255, 0.6);
    }
    50% { 
        box-shadow: 0 0 35px rgba(0, 246, 255, 0.9);
    }
}

/* Turn indicator */
.turn-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, var(--lines-color), var(--ball-orange));
    color: var(--bg-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1em;
    z-index: 100;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 246, 255, 0.4);
}

/* Disable calculator for inactive player */
.inactive-player .calculator-controls {
    pointer-events: none \!important;
    opacity: 0.3 \!important;
}

.inactive-player .calc-btn {
    cursor: not-allowed \!important;
    background: rgba(100, 100, 100, 0.3) \!important;
}