:root {
    --primary: #3c8dbc;
    --primary-light: #87c0ff;
    --primary-dark: #2a6d99;
    --accent: #ff6b6b;
    --accent-light: #ff8e8e;
    --text: #e6f7ff;
    --text-light: #c8e6ff;
    --text-lighter: rgba(200,230,255,0.7);
    --text-muted: rgba(200,230,255,0.45);
    --bg-dark: #0c0e1d;
    --bg-darker: #0a0c18;
    --bg-card: rgba(20,25,50,0.7);
    --bg-glass: rgba(20,25,50,0.55);
    --bg-input: rgba(20,25,50,0.6);
    --transition: all 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
    --transition-fast: all 0.2s ease;
    --shadow: 0 12px 35px rgba(0,0,0,0.45);
    --shadow-glow: 0 0 25px rgba(96,156,230,0.35);
    --glass-blur: blur(12px);
    --glass-border: 1px solid rgba(96,156,230,0.35);
    --border-subtle: 1px solid rgba(96,156,230,0.18);
    --card-radius: 18px;
    --btn-radius: 12px; --btn-radius-sm: 8px; --btn-radius-pill: 50px;
    --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 36px; --space-2xl: 48px;
    --font-xs: 0.72rem; --font-sm: 0.85rem; --font-base: 1rem; --font-lg: 1.15rem; --font-xl: 1.5rem; --font-2xl: 2rem;
    --scrollbar-width: 6px;
    --scrollbar-track: rgba(255,255,255,0.03);
    --scrollbar-thumb: linear-gradient(135deg,var(--primary),var(--accent));
}
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Open Sans', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #0c0e1d, #111328, #181c38);
            min-height: 100vh;
            color: #e6f7ff;
            padding: 20px;
            overflow-x: hidden;
            position: relative;
        }

        /* Custom scrollbar */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 3px; }
        ::-webkit-scrollbar-thumb { background: rgba(154,198,255,0.2); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(154,198,255,0.35); }
        
        .stars-bg {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: -1;
            overflow: hidden;
        }
        
        .star {
            position: absolute;
            font-size: 1.5rem;
            opacity: 0;
            animation: twinkle 4s infinite;
            color: rgba(255, 255, 255, 0.7);
            will-change: transform, opacity;
        }
        
        @keyframes twinkle {
            0% { opacity: 0; transform: scale(0.5) translateZ(0); }
            50% { opacity: 1; transform: scale(1) translateZ(0); }
            100% { opacity: 0; transform: scale(0.5) translateZ(0); }
        }
        
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 20px;
            position: relative;
            z-index: 1;
        }
        
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 100;
        }
        
        .modal-content {
            background: rgba(20,28,44,0.95);
            backdrop-filter: blur(25px);
            -webkit-backdrop-filter: blur(25px);
            padding: 35px;
            border-radius: 20px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0,0,0,0.5);
            border: 1px solid rgba(154,198,255,0.15);
            width: 90%;
            max-width: 450px;
        }
        
        .modal h2 {
            font-size: 2rem;
            font-family: 'Montserrat', sans-serif;
            margin-bottom: 20px;
            background: linear-gradient(135deg, #87c0ff, #ffc299);
            -webkit-background-clip: text; background-clip: text;
            color: transparent;
        }
        
        .modal p {
            font-size: 1.2rem;
            margin-bottom: 25px;
            line-height: 1.6;
        }
        
        .name-input {
            width: 100%;
            padding: 14px;
            font-size: 1.1rem;
            border-radius: 12px;
            border: 1px solid rgba(154,198,255,0.2);
            background: rgba(255,255,255,0.06);
            color: #f0f6ff;
            margin-bottom: 20px;
            text-align: center;
            transition: all 0.3s;
        }
        
        .name-input:focus {
            outline: none;
            border-color: #87c0ff;
            box-shadow: 0 0 20px rgba(154,198,255,0.2);
        }
        
        .start-btn {
            background: linear-gradient(135deg, #3c8dbc, #ff6b6b);
            color: rgba(216,236,247,0.7);
            border: none;
            padding: 13px 28px;
            border-radius: 14px;
            cursor: pointer;
            font-size: 1.15rem;
            font-weight: 700;
            font-family: 'Montserrat', sans-serif;
            transition: all 0.3s ease;
            display: inline-block;
            min-width: 150px;
            box-shadow: 0 4px 16px rgba(106,155,216,0.25);
        }
        
        .start-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 22px rgba(106,155,216,0.45);
        }
        
        header {
            text-align: center;
            padding: 20px 0;
            margin-bottom: 25px;
        }
        
        .title-container {
            position: relative;
            display: inline-block;
            padding: 25px 40px;
            border-radius: 20px;
            background: rgba(18,24,40,0.7);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            box-shadow: 0 15px 35px rgba(0,0,0,0.4);
            overflow: hidden;
            border: 1px solid rgba(154,198,255,0.15);
            max-width: 95%;
            width: 100%;
        }
        
        h1 {
            font-size: 3.5rem;
            margin-bottom: 10px;
            background: linear-gradient(45deg, #87c0ff, #a1c4fd, #87c0ff, #ff9e6d);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-size: 300% 300%;
            animation: gradientTitle 8s ease infinite;
            font-weight: 800;
            letter-spacing: 2px;
            text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        }
        
        @keyframes gradientTitle {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        .player-info {
            font-size: 1.3rem;
            margin-top: 10px;
            color: #87c0ff;
            font-weight: bold;
            padding: 8px 15px;
            background: rgba(255,255,255,0.04);
            border-radius: 8px;
            display: inline-block;
            
            animation: pulseText 2s infinite;
        }
        
        @keyframes pulseText {
            0% { transform: scale(1);  }
            50% { transform: scale(1.05); text-shadow: 0 0 15px rgba(255, 209, 102, 0.8); }
            100% { transform: scale(1);  }
        }
        
        .subtitle {
            font-size: 1.1rem;
            opacity: 0.9;
            max-width: 600px;
            margin: 15px auto 0;
            line-height: 1.6;
            text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
            background: rgba(255, 255, 255, 0.1);
            padding: 12px 20px;
            border-radius: 10px;
            backdrop-filter: blur(5px);
            border: 1px solid rgba(154,198,255,0.12);
        }
        
        .color-preview {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin: 20px 0;
            flex-wrap: wrap;
            align-items: center;
        }
        
        .color-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid rgba(154,198,255,0.12);
        }
        
        .color-sample {
            width: 30px;
            height: 30px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            box-shadow: 0 3px 6px rgba(0,0,0,0.2);
        }
        
        .game-container {
            background: rgba(20,28,44,0.7);
            backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.35);
            margin-bottom: 25px;
            border: 1px solid rgba(154,198,255,0.12);
        }
        
        .game-header {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid rgba(154,198,255,0.1);
            gap: 15px;
        }
        
        .game-info {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            justify-content: center;
            flex: 1;
        }
        
        .info-box {
            background: rgba(255,255,255,0.04);
            padding: 10px 15px;
            border-radius: 10px;
            min-width: 80px;
            text-align: center;
            border: 1px solid rgba(154,198,255,0.1);
            flex: 1;
            max-width: 100px;
            transition: all 0.3s ease;
        }
        
        .info-box:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.15);
        }
        
        .info-label {
            font-size: 0.9rem;
            opacity: 0.8;
            margin-bottom: 5px;
        }
        
        .info-value {
            font-size: 1.6rem;
            font-weight: bold;
            color: #87c0ff;
            
        }
        
        .game-controls {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
        }
        
        .control-btn {
            background: rgba(255,255,255,0.05);
            color: rgba(216,236,247,0.7);
            border: none;
            padding: 10px 15px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.95rem;
            font-weight: 600;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            border: 1px solid rgba(154,198,255,0.1);
            min-width: 100px;
        }
        
        .control-btn:hover {
            background: rgba(154,198,255,0.12);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }
        
        .game-board {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            gap: 6px;
            margin: 0 auto;
            max-width: 500px;
            background: rgba(255,255,255,0.04);
            padding: 12px;
            border-radius: 10px;
            border: 1px solid rgba(154,198,255,0.1);
        }
        
        .tile {
            aspect-ratio: 1/1;
            border-radius: 8px;
            cursor: pointer;
            transition: transform 0.2s;
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            user-select: none;
            touch-action: manipulation;
            background: rgba(0, 0, 0, 0.3);
            box-shadow: inset 0 0 8px rgba(0,0,0,0.3);
        }
        
        .tile.selected {
            transform: scale(0.9);
            box-shadow: 0 0 0 3px #87c0ff, 0 0 12px 3px rgba(255, 209, 102, 0.5);
            z-index: 10;
        }
        
        .tile::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle at center, rgba(255,255,255,0.4), transparent);
            opacity: 0.3;
        }
        
        .color-1 { color: #FF5252; }
        .color-2 { color: #4CAF50; }
        .color-3 { color: #2196F3; }
        .color-4 { color: #FFD740; }
        .color-5 { color: #AB47BC; }
        .color-6 { color: #00FFFF; }
        
        .special { 
            color: #87c0ff;
            animation: pulse 1s infinite;
        }
        
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }
        
        .leaderboard {
            background: rgba(255,255,255,0.04);
            padding: 25px;
            border-radius: 20px;
            margin-top: 30px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.35);
            border: 1px solid rgba(255, 255, 255, 0.15);
            position: relative;
            overflow: hidden;
        }
        
        .leaderboard::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle at top right, rgba(154,198,255,0.08), transparent 70%);
            pointer-events: none;
        }
        
        .leaderboard h2 {
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
            font-size: 2.2rem;
            color: #87c0ff;
            
            padding: 15px 0;
            background: linear-gradient(90deg, transparent, rgba(154,198,255,0.08), transparent);
            border-radius: 10px;
            position: relative;
        }
        
        .leaderboard h2::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 25%;
            width: 50%;
            height: 3px;
            background: linear-gradient(90deg, transparent, rgba(154,198,255,0.3), transparent);
        }
        
        .leaderboard-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0,0,0,0.15);
            background: rgba(0,0,0,0.15);
        }
        
        .leaderboard-table th {
            background: rgba(40,50,70,0.6);
            padding: 15px;
            text-align: center;
            font-size: 1.1rem;
            color: #87c0ff;
            
            position: relative;
            overflow: hidden;
            font-weight: 600;
            letter-spacing: 1px;
        }
        
        .leaderboard-table th::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            animation: shine 3s infinite;
        }
        
        @keyframes shine {
            0% { left: -100%; }
            100% { left: 100%; }
        }
        
        .leaderboard-table td {
            padding: 15px;
            text-align: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            font-size: 1.05rem;
            transition: all 0.3s ease;
        }
        
        .leaderboard-table tr {
            background: rgba(0,0,0,0.15);
            transition: all 0.3s ease;
        }
        
        .leaderboard-table tr:nth-child(even) {
            background: rgba(154,198,255,0.08);
        }
        
        .leaderboard-table tr:hover {
            background: rgba(154,198,255,0.1);
            transform: translateY(-2px);
        }
        
        .leaderboard-table tr:first-child {
            background: linear-gradient(to right, rgba(255, 209, 102, 0.2), rgba(255, 209, 102, 0.1));
            box-shadow: 0 5px 15px rgba(0,0,0,0.15);
        }
        
        .leaderboard-table tr:first-child td {
            color: #87c0ff;
            font-weight: bold;
            font-size: 1.2rem;
            
        }
        
        .leaderboard-table tr:nth-child(2) {
            background: linear-gradient(to right, rgba(161, 196, 253, 0.2), rgba(161, 196, 253, 0.1));
        }
        
        .leaderboard-table tr:nth-child(2) td {
            color: #a1c4fd;
            font-weight: bold;
        }
        
        .leaderboard-table tr:nth-child(3) {
            background: linear-gradient(to right, rgba(116, 185, 255, 0.2), rgba(116, 185, 255, 0.1));
        }
        
        .leaderboard-table tr:nth-child(3) td {
            color: #87c0ff;
            font-weight: bold;
        }
        
        .ranking-badge {
            display: inline-block;
            width: 30px;
            height: 30px;
            line-height: 30px;
            border-radius: 50%;
            text-align: center;
            font-weight: bold;
            margin-right: 10px;
        }
        
        .rank-1 .ranking-badge {
            background: linear-gradient(135deg, #FFD700, #FFA500);
            color: #000;
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }
        
        .rank-2 .ranking-badge {
            background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
            color: #000;
            box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
        }
        
        .rank-3 .ranking-badge {
            background: linear-gradient(135deg, #CD7F32, #8C6B46);
            color: #000;
            box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
        }
        
        .loading {
            text-align: center;
            padding: 30px;
            font-style: italic;
            color: #87c0ff;
            font-size: 1.1rem;
        }
        
        .error-message {
            text-align: center;
            padding: 30px;
            color: #ff6b6b;
            font-size: 1.1rem;
        }
        
        .game-status {
            text-align: center;
            padding: 15px;
            margin: 15px 0;
            border-radius: 8px;
            font-weight: bold;
            display: none;
            font-size: 1.1rem;
        }
        
        .success {
            background: rgba(116, 185, 255, 0.2);
            color: #87c0ff;
            border: 1px solid rgba(116, 185, 255, 0.3);
        }
        
        .error {
            background: rgba(255, 107, 107, 0.2);
            color: #ff6b6b;
            border: 1px solid rgba(255, 107, 107, 0.3);
        }
        
        .selection-hint {
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 8px;
            box-shadow: inset 0 0 0 3px #87c0ff;
            animation: pulse 1.5s infinite;
            pointer-events: none;
            z-index: 5;
        }
        
        @keyframes pulse {
            0% { opacity: 0.5; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.05); }
            100% { opacity: 0.5; transform: scale(1); }
        }
        
        .highlight {
            animation: highlight 0.5s ease-in-out;
        }
        
        @keyframes highlight {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }
        
        .special-star {
            animation: rotateStar 3s infinite linear;
            text-shadow: 0 0 10px rgba(255, 209, 102, 0.8);
        }
        
        @keyframes rotateStar {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .combo-display {
            position: absolute;
            font-size: 1.8rem;
            font-weight: bold;
            color: #87c0ff;
            text-shadow: 0 0 10px rgba(255, 209, 102, 0.8);
            animation: floatUp 1s forwards;
            pointer-events: none;
            z-index: 10;
        }
        
        @keyframes floatUp {
            0% { transform: translateY(0); opacity: 1; }
            100% { transform: translateY(-50px); opacity: 0; }
        }
        
        .explosion {
            position: absolute;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            animation: explode 0.5s forwards;
            pointer-events: none;
            z-index: 5;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }
        
        @keyframes explode {
            0% { transform: scale(0); opacity: 1; }
            50% { transform: scale(1.2); opacity: 0.8; }
            100% { transform: scale(1.5); opacity: 0; }
        }
        
        .tutorial {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.8);
            padding: 20px;
            border-radius: 20px;
            z-index: 1000;
            max-width: 90%;
            width: 400px;
            text-align: center;
            backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(154,198,255,0.12);
        }
        
        .tutorial h3 {
            color: #87c0ff;
            margin-bottom: 15px;
            font-size: 1.5rem;
        }
        
        .tutorial p {
            margin-bottom: 20px;
            line-height: 1.6;
        }
        
        .tutorial-btn {
            background: linear-gradient(to right, #87c0ff, #0984e3);
            color: rgba(216,236,247,0.7);
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
        }
        
        .level-indicator {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
        }
        
        .level-progress {
            flex-grow: 1;
            height: 8px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            overflow: hidden;
        }
        
        .level-progress-bar {
            height: 100%;
            background: linear-gradient(to right, #87c0ff, #0984e3);
            border-radius: 4px;
            transition: width 0.5s ease;
        }
        
        .achievements {
            background: rgba(255,255,255,0.04);
            padding: 20px;
            border-radius: 10px;
            margin-top: 25px;
        }
        
        .achievements h2 {
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.5rem;
            color: #87c0ff;
        }
        
        .achievement-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
        }
        
        .achievement-item {
            background: rgba(255, 255, 255, 0.1);
            padding: 15px;
            border-radius: 8px;
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        
        .achievement-item.unlocked {
            background: rgba(255, 209, 102, 0.2);
            border: 1px solid rgba(255, 209, 102, 0.5);
            box-shadow: 0 0 15px rgba(255, 209, 102, 0.3);
        }
        
        .achievement-item.unlocked::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            animation: shine 2s infinite;
            transform: rotate(45deg);
        }
        
        @keyframes shine {
            0% { left: -50%; }
            100% { left: 150%; }
        }
        
        .achievement-icon {
            font-size: 2rem;
            margin-bottom: 10px;
            color: #87c0ff;
        }
        
        .achievement-item.unlocked .achievement-icon {
            animation: bounce 0.5s ease;
        }
        
        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
            40% {transform: translateY(-10px);}
            60% {transform: translateY(-5px);}
        }
        
        .achievement-title {
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .achievement-desc {
            font-size: 0.9rem;
            opacity: 0.8;
        }
        
        .daily-tasks {
            background: rgba(255,255,255,0.04);
            padding: 20px;
            border-radius: 10px;
            margin-top: 25px;
        }
        
        .daily-tasks h2 {
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.5rem;
            color: #87c0ff;
        }
        
        .task-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .task-item {
            background: rgba(255, 255, 255, 0.1);
            padding: 12px;
            border-radius: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .task-info {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        
        .task-title {
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .task-progress {
            height: 5px;
            background: rgba(255,255,255,0.05);
            border-radius: 3px;
            overflow: hidden;
            margin-top: 5px;
        }
        
        .task-progress-bar {
            height: 100%;
            background: linear-gradient(to right, #87c0ff, #0984e3);
            border-radius: 3px;
            transition: width 0.5s ease;
        }
        
        .task-reward {
            background: rgba(255, 209, 102, 0.2);
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 0.9rem;
            color: #87c0ff;
            white-space: nowrap;
        }
        
        .game-modes {
            display: flex;
            gap: 15px;
            margin: 20px 0;
            flex-wrap: wrap;
            justify-content: center;
        }
        
        .mode-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(154,198,255,0.12);
            padding: 15px 20px;
            border-radius: 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            flex: 1;
            min-width: 150px;
            position: relative;
            overflow: hidden;
        }
        
        .mode-btn:hover {
            background: rgba(255,255,255,0.05);
            transform: translateY(-3px);
        }
        
        .mode-btn.active {
            background: rgba(116, 185, 255, 0.3);
            border-color: #87c0ff;
            box-shadow: 0 0 15px rgba(116, 185, 255, 0.5);
        }
        
        .mode-icon {
            font-size: 2rem;
            margin-bottom: 10px;
            color: #87c0ff;
        }
        
        .mode-title {
            font-weight: bold;
            margin-bottom: 5px;
            font-size: 1.1rem;
        }
        
        .mode-desc {
            font-size: 0.9rem;
            opacity: 0.8;
        }
        
        #time-container {
            display: none;
        }
        
        .timed-mode .info-box {
            min-width: 90px;
        }
        
        .timed-mode .game-info {
            justify-content: space-around;
        }
        
        .game-header {
            display: flex;
            flex-wrap: nowrap;
            justify-content: space-between;
            align-items: center;
        }
        
        .game-info {
            flex: 2;
            justify-content: flex-start;
        }
        
        .game-controls {
            flex: 1;
            justify-content: flex-end;
        }
        
        @media (max-width: 900px) {
            .game-header {
                flex-wrap: wrap;
            }
            
            .game-info, .game-controls {
                flex: 100%;
                justify-content: center;
            }
        }
        
        .timed-mode .game-info {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .timed-mode #time-container {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .game-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 20;
            border-radius: 20px;
            display: none;
        }
        
        .game-over-message {
            background: linear-gradient(135deg, #0c0e1d, #3c8dbc);
            padding: 30px;
            border-radius: 20px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            width: 80%;
            max-width: 400px;
        }
        
        .game-over-message h3 {
            font-size: 2rem;
            margin-bottom: 20px;
            color: #87c0ff;
        }
        
        .game-over-message p {
            font-size: 1.2rem;
            margin-bottom: 25px;
        }
        
        .leaderboard-tabs {
            display: flex;
            margin-bottom: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            justify-content: center;
            background: rgba(255,255,255,0.04);
            border-radius: 10px;
            padding: 5px;
        }
        
        .leaderboard-tab {
            padding: 12px 20px;
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.3s ease;
            font-weight: 600;
            font-size: 1.1rem;
            color: rgba(255, 255, 255, 0.7);
            border-radius: 8px;
            margin: 0 5px;
        }
        
        .leaderboard-tab.active {
            border-bottom: 2px solid #87c0ff;
            color: #87c0ff;
            
            background: rgba(154,198,255,0.1);
        }
        
        .leaderboard-tab:hover {
            background: rgba(154,198,255,0.08);
            color: #87c0ff;
        }
        
        .mode-title-wrapper {
            position: relative;
            display: inline-block;
        }
        
        .mode-title-wrapper::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, transparent, rgba(154,198,255,0.3), transparent);
            transform: scaleX(0);
            transition: transform 0.3s ease;
        }
        
        .mode-btn.active .mode-title-wrapper::after {
            transform: scaleX(1);
        }
        
        .leaderboard-crown {
            position: absolute;
            top: -15px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 2.5rem;
            color: #87c0ff;
            text-shadow: 0 0 15px rgba(255, 209, 102, 0.7);
            z-index: 2;
        }
