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

body {
    background-color: #548687;
    text-align: center;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

h1, h2 {
    color: green;
    margin-bottom: 1rem;
    font-size: 70px;
}
h2{
    font-size:40px;
}

/* ---------- Start & Menu Screens ---------- */
.start-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #020617, #0f172a);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
    gap: 1rem;
    padding: 1rem;
}

.start-screen input {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    margin: 0.3rem 0;
}

.start-screen button {
    padding: 0.8rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.3s ease;
}

.start-screen button:hover {
    transform: scale(1.05);
}


/* ---------- Game Board ---------- */
.container {
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.game {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.5rem, 2vw, 1rem);
    width: min(90vw, 420px);
}

.box {
    aspect-ratio: 1 / 1;
    border-radius: 1rem;
    border: none;
    box-shadow: 0 0 0.8rem rgba(0,0,0,0.5);
    font-size: clamp(2rem, 8vw, 4.5rem);
    color: #b0413e;
    background-color: #fffc7f;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.box:hover {
    background-color: #ffd93d;
    transform: scale(1.05);
}

/* ---------- Buttons ---------- */
#reset-btn, #new-btn, #exit-btn {
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
    color: #fff;
    border-radius: 1rem;
    border: none;
    margin: 0.5rem;
    cursor: pointer;
    transition: 0.3s;
}
#exit-btn {
    background-color: red;
}
#reset-btn, #new-btn{
    background-color: blue;
}

#reset-btn:hover, #new-btn:hover {
    background-color: #2198dded;
}
#exit-btn:hover{
    background-color: #df473ced;
}

/* ---------- Winner Message ---------- */
#msg {
    color: #84ea11;
    font-size: clamp(1.5rem, 6vw, 4rem);
    text-align: center;
    
}

.msg-container {
    top:0;
    left:0;
    position: absolute;
    inset: 0;
    display: flex;
    background: rgba(0,0,0,0.85);
    border-radius: 12px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color:#fff;
    z-index:10;
}
.msg-container h1{
    font-size:48px;
    color:red;
    margin-bottom:10px;
}



.hide { display: none; }

/* ---------- Utility ---------- */
.controls {
    margin: 1rem 0;
}


/* ---------- Responsive ---------- */
@media (max-width: 360px) {
    .game { width: 95vw; gap: 0.4rem; }
    #msg { font-size: 1.3rem; }
}
