/* ============================================
   Century Birthday - Bodyguard Game
   ============================================ */

/* Story dialog */
#story-dialog {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(8,8,24,0.9); backdrop-filter: blur(6px);
  transition: opacity 0.5s;
}
#story-dialog.hidden { opacity: 0; pointer-events: none; }
.story-card { text-align: center; animation: storyIn 0.6s ease-out; }
@keyframes storyIn { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.story-icon { font-size: 4rem; margin-bottom: 16px; animation: storyBounce 1.5s ease-in-out infinite; }
@keyframes storyBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.story-text { font-family: var(--font-display); font-size: 1.1rem; color: var(--color-gold-light); line-height: 1.8; letter-spacing: 0.05em; margin-bottom: 28px; }
.story-loading { font-family: var(--font-body); font-size: 0.8rem; color: rgba(200,190,210,0.5); margin-bottom: 16px; }

/* Instructions */
#instructions {
  position: absolute; top: 50px; left: 50%; transform: translateX(-50%);
  z-index: 15; font-family: var(--font-body); font-size: 0.75rem;
  color: rgba(200,190,210,0.5); pointer-events: none; letter-spacing: 0.03em;
}

/* Toast */
#toast {
  position: absolute; top: 38%; left: 50%; transform: translateX(-50%);
  z-index: 15; font-family: var(--font-body); font-size: 0.9rem;
  color: var(--color-gold-light); pointer-events: none;
  text-shadow: 0 0 12px rgba(240,215,140,0.4);
  opacity: 0; transition: opacity 0.3s;
  text-align: center; max-width: 80vw;
}
#toast.show { opacity: 1; }

#game-container {
  position: relative; width: 100vw; height: 100vh; height: 100dvh;
  overflow: hidden; cursor: none;
  background: radial-gradient(ellipse at 50% 50%, #1a1030, #080818);
  touch-action: none;
}
#bodyguard-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; touch-action: none; }

#hud {
  position: absolute; top: 16px; left: 0; right: 0;
  display: flex; justify-content: space-between; padding: 0 20px;
  z-index: 20; pointer-events: none; font-family: var(--font-display);
}
#hud-score { font-size: 1.4rem; font-weight: 700; color: var(--color-gold-light); }
#hud-combo { font-size: 1rem; color: var(--color-lavender); opacity: 0; transition: opacity 0.2s; }
#hud-combo.active { opacity: 1; }
#hud-lives { font-size: 1.2rem; color: #ff6b5b; letter-spacing: 2px; }

/* Results */
#results {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  z-index: 50; background: rgba(8,8,24,0.85); backdrop-filter: blur(8px);
}
#results.hidden { display: none; }
.results-card {
  background: linear-gradient(145deg, #1a1640, #0f0d28);
  border: 2px solid var(--color-gold-dark); border-radius: 20px;
  padding: 36px 44px; text-align: center; max-width: 400px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: cardAppear 0.5s ease-out;
}
@keyframes cardAppear { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.results-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--color-text-dim); margin-bottom: 4px; }
.results-grade {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 900;
  color: var(--color-gold-light); text-shadow: 0 0 40px rgba(240,215,140,0.5);
  margin-bottom: 12px;
}
.results-comment { font-family: var(--font-body); font-size: 0.95rem; color: var(--color-lavender); font-style: italic; margin-bottom: 20px; line-height: 1.7; }
.results-stats { margin-bottom: 24px; }
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 1rem; }
.stat-label { color: var(--color-text-dim); }
.stat-value { color: var(--color-text); font-weight: 600; }
.perfect-color { color: #f0d78c; }
.miss-color { color: #db5a5a; }
.results-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
