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

body {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #f8fafc;
    overflow-x: hidden;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
}

header {
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 12px;
}

label {
    font-weight: 600;
    color: #cbd5e1;
}

select {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

select:hover,
select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 1.5rem;
}

.box {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.05), 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.box:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(51, 65, 85, 0.8);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.box>span {
    pointer-events: none;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

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

.box span.X {
    color: #22d3ee;
    text-shadow: 0 0 15px rgba(34, 211, 238, 0.5);
}

.box span.O {
    color: #34d399;
    text-shadow: 0 0 15px rgba(52, 211, 153, 0.5);
}

.box.win-X {
    background: rgba(34, 211, 238, 0.2);
    border: 1px solid rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

.box.win-O {
    background: rgba(52, 211, 153, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.4);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
}

.player,
.win {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    min-height: 2.1rem;
    /* prevent layout shift */
    text-align: center;
    transition: color 0.3s;
}

.turn-x {
    color: #22d3ee;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}

.turn-o {
    color: #34d399;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

.win-draw {
    color: #94a3b8;
}

button {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4), 0 2px 4px -1px rgba(99, 102, 241, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.5), 0 4px 6px -2px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

button:active {
    transform: translateY(1px);
}