.tile {
    border: 1px solid black;
    display: inline-block;
    background-color: lightgray;
    text-align: center;
    width: 10px;
    height: 10px;
    position: absolute;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: linear-gradient(0.25turn, #3f87a6, #ebf8e1, #f69d3c);
}

#board {
    position: relative;
    width: 100%;
    height: 100%;
}

#board.hidden {
    display: none;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 18px;
    background: linear-gradient(90deg, rgba(32, 69, 104, 0.92), rgba(83, 159, 230, 0.9));
    border-bottom: 2px solid rgba(255, 248, 239, 0.35);
    color: #fff8ef;
}

.hud-item {
    display: flex;
    flex-direction: column;
    min-width: 92px;
}

.hud-best {
    min-width: 180px;
}

.hud-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 248, 239, 0.82);
}

#leaderboard-button,
#restart-button,
#menu-leaderboard-button,
#leaderboard-close,
#submit-score-button,
#win-modal-close {
    margin-left: auto;
    border: 1px solid #1c1c1c;
    border-radius: 999px;
    padding: 10px 18px;
    background: #ab4b7e;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

#leaderboard-button,
#menu-leaderboard-button,
#leaderboard-close {
    background: #3f87a6;
}

#restart-button,
#leaderboard-button,
#submit-score-button,
#win-modal-close {
    margin-left: 0;
}

#leaderboard-button {
    margin-left: auto;
}

#menu-leaderboard-button {
    margin-left: 0;
}

#leaderboard-close {
    margin-left: 0;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 24, 40, 0.55);
    z-index: 10;
}

.modal.hidden {
    display: none;
}

.modal-content {
    min-width: 280px;
    max-width: 420px;
    padding: 32px 28px;
    border: 2px solid #1c1c1c;
    border-radius: 18px;
    background: #fff8ef;
    text-align: center;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.modal-content h1 {
    margin: 0 0 12px;
    font-size: 2rem;
}

.modal-content p {
    margin: 0 0 20px;
    font-size: 1.1rem;
}

#win-best-badge {
    display: inline-block;
    margin: 0 0 20px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ab4b7e;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
}

#win-best-badge.hidden {
    display: none;
}

.modal-content button {
    cursor: pointer;
}

#score-name-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#score-name {
    width: 100%;
    margin: 0 0 12px;
    padding: 12px 14px;
    box-sizing: border-box;
    border: 1px solid #1c1c1c;
    border-radius: 12px;
    font: inherit;
    text-transform: uppercase;
    text-align: center;
}

.modal-note {
    min-height: 1.2em;
    margin: 0 0 16px;
    font-size: 0.95rem;
}

.modal-note.error {
    color: #9c1a4d;
}

#leaderboard-status.hidden {
    display: none;
}

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

.level-button {
    min-width: 110px;
}

#leaderboard-list {
    margin: 0 0 20px;
    padding-left: 24px;
    text-align: left;
}

#leaderboard-list.hidden {
    display: none;
}

#leaderboard-list li {
    margin-bottom: 10px;
}

html {
    font-family: 'Open Sans', sans-serif;
}
