/* The demo layer (js/demo-layer.js): words only the demo says, never inside the app's screen when the device is
   drawn on the page. Prefix dl-. Light only.
   Its look is not iOS on purpose: a yellow "Demo" tag, square-ish corners, a pale yellow card with a dashed edge. */

/* framed: a strip under the device (and under the nudge pill), in the page around the phone */
.dl-box {
  position: absolute; z-index: 4; left: 50%; top: calc(100% + var(--dl-top, 6px));
  transform: translate(-50%, 4px);
  display: flex; align-items: center; gap: 8px; box-sizing: border-box;
  width: max-content; max-width: min(560px, calc(100vw - 32px)); min-height: 34px; padding: 6px 12px 6px 6px;
  border-radius: 8px; border: 1px dashed #c9a227; background: #fff8d6; color: #3b3205;
  font: 500 13px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  letter-spacing: 0;
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out, visibility 0s linear 0.25s;
}
.dl-box.is-up { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.25s ease-out, transform 0.25s ease-out, visibility 0s; }
.dl-tag {
  flex: none; padding: 3px 6px; border-radius: 4px; background: #ffd60a; color: #1d1a05;
  font: 800 10px/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.dl-icon { flex: none; display: flex; color: #8a6d00; }
.dl-icon svg { display: block; }
.dl-text { min-width: 0; }
/* the words of a touch suggestion: the same card, a little quieter */
.dl-box.is-say { background: #fffbe8; }

/* phone mode: the app fills the window, so the card floats near the top, under the app's top bar, clear of the
   slim demo tabs at the two edges. It never takes a tap. */
#sb-root[data-fit="phone"] .dl-box {
  position: fixed; z-index: 950; top: calc(var(--sb-top, 10px) + 50px); left: 50%;
  max-width: calc(100vw - 72px); box-shadow: 0 4px 14px rgba(17, 24, 39, 0.16);
}

#sb-root[data-fit="phone"] .dl-box.on-full { top: calc(var(--sb-top, 10px) + 92px); }

@media (prefers-reduced-motion: reduce) {
  .dl-box, .dl-box.is-up { transition: none; }
}

/* phone mode: the shell's "Turn your phone sideways" pill joins the demo layer. It leaves the app's top bar for the
   demo card's place, in the demo card's look, and steps aside while a demo card shows. */
#sb-root[data-fit="phone"] .sb-nudge[data-nkey="phone-rotate"] {
  top: calc(var(--sb-top, 10px) + 50px); height: 34px; padding-left: 6px; gap: 4px; max-width: calc(100vw - 72px);
  border-radius: 8px; border: 1px dashed #c9a227; background: #fff8d6;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.16);
}
#sb-root[data-fit="phone"] .sb-nudge[data-nkey="phone-rotate"]::before {
  content: "Demo"; flex: none; padding: 3px 6px; border-radius: 4px; background: #ffd60a; color: #1d1a05;
  font: 800 10px/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  letter-spacing: 0.06em; text-transform: uppercase;
}
#sb-root[data-fit="phone"] .sb-nudge[data-nkey="phone-rotate"] .sb-nudge-key {
  height: 32px; padding: 0 6px; color: #3b3205; font-weight: 500; border-radius: 6px;
}
#sb-root[data-fit="phone"] .sb-nudge[data-nkey="phone-rotate"] .sb-nudge-key:hover { background: none; }
#sb-root[data-fit="phone"] .sb-nudge[data-nkey="phone-rotate"] .sb-nudge-x { width: 24px; height: 24px; background: rgba(201, 162, 39, 0.2); color: #3b3205; }
html.dl-busy #sb-root[data-fit="phone"] .sb-nudge[data-nkey="phone-rotate"] { visibility: hidden; opacity: 0; }

/* phone mode: the demo's own keys on the window's edges ("?" for the words, and app.html's close tab) wear the
   demo's yellow, so they never pass for keys of the app */
#sb-root[data-fit="phone"] .sb-coach-key,
#sb-root[data-fit="phone"] .sb-app-close {
  color: #1d1a05; background: #ffd60a;
  box-shadow: 0 0 0 1px rgba(120, 95, 0, 0.45), 0 2px 8px rgba(17, 24, 39, 0.22);
}
/* the coach card in phone mode: a demo card, with the same yellow edge */
#sb-root[data-fit="phone"][data-coach="open"] .sb-side { border-top: 4px solid #ffd60a; }

/* the coach box's demo-only controls (the jersey step's look picker) */
.sb-coach-extra { margin-top: 12px; padding-top: 12px; border-top: 0.5px solid var(--sb-border, #dadde3); }
.sb-coach-extra[hidden] { display: none; }
