/* === Dragon Flight styles === */

.df-body { background: #f8fafc; color: #0f172a; }

/* --- intro --- */
.df-intro-hero {
  text-align: center;
  padding: 28px 8px 8px;
}
.df-intro-marks { font-size: 28px; letter-spacing: 6px; margin-bottom: 10px; }
.df-intro-title {
  font-size: 34px;
  font-weight: 800;
  margin: 6px 0;
  background: linear-gradient(135deg, #ff6b6b 0%, #a855f7 55%, #4f46e5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.df-intro-lede { color: #475569; font-size: 15px; line-height: 1.55; margin: 6px 16px 18px; }

.df-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 18px;
  margin: 14px 0;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}
.df-card-title { font-size: 16px; font-weight: 700; margin: 0 0 10px; color: #0f172a; }
.df-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.df-rules li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #334155; }
.df-rules .df-icon { font-size: 18px; }

.df-items-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.df-items-legend li { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #334155; }
.df-items-legend img { width: 32px; height: 32px; }

.df-cta {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 20px 0 10px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff6b6b 0%, #a855f7 55%, #4f46e5 100%);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.df-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(168, 85, 247, 0.45); }
.df-cta:active { transform: translateY(0); }

.df-best-line { text-align: center; color: #64748b; font-size: 14px; margin: 4px 0 8px; }

.df-top-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.df-top-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 14px;
}
.df-top-rank { color: #a855f7; font-weight: 700; text-align: center; }
.df-top-name { color: #0f172a; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-top-score { color: #334155; font-variant-numeric: tabular-nums; font-weight: 600; }
.df-top-boss { color: #f59e0b; font-size: 12px; margin-left: 4px; }
.df-top-empty { color: #94a3b8; font-size: 13px; margin: 0; }

/* --- onboarding hint bubble --- */
.df-hint-bubble {
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  color: #7c2d12;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin: 14px 0;
  border: 1px solid #fcd34d;
  animation: df-pulse 2.2s ease-in-out infinite;
}
.df-hint-bubble ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
@keyframes df-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

/* === play screen === */
.df-body.df-play-body { background: linear-gradient(180deg, #0b1020 0%, #1e1b4b 100%); min-height: 100vh; }

.df-stage {
  position: relative;
  max-width: 400px;
  margin: 12px auto;
  aspect-ratio: 360 / 640;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.3);
  background: #0b1020;
  touch-action: none;
}
.df-canvas { width: 100%; height: 100%; display: block; touch-action: none; }

/* --- HUD (over canvas) --- */
.df-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0));
  background: rgba(11, 16, 32, 0.75);
  backdrop-filter: blur(8px);
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  z-index: 3;
  pointer-events: none;
}
.df-hud-hp { display: flex; align-items: center; gap: 2px; }
.df-hud-hp img { width: 22px; height: 22px; image-rendering: pixelated; }
.df-hud-score {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  font-family: 'SF Mono', ui-monospace, 'Menlo', monospace;
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}
.df-hud-right {
  text-align: right;
  font-size: 12px;
  line-height: 1.3;
}
.df-hud-time { font-variant-numeric: tabular-nums; opacity: 0.85; }
.df-hud-power { color: #fbbf24; font-weight: 700; }

/* --- combo badge --- */
.df-combo-badge {
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6b6b, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
  z-index: 4;
  animation: df-combo-float 1s ease-out forwards;
}
@keyframes df-combo-float {
  0% { opacity: 0; transform: translate(-50%, 0); }
  15% { opacity: 1; transform: translate(-50%, -6px); }
  100% { opacity: 0; transform: translate(-50%, -30px); }
}

/* --- boss HP bar --- */
.df-boss-bar {
  position: absolute;
  top: 60px;
  left: 12px;
  right: 12px;
  padding: 6px 10px;
  background: rgba(11, 16, 32, 0.85);
  border-radius: 6px;
  z-index: 3;
  color: #fff;
  font-size: 11px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.df-boss-bar-label { font-weight: 700; letter-spacing: 1px; margin-bottom: 3px; color: #fcd34d; }
.df-boss-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}
.df-boss-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #a855f7);
  border-radius: 4px;
  transition: width 120ms ease-out;
}

/* --- countdown --- */
.df-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 24px rgba(168, 85, 247, 0.9), 0 0 48px rgba(239, 68, 68, 0.6);
  z-index: 5;
  pointer-events: none;
  user-select: none;
}
.df-countdown.df-anim {
  animation: df-count-pop 1s ease-out;
}
@keyframes df-count-pop {
  0% { transform: scale(1.8); opacity: 0; }
  25% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; }
}

/* --- loading overlay --- */
.df-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #0b1020;
  color: #e2e8f0;
  z-index: 6;
}
.df-loading-bar {
  width: 60%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.df-loading-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #a855f7);
  transition: width 120ms linear;
  width: 0%;
}
.df-loading-text { font-size: 13px; color: #94a3b8; }

/* --- pause overlay --- */
.df-pause {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(11, 16, 32, 0.85);
  color: #fff;
  z-index: 7;
}
.df-pause-title { font-size: 22px; font-weight: 700; }
.df-pause-sub { font-size: 13px; color: #cbd5e1; }

/* --- shield timer indicator --- */
.df-shield-timer {
  position: absolute;
  top: 62px;
  right: 12px;
  background: rgba(96, 165, 250, 0.25);
  border: 1px solid #60a5fa;
  color: #e0f2fe;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  z-index: 3;
}

/* --- result modal (매치 app_004 tone) --- */
.df-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 16, 32, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  padding: 20px;
}
.df-modal-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.df-modal-title { font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 14px; color: #0f172a; }
.df-modal-stats { display: grid; gap: 8px; margin-bottom: 14px; }
.df-modal-stats div { display: flex; justify-content: space-between; font-size: 14px; color: #334155; }
.df-modal-stats strong { color: #0f172a; font-variant-numeric: tabular-nums; }
.df-modal-label { font-size: 12px; color: #64748b; }
.df-submit-form { display: grid; gap: 10px; }
.df-submit-form input[type='text'] {
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}
.df-submit-form input[type='text']:focus { border-color: #a855f7; box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2); }
.df-submit-cta { margin: 4px 0 0; }
.df-submit-error { color: #dc2626; font-size: 12px; margin: 4px 0 0; }
.df-submit-done { margin-top: 12px; }
.df-modal-rank {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  color: #a855f7;
  margin: 4px 0 14px;
}
.df-modal-rank-off { color: #64748b; font-size: 14px; font-weight: 600; }
.df-modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.df-cta-outline {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.df-cta-outline:hover { background: #f8fafc; }

/* --- low-perf mode marker (dev visibility) --- */
.df-low-perf { outline: 1px dashed rgba(239, 68, 68, 0.4); }

@media (prefers-reduced-motion: reduce) {
  .df-combo-badge { animation-duration: 0.2s; }
  .df-countdown.df-anim { animation: df-count-fade 1s ease-out; }
  @keyframes df-count-fade {
    0% { opacity: 0; }
    25% { opacity: 1; }
    100% { opacity: 0; }
  }
  .df-intro-hero { animation: none; }
}
