/* The demo frame (/demo, js/demo.js): one of the app's exercises on its dark stage, exactly as in the app
   (www/css/bead.css and the exercise's own stylesheet), playing inside an iPhone drawn by the page around it.
   The page lays the frame out at an iPhone's own size (393 points wide) and scales it into the phone's screen, so
   the stage keeps the room the status bar and the Dynamic Island take at the top, and the home indicator's at the
   bottom. This file only takes away what a demo has no use for and adds the touch mark and the visitor's score. */

:root { --safe-top: 54px; --safe-bottom: 22px; }
html, body { height: 100%; background: var(--stage); background-image: none; overflow: hidden; }
#app { max-width: none; height: 100%; min-height: 0; }
.stage-screen { height: 100%; min-height: 0; }
.stage-top { padding-top: 16px; }
.stage-title span { font-size: 16px; font-weight: 500; }
/* no pause button on the stage: the page has one under the phone */
.stage-pause { visibility: hidden; }
/* nothing in a demo can be selected */
body { user-select: none; -webkit-user-select: none; }
button { cursor: default; }
.is-mine button { cursor: pointer; }

/* where the autopilot touches, like the touch marks in a screen recording */
.demo-touch {
  position: fixed; left: 0; top: 0; z-index: 30; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  background: rgba(238, 235, 229, 0.16); border: 1px solid rgba(238, 235, 229, 0.42);
  opacity: 0; pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.3, 1), opacity 0.35s ease;
}
.demo-touch.is-on { opacity: 1; }
.demo-touch.is-down { background: rgba(238, 235, 229, 0.3); }
.demo-touch.is-down::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid rgba(238, 235, 229, 0.5); animation: demo-ring 0.45s ease-out forwards; }
@keyframes demo-ring { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }
.is-mine .demo-touch { display: none; }

/* the visitor's own time */
.demo-score {
  position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(17, 17, 16, 0.97); text-align: center; animation: demo-in 0.35s ease-out both;
}
.demo-score-num { margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-size: 96px; line-height: 1; letter-spacing: -1px; color: var(--stage-ink); font-variant-numeric: lining-nums; }
.demo-score-line { margin: 0 0 26px; font-size: 22px; font-weight: 600; color: var(--st-accent, #E05A44); }
.demo-score-btn {
  min-width: 200px; height: 56px; padding: 0 28px; border: 0; border-radius: 28px;
  background: var(--stage-ink); color: var(--stage); font: inherit; font-size: 18px; font-weight: 600;
}
@keyframes demo-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .demo-touch { display: none; }
  .demo-score { animation: none; }
}

.demo-nojs { position: absolute; inset: auto 24px 45% 24px; margin: 0; text-align: center; font-size: 15px; color: var(--stage-dim); }
