@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700&display=swap');

        :root {
            --red: #ff4757;
            --blue: #2e86de;
            --bg-dark: #0f172a;
            --card-bg: rgba(30, 41, 59, 0.7);
            --board-white: #ffffff;
            --text-glow: 0 0 10px rgba(255, 255, 255, 0.2);
        }

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

        body {
            font-family: 'Poppins', sans-serif;
            background-color: var(--bg-dark);
            background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
            color: #f8fafc;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            overflow: hidden;
        }

        #game-container {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 2.5rem;
            border-radius: 24px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            text-align: center;
            width: 400px;
            transition: transform 0.3s ease;
        }

        h1 {
            font-weight: 700;
            letter-spacing: -1px;
            margin-bottom: 1.5rem;
            background: linear-gradient(to right, #fff, #94a3b8);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        /* --- Setup Screen --- */
        .input-group {
            margin: 20px 0;
        }

        #player-input {
            background: rgba(15, 23, 42, 0.8);
            border: 2px solid #334155;
            border-radius: 12px;
            color: white;
            font-size: 1.5rem;
            padding: 10px;
            width: 80px;
            text-align: center;
            margin-bottom: 20px;
            outline: none;
            transition: border-color 0.3s;
        }

        #player-input:focus {
            border-color: var(--blue);
        }

        .btn-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }

        button {
            padding: 12px;
            border-radius: 12px;
            border: none;
            background: #334155;
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        button:hover {
            background: #475569;
            transform: translateY(-2px);
        }

        /* --- Game Board --- */
        #status-bar {
            font-size: 1.1rem;
            margin-bottom: 1.5rem;
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .turn-highlight {
            padding: 2px 10px;
            border-radius: 4px;
            font-weight: 700;
        }

        #board {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            background: #cbd5e1; /* Grid line color */
            padding: 12px;
            border-radius: 16px;
            margin-bottom: 20px;
        }

        .cell {
            background: var(--board-white);
            height: 100px;
            border-radius: 8px;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 3rem;
            font-weight: 700;
            cursor: pointer;
            color: #1e293b;
            transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .cell:hover:not(.taken) {
            transform: scale(0.95);
            background: #f1f5f9;
        }

        .cell.taken { cursor: default; }
        
        .x-mark { color: var(--red); text-shadow: 0 0 15px rgba(255, 71, 87, 0.4); }
        .o-mark { color: var(--blue); text-shadow: 0 0 15px rgba(46, 134, 222, 0.4); }

        /* --- End Screen --- */
        .modal {
            margin-top: 20px;
            animation: fadeIn 0.4s ease forwards;
        }

        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

        .exit-link {
            display: block;
            margin-top: 20px;
            color: #94a3b8;
            text-decoration: none;
            font-size: 0.85rem;
            transition: color 0.2s;
        }

        .exit-link:hover { color: white; }

        .hidden { display: none !important; }