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

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Rajdhani', sans-serif;
            background: #0a0a0f;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            color: white;
            flex-direction: column;
            padding: 10px;
            overflow-x: hidden;
        }

        #particles-canvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
        }

        .ambient-glow {
            position: fixed;
            width: 600px;
            height: 600px;
            border-radius: 50%;
            filter: blur(150px);
            opacity: 0.15;
            z-index: -1;
            animation: float 8s ease-in-out infinite;
        }

        .ambient-glow-1 {
            top: -200px;
            left: -200px;
            background: #4a90e2;
        }

        .ambient-glow-2 {
            bottom: -200px;
            right: -200px;
            background: #ff6b6b;
            animation-delay: -4s;
        }

        @keyframes float {
            0%, 100% { transform: translate(0, 0); }
            50% { transform: translate(30px, 30px); }
        }

        h1 {
            margin-bottom: 20px;
            font-size: 36px;
            font-family: 'Orbitron', sans-serif;
            font-weight: 900;
            letter-spacing: 4px;
            text-transform: uppercase;
            background: linear-gradient(135deg, #00f2ff 0%, #4a90e2 50%, #ff6b6b 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-shadow: none;
            filter: drop-shadow(0 0 20px rgba(74, 144, 226, 0.5));
            animation: titleGlow 3s ease-in-out infinite;
        }

        @keyframes titleGlow {
            0%, 100% { filter: drop-shadow(0 0 20px rgba(74, 144, 226, 0.5)); }
            50% { filter: drop-shadow(0 0 30px rgba(74, 144, 226, 0.8)); }
        }

        .game-container {
            display: flex;
            gap: 30px;
            padding: 25px;
            align-items: flex-start;
            background: rgba(255, 255, 255, 0.02);
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
        }

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

        .player-title {
            text-align: center;
            font-size: 20px;
            font-weight: 700;
            padding: 12px 20px;
            border-radius: 10px;
            font-family: 'Orbitron', sans-serif;
            letter-spacing: 2px;
            text-transform: uppercase;
            position: relative;
            overflow: hidden;
        }

        .player-title::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            animation: shimmer 3s infinite;
        }

        @keyframes shimmer {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        .player-1 .player-title {
            background: linear-gradient(135deg, rgba(0, 242, 255, 0.2), rgba(74, 144, 226, 0.3));
            border: 2px solid #00f2ff;
            box-shadow: 0 0 20px rgba(0, 242, 255, 0.3), inset 0 0 20px rgba(0, 242, 255, 0.1);
            color: #00f2ff;
        }

        .player-2 .player-title {
            background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 82, 82, 0.3));
            border: 2px solid #ff6b6b;
            box-shadow: 0 0 20px rgba(255, 107, 107, 0.3), inset 0 0 20px rgba(255, 107, 107, 0.1);
            color: #ff6b6b;
        }

        .game-board-wrapper {
            display: flex;
            gap: 15px;
        }

        .game-board {
            position: relative;
            flex-shrink: 0;
        }

        .game-canvas {
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(10, 10, 26, 0.95) 0%, rgba(20, 20, 40, 0.95) 100%);
            position: relative;
            overflow: hidden;
        }

        .game-canvas::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 12px;
            padding: 2px;
            background: linear-gradient(135deg, #00f2ff, #4a90e2);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            pointer-events: none;
        }

        .player-2 .game-canvas::before {
            background: linear-gradient(135deg, #ff6b6b, #ff5252);
        }

        .game-canvas::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 12px;
            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(74, 144, 226, 0.3);
            pointer-events: none;
        }

        .player-2 .game-canvas::after {
            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 107, 107, 0.3);
        }

        .side-panel {
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-width: 170px;
            justify-content: flex-start;
            flex-grow: 1;
        }

        .panel-section {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
            padding: 15px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(5px);
            transition: all 0.3s ease;
            flex: 1;
        }

        .panel-section:hover {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
            border-color: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
        }

        .panel-section h3 {
            margin-bottom: 10px;
            font-family: 'Orbitron', sans-serif;
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 2px;
            background: linear-gradient(90deg, #00f2ff, #4a90e2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .score-display {
            font-size: 36px;
            font-weight: 700;
            font-family: 'Orbitron', sans-serif;
            color: #ffd700;
            text-align: center;
            text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }

        .level-display {
            font-size: 36px;
            font-weight: 700;
            font-family: 'Orbitron', sans-serif;
            color: #00ff88;
            text-align: center;
            text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
        }

        .lines-display {
            font-size: 36px;
            font-weight: 700;
            font-family: 'Orbitron', sans-serif;
            color: #ff6b6b;
            text-align: center;
            text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
        }

        .next-canvas {
            display: block;
            margin: 0 auto;
            background: linear-gradient(180deg, rgba(10, 10, 26, 0.9) 0%, rgba(20, 20, 40, 0.9) 100%);
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .controls-info {
            font-size: 11px;
            line-height: 1.8;
        }

        .controls-info p {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 4px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }

        .controls-info p:last-child {
            border-bottom: none;
        }

        .controls-info span {
            background: linear-gradient(135deg, rgba(74, 144, 226, 0.4), rgba(74, 144, 226, 0.2));
            padding: 3px 8px;
            border-radius: 4px;
            font-family: 'Orbitron', sans-serif;
            font-size: 10px;
            font-weight: 600;
            border: 1px solid rgba(74, 144, 226, 0.3);
        }

        .center-panel {
            display: flex;
            flex-direction: column;
            gap: 20px;
            justify-content: center;
            min-width: 160px;
        }

        .battle-status {
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
            padding: 20px;
            border-radius: 15px;
            border: 2px solid rgba(255, 215, 0, 0.3);
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .battle-status::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.1), transparent);
            animation: rotate 4s linear infinite;
        }

        @keyframes rotate {
            100% { transform: rotate(360deg); }
        }

        .battle-status h3 {
            color: #ffd700;
            margin-bottom: 15px;
            font-size: 14px;
            font-family: 'Orbitron', sans-serif;
            letter-spacing: 3px;
            position: relative;
            z-index: 1;
        }

        .vs-text {
            font-size: 40px;
            font-weight: 900;
            font-family: 'Orbitron', sans-serif;
            background: linear-gradient(135deg, #ffd700, #ff6b6b);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-shadow: none;
            filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
            position: relative;
            z-index: 1;
            animation: vsPulse 2s ease-in-out infinite;
        }

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

        .buttons {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        button {
            width: 100%;
            padding: 14px 20px;
            font-size: 14px;
            font-weight: 700;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            font-family: 'Orbitron', sans-serif;
            letter-spacing: 2px;
            position: relative;
            overflow: hidden;
        }

        button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s;
        }

        button:hover::before {
            left: 100%;
        }

        .btn-primary {
            background: linear-gradient(135deg, #00f2ff, #4a90e2, #667eea);
            color: #0a0a1a;
            box-shadow: 0 4px 15px rgba(0, 242, 255, 0.3);
        }

        .btn-primary:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 25px rgba(0, 242, 255, 0.5);
        }

        .btn-secondary {
            background: linear-gradient(135deg, #667eea, #764ba2, #ff6b6b);
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .btn-secondary:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
        }

        #soundBtn {
            background: linear-gradient(135deg, #00ff88, #00cc6a);
            color: #0a0a1a;
            box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
        }

        #soundBtn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(0, 255, 136, 0.5);
        }

        .sound-off {
            background: linear-gradient(135deg, #ff6b6b, #ff5252) !important;
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3) !important;
        }

        .btn-pause {
            background: linear-gradient(135deg, #ffd700, #ff9500);
            color: #0a0a1a;
            box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
        }

        .btn-pause:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
        }

        .btn-pause.paused {
            background: linear-gradient(135deg, #00ff88, #00cc6a);
        }

        .game-over-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            backdrop-filter: blur(10px);
        }

        .game-over-content {
            text-align: center;
            padding: 50px 60px;
            background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(10, 10, 26, 0.98));
            border-radius: 25px;
            border: 3px solid;
            border-image: linear-gradient(135deg, #ffd700, #ff6b6b, #00f2ff) 1;
            box-shadow: 0 0 50px rgba(255, 215, 0, 0.3), 0 0 100px rgba(0, 242, 255, 0.1);
            animation: gameOverPulse 2s ease-in-out infinite;
        }

        @keyframes gameOverPulse {
            0%, 100% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.3), 0 0 100px rgba(0, 242, 255, 0.1); }
            50% { box-shadow: 0 0 70px rgba(255, 215, 0, 0.5), 0 0 150px rgba(0, 242, 255, 0.2); }
        }

        .game-over-content h2 {
            font-size: 42px;
            margin-bottom: 25px;
            font-family: 'Orbitron', sans-serif;
            font-weight: 900;
            background: linear-gradient(135deg, #ffd700, #ff6b6b);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: celebratePulse 0.5s ease-in-out infinite;
        }

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

        .winner-text {
            font-size: 32px;
            font-weight: 700;
            font-family: 'Orbitron', sans-serif;
            background: linear-gradient(90deg, #00ff88, #00f2ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 30px;
            text-shadow: none;
        }

        .game-over-content button {
            background: linear-gradient(135deg, #00f2ff, #4a90e2);
            color: #0a0a1a;
            margin-top: 15px;
            padding: 16px 40px;
            font-size: 16px;
        }

        .game-over-content button:hover {
            transform: scale(1.05);
            box-shadow: 0 10px 30px rgba(0, 242, 255, 0.5);
        }

        .attack-indicator {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 28px;
            font-weight: 900;
            font-family: 'Orbitron', sans-serif;
            color: #ff6b6b;
            text-shadow: 0 0 20px rgba(255, 107, 107, 0.8), 0 0 40px rgba(255, 107, 107, 0.5);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s;
            z-index: 10;
        }

        .attack-indicator.show {
            opacity: 1;
            animation: attackPulse 0.5s ease-out;
        }

        @keyframes attackPulse {
            0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
            50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
            100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
        }

        .mode-select-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a0f 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            backdrop-filter: blur(5px);
        }

        .mode-select-content {
            text-align: center;
            padding: 60px 80px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
            border-radius: 30px;
            border: 2px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(20px);
            position: relative;
            overflow: hidden;
        }

        .mode-select-content::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: conic-gradient(from 0deg, transparent, rgba(0, 242, 255, 0.1), transparent, rgba(255, 107, 107, 0.1), transparent);
            animation: bgRotate 10s linear infinite;
        }

        @keyframes bgRotate {
            100% { transform: rotate(360deg); }
        }

        .mode-select-content h1 {
            font-size: 52px;
            margin-bottom: 15px;
            position: relative;
            z-index: 1;
        }

        .mode-select-content .subtitle {
            font-size: 20px;
            color: rgba(255, 255, 255, 0.5);
            margin-bottom: 50px;
            font-family: 'Rajdhani', sans-serif;
            font-weight: 300;
            letter-spacing: 4px;
            position: relative;
            z-index: 1;
        }

        .mode-buttons {
            display: flex;
            gap: 30px;
            flex-wrap: wrap;
            justify-content: center;
            position: relative;
            z-index: 1;
        }

        .difficulty-setting {
            margin-top: 28px;
            display: flex;
            gap: 12px;
            align-items: center;
            justify-content: center;
            font-family: 'Orbitron', sans-serif;
            letter-spacing: 1px;
            position: relative;
            z-index: 1;
        }

        .difficulty-setting label {
            color: rgba(255, 255, 255, 0.85);
            font-size: 13px;
        }

        .difficulty-setting select {
            background: rgba(10, 10, 26, 0.8);
            color: #00f2ff;
            border: 1px solid rgba(0, 242, 255, 0.35);
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 13px;
            font-family: 'Orbitron', sans-serif;
            letter-spacing: 1px;
            outline: none;
        }

        .ai-difficulty-panel {
            margin-top: 0;
            padding: 10px 12px;
            border-radius: 10px;
            background: linear-gradient(135deg, rgba(0, 242, 255, 0.08), rgba(74, 144, 226, 0.06));
            border: 1px solid rgba(0, 242, 255, 0.2);
        }

        .mode-btn {
            padding: 30px 50px;
            font-size: 20px;
            min-width: 220px;
            border-radius: 16px;
            cursor: pointer;
            transition: all 0.4s ease;
            position: relative;
            overflow: hidden;
        }

        .mode-btn-local {
            background: linear-gradient(135deg, #00f2ff, #4a90e2);
            color: #0a0a1a;
            box-shadow: 0 8px 30px rgba(0, 242, 255, 0.3);
        }

        .mode-btn-local:hover {
            transform: translateY(-8px) scale(1.05);
            box-shadow: 0 15px 50px rgba(0, 242, 255, 0.5);
        }

        .mode-btn-online {
            background: linear-gradient(135deg, #667eea, #764ba2, #ff6b6b);
            color: white;
            box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
        }

        .mode-btn-online:hover {
            transform: translateY(-8px) scale(1.05);
            box-shadow: 0 15px 50px rgba(102, 126, 234, 0.5);
        }

        .mode-btn .icon {
            font-size: 48px;
            display: block;
            margin-bottom: 15px;
        }

        .waiting-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            backdrop-filter: blur(10px);
        }

        .waiting-content {
            text-align: center;
        }

        .waiting-content h2 {
            font-size: 36px;
            margin-bottom: 25px;
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            background: linear-gradient(90deg, #ffd700, #ff6b6b);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .spinner {
            width: 70px;
            height: 70px;
            border: 4px solid rgba(255, 255, 255, 0.1);
            border-top-color: #00f2ff;
            border-right-color: #4a90e2;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 30px auto;
            box-shadow: 0 0 30px rgba(0, 242, 255, 0.3);
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .cancel-btn {
            margin-top: 35px;
            background: linear-gradient(135deg, #ff6b6b, #ff5252);
            color: white;
            padding: 14px 35px;
            border: none;
            border-radius: 10px;
            font-family: 'Orbitron', sans-serif;
            font-weight: 600;
            letter-spacing: 2px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .cancel-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 30px rgba(255, 107, 107, 0.5);
        }

        .opponent-preview {
            background: rgba(255, 255, 255, 0.05);
            padding: 10px;
            border-radius: 8px;
            border: 1px dashed rgba(255, 255, 255, 0.2);
        }

        .opponent-preview canvas {
            opacity: 0.7;
        }

        .status-message {
            position: fixed;
            top: 25px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(10, 10, 26, 0.98));
            padding: 18px 40px;
            border-radius: 12px;
            border: 2px solid #00f2ff;
            z-index: 3000;
            display: none;
            font-family: 'Orbitron', sans-serif;
            font-size: 14px;
            letter-spacing: 2px;
            box-shadow: 0 0 30px rgba(0, 242, 255, 0.3);
            animation: statusSlide 0.3s ease-out;
        }

        @keyframes statusSlide {
            from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
            to { transform: translateX(-50%) translateY(0); opacity: 1; }
        }

        @media (max-width: 1000px) {
            .game-container {
                flex-direction: column;
                gap: 20px;
            }

            .game-board-wrapper {
                flex-direction: column;
            }

            .mode-select-content {
                padding: 40px;
            }

            .mode-select-content h1 {
                font-size: 36px;
            }

            .mode-btn {
                padding: 20px 30px;
                font-size: 16px;
                min-width: 180px;
            }
        }