body {
    margin: 0;
    background: #dfe6ee;
    font-family: Arial, sans-serif;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wordlegrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: min(92vw, 330px);
    margin: 0 auto;
}

.tile {
    aspect-ratio: 1 / 1;
    width: 100%;
    border: 2px solid #777;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 6vw, 28px);
    font-weight: bold;
    text-transform: uppercase;
    box-sizing: border-box;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

#guess {
    width: 140px;
    max-width: 100%;
    height: 40px;
    font-size: 18px;
    text-align: center;
    text-transform: uppercase;
    border: 2px solid #777;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
}

#guess:focus {
    border-color: #4CAF50;
}

button {
    height: 40px;
    padding: 0 16px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
}

button:hover {
    background-color: #43a047;
}

button:active {
    transform: scale(0.96);
}
.keyboard {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: nowrap;
}

.key {
    width: 32px;
    height: 42px;
    background-color: #d3d6da;
    border-radius: 4px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center; 
}

.wide-key {
    width: 60px;
}

.key.correct {
    background-color: green;
    color: white;
}

.key.present {
    background-color: goldenrod;
    color: white;
}

.key.absent {
    background-color: gray;
    color: white;
}
.popup {
    margin: 10px auto 0;
    padding: 10px 12px;
    max-width: 260px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
}

.popup.hidden { display: none; }

.popup.error {
    background: #ffd6d6;
    border: 2px solid #d33;
    color: #700;
}

.popup.info {
    background: #e7f3ff;
    border: 2px solid #339;
    color: #113;
}

.reset {
    margin: 10px auto 0;
    display: block;
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    background: #333;
    color: white;
    cursor: pointer;
}

.reset.hidden { display: none; }