:root { font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
.embedded-preview .prompt-chrome, .embedded-preview .local-play { display: none; }
.embedded-preview, .embedded-preview body { background: #050505; }
.embedded-preview #orientationLayer { transform: none; }
body { --bg: #050505; --text: #f5f1e9; --soft: rgb(245 241 233 / 24%); --cue: #b59478; color: var(--text); background: var(--bg); transition: background .25s, color .25s; }
body.theme-light { --bg: #f6f4ee; --text: #161814; --soft: rgb(22 24 20 / 22%); --cue: #81664f; }
body.theme-sepia { --bg: #241d15; --text: #f5dfbc; --soft: rgb(245 223 188 / 22%); --cue: #c89c6f; }

#stage { position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; }
#orientationLayer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: scale(var(--flip-x, 1), var(--flip-y, 1));
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}
#scrollContent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
#scriptText {
  width: min(var(--text-width, 820px), calc(100vw - var(--side-margin, 9vw) * 2));
  min-height: 100%;
  margin: 0 auto;
  padding: 48vh 0 55vh;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-size, 64px);
  font-weight: 560;
  line-height: var(--line-height, 1.42);
  letter-spacing: -.025em;
  text-align: var(--align, left);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.script-cue { color: var(--cue); font-size: .82em; font-style: italic; font-weight: 520; letter-spacing: .01em; }
.script-emphasis { color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.script-divider { display: block; width: clamp(82px, 22%, 210px); height: 1px; margin: .72em auto 1.02em; background: var(--soft); }
.script-line { display: block; }
.script-blank-line { display: block; height: .72em; }
.show-line-guides .script-line { padding-left: .52em; text-indent: -.52em; }
.line-break-marker { display: none; margin-left: .28em; color: #ef9256; font-size: .43em; font-style: normal; font-weight: 700; line-height: 1; vertical-align: .58em; opacity: .66; text-indent: 0; }
.show-line-guides .line-break-marker { display: inline-block; }

.focus-guide { position: fixed; z-index: 3; top: 43%; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; opacity: 1; transition: opacity .2s; }
.focus-guide.hidden { opacity: 0; }
.focus-guide span { width: clamp(18px, 4vw, 55px); height: 1px; background: #ef9256; box-shadow: 0 0 12px rgb(239 146 86 / 45%); }
.focus-guide span:first-child::after, .focus-guide span:last-child::before { content: ""; display: block; width: 4px; height: 4px; margin-top: -1.5px; border-radius: 50%; background: #ef9256; }
.focus-guide span:first-child::after { float: right; }

.end-marker { position: absolute; z-index: 2; left: 50%; bottom: 12vh; transform: translateX(-50%); color: var(--soft); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .24em; opacity: 0; transition: opacity .3s; }
.end-marker.visible { opacity: 1; }

.prompt-chrome { position: fixed; z-index: 5; left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); top: max(16px, env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: center; opacity: .7; transition: opacity .25s; }
.chrome-hidden .prompt-chrome, .chrome-hidden .local-play { opacity: 0; pointer-events: none; }
.prompt-status { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--soft); border-radius: 999px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); color: var(--text); font-size: 10px; font-weight: 650; }
.prompt-status i { width: 6px; height: 6px; border-radius: 50%; background: #b58d48; }
.prompt-status i.online { background: #55ad72; box-shadow: 0 0 0 3px rgb(85 173 114 / 12%); }
.prompt-status i.offline { background: #c9574e; }
#fullscreenButton { padding: 8px 11px; border: 1px solid var(--soft); border-radius: 999px; color: var(--text); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); font: 650 10px inherit; cursor: pointer; }

.local-play { position: fixed; z-index: 5; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 47px; height: 47px; display: grid; place-items: center; border: 1px solid var(--soft); border-radius: 50%; color: var(--text); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); opacity: .7; transition: opacity .25s; }
.local-play svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.local-play .play-icon { margin-left: 2px; fill: currentColor; stroke: none; }
.local-play .pause-icon, .local-play.is-playing .play-icon { display: none; }
.local-play.is-playing .pause-icon { display: block; }

@media (max-width: 600px) {
  #scriptText { font-weight: 590; letter-spacing: -.02em; }
}

@media (prefers-reduced-motion: reduce) { body { transition: none; } }
