/* ============================================
   BELL PONTE - Moorhuhn Pizza Game Styles
   ============================================ */

/* Game start screen within section */
.game-instructions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  position: relative;
}

.game-instruction {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.game-instruction .gi-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(192, 57, 43, 0.25);
  color: #ff6b5a;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Game HUD */
.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(10, 10, 10, 0.95);
  border-bottom: 1px solid var(--color-border);
}

.game-hud-left,
.game-hud-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.game-hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-hud-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.game-hud-value {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.game-hud-value.score {
  color: var(--color-warm-gold);
}

.game-hud-value.timer {
  color: var(--color-fire-red-glow);
}

.game-hud-value.combo {
  color: var(--color-warm-gold-light);
  font-size: 1rem;
}

/* Combo flash animation */
.combo-flash {
  animation: comboFlash 0.3s ease-out;
}

@keyframes comboFlash {
  0% { transform: scale(1.5); color: #fff; }
  100% { transform: scale(1); }
}

/* Hit indicator */
.hit-indicator {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-warm-gold);
  pointer-events: none;
  z-index: 100;
  animation: hitFloat 0.8s ease-out forwards;
  text-shadow: 0 0 10px rgba(212, 168, 67, 0.5);
}

@keyframes hitFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1.3);
  }
}

/* Miss indicator */
.miss-indicator {
  position: absolute;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 100;
  animation: missFloat 0.5s ease-out forwards;
}

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

/* Game over screen */
.game-result {
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-lg);
}

.game-result-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-sm);
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.game-result-subtitle {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-xl);
}

/* Custom name input (replaces browser prompt) */
.game-name-input {
  margin-bottom: var(--space-lg);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.game-name-input label {
  display: block;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-xs);
  text-align: left;
}

.name-input-row {
  display: flex;
  gap: var(--space-sm);
}

.name-input-row input {
  flex: 1;
  padding: 8px 14px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(212, 168, 67, 0.3);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: var(--text-base);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}

.name-input-row input::placeholder {
  color: rgba(255,255,255,0.35);
}

.name-input-row input:focus {
  border-color: var(--color-warm-gold);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.2);
}

.name-input-row .game-btn {
  padding: 8px 16px;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.game-result-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.game-stat {
  text-align: center;
}

.game-stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--color-warm-gold);
  display: block;
  margin-bottom: var(--space-xs);
}

.game-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Leaderboard */
.leaderboard {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.06), rgba(20, 20, 20, 0.8));
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: var(--border-radius-md);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.leaderboard-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-warm-gold);
  text-align: center;
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-entry {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}

.lb-entry:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lb-gold {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(212, 168, 67, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.25);
}

.lb-silver {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.08), rgba(150, 150, 150, 0.04));
  border: 1px solid rgba(192, 192, 192, 0.2);
}

.lb-bronze {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.08), rgba(180, 100, 30, 0.04));
  border: 1px solid rgba(205, 127, 50, 0.2);
}

.lb-rank {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  min-width: 28px;
  text-align: center;
  color: var(--color-text-muted);
}

.lb-gold .lb-rank { color: #ffd700; }
.lb-silver .lb-rank { color: #c0c0c0; }
.lb-bronze .lb-rank { color: #cd7f32; }

.lb-name {
  flex: 1;
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-warm-gold);
  min-width: 50px;
  text-align: right;
}

.lb-detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 80px;
  text-align: right;
}

.lb-empty {
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  font-size: var(--text-sm);
  padding: var(--space-md);
  list-style: none;
}

/* Confetti */
.confetti-piece {
  position: fixed;
  pointer-events: none;
  z-index: 10001;
  animation: confettiFall var(--fall-duration, 3s) ease-in forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* Game action buttons */
.game-action-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-xl);
}

.game-btn {
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--border-radius-xl);
  font-weight: 600;
  font-size: var(--text-base);
  transition: all var(--transition-fast);
}

.game-btn-primary {
  background: linear-gradient(135deg, var(--color-fire-red), var(--color-fire-red-dark));
  color: #fff;
  box-shadow: var(--shadow-glow-red);
}

.game-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(192, 57, 43, 0.5);
}

.game-btn-secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.game-btn-secondary:hover {
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
}

/* Sound toggle button in HUD */
.game-sound-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s;
}

.game-sound-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Custom game cursor – disable on touch devices */
.game-overlay canvas {
  cursor: none;
}

@media (pointer: coarse) {
  .game-overlay canvas {
    cursor: crosshair;
  }
}

/* ---- Mobile game adjustments ---- */
@media (max-width: 767px) {
  .game-hud {
    padding: 6px 10px;
    gap: var(--space-xs);
  }

  .game-hud-left,
  .game-hud-right {
    gap: var(--space-sm);
  }

  .game-hud-label {
    font-size: 0.55rem;
  }

  .game-hud-value {
    font-size: 1rem;
  }

  .game-hud-value.combo {
    font-size: 0.85rem;
  }

  .game-close-btn {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }

  .game-sound-btn {
    width: 32px;
    height: 32px;
  }

  .game-sound-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Game over screen mobile */
  .game-result {
    padding: var(--space-md);
    max-height: 100vh;
  }

  .game-result-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-xs);
  }

  .game-result-subtitle {
    font-size: var(--text-base);
    margin-bottom: var(--space-md);
  }

  .game-result-stats {
    gap: var(--space-md);
    margin-bottom: var(--space-md);
  }

  .game-stat-value {
    font-size: var(--text-lg);
  }

  .game-stat-label {
    font-size: 0.6rem;
  }

  /* Name input mobile */
  .game-name-input {
    max-width: 100%;
  }

  .name-input-row {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .name-input-row input {
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  .name-input-row .game-btn {
    width: 100%;
    padding: 10px;
  }

  /* Leaderboard mobile */
  .leaderboard {
    padding: var(--space-md);
    max-width: 100%;
  }

  .lb-detail {
    display: none; /* Hide details on small screens */
  }

  .lb-entry {
    padding: 6px 10px;
  }

  /* Action buttons mobile */
  .game-action-buttons {
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
  }

  .game-btn {
    width: 100%;
    padding: var(--space-md);
    font-size: var(--text-sm);
    text-align: center;
  }

  /* Instructions mobile */
  .game-instructions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .hit-indicator {
    font-size: 1.1rem;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .game-hud {
    padding: 4px 8px;
  }

  .game-hud-value {
    font-size: 0.9rem;
  }

  .game-result-title {
    font-size: var(--text-lg);
  }

  .leaderboard-title {
    font-size: var(--text-base);
  }
}
