/*
 * Demo Player styles — part of the Demo Platform Kit (single-purchase license, see LICENSE.txt)
 * Scope: only elements inside .dp-root. No global resets, no external fonts.
 */
.dp-root {
  --dp-bg: #10192B;
  --dp-panel: #FFFFFF;
  --dp-ink: #1F2A3A;
  --dp-muted: #55627A;
  --dp-line: #DCE3EE;
  --dp-accent: #1D4ED8;
  --dp-accent-dark: #1E40AF;
  --dp-amber: #F2B33D;
  --dp-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 100%;
  background: var(--dp-bg);
  border-radius: var(--dp-radius);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Noto Sans Japanese", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--dp-ink);
  line-height: 1.5;
}
.dp-root *,
.dp-root *::before,
.dp-root *::after { box-sizing: border-box; }

/* ---------- stage ---------- */
.dp-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0B1220;
  overflow: hidden;
}
.dp-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.dp-dim {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 46% 52% at var(--spot-x, 50%) var(--spot-y, 82%), rgba(6, 12, 24, 0.05) 0%, rgba(6, 12, 24, 0.42) 100%);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.dp-is-locked .dp-dim { background: rgba(6, 12, 24, 0.66); }
.dp-spot {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid var(--dp-amber);
  box-shadow: 0 0 0 6px rgba(242, 179, 61, 0.25), 0 0 0 9999px rgba(6, 12, 24, 0.35);
  pointer-events: none;
  animation: dp-pulse 1.8s ease-out infinite;
}
.dp-is-locked .dp-spot { display: none; }
@keyframes dp-pulse {
  0%   { box-shadow: 0 0 0 4px rgba(242, 179, 61, 0.35), 0 0 0 9999px rgba(6, 12, 24, 0.35); }
  70%  { box-shadow: 0 0 0 14px rgba(242, 179, 61, 0), 0 0 0 9999px rgba(6, 12, 24, 0.35); }
  100% { box-shadow: 0 0 0 4px rgba(242, 179, 61, 0.2), 0 0 0 9999px rgba(6, 12, 24, 0.35); }
}

/* ---------- caption bubble ---------- */
.dp-bubble {
  position: absolute;
  transform: translate(-50%, calc(-100% - 30px));
  max-width: min(78%, 460px);
  background: var(--dp-panel);
  color: var(--dp-ink);
  border-radius: 10px;
  border-bottom-left-radius: 3px;
  padding: 12px 16px 12px;
  box-shadow: 0 12px 32px rgba(6, 12, 24, 0.45);
  pointer-events: none;
}
.dp-bubble.dp-bubble-below {
  transform: translate(-50%, 34px);
  border-bottom-left-radius: 10px;
  border-top-left-radius: 3px;
}
.dp-bubble-step {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dp-accent);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.dp-bubble-text {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--dp-ink);
}

/* ---------- gate ---------- */
.dp-gate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: transparent;
}
.dp-gate[hidden] { display: none; }
.dp-gate-box {
  background: var(--dp-panel);
  border-radius: 14px;
  border-top: 4px solid var(--dp-amber);
  box-shadow: 0 24px 64px rgba(6, 12, 24, 0.55);
  padding: 26px 30px;
  max-width: 420px;
  text-align: center;
}
.dp-lock { color: var(--dp-accent); margin-bottom: 8px; }
.dp-gate-title { font-size: 18px; margin: 0 0 6px; color: var(--dp-ink); }
.dp-gate-body { font-size: 14px; color: var(--dp-muted); margin: 0 0 16px; }
.dp-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dp-gate-btn { min-height: 46px; }

/* ---------- progress + toolbar ---------- */
.dp-progress {
  height: 5px;
  background: rgba(255, 255, 255, 0.14);
}
.dp-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--dp-amber);
  transition: width 0.2s ease;
}
.dp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
}
.dp-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.dp-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.dp-counter {
  font-size: 12.5px;
  color: #C4CFE2;
  font-variant-numeric: tabular-nums;
}
.dp-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.dp-btn:hover { background: rgba(255, 255, 255, 0.16); }
.dp-btn[disabled] { opacity: 0.45; cursor: default; }
.dp-btn[disabled]:hover { background: rgba(255, 255, 255, 0.08); }
.dp-btn[hidden], .dp-lang[hidden] { display: none; }
.dp-next { background: var(--dp-accent); border-color: var(--dp-accent); }
.dp-next:hover { background: var(--dp-accent-dark); }
.dp-next[disabled]:hover { background: var(--dp-accent); }
.dp-gate-cta,
.dp-gate-actions a.dp-btn { background: var(--dp-accent); border-color: var(--dp-accent); }
.dp-gate-cta:hover,
.dp-gate-actions a.dp-btn:hover { background: var(--dp-accent-dark); }
.dp-lang {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  cursor: pointer;
}
.dp-lang option { color: var(--dp-ink); background: #FFFFFF; }

/* ---------- error card (steps failed to load) ---------- */
.dp-error {
  margin: 0;
  padding: 18px 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #FFD9D2;
  background: #3B120C;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- a11y ---------- */
.dp-root:focus-visible,
.dp-root:focus-within { outline: 3px solid var(--dp-amber); outline-offset: 2px; }
.dp-btn:focus-visible,
.dp-lang:focus-visible { outline: 3px solid var(--dp-amber); outline-offset: 2px; }
.dp-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 560px) {
  .dp-stage { aspect-ratio: 4 / 3; }
  .dp-bubble { max-width: 92%; }
  .dp-gate-box { padding: 20px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .dp-spot { animation: none; }
  .dp-root *, .dp-root *::before, .dp-root *::after { transition: none !important; animation: none !important; }
}
