* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #2e2c2c;
    
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 16px;
}
.container{
    width: 100%;
    max-width:500px;
    text-align:center;

}
h1{
    color: #f0f0f0;
    font-size: 4rem;
    text-decoration:underline;
    margin-bottom: 8px;
}

.subtitle{
    color:#f0f0f0;
    font-size: medium;
    margin-bottom: 24px;
}

#board{
    display: grid;
    grid-template-rows: repeat(6,1fr);
    gap: 5px;
    margin: 0 auto 24px;
    width: 100%;
    max-width: 350px;
    aspect-ratio: 5/6 ;


}

.row{
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 5px;

}

.tile{
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: medium;
    text-transform: uppercase;
    text-decoration: solid;
    background:rgb(64, 64, 66);
    border: 2px solid rgb(86, 83, 83);
    color: rgb(255, 255, 255);
    aspect-ratio: 1/1;
    transition: transform 0.3s ease,background 0.3s ease, border 0.3s ease;
    user-select: none;
}

.tile.pop{
    animation: pop 0.1s ease;
}
@keyframes pop{
    0% { transform: scale(1);}
    50%{ transform: scale(1.12);}
    100%{ transform: scale(1);}
    
}

.tile.flip{
    animation: flip 0.4s ease forwards;
}

@keyframes flip{
    0% { transform: rotateX(0deg);}
    50% { transform: rotateX(90deg);}
    100%{ transform: rotateX(0deg);}
}

.tile.correct{
    background: #446841;
    border-color: #446841;
}

.tile.present{
    background: #b59f3b;
    border-color: #b59f3b;
}

#keyboard{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.kb-row{
    display: flex;
    justify-content: center;
    gap:4px;
}
.key{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 58px;
    min-width: 30px;
    padding: 0 8px;
    background: #818384;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.15s ease;
    user-select: none;
    flex:1;
}

.key.wide{
    flex:1.5;
    font-size: 0.7rem;
}
.key:hover{
    opacity:0.85;
}
.key:active{
    transform: scale(0.95);
    
}

.key.correct{
    background: #538d4e;
}
.key.present{
    background: #b59f3b;
}
.key.absent{
    background: #3a3a3c;
}

#message{
    height: 32px;
    font-size: 0.95rem;
    color: #f0f0f0;
    margin-bottom: 8px;
}

#message.error{
    color: #f44336;
}

#message.win{
    color: #538d4e;
    font-weight: 700;

}

.controls{
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.controls button{
    padding:10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #538d4e;
    color: #ffff;
    transition: background 0.2s ease;

}

.controls button:hover{
    background: #66a85f;
}

.controls button.secondary {

    background:#3a3a3c;

}

.controls button.secondary:hover{
    background: #555;

}

@media (max-width: 480px){
    h1 {font-size: 1.6rem;}
    .tile {font-size: 1.5rem;}
    .key { height: 50px; font-size: 0.75rem; min-width: 24px;}
}

.b1{
    border: none;
    border-radius: 8px;
    padding: 6px 8px ;
    background-color: #538d4e;
    color: #f0f0f0;

}
.secondary{
    border: none;
    border-radius: 8px;
    padding: 6px 8px;
    color: #f0f0f0;
    background-color: #f44336;
}
.controls{
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}