/* ============================================
   Century Birthday - Phone Screen Protector 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 ease-out;
}
#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.2rem; color: var(--color-gold-light); line-height: 2; letter-spacing: 0.05em; margin-bottom: 32px; text-shadow: 0 0 20px rgba(240,215,140,0.3); }

/* Game */
#game-container {
  position: relative; width: 100vw; height: 100vh; height: 100dvh;
  overflow: hidden; background: linear-gradient(180deg, #1a1640, #0f0d28);
  touch-action: none;
}
#phone-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; touch-action: none; }

/* HUD */
#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-level { font-size: 1rem; color: var(--color-lavender); }
#hud-score { font-size: 1.2rem; font-weight: 700; color: var(--color-gold-light); }

/* Level Popup */
#level-popup {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  color: var(--color-gold-light); z-index: 25; pointer-events: none;
  text-align: center; text-shadow: 0 0 30px rgba(240,215,140,0.5);
  transition: opacity 0.4s;
}
#level-popup.hidden { display: none; }

/* 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; letter-spacing: 0.1em; }
.results-grade { font-family: var(--font-display); font-size: 4rem; font-weight: 900; color: var(--color-gold-light); text-shadow: 0 0 40px rgba(240,215,140,0.5); line-height: 1; }
.results-title-text { font-family: var(--font-body); font-size: 1rem; color: var(--color-lavender); margin-bottom: 20px; font-style: italic; }
.results-stats { margin-bottom: 28px; }
.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; }
.results-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 480px) {
  .results-card { padding: 24px 20px; }
  .results-grade { font-size: 3rem; }
}
