        @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding: 20px;
            position: relative;
            overflow-x: hidden;
        }

        /* Animated background circles */
        body::before,
        body::after {
            content: '';
            position: fixed;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.5;
            animation: float 20s ease-in-out infinite;
            z-index: 0;
        }

        body::before {
            width: 400px;
            height: 400px;
            background: rgba(255, 255, 255, 0.2);
            top: -100px;
            left: -100px;
            animation-delay: -5s;
        }

        body::after {
            width: 500px;
            height: 500px;
            background: rgba(118, 75, 162, 0.3);
            bottom: -150px;
            right: -150px;
        }

        @keyframes float {
            0%, 100% {
                transform: translate(0, 0) scale(1);
            }
            33% {
                transform: translate(50px, -50px) scale(1.1);
            }
            66% {
                transform: translate(-30px, 30px) scale(0.9);
            }
        }

        .main-content {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            z-index: 1;
        }

        .game-container {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 25px 25px;
            box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3), 
                        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
            max-width: 500px;
            width: 100%;
            transform: translateY(0);
            animation: slideIn 0.6s ease-out;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        h1 {
            text-align: center;
            background: linear-gradient(135deg, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 8px;
            font-size: 1.8em;
            font-weight: 700;
            letter-spacing: -1px;
        }

        .subtitle {
            text-align: center;
            color: #666;
            font-size: 0.8em;
            margin-bottom: 18px;
            font-weight: 300;
        }

        /* Player Selection Modal */
        .modal {
            display: flex;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(5px);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease;
        }

        .modal.hidden {
            display: none;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal-content {
            background: white;
            padding: 40px 35px;
            border-radius: 25px;
            text-align: center;
            max-width: 450px;
            width: 90%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
            animation: scaleIn 0.3s ease;
        }

        @keyframes scaleIn {
            from {
                transform: scale(0.8);
                opacity: 0;
            }
            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .modal h2 {
            color: #333;
            margin-bottom: 15px;
            font-size: 1.8em;
        }

        .modal p {
            color: #666;
            margin-bottom: 30px;
            font-size: 0.95em;
        }

        .player-selection {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-bottom: 25px;
        }

        .player-option {
            flex: 1;
            padding: 25px 15px;
            border: 3px solid #e5e7eb;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            background: #f9fafb;
        }

        .player-option:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
        }

        .player-option.selected {
            border-color: #667eea;
            background: linear-gradient(135deg, #667eea15, #764ba215);
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
        }

        .player-option-symbol {
            font-size: 3em;
            margin-bottom: 8px;
        }

        .player-option-text {
            font-size: 1em;
            font-weight: 600;
            color: #333;
        }

        .difficulty-select, .grid-select {
            margin-bottom: 25px;
        }

        .difficulty-select label, .grid-select label {
            display: block;
            margin-bottom: 12px;
            color: #666;
            font-weight: 500;
            font-size: 0.95em;
        }

        .difficulty-buttons, .grid-buttons {
            display: flex;
            gap: 10px;
        }

        .difficulty-btn, .grid-btn {
            flex: 1;
            padding: 12px;
            border: 2px solid #e5e7eb;
            background: white;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
            color: #666;
            font-size: 0.9em;
        }

        .difficulty-btn:hover, .grid-btn:hover {
            border-color: #667eea;
            color: #667eea;
        }

        .difficulty-btn.selected, .grid-btn.selected {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border-color: transparent;
        }

        .scoreboard {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 18px;
        }

        .score-card {
            background: linear-gradient(135deg, #f8f9fa, #e9ecef);
            padding: 10px;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            transition: transform 0.3s ease;
        }

        .score-card:hover {
            transform: translateY(-3px);
        }

        .score-card.player {
            background: linear-gradient(135deg, #667eea20, #764ba220);
        }

        .score-card.computer {
            background: linear-gradient(135deg, #f093fb20, #f5576c20);
        }

        .score-label {
            font-size: 0.75em;
            color: #666;
            margin-bottom: 5px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .score-value {
            font-size: 1.6em;
            font-weight: 700;
            background: linear-gradient(135deg, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .status {
            text-align: center;
            font-size: 1em;
            margin-bottom: 15px;
            min-height: 30px;
            color: #333;
            font-weight: 600;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 10px;
            transition: all 0.3s ease;
        }

        .status.win {
            background: linear-gradient(135deg, #10b98120, #34d39920);
            color: #059669;
        }

        .status.lose {
            background: linear-gradient(135deg, #ef444420, #dc262620);
            color: #dc2626;
        }

        .status.tie {
            background: linear-gradient(135deg, #f59e0b20, #f97316 20);
            color: #ea580c;
        }

        .board {
            display: grid;
            gap: 8px;
            margin-bottom: 18px;
            max-width: 420px;
            margin-left: auto;
            margin-right: auto;
            perspective: 1000px;
        }

        .board.grid-3 {
            grid-template-columns: repeat(3, 1fr);
        }

        .board.grid-5 {
            grid-template-columns: repeat(5, 1fr);
        }

        .board.grid-7 {
            grid-template-columns: repeat(7, 1fr);
        }

        .cell {
            aspect-ratio: 1;
            background: linear-gradient(135deg, #ffffff, #f8f9fa);
            border: none;
            border-radius: 10px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1),
                        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
            position: relative;
            overflow: hidden;
        }

        .grid-3 .cell {
            font-size: 2.2em;
        }

        .grid-5 .cell {
            font-size: 1.4em;
        }

        .grid-7 .cell {
            font-size: 1em;
        }

        .cell::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, transparent, rgba(102, 126, 234, 0.1));
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .cell:hover:not(.taken)::before {
            opacity: 1;
        }

        .cell:hover:not(.taken) {
            transform: translateY(-3px) scale(1.03);
            box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3),
                        0 0 0 1px rgba(102, 126, 234, 0.3) inset;
        }

        .cell:active:not(.taken) {
            transform: translateY(-2px) scale(0.98);
        }

        .cell.taken {
            cursor: not-allowed;
        }

        .cell.x {
            color: #667eea;
            animation: cellAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }

        .cell.o {
            color: #f5576c;
            animation: cellAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }

        @keyframes cellAppear {
            0% {
                transform: scale(0) rotate(-180deg);
                opacity: 0;
            }
            100% {
                transform: scale(1) rotate(0);
                opacity: 1;
            }
        }

        .cell.winner {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            animation: winner 0.6s ease-in-out;
            box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
        }

        @keyframes winner {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.1);
            }
        }

        .controls {
            display: flex;
            gap: 8px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 50px;
            font-size: 0.85em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
            font-family: 'Poppins', sans-serif;
        }

        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
        }

        .btn:active {
            transform: translateY(-1px);
        }

        .btn.secondary {
            background: linear-gradient(135deg, #6b7280, #4b5563);
            box-shadow: 0 5px 20px rgba(75, 85, 99, 0.3);
        }

        .btn.secondary:hover {
            box-shadow: 0 8px 30px rgba(75, 85, 99, 0.5);
        }

        .btn.change-symbol {
            background: linear-gradient(135deg, #f093fb, #f5576c);
            box-shadow: 0 5px 20px rgba(240, 147, 251, 0.4);
        }

        .btn.change-symbol:hover {
            box-shadow: 0 8px 30px rgba(240, 147, 251, 0.6);
        }

        /* Footer */
        footer {
            position: relative;
            z-index: 1;
            text-align: center;
            padding: 15px 20px;
            margin-top: 20px;
            color: rgba(255, 255, 255, 0.9);
        }

        .footer-content {
            max-width: 600px;
            margin: 0 auto;
        }

        .footer-content p {
            font-size: 0.85em;
            margin-bottom: 8px;
            font-weight: 300;
        }

        .footer-links {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 10px;
        }

        .footer-links a {
            color: rgba(255, 255, 255, 0.8);
            text-decoration: none;
            font-size: 0.85em;
            transition: all 0.3s ease;
            font-weight: 400;
        }

        .footer-links a:hover {
            color: white;
            transform: translateY(-2px);
        }

        /* Info Pages - Made Smaller */
        .info-page {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(10px);
            z-index: 2000;
            overflow-y: auto;
            animation: fadeIn 0.3s ease;
            padding: 20px;
        }

        .info-page.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .info-content {
            background: white;
            padding: 25px 30px;
            border-radius: 20px;
            max-width: 500px;
            width: 100%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
            animation: scaleIn 0.3s ease;
            position: relative;
        }

        .info-content::-webkit-scrollbar {
            width: 8px;
        }

        .info-content::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 10px;
        }

        .info-content::-webkit-scrollbar-thumb {
            background: linear-gradient(135deg, #667eea, #764ba2);
            border-radius: 10px;
        }

        .info-content h2 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.5em;
            background: linear-gradient(135deg, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            padding-right: 40px;
        }

        .info-content h3 {
            color: #333;
            margin-top: 20px;
            margin-bottom: 10px;
            font-size: 1.1em;
        }

        .info-content p {
            color: #666;
            line-height: 1.6;
            margin-bottom: 12px;
            font-size: 0.9em;
        }

        .info-content ul {
            color: #666;
            line-height: 1.6;
            margin-bottom: 15px;
            margin-left: 20px;
            font-size: 0.9em;
        }

        .info-content li {
            margin-bottom: 8px;
        }

        .close-info {
            position: absolute;
            top: 15px;
            right: 15px;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            font-size: 1.3em;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
            line-height: 1;
        }

        .close-info:hover {
            transform: rotate(90deg) scale(1.1);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
        }

        .contact-form {
            margin-top: 15px;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 6px;
            color: #333;
            font-weight: 600;
            font-size: 0.9em;
        }

        .form-group input,
        .form-group textarea {
            width: 100%;
            padding: 10px;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            font-family: 'Poppins', sans-serif;
            font-size: 0.9em;
            transition: border-color 0.3s ease;
        }

        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #667eea;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 100px;
        }

        .submit-btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            padding: 10px 25px;
            border-radius: 50px;
            font-size: 0.95em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
            font-family: 'Poppins', sans-serif;
            width: 100%;
        }

        .submit-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
        }

        .social-links {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 20px;
            flex-wrap: wrap;
        }

        .social-link {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            text-decoration: none;
            font-size: 1.3em;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
        }

        .social-link:hover {
            transform: translateY(-5px) scale(1.1);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
        }

        .social-link.Instagram {
            background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
        }

        .social-link.discord {
            background: linear-gradient(135deg, #7289da, #5b6eae);
        }

        .social-link.github {
            background: linear-gradient(135deg, #333, #000);
        }

        .social-link.portfolio {
            background: linear-gradient(135deg, #f093fb, #f5576c);
        }

        @media (max-width: 600px) {
            h1 {
                font-size: 1.5em;
            }

            .game-container {
                padding: 20px 15px;
            }

            .grid-3 .cell {
                font-size: 2em;
            }

            .grid-5 .cell {
                font-size: 1.2em;
            }

            .grid-7 .cell {
                font-size: 0.9em;
            }

            .controls {
                flex-direction: column;
            }

            .btn {
                width: 100%;
            }

            .modal-content {
                padding: 30px 20px;
            }

            .player-option {
                padding: 20px 10px;
            }

            .player-option-symbol {
                font-size: 2.5em;
            }

            .footer-links {
                flex-direction: column;
                gap: 10px;
            }

            .info-content {
                padding: 20px;
                max-height: 85vh;
            }

            .info-content h2 {
                font-size: 1.3em;
            }

            .close-info {
                width: 30px;
                height: 30px;
                font-size: 1.1em;
            }
        }