/* ScriptCam (templates/scriptcam.html): the story's readouts and the feature panels.
   The 3D is static/motion/scriptcam.js. Anything drawn from the app keeps its rounded corners,
   its dark palette and its cue yellow (Theme.swift: cue #FFD60A, record #FF453A, keep #30D158,
   elevated #1C1C1E, said words at 30%). */

/* the giant word has nine letters, a little more than EasyLogo's eight */
.mx-app--scriptcam .mx-story__word { --word: 12.4vw; --word-phone: 13vw; }
/* the readout sits over the phone's bright camera picture at times, so it carries a shadow */
.mx-app--scriptcam .mx-story__hud { text-shadow: 0 1px 14px rgba(0, 0, 0, .95), 0 0 3px rgba(0, 0, 0, .7); }
.mx-scc-dot { display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; vertical-align: 1px; background: #FF453A; box-shadow: 0 0 10px rgba(255, 69, 58, .8); }

/* the beats have sentence-long titles, so they run smaller than Cinder's session names */
.mx-app--scriptcam .mx-story__step-in { max-width: 520px; }
.mx-app--scriptcam .mx-story__step h2 { font-size: clamp(40px, 4.3vw, 70px); }

/* ---------- the story's readouts ---------- */
.mx-app--scriptcam .mx-story__fig { margin: 26px 0 0; }
.mx-app--scriptcam .mx-story__fig .mx-num { min-width: 1.4ch; }
.mx-scc-reads { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.mx-scc-reads > div {
  min-width: 92px; padding: 9px 13px 10px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(14, 14, 17, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.mx-scc-reads dt { font-size: 11px; }
.mx-scc-reads dd { margin: 1px 0 0; font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-scc-reads__word { display: none; }   /* wide screens show the word as the big numeral */
.mx-app--scriptcam .mx-story__step .mx-actions { margin-top: 26px; }

/* the whole script, for anyone not watching the phone: read by screen readers, and shown
   when there is no WebGL */
.mx-scc-transcript {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mx-story.no-gl .mx-scc-transcript {
  position: static; width: auto; height: auto; margin: 22px 0 0; overflow: visible; clip: auto; white-space: normal;
  display: grid; gap: 10px; max-width: 460px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--graphite);
}
.mx-scc-transcript p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--bone-2); }
.mx-scc-transcript p:first-child { font-weight: 600; color: var(--bone); }

/* step 2: what it heard, lit as the phone hears it */
.mx-scc-heard { max-width: 460px; margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.mx-scc-heard li {
  position: relative; display: grid; gap: 2px; padding: 11px 0 11px 26px;
  border-bottom: 1px solid var(--line); color: var(--ash); transition: color .3s var(--ease);
}
.mx-scc-heard li::before {
  content: ""; position: absolute; left: 0; top: 17px; width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--line-2); transition: background-color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.mx-scc-heard q { font-size: 16px; font-weight: 550; color: var(--bone-2); quotes: "\201C" "\201D"; transition: color .3s var(--ease); }
.mx-scc-heard span { font-stretch: 62%; font-weight: 650; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.mx-scc-heard li.is-now q { color: var(--bone); }
.mx-scc-heard li.is-now span { color: var(--accent-ink); }
.mx-scc-heard li.is-now::before { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 214, 10, .16); }
.mx-scc-heard li.is-done::before { background: var(--accent); border-color: var(--accent); }

/* the Skip Tolerance setting, drawn as the app's segmented control */
.mx-scc-tol { max-width: 460px; margin: 20px 0 0; }
.mx-scc-tol .mx-read { font-size: 11.5px; }
.mx-scc-tol ul {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 8px 0 0; padding: 2px;
  list-style: none; border-radius: 10px; background: rgba(118, 118, 128, .24);
}
.mx-scc-tol li { display: grid; justify-items: center; gap: 1px; padding: 7px 6px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--bone-2); }
.mx-scc-tol li b { font-weight: 500; font-size: 12px; color: var(--ash); font-variant-numeric: tabular-nums; }
.mx-scc-tol li.is-on { background: #636366; color: #fff; }
.mx-scc-tol li.is-on b { color: rgba(255, 255, 255, .78); }

/* step 4: the takes, lit as each one comes out of the phone, then the one video */
.mx-scc-takes { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.mx-scc-takes li {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(14, 14, 17, .62);
  font-weight: 600; font-size: 14px; color: var(--ash);
  transition: color .3s var(--ease), border-color .3s var(--ease), background-color .3s var(--ease);
}
.mx-scc-takes li b { font-weight: 500; font-variant-numeric: tabular-nums; }
.mx-scc-takes li.is-on { color: var(--bone); border-color: var(--line-2); }
.mx-scc-takes li.mx-scc-takes__all.is-on { color: #000; border-color: var(--accent); background: var(--accent); }

@media (max-width: 860px) {
  /* the copy sits under the phone, so it stays short: the word joins the readouts */
  .mx-app--scriptcam .mx-story__step h2 { font-size: 34px; }
  .mx-app--scriptcam .mx-story__fig { display: none; }
  .mx-app--scriptcam .mx-story__step:last-child .mx-story__fig { display: flex; margin-top: 16px; }
  .mx-app--scriptcam .mx-story__step:last-child .mx-story__fig .mx-num { font-size: 64px; }
  .mx-scc-reads__word { display: block; }
  .mx-scc-reads__word dd { min-width: 5.4ch; }
  .mx-scc-reads { margin-top: 14px; gap: 6px; }
  .mx-scc-reads > div { min-width: 0; padding: 7px 11px 8px; }
  .mx-scc-reads dd { font-size: 15px; }
  .mx-app--scriptcam .mx-story__src { margin-top: 14px; font-size: 12.5px; }
  .mx-scc-heard { margin-top: 12px; }
  .mx-scc-heard li { padding: 7px 0 7px 24px; }
  .mx-scc-heard li::before { top: 12px; }
  .mx-scc-heard q { font-size: 14.5px; }
  .mx-scc-heard span { font-size: 11px; }
  .mx-scc-tol { display: none; }   /* the copy sits over the phone here, so the setting waits for the panels below */
  .mx-scc-takes { margin-top: 12px; gap: 6px; }
  .mx-scc-takes li { padding: 5px 10px; font-size: 13px; }
  .mx-app--scriptcam .mx-story__step .mx-actions { margin-top: 16px; }
}

/* ---------- the feature panels: the app's own UI, small ---------- */
.mx-scc-viz { gap: 14px; }
@media (min-width: 701px) { .mx-feat:not(.mx-feat--third) > .mx-scc-viz { min-height: 320px; } }   /* the halves of a row line up */

/* the teleprompter panel: dark glass, 30 pt corners, rounded semibold */
.mx-scc-tp {
  position: relative; padding: 16px 20px 12px 26px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(64, 64, 66, .9), rgba(44, 44, 46, .92)); border: 1px solid rgba(255, 255, 255, .1);
}
.mx-scc-tp__line {
  position: relative; margin: 0; font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  font-weight: 600; font-size: clamp(19px, 1.75vw, 24px); line-height: 1.45; letter-spacing: .01em; color: #fff; white-space: nowrap;
}
.mx-scc-tp__line.is-said, .mx-scc-tp .is-said { color: rgba(255, 255, 255, .3); }
.mx-scc-tp .is-cue { color: var(--accent); }
.mx-scc-tp__caret {
  position: absolute; left: -17px; top: 50%; width: 0; height: 0; margin-top: -5px;
  border-left: 9px solid var(--accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.mx-scc-tp__foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.mx-scc-listen {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 214, 10, .16); color: var(--accent); font-weight: 600; font-size: 12.5px;
}
.mx-scc-listen svg { width: 13px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.mx-scc-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .11); overflow: hidden; }
.mx-scc-bar i { display: block; width: calc(var(--v) * 100%); height: 100%; border-radius: 2px; background: var(--accent); }

/* the scroll mode menu */
.mx-scc-menu { margin: 0; padding: 6px; list-style: none; border-radius: 18px; background: var(--graphite-2); }
.mx-scc-menu li { display: grid; grid-template-columns: 22px minmax(0, 1fr) 16px; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; }
.mx-scc-menu li + li { border-top: 1px solid var(--line); border-radius: 0; }
.mx-scc-menu li::after { content: ""; }
.mx-scc-menu li.is-on::after {
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4 5 8.8 9.6 3.4' fill='none' stroke='%23FFD60A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.mx-scc-menu svg { width: 18px; height: 16px; fill: none; stroke: var(--bone-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mx-scc-menu li.is-on svg { stroke: var(--accent); }
.mx-scc-menu b { display: block; font-weight: 600; font-size: 15px; }
.mx-scc-menu i { display: block; font-style: normal; font-size: 12.5px; color: var(--ash); }
.mx-scc-wpm { margin-top: 2px; }

/* the script library's card, with its takes waiting */
.mx-scc-lib { padding: 14px 16px; border-radius: 18px; background: var(--graphite-2); }
.mx-scc-lib b { display: block; font-weight: 600; font-size: 15.5px; }
.mx-scc-lib p { margin: 4px 0 12px; font-size: 13.5px; line-height: 1.4; color: var(--ash); }
.mx-scc-lib__meta { font-size: 12.5px; color: var(--ash-2); font-variant-numeric: tabular-nums; }
.mx-scc-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 214, 10, .16); color: var(--accent); font-weight: 600; font-size: 12px; white-space: nowrap;
}
.mx-scc-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }

/* settings rows, segmented controls and a toggle, the way Settings draws them */
.mx-scc-rows { margin: 0; padding: 0 14px; list-style: none; border-radius: 18px; background: var(--graphite-2); }
.mx-scc-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 14.5px; }
.mx-scc-rows li + li { border-top: 1px solid var(--line); }
.mx-scc-rows em { font-style: normal; color: var(--ash); }
.mx-scc-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(118, 118, 128, .24); }
.mx-scc-seg i { min-width: 46px; padding: 3px 8px; border-radius: 7px; font-style: normal; font-weight: 600; font-size: 12.5px; text-align: center; color: var(--bone-2); }
.mx-scc-seg i.is-on { background: #636366; color: #fff; }
.mx-scc-toggle { position: relative; width: 46px; height: 28px; border-radius: 999px; background: rgba(120, 120, 128, .32); }
.mx-scc-toggle::after { content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; }
.mx-scc-toggle.is-on { background: #30D158; }
.mx-scc-toggle.is-on::after { left: 20px; }
.mx-scc-mirror {
  margin: 0; padding: 14px 18px; border-radius: 18px; background: #000; transform: scaleX(-1);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif; font-weight: 600; font-size: 21px; color: #fff; white-space: nowrap; overflow: hidden;
}

/* iPad: the real split view, cropped to its upper half */
.mx-scc-ipad { padding: 14px 14px 0; justify-content: flex-start; overflow: hidden; }
.mx-scc-ipad img { display: block; width: 100%; height: 306px; object-fit: cover; object-position: 50% 0; border-radius: 12px 12px 0 0; }

/* where things go */
.mx-scc-net { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mx-scc-net li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px; background: var(--graphite-2);
}
.mx-scc-net b { display: block; font-weight: 600; font-size: 14.5px; }
.mx-scc-net i { display: block; font-style: normal; font-size: 12.5px; color: var(--ash); }
.mx-scc-net em {
  font-style: normal; font-stretch: 62%; font-weight: 650; font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; white-space: nowrap; color: #7BE38F;
}

@media (prefers-reduced-motion: reduce) {
  /* motion.css drops the word's transform here, centring included, so centre it with top instead */
  .mx-app--scriptcam .mx-story__word { top: calc(44% - var(--word) * .4); }
  .mx-scc-heard li, .mx-scc-heard li::before, .mx-scc-heard q, .mx-scc-takes li { transition: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 860px) {
  .mx-app--scriptcam .mx-story__word { top: calc(30% - var(--word-phone) * .4); }
}
