:root { color-scheme: dark; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #030c15; }
/* Keep UI scrolling available while disabling browser pinch zoom. */
#experience-ui, #experience-ui *, .prompt-box-8w, .prompt-box-8w * { touch-action: pan-x pan-y; }
button, select, .button-link { min-height: 48px; border: 1px solid rgba(139,221,230,.65); border-radius: 2px; padding: 0 18px; background: linear-gradient(135deg,rgba(30,70,85,.8),rgba(5,18,32,.96)); color: #fff; font: inherit; font-weight: 400; }
button:disabled { opacity: .38; }
.primary { border: 1px solid #99e4ea; background: linear-gradient(135deg,#214c5d,#081d31); color: #efffff; box-shadow: inset 0 0 12px rgba(115,225,233,.12),0 0 16px rgba(100,224,232,.25); text-shadow: 0 0 8px rgba(144,239,246,.65); }
.screen { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: max(20px,env(safe-area-inset-top)) 20px max(20px,env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 20% 30%,rgba(21,68,79,.4),transparent 65%),repeating-linear-gradient(0deg,rgba(124,218,230,.025) 0 1px,transparent 1px 4px),rgba(2,10,20,.95); }
.hidden { display: none !important; }
.start-card, .line-browser-card, .desktop-card, .capture-card { width: min(100%,420px); display: grid; gap: 14px; padding: 22px; border: 1px solid rgba(143,224,230,.65); border-radius: 2px; background: linear-gradient(145deg,rgba(15,40,55,.96),rgba(3,13,26,.98)); box-shadow: 0 0 8px rgba(130,231,235,.24),0 0 28px rgba(86,218,228,.2),inset 0 0 20px rgba(104,221,230,.05); }
.start-card h1, .line-browser-card h1, .desktop-card h1, .start-card p, .line-browser-card p, .desktop-card p { margin: 0; }
.start-card { max-height: 94vh; overflow: auto; }
.desktop-card { max-height: 94vh; overflow: auto; text-align: center; }
.desktop-card h2 { margin: 0; font-size: 24px; }
.desktop-brand { text-align: center; }
.desktop-brand h1 { margin: -8px 0 -18px; }
.desktop-qr-link { justify-self: center; display: block; width: min(100%,222px); }
.desktop-qr { display: block; width: 100%; height: auto; }
.brand-logo { display: block; width: 100%; height: auto; }
/* The logo includes its own glow padding; compensate in the title layout. */
.start-card h1 { margin: -8px 0 -18px; }
.content-subtitle { font-family: "Times New Roman", Times, "Yu Mincho", "Hiragino Mincho ProN", serif; text-align: center; font-size: 20px; font-weight: 400; letter-spacing: .03em; color: #e5fbff; text-shadow: 0 0 12px rgba(118,230,239,.55); }
.streaming-notice { text-align: center; font-size: 15px; font-family: "Orbitron", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.ar-brand-logo { width: min(55vw,220px); height: auto; margin-bottom: 12px; }
.permission-note, .capture-card p { color: #bbb; font-size: 14px; line-height: 1.5; }
.ar-brand { text-align: center; margin: -12px 0 12px; flex-shrink: 0; color: #fff; }
.ar-brand .ar-brand-logo { margin: 0 auto; display: block; width: auto; max-width: min(48vw,190px); height: clamp(20px,calc((100dvh - min(100dvh,133.333vw)) / 2 - env(safe-area-inset-top) - 52px),58px); }
.ar-brand .content-subtitle { margin: -6px 0 0; font-size: 18px; text-shadow: 0 1px 4px #000; }
.capture-card .content-subtitle { color: #fff; font-size: 20px; }
.capture-brand { text-align: center; }
.capture-brand-logo { display: block; width: min(65%,220px); height: auto; margin: -8px auto -8px; }
.capture-brand .content-subtitle { margin: 0; }
.ar-brand .streaming-notice, .capture-brand .streaming-notice { margin: 5px 0 0; color: #fff; font-size: clamp(11px,3.2vw,14px); line-height: 1.4; font-weight: 600; text-shadow: 0 1px 4px #000; }
.legal-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.copyright-notice { color: #bbb; font-size: 12px; text-align: right; max-width: 85%; white-space: normal; }
.copyright-segment { white-space: nowrap; }
.desktop-card .copyright-notice { max-width: 100%; text-align: center; }
#ar-hud { position: fixed; z-index: 500; inset: 0; pointer-events: none; padding: max(18px,env(safe-area-inset-top)) 16px max(18px,env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
#status-message { max-width: 480px; margin: 0; padding: 10px 16px; border: 1px solid rgba(143,224,230,.6); border-radius: 2px; background: rgba(5,25,40,.88); text-align: center; text-shadow: 0 0 8px rgba(118,230,239,.35); box-shadow: 0 0 16px rgba(86,218,228,.18); }
#placement-cue { position: absolute; left: 50%; top: 56%; width: 72px; height: 72px; translate: -50% -50%; color: #fff; pointer-events: none; animation: tap-cue 1.35s ease-in-out infinite; }
#placement-cue svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#placement-cue * { pointer-events: none; }
.tap-ring { fill: none; stroke: currentColor; transform-origin: 36px 27px; }
.tap-ring-outer { stroke-width: 2; opacity: .42; animation: tap-ring 1.35s ease-out infinite; }
.tap-ring-inner { stroke-width: 2.5; opacity: .82; }
.tap-hand { fill: rgba(20,20,20,.72); stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes tap-cue { 0%,100% { transform: translateY(0); opacity: .72; } 50% { transform: translateY(-7px); opacity: 1; } }
@keyframes tap-ring { 0% { transform: scale(.72); opacity: .7; } 70%,100% { transform: scale(1.2); opacity: 0; } }
.controls { margin-bottom: 28px; pointer-events: auto; width: min(100%,560px); margin-top: auto; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.controls button { padding: 0 8px; backdrop-filter: none; }
.credits-link { justify-self: start; color: #bbb; font-size: 12px; }
.capture-card { max-height: 94vh; overflow: auto; }
#capture-preview { width: 100%; max-height: 58vh; object-fit: contain; border: 1px solid rgba(143,224,230,.55); border-radius: 2px; box-shadow: 0 0 14px rgba(86,218,228,.15); background: #000; -webkit-touch-callout: default; }
.capture-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.button-link { display: grid; place-items: center; text-decoration: none; text-align: center; }
.toast { position: fixed; z-index: 1200; left: 50%; bottom: max(90px,env(safe-area-inset-bottom)); translate: -50% 0; width: min(calc(100% - 32px),480px); padding: 14px; border: 1px solid #fff; border-radius: 0; background: #8b1b1b; text-align: center; }

/* 8th Wall's built-in motion permission pre-prompt. */
.prompt-box-8w { border: 1px solid #222 !important; border-radius: 0 !important; padding: 16px !important; background: #f4f4f4 !important; filter: none !important; box-shadow: none !important; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; }
.prompt-box-8w *, .open-header-top, .open-header-bottom, .open-header-unknown, .desktop-message, .desktop-hint, .copy-link-btn { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; }
.prompt-button-8w { border: 1px solid #555 !important; border-radius: 0 !important; background: #ddd !important; color: #111 !important; font-weight: 600 !important; }
.prompt-button-8w.button-primary-8w { background: #222 !important; color: #fff !important; }
@media (max-width: 380px) { .controls button, .capture-actions > * { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { #placement-cue, .tap-ring-outer { animation: none; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#reset-button { justify-self: start; }
.sound-choice { margin: -8px 0; padding: 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: #aaa; font-size: 12px; }
.sound-choice .sound-toggle { min-height: 44px; padding: 0 8px; display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #a8b9bf; font-size: 12px; cursor: pointer; }
.sound-choice .sound-toggle:hover { box-shadow: none; color: #c2d7dc; }
.sound-toggle-track { width: 34px; height: 18px; padding: 3px; border: 1px solid #456570; border-radius: 2px; background: linear-gradient(135deg,#102a39,#091a2a); transition: background .15s, border-color .15s; }
.sound-toggle-track::before { content: ""; display: block; width: 10px; height: 10px; border-radius: 1px; background: #6e8790; transition: transform .15s, background .15s; }
.sound-toggle-state { width: 26px; text-align: left; font-size: 10px; letter-spacing: .08em; color: inherit; }
.sound-toggle[aria-checked="true"] .sound-toggle-track { border-color: #648a94; background: linear-gradient(135deg,#183b49,#0c2536); }
.sound-toggle[aria-checked="true"] .sound-toggle-track::before { transform: translateX(16px); background: #abc9cd; }
.sound-toggle[aria-checked="true"] .sound-toggle-state { color: #b5ccd1; }
@media (prefers-reduced-motion: reduce) { .sound-toggle-track, .sound-toggle-track::before { transition: none; } }
.controls .shutter-button { position: relative; top: -20px; width: 76px; height: 76px; min-height: 76px; padding: 5px; border: 3px solid #fff; border-radius: 50%; background: rgba(0,0,0,.25); display: grid; place-items: center; box-shadow: 0 0 15px rgba(123,235,241,.4),0 2px 12px rgba(0,0,0,.3); }
.shutter-button::before { content: ""; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .12s ease; }
.shutter-button:active:not(:disabled)::before { transform: scale(.88); }
.shutter-button:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.capture-actions > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 4px; font-size: 14px; }
.action-icon { width: 22px; height: 22px; flex-shrink: 0; }

/* Match the centered 3:4 crop used for saved photos. */
.capture-frame { position: absolute; width: min(100vw,75dvh); aspect-ratio: 3 / 4; left: 50%; top: 50%; translate: -50% -50%; border: 1px solid rgba(255,255,255,.45); box-shadow: 0 0 0 100vmax rgba(0,0,0,.85); pointer-events: none; }
#ar-hud > :not(.capture-frame) { position: relative; }
#ar-hud > #placement-cue { position: absolute; }
#ar-hud > .ar-copyright { position: absolute; right: max(16px,env(safe-area-inset-right)); bottom: max(8px,env(safe-area-inset-bottom)); margin: 0; color: #fff; font-size: 12px; text-shadow: 0 1px 4px #000; max-width: calc(100% - 32px); text-align: right; white-space: normal; }

#effect-preview-panel { position: fixed; z-index: 1100; right: 16px; top: 16px; width: min(320px,calc(100vw - 32px)); padding: 14px; background: rgba(20,20,24,.94); border: 1px solid #777; font-size: 14px; }
#effect-preview-panel p { margin: 8px 0; color: #b9eaff; }
#effect-preview-panel input { width: 56px; padding: 6px; background: #303038; color: #fff; border: 1px solid #888; font: inherit; }
.preview-stages { display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; margin-top: 12px; }
.preview-stages button { min-height: 36px; padding: 0 4px; font-size: 14px; }
#effect-preview-settings summary { cursor: pointer; margin: 8px 0; }
.effects-preview:has(#start-screen:not(.hidden)) #effect-preview-panel { display: none; }
@media (max-width: 600px) {
  #effect-preview-panel { top: auto; bottom: max(110px,calc(env(safe-area-inset-bottom) + 100px)); }
}

button:not(:disabled):hover, .button-link:hover { box-shadow: 0 0 20px rgba(117,229,237,.35); }
button:focus-visible, .button-link:focus-visible { outline: 2px solid #a1edf2; outline-offset: 4px; }

#start-button { margin: 8px 0; font-family: "Orbitron", system-ui, sans-serif; font-size: 22px; min-height: 56px; }
.permission-note { text-align: center; }
.credits-link { flex-shrink: 0; }

.loading-card { display: grid; justify-items: center; gap: 20px; text-align: center; }
.loading-spinner { width: 44px; height: 44px; border: 3px solid rgba(143,224,230,.2); border-top-color: #99e4ea; border-radius: 50%; animation: loading-spin 1s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation-duration: 3s; } }
