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

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, .22), transparent 30%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, .18), transparent 30%),
        linear-gradient(135deg, #0f172a, #111827);
    color: white;
    display: flex;
    justify-content: center;
    padding: 30px 15px;
}

.app {
    width: min(620px, 100%);
    text-align: center;
}

header {
    margin-bottom: 25px;
}

h1 {
    font-size: clamp(2.8rem, 8vw, 5rem);
    margin-bottom: 8px;
}

header p {
    color: #cbd5e1;
    font-weight: 700;
}

.board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 8px;
    width: min(350px, 100%);
    margin: 0 auto 20px;
}

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

.tile {
    aspect-ratio: 1 / 1;
    border: 2px solid #475569;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    background: rgba(255,255,255,.04);
    transition: .25s;
}

.tile.filled {
    border-color: #94a3b8;
    transform: scale(1.04);
}

.green {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: white;
}

.yellow {
    background: #eab308 !important;
    border-color: #eab308 !important;
    color: white;
}

.gray {
    background: #475569 !important;
    border-color: #475569 !important;
    color: white;
}

.message {
    min-height: 32px;
    font-size: 1.15rem;
    font-weight: 900;
    margin: 15px 0;
}

.keyboard {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    min-width: 38px;
    height: 48px;
    border: none;
    border-radius: 9px;
    background: #334155;
    color: white;
    font-weight: 900;
    cursor: pointer;
    transition: .15s;
}

.key:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

.key.big {
    min-width: 70px;
    font-size: .82rem;
}

.new-game {
    margin-top: 20px;
    padding: 13px 22px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #3b82f6);
    color: white;
    font-weight: 900;
    cursor: pointer;
}

.rules {
    margin-top: 28px;
    padding: 20px;
    border-radius: 18px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.14);
    text-align: left;
}

.rules h2 {
    margin-bottom: 12px;
    text-align: center;
}

.rule {
    margin: 10px 0;
    color: #e5e7eb;
    font-weight: 700;
}

.box {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    margin-right: 8px;
    font-weight: 900;
}

@media (max-width: 480px) {
    .key {
        min-width: 30px;
        height: 44px;
        font-size: .85rem;
    }

    .key.big {
        min-width: 58px;
    }

    .tile {
        font-size: 1.6rem;
    }
}
