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

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

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

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

    .spinner {
        width: 60px;
        height: 60px;
        border: 4px solid rgba(255, 255, 255, 0.3);
        border-top: 4px solid white;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-bottom: 20px;
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }

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

    .preloader h2 {
        color: white;
        font-size: 1.5rem;
        animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {

        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.5;
        }
    }

    /* Main Container */
    #main-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 20px;
        opacity: 0;
        animation: fadeInUp 1s ease-out forwards;
        animation-delay: 0.5s;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Game Header */
    .game-header {
        text-align: center;
        margin-bottom: 20px;
        animation: slideInDown 1s ease-out;
        background-color: #6352e9;
        padding: 10px;
        border-radius: 25px;
    }

    .game-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: #5b4cec;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        margin-bottom: 10px;
    }

    .game-subtitle {
        font-size: 1.2rem;
        color: #df3670;
        font-weight: 300;
    }

    /* Player Info */
    .player-info {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        padding: 15px 30px;
        margin-bottom: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        text-align: center;
        min-width: 300px;
        transform: scale(0.9);
        animation: scaleIn 0.6s ease-out forwards;
        animation-delay: 0.8s;
    }

    @keyframes scaleIn {
        to {
            transform: scale(1);
        }
    }

    #player-type {
        font-size: 1.5rem;
        font-weight: 600;
        color: #4f3ff0;
        margin-bottom: 10px;
        transition: all 0.3s ease;
    }

    .player-1-color {
        color: #34c471 !important;
    }

    .player-2-color {
        color: #df3670 !important;
    }

    /* Timer */
    .timer-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .timer {
        font-size: 1.2rem;
        font-weight: 500;
        color: #666;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .timer-icon {
        width: 20px;
        height: 20px;
        background: #4f3ff0;
        border-radius: 50%;
        position: relative;
        animation: tick 1s ease-in-out infinite;
    }

    @keyframes tick {

        0%,
        100% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.1);
        }
    }

    .timer-icon::before {
        content: '';
        position: absolute;
        top: 2px;
        left: 50%;
        width: 1px;
        height: 8px;
        background: white;
        transform-origin: bottom;
        animation: clockHand 60s linear infinite;
    }

    @keyframes clockHand {
        from {
            transform: translateX(-50%) rotate(0deg);
        }

        to {
            transform: translateX(-50%) rotate(360deg);
        }
    }

    /* Grid Container */
    .grid-container {
        perspective: 1000px;
        margin-bottom: 30px;
    }

    #grid {
        background: linear-gradient(145deg, #4f3ff0, #6b5ce6);
        border-radius: 20px;
        padding: 20px;
        box-shadow:
            0 20px 40px rgba(79, 63, 240, 0.3),
            inset 0 -2px 0 rgba(255, 255, 255, 0.1);
        transform: rotateX(5deg);
        transition: transform 0.3s ease;
        animation: gridEntrance 1s ease-out;
        animation-delay: 1s;
        animation-fill-mode: backwards;
    }

    @keyframes gridEntrance {
        from {
            opacity: 0;
            transform: rotateX(90deg) scale(0.8);
        }

        to {
            opacity: 1;
            transform: rotateX(5deg) scale(1);
        }
    }

    #grid:hover {
        transform: rotateX(0deg) scale(1.02);
    }

    .row {
        display: flex;
        gap: 8px;
        margin-bottom: 8px;
    }

    .row:last-child {
        margin-bottom: 0;
    }

    .col {
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        width: 70px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        transition: all 0.3s ease;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .col::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(145deg, transparent, rgba(255, 255, 255, 0.2));
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .col:hover::before {
        opacity: 1;
    }

    .col:hover {
        transform: translateY(-2px);
        box-shadow:
            inset 0 2px 4px rgba(0, 0, 0, 0.1),
            0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .btn {
        width: 50px;
        height: 50px;
        border: none;
        border-radius: 50%;
        background: transparent;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        position: relative;
        overflow: hidden;
    }

    .btn:disabled {
        cursor: not-allowed;
    }

    .btn-player-1 {
        background: linear-gradient(145deg, #34c471, #2aa963);
        box-shadow:
            0 4px 8px rgba(52, 196, 113, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        animation: dropIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    .btn-player-2 {
        background: linear-gradient(145deg, #df3670, #c12c5f);
        box-shadow:
            0 4px 8px rgba(223, 54, 112, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        animation: dropIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    @keyframes dropIn {
        0% {
            transform: translateY(-100px) rotate(180deg) scale(0);
            opacity: 0;
        }

        50% {
            transform: translateY(0) rotate(90deg) scale(1.2);
            opacity: 0.8;
        }

        100% {
            transform: translateY(0) rotate(0deg) scale(1);
            opacity: 1;
        }
    }

    .btn-player-1::before,
    .btn-player-2::before {
        content: '';
        position: absolute;
        top: 15%;
        left: 15%;
        width: 70%;
        height: 70%;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .btn-player-1:hover::before,
    .btn-player-2:hover::before {
        opacity: 1;
        animation: shine 0.5s ease;
    }

    @keyframes shine {
        0% {
            transform: scale(0);
        }

        50% {
            transform: scale(1.2);
        }

        100% {
            transform: scale(1);
        }
    }

    /* Reset Button */
    #reset-btn {
        background: #6354e9;
        backdrop-filter: blur(10px);
        border: 2px solid rgb(102 87 232);
        border-radius: 50px;
        color: #4f3ff0;
        font-family: 'Poppins', sans-serif;
        font-size: 1.1rem;
        font-weight: 600;
        padding: 15px 40px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 1px;
        position: relative;
        overflow: hidden;
        margin-top: 10px;
        color: #ffff;
    }

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

    #reset-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        background: linear-gradient(145deg, rgba(79, 63, 240, 0.1), rgba(79, 63, 240, 0.05));
        color: #4f3ff0;
    }

    #reset-btn:hover::before {
        left: 100%;
    }

    #reset-btn:active {
        transform: translateY(0);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    }

    /* Mode Toggle Button */
    #mode-toggle {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
        backdrop-filter: blur(10px);
       
        border-radius: 50px;
        color: #4f3ff0;
        font-family: 'Poppins', sans-serif;
        font-size: 1.1rem;
        font-weight: 600;
        padding: 10px 40px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 1px;
        position: relative;
        overflow: hidden;
        margin-bottom: 5px;
    }

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

    #mode-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        background: linear-gradient(145deg, rgba(79, 63, 240, 0.1), rgba(79, 63, 240, 0.05));
        color: #4f3ff0;
    }

    #mode-toggle:hover::before {
        left: 100%;
    }

    #mode-toggle:active {
        transform: translateY(0);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    }

    /* AI Thinking Indicator */
    .ai-thinking {
        display: none;
        margin-top: 15px;
        color: #4f3ff0;
        font-size: 1rem;
        animation: pulse 2s infinite;
    }

    /* Winning Animation */
    .winner-celebration {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1000;
    }

    .confetti {
        position: absolute;
        width: 10px;
        height: 10px;
        background: #FFD700;
        animation: confetti-fall 3s linear infinite;
    }

    @keyframes confetti-fall {
        to {
            transform: translateY(100vh) rotate(360deg);
        }
    }

    /* Modal Styles */
    .modal {
        display: none;
        position: fixed;
        z-index: 2000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .modal-content {
        background: linear-gradient(145deg, #fff, #f8f9fa);
        margin: 15% auto;
        padding: 40px;
        border-radius: 20px;
        width: 90%;
        max-width: 400px;
        text-align: center;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        animation: modalSlideIn 0.5s ease;
        position: relative;
        overflow: hidden;
    }

    @keyframes modalSlideIn {
        from {
            transform: translateY(-50px) scale(0.9);
            opacity: 0;
        }

        to {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }

    .modal h2 {
        color: #4f3ff0;
        font-size: 2rem;
        margin-bottom: 20px;
        animation: bounce 1s ease infinite;
    }

    @keyframes bounce {

        0%,
        100% {
            transform: translateY(0);
        }

        50% {
            transform: translateY(-10px);
        }
    }

    .close-modal {
        background: #4f3ff0;
        color: white;
        border: none;
        border-radius: 25px;
        padding: 12px 30px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-top: 20px;
    }

    .close-modal:hover {
        background: #3d2fd4;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(79, 63, 240, 0.4);
    }

    /* Responsive Design */
    @media (max-width: 768px) {
        .game-title {
            font-size: 1.5rem;
        }

        .col {
            width: 50px;
            height: 50px;
        }

        .btn {
            width: 35px;
            height: 35px;
        }

        #grid {
            padding: 15px;
        }

        .row {
            gap: 5px;
            margin-bottom: 5px;
        }
    }

    @media (max-width: 480px) {
        .game-title {
            font-size: 1.2rem;
        }

        .col {
            width: 40px;
            height: 40px;
        }

        .btn {
            width: 28px;
            height: 28px;
        }

        .player-info {
            padding: 15px 25px;
            min-width: 250px;
        }

        #player-type {
            font-size: 1.2rem;
        }
    }
