/* ============================================
   Shared Game Styles — 度咯工坊 (Light Theme)
   Stripe-caliber design system
   Include via: <link rel="stylesheet" href="/styles/games.css">
   ============================================ */

/* ── Layout ── */
.game-container {
  text-align: center;
  padding: 20px;
  max-width: 500px;
  margin: 0 auto;
}

.game-header {
  margin-bottom: 25px;
}

.game-header h1 {
  font-size: 32px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #635BFF 0%, #4F46E5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-intro {
  color: #425466;
  font-size: 1.1rem;
  margin: 15px 0;
  line-height: 1.6;
}

/* ── Score / Status ── */
.score-display {
  font-size: 24px;
  font-weight: bold;
  color: var(--indigo, #635BFF);
  margin: 10px 0;
}

.status-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.status-box {
  background: #F6F9FC;
  border: 1px solid #E3E8EE;
  border-radius: 12px;
  padding: 8px 20px;
  color: #425466;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-box b {
  color: var(--indigo, #635BFF);
  font-size: 1.25rem;
  font-weight: 700;
}

/* ── Canvas ── */
.game-container canvas,
.game-container #gameCanvas {
  border: 3px solid var(--indigo, #635BFF);
  border-radius: 16px;
  background: #FAFAFC;
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.04), 0 12px 32px rgba(10, 37, 64, 0.08);
}

/* ── Buttons ── */
.controls {
  margin-top: 25px;
}

.btn {
  padding: 12px 32px;
  font-size: 16px;
  margin: 8px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(180deg, #635BFF 0%, #4F46E5 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 91, 255, 0.4);
}

.btn-primary:focus-visible {
  outline: 2px solid rgba(99, 91, 255, 0.6);
  outline-offset: 2px;
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(99, 91, 255, 0.4);
  color: #635BFF;
}

.btn-outline:hover {
  background: rgba(99, 91, 255, 0.08);
  border-color: var(--indigo, #635BFF);
}

/* ── Instructions ── */
.instructions {
  margin-top: 20px;
  color: #8898AA;
  font-size: 14px;
}

/* ── Mobile Controls ── */
.mobile-controls {
  display: none;
  margin-top: 30px;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mobile-btn {
  width: 70px;
  height: 70px;
  font-size: 32px;
  background: rgba(99, 91, 255, 0.06);
  border: 2px solid rgba(99, 91, 255, 0.3);
  color: #635BFF;
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mobile-btn:active {
  background: rgba(99, 91, 255, 0.15);
  transform: scale(0.95);
}

.mobile-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ── Game Over Modal ── */
.game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.game-modal {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(10, 37, 64, 0.12), 0 32px 64px rgba(10, 37, 64, 0.16);
  max-width: 400px;
  width: 90%;
  animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #E3E8EE;
}

.game-modal h2 {
  font-size: 24px;
  font-weight: 600;
  color: #0A2540;
  margin-bottom: 8px;
}

.game-modal p {
  font-size: 16px;
  color: #425466;
  margin-bottom: 24px;
}

.game-modal .btn-primary {
  background: linear-gradient(180deg, #635BFF 0%, #4F46E5 100%);
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
  transition: all 0.2s;
}

.game-modal .btn-primary:hover {
  box-shadow: 0 8px 24px rgba(99, 91, 255, 0.4);
  transform: translateY(-1px);
}

/* ── Keyframes ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .game-modal-overlay,
  .game-modal {
    animation: none;
  }
  .game-modal .btn-primary:hover {
    transform: none;
  }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .game-header h1 {
    font-size: 26px;
  }
}
