/* === 共用遊戲 Layout === */

.game-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  flex-shrink: 0;
}

.game-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* === 退出按鈕（家長用，刻意低調） === */

.game-exit-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-gray-400);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 200ms;
}

.game-exit-btn:active {
  background: rgba(0, 0, 0, 0.1);
}

/* === 星星進度 === */

.game-progress {
  display: flex;
  gap: 6px;
  align-items: center;
}

.game-progress-star {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 300ms ease-out;
}

.game-progress-star.done {
  background: linear-gradient(135deg, #F97316, #EA580C);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

.game-progress-star.pending {
  background: var(--color-gray-100);
}

.game-progress-star.earned {
  animation: gameBounce 500ms ease-out;
}

/* === Splash 畫面 === */

.game-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  gap: var(--space-xl);
  padding: var(--space-lg);
  text-align: center;
}

.game-splash-icon {
  font-size: 80px;
  animation: splashBounce 1.5s ease-in-out infinite;
}

.game-splash-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-primary);
}

.game-splash-btn {
  min-width: 200px;
  min-height: 80px;
  padding: var(--space-md) 48px;
  font-size: 1.3rem;
}

/* === 慶祝覆蓋層 === */

.game-celebration {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(253, 242, 248, 0.95);
  z-index: 100;
  gap: var(--space-lg);
  animation: gameFadeIn 300ms ease-out;
}

.game-celebration-emoji {
  font-size: 100px;
  animation: celebrate 1s ease-out;
}

.game-celebration-text {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-primary);
  text-align: center;
}

.game-celebration-sub {
  font-family: var(--font-text);
  font-size: 1.2rem;
  color: var(--color-text);
  opacity: 0.8;
}

.game-celebration.final .game-celebration-emoji {
  font-size: 120px;
  animation: celebrate 1.2s ease-out;
}

.game-celebration .game-star {
  position: absolute;
  font-size: 24px;
  color: var(--color-accent);
  animation: starBurst 1s ease-out forwards;
  pointer-events: none;
}

/* === 慶祝按鈕 === */

.game-celebration-actions {
  display: flex;
  gap: 12px;
  margin-top: var(--space-md);
}

.game-celebration-btn {
  min-width: 160px;
  min-height: 64px;
  padding: 16px 32px;
  border: none;
  border-radius: 24px;
  font-family: var(--font-text);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms;
}

.game-celebration-btn:active {
  transform: scale(0.95);
}

.game-celebration-btn.primary {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: #fff;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.game-celebration-btn.secondary {
  background: #fff;
  color: var(--color-gray-500);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* === 底部工具列 === */

.game-bottom-bar {
  flex-shrink: 0;
  padding: var(--space-md);
  padding-bottom: max(var(--space-md), env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

/* === 爸媽提示（互動版） === */

.game-parent-hint {
  position: fixed;
  bottom: env(safe-area-inset-bottom, 0px);
  left: 0;
  right: 0;
  padding: 6px 16px;
  background: rgba(253, 242, 248, 0.9);
  font-size: 13px;
  font-family: var(--font-text);
  color: var(--color-text);
  text-align: center;
  opacity: 0.6;
  pointer-events: none;
  z-index: 50;
}
