* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff;
  font-family: "Press Start 2P", monospace;
}

#game {
  width: 100vw;
  height: 100vh;
  display: block;
  background: #fff;
  touch-action: none;
}

.mobile-hint {
  position: fixed;
  left: 50%;
  top: 0.8rem;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border: 2px solid #000;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  font-size: 0.45rem;
  line-height: 1.5;
  text-align: center;
  max-width: calc(100vw - 1.2rem);
}

.mobile-hint.hidden {
  display: none;
}

.unlock-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  display: grid;
  gap: 0.7rem;
  justify-items: center;
}

.leaderboard {
  min-width: 180px;
  max-width: 320px;
  border: 2px solid #000;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.98);
  padding: 1rem;
  overflow: hidden;
}

.leaderboard-title {
  margin: 0;
  color: #000;
  font-size: 0.7rem;
}

.scores-list {
  margin: 0.7rem 0 0 0;
  padding-left: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #000;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.scores-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  padding: 0;
}

.score-name {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.score-value {
  text-align: right;
  margin-left: auto;
}

.result-line,
.rank-line {
  margin: 0;
  color: #000;
  text-align: center;
}

.result-line {
  font-size: 0.78rem;
}

.rank-line {
  font-size: 0.58rem;
}

.score-form {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}

.score-label {
  color: #000;
  font-size: 0.5rem;
  text-align: center;
}

.score-row {
  display: flex;
  gap: 0.42rem;
  align-items: center;
}

.score-input {
  width: min(220px, 56vw);
  border: 2px solid #000;
  border-radius: 4px;
  background: #fff;
  color: #000;
  font-family: "Press Start 2P", monospace;
  font-size: 0.54rem;
  padding: 0.45rem 0.5rem;
}

.score-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #000;
}

.score-submit {
  border: 2px solid #000;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 0.48rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
}

.score-submit:disabled {
  opacity: 0.65;
  cursor: default;
}

.play-again {
  border: 2px solid #000;
  background: #000;
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 1rem;
  border-radius: 6px;
  padding: 0.72rem 1.15rem;
  min-width: 220px;
  cursor: pointer;
}

.contact-text {
  margin: 0;
  color: #000;
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
}

.top-icons {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
}

.top-icons a {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 2px solid #000;
  border-radius: 4px;
  text-decoration: none;
  color: #000;
  font-family: "Press Start 2P", monospace;
  font-size: 0.68rem;
  background: #fff;
}

.hidden {
  display: none;
}

@media (max-width: 700px) {
  .leaderboard {
    min-width: 150px;
  }
}
