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

:root {
    /* Backgrounds */
    --bg-main: #0f1115;    
    --bg-card: #161a21;      
    --bg-cell: #1f2530;   
    --bg-hover: #2a3140; 

    /* Text */
    --text-main: #e6e8eb; 
    --text-muted: #9aa3b2;  

    /* Accent */
    --accent: #4f8cff;  
    --accent-strong: #3b73d9;

    /* Winner */
    --winner: #2ecc71;  
}

.web {
    width: 100%;
    min-height: 100vh;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(
        circle at top,
        #1e293b,
        #020617
    );
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 16px;
    border-radius: 16px;
    background-color: var(--bg-card);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.container h1{
    text-align: center;
    text-shadow: 1.5px 1.5px silver;
    font-weight: 700;
    font-family: 'Times New Roman', Times, serif;
    font-style: oblique;
}

#status {
    font-weight: 600;
    color: var(--accent);
    text-align: center;
}

.scoreboard {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 10px;
}

.cell {
    width: 100px;
    height: 100px;
    background-color: var(--bg-cell);
    color: var(--text-main);
    border-radius: 12px;
    font-size: 42px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: 
        background-color 0.2s ease,
        transform 0.1s ease;
}

.cell:hover {
    background-color: var(--bg-hover);
    transform: scale(1.05);
}

.winner {
    background-color: var(--winner) !important;
    color: #022c22;
    box-shadow: 0 0 20px rgba(34,197,94,0.7);
    animation: winnerPulse 1s infinite alternate;
}

@keyframes winnerPulse {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}

.board.disabled .cell {
    cursor: default;
}
.board.disabled .cell:hover {
    background-color: var(--scolor); 
}

#resetBtn,
#modeBtn {
    padding: 10px 28px;
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        var(--accent),
        var(--accent-strong)
    );
    color: #020617;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#modeBtn:hover {
    box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.35);
    border-color: var(--accent);
}

#resetBtn:active {
    transform: scale(0.9);
}

#modeHint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 8px;
}

@media only screen and (max-width:370px){
    .board{
        grid-template-columns: repeat(3, 80px);
    }

    .cell{
        width: 80px;
        height: 110px;
    }
}
