/* Import Google Fonts */
        @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Poppins', sans-serif;
        }

        body {
            background: #f0f2f5;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .loader-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: white;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 100;
        }

        .logo {
            font-size: 28px;
            font-weight: bold;
            color: #1877f2;
            margin-bottom: 20px;
        }

        .loader {
            width: 300px;
            height: 4px;
            background-color: #e4e6eb;
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 20px;
        }

        .loader-bar {
            height: 100%;
            width: 0%;
            background-color: #1877f2;
            border-radius: 4px;
            animation: loading 2s ease-in-out infinite;
        }

        @keyframes loading {
            0% {
                width: 0%;
                transform: translateX(0);
            }
            50% {
                width: 70%;
            }
            100% {
                width: 100%;
                transform: translateX(100%);
            }
        }

        .loading-text {
            color: #65676b;
            font-size: 14px;
        }

        .content {
            display: none;
            width: 100%;
            max-width: 500px;
        }

        /* Start Button */
        .start_btn {
            text-align: center;
            margin-bottom: 20px;
        }

        .start_btn button {
            font-size: 25px;
            font-weight: 500;
            color: #007bff;
            padding: 15px 30px;
            outline: none;
            border: none;
            border-radius: 5px;
            border: solid 1px #007bff;
            background: white;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .start_btn button:hover {
            background: #007bff;
            color: white;
        }

        /* Info Box */
        .info_box {
            width: 100%;
            background: #fff;
            border-radius: 5px;
            transform: translateY(-50%) scale(0.9);
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s ease;
            position: absolute;
            top: 50%;
            left: 0;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .info_box.activeInfo {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(-50%) scale(1);
        }

        .info_box .info-title {
            height: 60px;
            width: 100%;
            border-bottom: 1px solid lightgrey;
            display: flex;
            align-items: center;
            padding: 0 30px;
            border-radius: 5px 5px 0 0;
            font-size: 20px;
            font-weight: 600;
        }

        .info_box .info-list {
            padding: 15px 30px;
        }

        .info_box .info-list .info {
            margin: 5px 0;
            font-size: 17px;
        }

        .info_box .info-list .info span {
            font-weight: 600;
            color: #007bff;
        }

        .info_box .buttons {
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding: 0 30px;
            border-top: 1px solid lightgrey;
        }

        .info_box .buttons button {
            margin: 0 5px;
            height: 40px;
            width: 100px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            border: none;
            outline: none;
            border-radius: 5px;
            border: 1px solid #007bff;
            transition: all 0.3s ease;
        }

        .buttons button.quit {
            color: #007bff;
            background: #fff;
        }

        .buttons button.restart {
            color: #fff;
            background: #007bff;
        }

        .buttons button.quit:hover {
            background: #007bff;
            color: #fff;
        }

        .buttons button.restart:hover {
            background: #0263ca;
        }

        /* Game Box */
        .game_box {
            width: 100%;
            background: #fff;
            border-radius: 5px;
            transform: translateY(-50%) scale(0.9);
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s ease;
            position: absolute;
            top: 50%;
            left: 0;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .game_box.activeGame {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(-50%) scale(1);
        }

        .game_box header {
            position: relative;
            z-index: 2;
            height: 70px;
            padding: 0 30px;
            background: #fff;
            border-radius: 5px 5px 0 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0px 3px 5px 1px rgba(0,0,0,0.1);
        }

        .game_box header .title {
            font-size: 20px;
            font-weight: 600;
        }

        .game_box header .player_info {
            color: #004085;
            background: #cce5ff;
            border: 1px solid #b8daff;
            height: 45px;
            padding: 0 15px;
            border-radius: 5px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .game_box header .player_info .current_player {
            font-weight: 400;
            font-size: 17px;
            user-select: none;
        }

        .game_box header .player_info .player_symbol {
            font-size: 18px;
            font-weight: 500;
            height: 30px;
            width: 30px;
            color: #fff;
            border-radius: 5px;
            line-height: 30px;
            text-align: center;
            background: #343a40;
            border: 1px solid #343a40;
            user-select: none;
            margin-left: 10px;
        }

        .game_box .game_board {
            padding: 25px 30px 20px 30px;
            background: #fff;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-gap: 10px;
        }

        .game_box .game_board .cell {
            background: aliceblue;
            border: 1px solid #84c5fe;
            border-radius: 5px;
            aspect-ratio: 1/1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .game_box .game_board .cell.x {
            color: #007bff;
        }

        .game_box .game_board .cell.o {
            color: #28a745;
        }

        .game_box .game_board .cell:hover {
            background: #cce5ff;
        }

        .game_box .game_board .cell.winning-cell {
            background: #d4edda;
            animation: pulse 1.5s infinite;
        }

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

        footer {
            height: 60px;
            padding: 0 30px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-top: 1px solid lightgrey;
        }

        footer .score_info span {
            display: flex;
            user-select: none;
        }

        footer .score_info span p {
            font-weight: 500;
            padding: 0 5px;
        }

        footer .score_info span p:first-child {
            padding-left: 0px;
        }

        footer button {
            height: 40px;
            padding: 0 13px;
            font-size: 18px;
            font-weight: 400;
            cursor: pointer;
            border: none;
            outline: none;
            color: #fff;
            border-radius: 5px;
            background: #007bff;
            border: 1px solid #007bff;
            line-height: 10px;
            transition: all 0.3s ease;
        }

        footer button:hover {
            background: #0263ca;
        }

        /* Result Box */
        .result_box {
            background: #fff;
            border-radius: 5px;
            display: flex;
            padding: 25px 30px;
            width: 100%;
            align-items: center;
            flex-direction: column;
            justify-content: center;
            transform: translateY(-50%) scale(0.9);
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s ease;
            position: absolute;
            top: 50%;
            left: 0;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .result_box.activeResult {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(-50%) scale(1);
        }

        .result_box .icon {
            font-size: 100px;
            color: #007bff;
            margin-bottom: 10px;
        }

        .result_box .complete_text {
            font-size: 20px;
            font-weight: 500;
        }

        .result_box .score_text span {
            display: flex;
            margin: 10px 0;
            font-size: 18px;
            font-weight: 500;
        }

        .result_box .score_text span p {
            padding: 0 4px;
            font-weight: 600;
        }

        .result_box .buttons {
            display: flex;
            margin: 20px 0;
        }

        .result_box .buttons button {
            margin: 0 10px;
            height: 45px;
            padding: 0 20px;
            font-size: 18px;
            font-weight: 500;
            cursor: pointer;
            border: none;
            outline: none;
            border-radius: 5px;
            border: 1px solid #007bff;
            transition: all 0.3s ease;
        }

        /* Victory Celebration */
        .victory_screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #6e8efb, #a777e3);
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 100;
            animation: backgroundShift 10s infinite alternate;
        }

        @keyframes backgroundShift {
            0% { background: linear-gradient(135deg, #ff9a9e, #fad0c4); }
            25% { background: linear-gradient(135deg, #a1c4fd, #c2e9fb); }
            50% { background: linear-gradient(135deg, #ffecd2, #fcb69f); }
            75% { background: linear-gradient(135deg, #84fab0, #8fd3f4); }
            100% { background: linear-gradient(135deg, #d4fc79, #96e6a1); }
        }

        .confetti {
            position: absolute;
            width: 10px;
            height: 10px;
            background-color: #f00;
            animation: fall linear forwards;
        }

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

        .winner-text {
            font-size: 4rem;
            font-weight: bold;
            color: white;
            text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
            margin-bottom: 30px;
            animation: bounce 1s infinite alternate;
        }

        @keyframes bounce {
            from { transform: scale(1); }
            to { transform: scale(1.1); }
        }

        .winner-symbol {
            font-size: 8rem;
            margin-bottom: 30px;
            animation: spin 2s infinite linear;
            color: white;
        }

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

        .celebration-buttons {
            display: flex;
            gap: 20px;
            margin-top: 20px;
        }

        .celebration-btn {
            padding: 15px 30px;
            font-size: 1.2rem;
            background-color: rgba(255, 255, 255, 0.9);
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            color: #007bff;
            font-weight: bold;
        }

        .celebration-btn:hover {
            transform: translateY(-5px) scale(1.05);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
        }

        @media (max-width: 480px) {
            .content {
                padding: 10px;
            }
            
            .winner-text {
                font-size: 2.5rem;
            }
            
            .winner-symbol {
                font-size: 5rem;
            }
            
            .celebration-buttons {
                flex-direction: column;
            }
        }