* {
    user-select: none;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    background: #121213;
    color: #d7dadc;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Inter", Arial, sans-serif;
}

.page-wrap {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.game-container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid #3a3a3c;
    padding-bottom: 8px;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.5rem;
}

.menu {
    display: flex;
    gap: 10px;
    opacity: 0.9;
    align-items: center;
}

.menu span {
    display: flex;
    text-align: center;
    font-weight: bold;
    align-items: center;
}

#leaderboard {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e93;
}

#leaderboard[gold] {
    background: radial-gradient(ellipse farthest-corner at left top, #FFD700 0%, #FFC700 40%, #B8860B 100%);
    color: white;
}
#leaderboard[silver] {
    background: radial-gradient(ellipse farthest-corner at left top, #C0C0C0 0%, #D9D9D9 40%, #A9A9A9 100%);
    color: black;
}
#leaderboard[bronze] {
    background: radial-gradient(ellipse farthest-corner at left top, #CD7F32 0%, #D2691E 50%, #8B4513 100%);
    color: white;
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1c1c1e;
  color: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.close-btn {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
}

.tiles {
    display: flex;
    flex-direction: column;
    gap: 1vh;
    margin: 2vh 0;
}

.tiles .row {
    display: flex;
    justify-content: center;
    gap: 1.2vw;
}

.tile {
    width: 18vw;
    height: 18vw;
    max-width: 70px;
    max-height: 70px;
    font-size: 2rem;
    transition: background-color 0.3s ease;
    border: 2px solid #3a3a3c;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: "Courier New", monospace;
}

.tile.correct-all {
    background: #6aaa64;
    border-color: #6aaa64;
    color: #fff;
}

.tile.wrong {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.progress-wrap {
    margin: 1vh 0 2vh;
}

.progress {
    width: 100%;
    height: 1.2vh;
    background: #3a3a3c;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #6aaa64;
    transition: width 0.25s ease;
}

.numpad {
    height: 100%;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1vh;
}

.numpad .row {
    display: flex;
    justify-content: center;
    gap: 1.2vw;
}

.numpad .btn {
    width: 18vw;
    height: 18vw;
    max-width: 70px;
    max-height: 70px;
    font-size: 2rem;
    font-weight: 8-700;
    border: 2px solid #3a3a3c;
    background: transparent;
    color: #d7dadc;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-family: "Courier New", monospace;
}

.numpad .btn:hover {
    border-color: #d7dadc;
}