/* Mexicat Runner - Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Courier New', 'Courier', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background: url('../assets/background.png') center / cover no-repeat fixed;
}

.game-container {
  text-align: center;
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #000;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.subtitle {
  font-size: 0.85rem;
  color: #555;
  margin-top: -14px;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

canvas {
  border: 4px solid #000;
  display: block;
  margin: 0 auto;
  background-color: #fff;
  cursor: crosshair;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.instructions {
  margin-top: 20px;
  font-size: 1rem;
  color: #333;
  line-height: 1.6;
}

.instructions p {
  margin: 8px 0;
}

.instructions strong {
  color: #000;
  font-weight: bold;
}

/* Responsive design */
@media (max-width: 900px) {
  body {
    padding: 10px;
  }

  .game-container {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  canvas {
    max-width: 100%;
    height: auto;
  }
}

/* Canvas wrapper for overlay positioning */
#canvas-wrapper {
  position: relative;
  display: inline-block;
}

/* Name entry overlay (shown on game over) */
.name-overlay {
  position: absolute;
  bottom: 16%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.97);
  border: 3px solid #000;
  border-radius: 8px;
  padding: 28px 40px;
  text-align: center;
  font-family: 'Courier New', monospace;
  z-index: 10;
  min-width: 300px;
}

.name-overlay.hidden {
  display: none;
}

.rank-display {
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 8px;
  min-height: 1.2em;
}

.overlay-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 14px;
  color: #000;
}

.name-overlay input {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  padding: 8px 12px;
  border: 2px solid #000;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
  text-align: center;
}

.name-overlay input:focus {
  outline: none;
  border-color: #555;
}

.overlay-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.overlay-buttons button {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: bold;
  padding: 8px 20px;
  border: 2px solid #000;
  border-radius: 4px;
  cursor: pointer;
  background: #000;
  color: #fff;
  transition: background 0.15s, color 0.15s;
}

.overlay-buttons button:hover {
  background: #fff;
  color: #000;
}

.overlay-buttons #skip-score-btn {
  background: #fff;
  color: #000;
}

.overlay-buttons #skip-score-btn:hover {
  background: #000;
  color: #fff;
}

/* Patch note modal */
.patch-note-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.patch-note-overlay.hidden {
  display: none;
}

.patch-note-modal {
  background: #fff;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 32px 40px;
  font-family: 'Courier New', monospace;
  max-width: 720px;
  width: 90%;
  text-align: center;
}

.patch-note-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.patch-note-list {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
  line-height: 2;
  font-size: 0.95rem;
}

.patch-note-modal button {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: bold;
  padding: 8px 28px;
  border: 2px solid #000;
  border-radius: 4px;
  cursor: pointer;
  background: #000;
  color: #fff;
  transition: background 0.15s, color 0.15s;
}

.patch-note-modal button:hover {
  background: #fff;
  color: #000;
}

/* Fun hover effect on canvas */
canvas:hover {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Loading animation (optional) */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}
