/* src/style.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow: hidden;
  touch-action: none;
  height: 100%;
}

body {
  display: flex;
  background-color: #121113;
  justify-content: center;
  align-items:  center;
}

#game-container {
  display: flex;
  position: relative;
  justify-content: center;
  width: 100%;
  max-width: 600px;
  padding: 0 16px;
}

#game-container canvas {
  aspect-ratio: 4;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%;
}

#score-overlay {
  position: absolute;
  display: flex;
  z-index: 10;
  background: #121113e0;
  justify-content: center;
  align-items:  center;
  inset: 0;
}

#score-modal {
  display: flex;
  color: #e8e8e8;
  text-align: center;
  background: #1a1a1b;
  border: 2px solid #3a3a3b;
  border-radius: 4px;
  flex-direction: column;
  align-items:  center;
  gap: 16px;
  min-width: 400px;
  max-width: 90vw;
  padding: 32px;
  font-family: PressStart2P, monospace;
}

@media (max-width: 500px) {
  #score-modal {
    width: 90vw;
    min-width: auto;
  }
}

@media (max-height: 600px) {
  #score-modal {
    overflow-y: auto;
    gap: 12px;
    max-height: 90vh;
    padding: 20px;
  }
}

#score-modal h2 {
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-size: 14px;
}

#final-score-display {
  color: #a8a8a8;
  font-size: 12px;
}

#submit-section {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 12px;
}

#player-initials {
  color: #e8e8e8;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 4px;
  outline: none;
  background: #121113;
  border: 2px solid #3a3a3b;
  border-radius: 2px;
  width: 100px;
  padding: 12px 8px;
  font-family: PressStart2P, monospace;
  font-size: 16px;
}

#player-initials:focus {
  border-color: #5a5a5b;
}

#player-initials::placeholder {
  color: #5a5a5b;
  letter-spacing: 4px;
}

#submit-btn, #action-btn {
  color: #e8e8e8;
  cursor: pointer;
  background: #2a2a2b;
  border: 2px solid #4a4a4b;
  border-radius: 2px;
  width: 100%;
  max-width: 200px;
  padding: 12px 16px;
  transition: background .15s, border-color .15s;
  font-family: PressStart2P, monospace;
  font-size: 10px;
}

#submit-btn:hover:not(:disabled), #action-btn:hover {
  background: #3a3a3b;
  border-color: #5a5a5b;
}

#submit-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.leaderboard-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 10px;
}

.leaderboard-table th {
  color: #a8a8a8;
  border-bottom: 1px solid #3a3a3b;
  padding: 8px 4px;
}

.leaderboard-table td {
  padding: 8px 4px;
}

.leaderboard-table tbody tr:hover {
  background: #252526;
}

.leaderboard-table tbody tr.highlight {
  color: #7fc97f;
  background: #2a3a2a;
}

.loading, .empty, .error {
  color: #a8a8a8;
  padding: 20px;
  font-size: 10px;
}

.error {
  color: #e85a5a;
}
