/* Live demo frame shared by the app pages. Each page sets the colours:
   --demo-bg, --demo-fg, --demo-soft, --demo-accent, --demo-accent-fg, --demo-line, --demo-radius */
.demo {
  --demo-bg: #12162e; --demo-fg: #fff; --demo-soft: rgba(255, 255, 255, 0.72);
  --demo-accent: #fff; --demo-accent-fg: #12162e; --demo-line: rgba(255, 255, 255, 0.14); --demo-radius: 28px;
  position: relative; margin: 0; width: 100%; max-width: 380px; aspect-ratio: var(--demo-ratio, 2 / 3);
  border-radius: var(--demo-radius); overflow: hidden; isolation: isolate;
  background: var(--demo-bg); color: var(--demo-fg); box-shadow: inset 0 0 0 1px var(--demo-line), 0 30px 70px -30px rgba(0, 0, 0, 0.55);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.demo canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.demo canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--demo-accent); }
.demo-ui { position: absolute; inset: 0; pointer-events: none; font-family: inherit; }
.demo-ui button { pointer-events: auto; font: inherit; cursor: pointer; border: 0; }

.demo-badge {
  position: absolute; top: 14px; right: 14px; padding: 5px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--demo-fg) 14%, transparent); color: var(--demo-soft);
  font-size: 0.75rem; font-weight: 700; line-height: 1; letter-spacing: 0.04em;
}
.demo[data-mode="play"] .demo-badge, .demo[data-mode="over"] .demo-badge { display: none; }

/* In demo mode the whole frame is one big button; the pill says what tapping does */
.demo-tap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: transparent; }
.demo-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 22px 0 18px; border-radius: 99px;
  background: var(--demo-accent); color: var(--demo-accent-fg); font-weight: 800; font-size: 0.95rem; line-height: 1.2;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5); transition: transform 0.2s ease;
}
.demo-pill svg { width: 18px; height: 18px; flex: none; }
.demo-tap:hover .demo-pill { transform: scale(1.04); }
.demo-tap:focus-visible { outline: none; }
.demo-tap:focus-visible .demo-pill { outline: 3px solid var(--demo-fg); outline-offset: 3px; }
.demo[data-mode="play"] .demo-tap, .demo[data-mode="over"] .demo-tap { display: none; }

.demo-end {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; padding: 28px; text-align: center;
  background: color-mix(in srgb, var(--demo-bg) 82%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  pointer-events: auto; animation: demo-in 0.25s ease both;
}
.demo-end[hidden] { display: none; }
.demo-end-title { margin: 0; font-size: 1.5rem; font-weight: 800; }
.demo-end-score { margin: 0; color: var(--demo-soft); font-weight: 700; }
.demo-end-score b { color: var(--demo-fg); font-size: 1.6em; font-variant-numeric: tabular-nums; margin-left: 4px; }
.demo-end-note { margin: 4px 0 8px; color: var(--demo-soft); font-size: 0.875rem; line-height: 1.6; text-wrap: pretty; }
.demo-end-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.demo-again { min-height: 44px; padding: 0 22px; border-radius: 99px; background: var(--demo-accent); color: var(--demo-accent-fg); font-weight: 800; }
.demo-watch { min-height: 40px; padding: 0 16px; border-radius: 99px; background: transparent; color: var(--demo-soft); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@keyframes demo-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .demo-end { animation: none; } .demo-pill { transition: none; } }
