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

    body {
        font-family: 'Comic Sans MS', cursive, sans-serif;
        background: url('bg.jpg') no-repeat center center fixed;
        background-size: cover;
        min-height: 100vh;
        overflow-x: hidden;
    }

    /* Preloader */
    .preloader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #0257ac 0%, #003f7d 100%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1000;
        transition: opacity 0.5s ease-out;
    }

    .preloader.hidden {
        opacity: 0;
        pointer-events: none;
    }

    .loader-emoji {
        font-size: 4rem;
        animation: spin 2s linear infinite;
        margin-bottom: 20px;
    }

    .loader-dots {
        display: flex;
        gap: 10px;
    }

    .dot {
        width: 15px;
        height: 15px;
        border-radius: 50%;
        background: #ff6b6b;
        animation: bounce 1.4s ease-in-out infinite both;
    }

    .dot:nth-child(1) { animation-delay: -0.32s; }
    .dot:nth-child(2) { animation-delay: -0.16s; }
    .dot:nth-child(3) { animation-delay: 0s; }

    .loader-text {
        font-size: 1.8rem;
        color: #fff;
        margin-top: 20px;
        font-weight: bold;
    }

    /* Mode Selection */
    .mode-selection {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #0257ac 0%, #003f7d 100%);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 200;
        opacity: 1;
        transition: opacity 0.5s ease-out;
    }

    .mode-selection.hidden {
        opacity: 0;
        pointer-events: none;
    }

    .mode-content {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 25px;
        padding: 40px;
        text-align: center;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(10px);
        max-width: 500px;
        width: 90%;
    }

    .mode-title {
        font-size: 2.5rem;
        color: #4a5568;
        margin-bottom: 30px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }

    .mode-subtitle {
        font-size: 1.2rem;
        color: #666;
        margin-bottom: 40px;
    }

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

    .mode-btn {
        background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
        color: white;
        border: none;
        padding: 20px 30px;
        font-size: 1.3rem;
        border-radius: 15px;
        cursor: pointer;
        font-weight: bold;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 8px 20px rgba(79, 172, 254, 0.3);
        position: relative;
        overflow: hidden;
    }

    .mode-btn.easy {
        background: linear-gradient(45deg, #56ab2f 0%, #a8e6cf 100%);
        box-shadow: 0 8px 20px rgba(86, 171, 47, 0.3);
    }

    .mode-btn.medium {
        background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
        box-shadow: 0 8px 20px rgba(240, 147, 251, 0.3);
    }

    .mode-btn.hard {
        background: linear-gradient(45deg, #ff6b6b 0%, #ffa500 100%);
        box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
    }

    .mode-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 25px rgba(79, 172, 254, 0.4);
    }

    .mode-btn.easy:hover {
        box-shadow: 0 12px 25px rgba(86, 171, 47, 0.4);
    }

    .mode-btn.medium:hover {
        box-shadow: 0 12px 25px rgba(240, 147, 251, 0.4);
    }

    .mode-btn.hard:hover {
        box-shadow: 0 12px 25px rgba(255, 107, 107, 0.4);
    }

    .mode-btn::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;
    }

    .mode-btn:hover::before {
        left: 100%;
    }

    .mode-description {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.9);
        margin-top: 5px;
    }

    .current-mode {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        padding: 10px 20px;
        margin-bottom: 20px;
        backdrop-filter: blur(5px);
    }

    .current-mode-text {
        font-size: 1.1rem;
        
        font-weight: bold;
    }

    /* Game Container */
    .game-container {
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        text-align: center;
    }

    .game-header {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        padding: 20px;
        margin-bottom: 30px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px);
    }

    .game-title {
        font-size: 1.5rem;
        color: #4a5568;
        margin-bottom: 20px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }

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

    .stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-weight: bold;
    }

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

    .stat-value {
        font-size: 1.4rem;
        color: #2d3748;
    }

    /* Timer Progress Bar */
    .timer-container {
        position: relative;
        width: 200px;
        height: 10px;
        background: #e2e8f0;
        border-radius: 5px;
        overflow: hidden;
    }

    .timer-bar {
        height: 100%;
        background: linear-gradient(90deg, #48bb78, #38a169, #f56565);
        border-radius: 5px;
        transition: width 0.1s ease-out;
        position: relative;
    }

    .timer-bar::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        animation: shimmer 2s infinite;
    }

    /* Game Grid */
    .game-grid {
        display: grid;
        gap: 10px;
        background: rgba(255, 255, 255, 0.95);
        padding: 20px;
        border-radius: 20px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px);
        margin-bottom: 30px;
    }

    .emoji-cell {
        background: #f7fafc;
        border: 3px solid transparent;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 2.5rem;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        margin: auto;
    }

    .emoji-cell::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
        transform: translateX(-100%);
        transition: transform 0.5s;
    }

    .emoji-cell:hover {
        transform: scale(1.1);
        border-color: #4299e1;
        box-shadow: 0 8px 25px rgba(66, 153, 225, 0.3);
    }

    .emoji-cell:hover::before {
        transform: translateX(100%);
    }

    .emoji-cell.correct {
        animation: success 0.8s ease-out;
        border-color: #48bb78;
        background: #f0fff4;
    }

    .emoji-cell.wrong {
        animation: shake 0.6s ease-in-out;
        border-color: #f56565;
        background: #fef5f5;
    }

    /* Game Over Screen */
    .game-over {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #0257ac 0%, #003f7d 100%);
        display: flex;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.5s ease-out;
    }

    .game-over.show {
        opacity: 1;
        pointer-events: all;
    }

    .game-over-content {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 25px;
        padding: 40px;
        text-align: center;
        color: white;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        transform: scale(0.8);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .game-over.show .game-over-content {
        transform: scale(1);
    }

    .game-over-title {
        font-size: 3rem;
        margin-bottom: 20px;
        animation: bounce 2s ease-in-out infinite;
    }

    .final-score {
        font-size: 2rem;
        margin-bottom: 30px;
        color: #ffd700;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }

    .restart-btn {
        background: linear-gradient(45deg, #ff6b6b, #ffa500);
        color: white;
        border: none;
        padding: 15px 30px;
        font-size: 1.2rem;
        border-radius: 50px;
        cursor: pointer;
        font-weight: bold;
        transition: all 0.3s ease;
        box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
    }

    .restart-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 25px rgba(255, 107, 107, 0.4);
    }

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

    @keyframes bounce {
        0%, 80%, 100% { transform: scale(0); }
        40% { transform: scale(1); }
    }

    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
        20%, 40%, 60%, 80% { transform: translateX(10px); }
    }

    @keyframes success {
        0% { transform: scale(1); }
        50% { transform: scale(1.3) rotate(5deg); }
        100% { transform: scale(1); }
    }

    @keyframes shimmer {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(100%); }
    }

    /* Particle Effect */
    .particle {
        position: absolute;
        pointer-events: none;
        font-size: 1.5rem;
        animation: particle-float 1s ease-out forwards;
    }

    @keyframes particle-float {
        0% {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
        100% {
            transform: translateY(-100px) scale(0.5);
            opacity: 0;
        }
    }

    /* Responsive Design */
    @media (max-width: 768px) {
        .game-title { font-size: 2rem; }
        .game-stats { justify-content: center; }
        .stat-item { margin: 0 10px; }
        .emoji-cell { font-size: 2rem; }
        .game-over-title { font-size: 2.5rem; }
    }

    @media (max-width: 480px) {
        .game-container { padding: 10px; }
        .game-title { font-size: 1.8rem; }
        .emoji-cell { font-size: 1.8rem; }
    }
    .toptext{color: #1d222a !important;}
