* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    max-height: 100vh;
    text-align: center;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    font-family: 'Courier New', Courier, monospace;
    color: white;
    padding: 1rem;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    margin-bottom: 1.5rem;
    text-align: center;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #ffcc00;
}

#win-msg {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #00ffcc;
    height: 3rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
}

#game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 60vmin;
    margin-bottom: 1.5rem;
}

.player {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.player.active {
    background: rgba(138, 43, 226, 0.7);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.8);
}

#container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 90vmin;
}

#game {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1vmin;
    width: 60vmin;
    height: 60vmin;
    max-width: 90vw;
    max-height: 90vw;
    margin: 0 auto 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1vmin;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    aspect-ratio: 1/1;
}

.boxes {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 10vmin;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    aspect-ratio: 1/1;
}

.boxes:hover {
    background: rgba(138, 43, 226, 0.3);
    transform: translateY(-3px);
   
}

.boxes.x {
    color: #ff5252;
}

.boxes.o {
    color: #4fc3f7;
}

#controls {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

#reset-btn, #new-game {
    padding: 0.8rem 1.8rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-family: 'Courier New', Courier, monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}    
a{
    text-decoration: none;
    color: #fff;
}


#reset-btn:hover, #new-game:hover {
    background: rgba(138, 43, 226, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
   
}

#reset-btn:active, #new-game:active {
    transform: translateY(1px);
}

footer {
    position: absolute;
    bottom: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #game {
        width: 70vmin;
        height: 70vmin;
    }
    
    .boxes {
        font-size: 12vmin;
    }
}

@media (max-width: 480px) {
    #game {
        width: 85vmin;
        height: 85vmin;
    }
    
    .boxes {
        font-size: 15vmin;
    }
    
    #controls {
        flex-direction: column;
        gap: 1rem;
    }
}