:root {
    --bg-dark: #0f172a;
    --bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    --primary: #22d3ee;
    /* Cyan for X */
    --accent: #f472b6;
    /* Pink for O */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: -1;
}

.orb-1 {
    width: 50vw;
    height: 50vw;
    background: var(--primary);
    top: -20%;
    left: -10%;
}

.orb-2 {
    width: 40vw;
    height: 40vw;
    background: var(--accent);
    bottom: -10%;
    right: -10%;
}

.game-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    max-width: 600px;
    align-items: center;
}

.hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
}

.turn-indicator span:last-child {
    font-weight: 700;
    margin-left: 0.5rem;
}

.text-x {
    color: var(--primary);
}

.text-o {
    color: var(--accent);
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 400px;
    /* Square */
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 20px;
}

.cell {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.cell:hover:not(.taken) {
    background: rgba(255, 255, 255, 0.1);
}

.cell.taken {
    cursor: default;
}

.cell.x {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary);
}

.cell.o {
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent);
}

.cell.win {
    background: rgba(255, 255, 255, 0.2);
    animation: pulse 1s infinite;
}

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

    50% {
        transform: scale(1.05);
    }

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

.footer-controls {
    margin-top: 2rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
}

.scores {
    display: flex;
    gap: 1.5rem;
    font-size: 1.2rem;
    background: var(--glass-bg);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
}

.scores .p1 {
    color: var(--primary);
}

.scores .p2 {
    color: var(--accent);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: #1e1b4b;
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-btn {
    background: linear-gradient(45deg, var(--primary), #3b82f6);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 1rem;
    cursor: pointer;
    font-size: 1.1rem;
    display: block;
    width: 100%;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn.secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.cta-btn.secondary:hover {
    background: rgba(34, 211, 238, 0.1);
}

.hidden {
    display: none !important;
}

.pulse-text {
    animation: flashInfo 1.5s infinite;
}
@keyframes flashInfo {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}