* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0b0d17;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  touch-action: manipulation;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  padding: 10px;
}

.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #151932;
  border-radius: 8px 8px 0 0;
  border: 2px solid #232b50;
  border-bottom: none;
}

.game-header h1 {
  font-size: 1.2rem;
  color: #ff4757;
}

.score-display {
  font-size: 1.1rem;
  font-weight: bold;
  color: #2ed573;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 2 / 3;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  background: #05050f;
  border: 2px solid #232b50;
  border-radius: 0 0 8px 8px;
  display: block;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(11, 13, 23, 0.92);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  border-radius: 0 0 8px 8px;
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

.overlay h2 {
  font-size: 2rem;
  color: #ff4757;
  margin-bottom: 12px;
}

.instructions {
  background: #151932;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: left;
  margin-bottom: 16px;
  width: 100%;
  border: 1px solid #232b50;
}

.instructions p {
  margin-bottom: 6px;
}

.instructions ul {
  list-style-type: none;
  padding-left: 0;
}

.instructions li {
  margin-bottom: 6px;
}

kbd {
  background-color: #232b50;
  border-radius: 3px;
  border: 1px solid #2ed573;
  padding: 1px 4px;
  font-size: 0.75rem;
}

.final-score-text {
  font-size: 1.4rem;
  color: #2ed573;
  margin-bottom: 16px;
  font-weight: bold;
}

.btn {
  background-color: #ff4757;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.btn:hover {
  background-color: #ff6b81;
}

.btn:active {
  transform: scale(0.98);
}

#mis-leaderboard {
  width: 100%;
  margin-top: 15px;
  max-height: 200px;
  overflow-y: auto;
}