body {
  background-color: #2a3441;
  color: white;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  overflow: hidden;
  width: 100%;
  height: 100%;
}

/* ========== GAME HUD (Heads-Up Display) ========== */
.game-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 25px 0;
  z-index: 1000;
}

.hud-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 30px;
  gap: 40px;
}

.hud-left,
.hud-center,
.hud-right {
  display: flex;
  justify-content: center;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s ease;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Monaco', 'Courier New', monospace;
}

.stat-box.highlight .stat-label {
  color: rgba(255, 255, 255, 0.7);
}

.stat-box.highlight .stat-value {
  font-size: 1.6rem;
  color: #ffffff;
}

/* Score update animation */
@keyframes statPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.stat-value.updated {
  animation: statPulse 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Special animation for best time (new record) */
@keyframes bestTimeUpdate {
  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.2);
  }

  50% {
    transform: scale(1.1);
  }

  75% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

.stat-value.best-record {
  animation: bestTimeUpdate 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .game-hud {
    padding: 20px 0;
  }

  .hud-container {
    padding: 0 20px;
    gap: 30px;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .stat-box.highlight .stat-value {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .game-hud {
    padding: 15px 0;
  }

  .hud-container {
    padding: 0 15px;
    gap: 20px;
  }

  .stat-label {
    font-size: 0.6rem;
    letter-spacing: 1px;
  }

  .stat-value {
    font-size: 1rem;
  }

  .stat-box.highlight .stat-value {
    font-size: 1.2rem;
  }
}

.message {
  text-align: center;
  padding: 10px;
  padding-top: 90px;
  font-size: 1.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* Responsive message padding */
@media (max-width: 768px) {
  .message {
    padding-top: 80px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .message {
    padding-top: 70px;
    font-size: 1.2rem;
  }
}

.output {
  position: relative;
  width: 100%;
  height: 100vh;
  background: transparent;
}

.box {
  width: 100px;
  height: 100px;
  position: absolute;
  background-color: cornsilk;
  border: 1px solid black;
  font-size: 1.5em;
  line-height: 100px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease;
  opacity: 0;
  transform: scale(0.85);
  user-select: none;
  -webkit-user-select: none;
}

.box * {
  pointer-events: none;
  user-select: none;
}

.box:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.box.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.box.pop-effect {
  animation: popAnimation 0.3s ease-out forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popAnimation {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(0);
  }
}

/* Click particle effect */
.click-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
}

@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* Click flash effect */
.click-flash {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
  z-index: 998;
  animation: flashEffect 0.3s ease-out;
}

@keyframes flashEffect {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }

  100% {
    transform: scale(2);
    opacity: 0;
  }
}