/* The room is a shared canvas, with controls close to the current scene. */
.jammin-room{min-height:100svh;background:radial-gradient(ellipse at 50% 35%,#101c2233,transparent 48%),#020304}
.jammin-room .jammin-header{position:fixed;inset:0 0 auto;background:linear-gradient(#020304ec,#02030400);z-index:10}
.jammin-room .room-nav{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}
.room-nav svg,.invite-link svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.room-button{display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0;border:1px solid #ffffff14;border-radius:50%;background:#ffffff03;color:#9eaeab;transition:background .35s,color .35s,border-color .35s}
.room-button:hover{background:#ffffff08;color:#e3efe8;border-color:#ffffff2b}
.room-balance{padding-left:5px;font-size:13px;color:#bad8cd;font-variant-numeric:tabular-nums;white-space:nowrap}
.invite-link{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:#a1adae}
.scenes-dialog{position:fixed;inset:0;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#020304;color:#dce8e2;overflow:auto;animation:gallery-reveal .8s ease both}
.scenes-dialog::backdrop{background:#020304}
.scenes-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px var(--dock-left);background:linear-gradient(#020304 75%,#02030400)}
.scenes-header h2{margin:0;font-size:14px;font-weight:450;letter-spacing:-.015em;color:#a9b9b4}
.scenes-header button{display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0;border:1px solid #ffffff14;border-radius:50%;background:#ffffff03;color:#a5b7b0}
.gallery-body{width:min(1080px,100%);margin:0 auto;padding:38px 28px 80px;min-height:calc(100dvh - 100px)}
.gallery-empty-art{display:none;color:#73928c;margin:0 auto 22px;width:94px;height:78px}.gallery-empty-art svg{width:100%;height:100%;stroke:currentColor;stroke-width:.8}
.gallery-body:has(.scene-gallery:empty):not(:has(#earlier-stories:not([hidden]))){display:flex;flex-direction:column;align-items:center;justify-content:center;padding-bottom:160px}
.gallery-body:has(.scene-gallery:empty):not(:has(#earlier-stories:not([hidden]))) .gallery-empty-art{display:block;animation:gallery-reveal 1.4s ease both}
.scenes-note{font-size:14px;color:#82958e;line-height:1.8;margin:0 auto 35px;text-align:center;max-width:320px}.scenes-note:empty{display:none}
.scene-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:36px 24px;width:100%}.scene-gallery:has(>:only-child){grid-template-columns:minmax(0,1fr);max-width:880px;margin:auto}
#story-scene-list article,.scene-gallery .timeline-item{display:flex;flex-direction:column;gap:14px;margin:0;padding:0;border:0;background:transparent;text-align:left;min-width:0;color:#b6c9c0}
#story-scene-list article p{order:2;margin:0;font-size:13px;line-height:1.7;color:#9caea6}
#story-scene-list img,#story-scene-list video,.scene-gallery .timeline-item img{display:block;width:100%;aspect-ratio:16/9;object-fit:contain;max-height:65svh;border-radius:16px;background:#0a0f11}
.scene-gallery .timeline-item{cursor:pointer;border-radius:16px;transition:opacity .35s}.scene-gallery .timeline-item:hover{opacity:.78}.scene-gallery .timeline-item small{display:block;font-size:12px;color:#859b92}.scene-gallery .timeline-item.active img{outline:1px solid #c1e8da80;outline-offset:5px}
.scene-placeholder{display:grid;place-items:center;aspect-ratio:16/9;border:1px solid #ffffff0c;border-radius:16px;background:#ffffff02;color:#698279;font-size:12px}
#earlier-stories{border-top:1px solid #ffffff12;margin-top:40px;padding-top:22px}#earlier-stories h3{font-size:12px;font-weight:400;color:#849794}#history{display:flex;gap:8px;flex-wrap:wrap}
@keyframes gallery-reveal{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:600px){.gallery-body{padding:24px 18px 60px}.scene-gallery{grid-template-columns:minmax(0,1fr);gap:30px}.scenes-header{padding-top:16px;padding-bottom:16px}.gallery-body:has(.scene-gallery:empty){padding-bottom:110px}}
.play-space{width:min(940px,100%);margin:0 auto;padding:clamp(155px,23vh,220px) 24px 70px;min-height:100svh;animation:room-reveal 1.5s .18s both}
.room-heading{text-align:center;margin:0 auto 40px;max-width:650px}
.room-heading h1{font-size:12px;font-weight:450;letter-spacing:.035em;color:#778689;margin:0 0 8px}
#step{font-size:11px;color:#738284;letter-spacing:.025em;line-height:1.5;min-height:17px}
.steps{display:flex;justify-content:center;gap:5px;margin:16px auto 0;max-width:92px}
.steps:empty{display:none}.steps span{height:2px;background:#ffffff16;border-radius:3px;flex:1}.steps .active{background:#c1e6da99}.steps .done{background:#c1e6da}
.scene-space:has(>img:not([hidden])),.scene-space:has(>video:not([hidden])),.scene-space:has(#comic-sheet:not([hidden])){margin:0 auto 25px}
#scene,#movie{display:block;width:100%;max-height:60svh;object-fit:contain;border-radius:22px;background:#030506;margin:0 auto;animation:scene-reveal 1.5s ease both}
#movie{outline:1px solid #ffffff0e}#scene{border:1px solid #ffffff12}
.input-space{max-width:650px;margin:0 auto}
#prompt{font-size:clamp(25px,3vw,35px);font-weight:500;letter-spacing:-.04em;line-height:1.35;text-align:center;margin:0 auto 36px;max-width:630px;text-wrap:balance;min-height:48px}
.composer{display:flex;align-items:flex-end;gap:8px;padding:7px;border:1px solid #ffffff25;border-radius:19px;background:#ffffff07;box-shadow:0 18px 55px #0005,0 0 0 1px #0005 inset;transition:border-color .5s,box-shadow .5s}
.composer:focus-within{border-color:#a1edee70;box-shadow:0 15px 55px #0006,0 0 0 3px #93eefc0b}
#text{flex:1;display:block;width:100%;min-width:0;min-height:44px;max-height:180px;resize:none;padding:12px 10px;background:transparent;color:#eff4f0;border:0;outline:0;font-size:15px;line-height:1.5;box-shadow:none}
#text::placeholder{color:#6d7b7e}.composer .icon-button{flex:0 0 42px;width:42px;height:42px;display:grid;place-items:center;padding:0;border-radius:13px;border:0;background:transparent;color:#92a3a6}
.icon-button svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.composer #send{background:#d3f2e5;color:#172b24;box-shadow:inset 0 1px 0 #ffffff60;transition:background .4s,opacity .4s}.composer #send:hover{background:#e5fff2}.composer #send:disabled{opacity:.28;cursor:default}
#mic:hover{background:#ffffff08;color:#d5e5e1}#mic[aria-pressed=true]{color:#d3f2e5;background:#d3f2e517;box-shadow:0 0 0 1px #d3f2e555 inset}
.composer-meta{display:flex;align-items:center;gap:10px;margin:12px 5px 0;font-size:11px;line-height:1.5;color:#718185;flex-wrap:wrap}
.composer-meta select{width:auto;background:transparent;border:0;color:#819194;font:inherit;padding:3px 0;cursor:pointer;outline-color:#a1edee}.composer-meta option{background:#11181a;color:#e1ebe7}
#turn-price{margin-left:auto;color:#849a94}#credits-link{color:#bddacc;border-bottom:1px solid #bddacc35}
#charge-note{font-size:10px;line-height:1.5;color:#647573;margin:8px 5px 0;text-align:right}#charge-note:empty{display:none}
.choices{display:flex;justify-content:center;gap:10px;margin:26px auto 0;align-items:stretch;animation:room-reveal 1.5s .4s both}
.choices button{flex:1;text-align:left;border:1px solid #ffffff12;background:#ffffff02;border-radius:14px;color:#899799;font-size:12px;font-weight:400;line-height:1.65;padding:13px 16px;transition:background .5s,color .5s,border-color .5s}
.choices button:hover,.choices button[aria-pressed=true]{border-color:#b9e5d53b;background:#c1efde07;color:#dae7e1}
.scene-status{max-width:650px;margin:0 auto;text-align:center}.scene-status:has(#status:empty):has(progress[hidden]){display:none}
#status{font-size:13px;color:#8fa2a3;line-height:1.6;margin:0 0 12px;white-space:pre-line}
progress{display:block;width:180px;height:2px;accent-color:#b8e3d5;border:0;border-radius:4px;overflow:hidden;margin:20px auto 30px;background:#ffffff12}progress::-webkit-progress-bar{background:#ffffff12}progress::-webkit-progress-value{background:#b8e3d5;transition:width 1s ease}
#feedback{max-width:700px;margin:18px auto 30px;font-size:14px;line-height:1.7;color:#9faeaf;text-align:center}#feedback:empty,.error:empty,#ending-note:empty{display:none}
.clue{max-width:650px;margin:0 auto 25px;padding:12px 16px;border-left:1px solid #baded56b;font-size:13px;line-height:1.6;color:#b6c8c5;background:#b5e0d804;border-radius:0 10px 10px 0}
.scene-actions{display:flex;justify-content:center;gap:14px;margin-top:25px;flex-wrap:wrap}.scene-actions:has(>button[hidden]):not(:has(>button:not([hidden]))){display:none}
#hide-scene{display:block;margin:14px auto 0;font-size:11px}#finish{border:0;background:transparent;font-size:11px;color:#6e8581}
.handoff{text-align:center;padding:45px 0}.handoff h2,.ending h2{font-size:clamp(27px,3vw,36px);font-weight:500;letter-spacing:-.04em;margin:18px 0}.handoff p,.ending>p{color:#849696;font-size:13px;line-height:1.6}.handoff .primary{margin-top:22px}.handoff-symbol{width:48px;height:48px;stroke:#b1d1c9;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round}
.ending{text-align:center;max-width:800px;margin:auto}.ending .eyebrow{font-size:10px;color:#7d9890;letter-spacing:.08em}.ending #new{margin-top:26px}
#chain article{border-top:1px solid #ffffff12;padding:24px 0;text-align:left}#chain h3{font-size:11px;color:#809b93;font-weight:400}#chain p{font-size:13px;line-height:1.7;color:#a6b9b4}#chain img,#chain video{width:100%;max-height:65vh;object-fit:contain;border-radius:18px}
.comic-sheet{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.comic-sheet article{border:1px solid #ffffff14;border-radius:15px;overflow:hidden;padding:0}.comic-sheet h3,.comic-sheet p{padding:0 15px;font-size:12px;line-height:1.6;color:#99ada7}.comic-sheet img{width:100%;display:block}
.story-scenes{margin:30px auto;max-width:800px;font-size:12px;color:#92aaa2}.story-scenes>summary{text-align:center;cursor:pointer}#current-game{display:block;margin:0 auto 24px}.error{max-width:650px;margin:22px auto 0;text-align:center;color:#e8b2a7;font-size:12px;line-height:1.6}
.quiet-copy{transition:opacity .7s ease,filter .7s ease}.quiet-copy.copy-fading{opacity:0;filter:blur(2px)}
body.has-scene .play-space{padding-top:108px}body.has-scene .room-heading{margin-bottom:22px}body.has-scene #prompt{font-size:24px;margin-bottom:22px;min-height:0}body.has-scene .choices{margin-top:20px}
body.scene-busy:not(.has-scene) .scene-status{padding:40px 0}body.scene-busy:not(.has-scene) .scene-status #status{font-size:20px;color:#d1dcd7;letter-spacing:-.02em}
@keyframes room-reveal{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes scene-reveal{from{opacity:0;filter:blur(7px)}to{opacity:1;filter:blur(0)}}
@media(max-width:620px){.play-space{padding:160px 18px 55px}.room-heading{margin-bottom:30px}#prompt{font-size:27px;line-height:1.4;margin-bottom:32px}.choices{flex-direction:column;gap:8px;margin-top:22px}.choices button{font-size:12px;padding:11px 14px}#text{font-size:16px;min-height:44px;padding-left:8px}.composer{gap:3px}.composer .icon-button{width:38px;height:42px;flex-basis:38px}.composer-meta{font-size:10px;gap:8px}.room-nav{gap:10px}.invite-link{font-size:11px}.invite-link svg{width:15px}#scene,#movie{border-radius:15px;max-height:52svh}.comic-sheet{grid-template-columns:1fr}body.has-scene .play-space{padding-top:106px}body.has-scene #prompt{font-size:23px}#charge-note{text-align:left}.menu-sheet{right:-2px}.handoff{padding:30px 0}}
/* The first-scene preview reserves its space, keeping the composer anchored. */
body.has-scene-ideas .play-space{padding-top:clamp(125px,16vh,160px)}
body.has-scene-ideas .room-heading{margin-bottom:14px}
body.has-scene-ideas #play{position:relative}
body.has-scene-ideas .scene-space{height:clamp(160px,27vh,270px);max-width:650px;margin:0 auto 26px;position:relative}
body.has-scene-ideas #prompt{position:absolute;top:clamp(35px,7vh,76px);left:50%;transform:translateX(-50%);width:min(100%,630px);margin:0;min-height:0;transition:opacity .65s ease,filter .65s ease;pointer-events:none}
body.has-idea-preview #prompt{opacity:0;filter:blur(4px)}
.idea-preview{position:relative;width:100%;height:100%;margin:0;display:flex;align-items:center;justify-content:center}
.idea-preview>img{height:100%;width:auto;max-width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:18px;box-shadow:0 20px 70px #0008;animation:scene-reveal .9s ease both}
.idea-preview figcaption{position:absolute;bottom:9px;left:50%;transform:translateX(-50%);padding:4px 9px;border-radius:12px;background:#0008;color:#e3eee5b3;backdrop-filter:blur(10px);font-size:9px;letter-spacing:.025em;white-space:nowrap}
.idea-preview>button{position:absolute;right:calc((100% - min(100%,(clamp(160px,27vh,270px) * 16 / 9))) / 2 + 9px);top:9px;width:28px;height:28px;display:grid;place-items:center;border:1px solid #ffffff20;border-radius:50%;background:#0007;backdrop-filter:blur(10px);color:#e6eee5;cursor:pointer}
.idea-preview svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;fill:none}
.idea-flight{position:fixed;z-index:80;pointer-events:none;object-fit:cover;border-radius:18px;transform-origin:top left;box-shadow:0 18px 65px #0005}
.scene-ideas{margin:24px -44px 0;animation:room-reveal 1.6s .4s both}
.scene-ideas-heading{display:flex;align-items:center;justify-content:space-between;margin:0 44px 10px;color:#687b76;font-size:10px;letter-spacing:.02em}
.scene-ideas-heading button{width:28px;height:28px;display:grid;place-items:center;padding:0;border:1px solid #ffffff12;border-radius:50%;background:transparent;color:#82958e;cursor:pointer}
.scene-ideas-heading svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.scene-ideas-heading .play-mark{display:none}.scene-ideas-heading button[aria-pressed=true] .pause-mark{display:none}.scene-ideas-heading button[aria-pressed=true] .play-mark{display:block}
.ideas-rail{display:flex;gap:14px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:6px 44px 12px;scroll-padding:44px;mask-image:linear-gradient(90deg,transparent,#000 28px,#000 calc(100% - 28px),transparent)}
.ideas-rail::-webkit-scrollbar{display:none}
.idea-card{flex:0 0 232px;min-width:0;display:flex;flex-direction:column;text-align:left;border:1px solid #ffffff16;border-radius:15px;background:#ffffff02;color:#a5b4ae;padding:0;overflow:hidden;cursor:pointer;transition:border-color .45s,color .45s,background .45s}
.idea-card img{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;opacity:.78;transition:opacity .6s}
.idea-card span{display:block;padding:12px 14px 14px;font-size:11px;line-height:1.6;text-wrap:pretty}
.idea-card:hover,.idea-card[aria-pressed=true]{border-color:#d5f1e669;color:#e0ece5;background:#b7ebd507}.idea-card:hover img,.idea-card[aria-pressed=true] img{opacity:1}
.idea-card:focus-visible,.scene-ideas-heading button:focus-visible,.idea-preview button:focus-visible{outline:2px solid #c7e9dc;outline-offset:3px}
@media(max-width:620px){
 body.has-scene-ideas .play-space{padding-top:114px}
 body.has-scene-ideas .room-heading{margin-bottom:14px}
 body.has-scene-ideas .scene-space{height:clamp(155px,25vh,210px);margin-bottom:20px}
 body.has-scene-ideas #prompt{top:45px;font-size:25px}
 .idea-preview>img{width:100%;height:auto;max-height:100%;object-fit:cover}
 .idea-preview>button{right:8px;top:calc((100% - min(100%,(100vw - 36px) * 9 / 16)) / 2 + 8px)}
 .idea-preview figcaption{bottom:calc((100% - min(100%,(100vw - 36px) * 9 / 16)) / 2 + 8px)}
 .scene-ideas{margin:20px -18px 0}
 .scene-ideas-heading{margin:0 18px 7px}
 .ideas-rail{gap:12px;padding-left:18px;padding-right:18px;scroll-padding:18px;mask-image:linear-gradient(90deg,transparent,#000 12px,#000 calc(100% - 12px),transparent)}
 .idea-card{flex-basis:212px}.idea-card span{font-size:11px;padding:11px 13px 13px}
}
.learning-room #feedback{max-width:650px;margin:0 auto 30px;font-size:16px;line-height:1.85;text-align:left;color:#c4d1ca;white-space:pre-line}.learning-room #feedback:empty{display:none}
.learning-room #prompt{font-size:clamp(24px,3vw,32px)}
#animate-label{display:inline-flex;align-items:center;gap:7px;cursor:pointer;color:#91a59b}#animate{accent-color:#cceedd;width:13px;height:13px;margin:0}
.learning-room .lesson-note{white-space:pre-line;line-height:1.8;color:#b0c3b9}
@media(max-width:620px){.learning-room .choices{flex-wrap:wrap}.learning-room .choices button{flex:1 1 130px}.learning-room #feedback{font-size:15px}}
.lesson-sources{display:flex;justify-content:center;flex-wrap:wrap;gap:8px 16px;max-width:650px;margin:0 auto 28px;animation:room-reveal 1.2s ease both}.lesson-sources a{font-size:11px;line-height:1.6;color:#91afa5;border-bottom:1px solid #b7e0d124;overflow-wrap:anywhere}.lesson-sources a:hover{color:#d3efe2}.lesson-sources a:focus-visible{outline:1px solid #c7e9dc;outline-offset:4px}.scene-gallery .lesson-sources{justify-content:flex-start;margin:0}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-delay:0ms!important;transition-duration:.01ms!important}}

.learning-room #prompt[hidden]{display:none}.learning-room #choices:empty{display:none}
.learning-room .composer-meta{gap:10px}.learning-room #answer-format{margin-right:2px}
.learning-room .scene-space.has-lesson-video{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:center}
.learning-room .scene-space.has-lesson-video :is(#scene,#movie){width:100%;aspect-ratio:16/9;object-fit:contain;max-height:none;border-radius:16px}
@media(max-width:620px){.learning-room .scene-space.has-lesson-video{grid-template-columns:1fr}.learning-room #answer-format button{padding:7px 8px;font-size:10px}.learning-room .composer-meta{gap:7px}}
