.play-page{width:min(1840px,calc(100% - 20px));margin:10px auto;min-height:calc(100vh - 20px)}
.play-page .crayon-grid{grid-template-columns:minmax(0,1fr) 300px;min-height:calc(100vh - 20px)}
.play-main{gap:16px;padding:20px}

.play-stage{min-width:0;padding:16px;border:3px solid var(--ink);border-radius:var(--wonky);background:var(--card);box-shadow:5px 6px 0 rgba(51,48,43,.85)}
.stage-header,.stage-footer{display:flex;align-items:center}
.stage-header{justify-content:space-between;min-height:34px;padding:0 4px 10px;border-bottom:2px dashed var(--rule)}
.stage-header small{color:var(--muted);font-size:14px}
.stage-now{display:flex;align-items:center;gap:8px}
.stage-now b{font-size:17px;font-weight:400}
#status-dot{width:10px;height:10px;border:2px solid var(--ink);border-radius:50%;background:var(--muted)}
#status-dot.ready{background:var(--blue)}

.preview-frame-wrap{position:relative;width:100%;aspect-ratio:16/9;min-height:520px;margin-top:12px;overflow:hidden;border:3px solid var(--ink);border-radius:250px 18px 235px 20px/20px 240px 18px 250px;background:#131817;box-shadow:4px 5px 0 var(--ink)}
.preview-frame-wrap iframe{display:block;width:100%;height:100%;border:0;background:#131817}
.loading-layer{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:var(--card);color:var(--ink);transition:opacity .28s,visibility .28s}
.loading-layer.hidden{visibility:hidden;opacity:0}
.loading-layer b{font-size:20px;font-weight:400}
.loading-layer small{color:var(--muted)}
.runtime-choice{position:absolute;z-index:5;inset:0;display:grid;place-items:center;padding:24px;background:rgba(253,246,230,.94);color:var(--ink)}
.runtime-choice>div{display:grid;width:min(590px,92%);gap:13px;padding:24px;border:3px solid var(--ink);border-radius:24px 14px 22px 16px/16px 24px 14px 26px;background:var(--card);box-shadow:5px 6px 0 var(--ink);text-align:center}
.runtime-choice b{font-size:25px;font-weight:400}.runtime-choice p{margin:0;font-size:16px;line-height:1.6}.runtime-choice small{color:var(--muted);line-height:1.55}
.runtime-choice>div>div{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.runtime-choice button{min-height:42px;padding:7px 15px}
.loader{width:36px;height:36px;border:3px solid var(--rule);border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.touch-controls{position:absolute;right:16px;bottom:16px;left:16px;display:flex;justify-content:space-between;pointer-events:none}
.touch-controls>div{display:flex;gap:8px}
.touch-controls button{pointer-events:auto;width:48px;height:46px;border:2.5px solid var(--ink);border-radius:250px 16px 230px 14px/14px 240px 16px 250px;background:rgba(253,246,230,.9);box-shadow:2px 3px 0 var(--ink);color:var(--ink);font-size:21px;touch-action:none}
.touch-controls .touch-jump{width:58px;height:58px;border-radius:50%;background:var(--yellow);font-size:17px}

.stage-footer{gap:10px;min-height:48px;padding:12px 2px 0;color:var(--muted)}
.stage-footer p{margin:0 0 0 auto;font-size:14px}
.control-hint{display:flex;align-items:center;gap:5px;font-size:14px}
.burst-hint{color:var(--ink)}
.burst-hint kbd{background:var(--yellow)}
kbd{display:inline-grid;min-width:30px;height:28px;place-items:center;padding:0 7px;border:2px solid var(--ink);border-radius:8px;background:var(--paper);box-shadow:1px 2px 0 var(--ink);color:var(--ink);font:inherit}
.telemetry{display:flex;gap:10px;margin-left:auto;font-size:13px}.telemetry b{color:var(--ink);font-weight:400}

.action-strip{padding:12px 0;border-top:2px dashed var(--rule);border-bottom:2px dashed var(--rule)}
.action-buttons{display:flex;gap:8px;flex-wrap:wrap}
.action-buttons button,.qa-button{display:flex;min-height:40px;align-items:center;gap:7px;padding:6px 11px;border:2px solid var(--ink);border-radius:var(--wonky);background:var(--paper);box-shadow:2px 3px 0 var(--ink);color:var(--ink)}
.action-buttons button.active{background:#dbe8f4}
.action-buttons button kbd{min-width:24px;height:24px;box-shadow:none}
.action-buttons button span{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-empty{color:var(--muted)}

.play-decisions{padding-top:0;border-top:0}
.play-decisions>*{display:inline-grid;min-width:0;flex:1;place-items:center;text-align:center}
.play-decisions .primary-button{flex:2}

.play-facts{min-width:0}
.motion-fact{display:flex!important;align-items:center;gap:8px}
#motion-pulse{width:10px;height:10px;border:2px solid var(--ink);border-radius:50%;background:var(--muted)}
#motion-pulse.active{background:var(--yellow);animation:pulse 1s ease-in-out infinite}
@keyframes pulse{50%{transform:scale(.72);opacity:.6}}
.select-wrap{position:relative;margin:0}
.select-wrap select,.transition-select{width:100%;min-width:0;height:42px;padding:0 34px 0 11px;border:2px solid var(--ink);border-radius:var(--wonky);background:var(--paper);color:var(--ink);appearance:none}
.select-wrap>span{position:absolute;top:8px;right:12px;pointer-events:none}
.rail-actions{display:grid;gap:10px;padding:0 20px 18px}
.rail-actions .paper-button{width:100%}
.quiet-button{min-height:38px;border:0;background:none;color:var(--muted);text-decoration:underline;text-decoration-style:dashed;text-underline-offset:4px}
.input-pill{display:flex;align-items:center;gap:8px}.input-pill i{width:9px;height:9px;border:2px solid var(--ink);border-radius:50%;background:var(--blue)}

.qa-console{padding:16px;border:3px solid var(--ink);border-radius:var(--wonky);background:var(--paper);box-shadow:4px 5px 0 var(--ink)}
.qa-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.qa-heading h2{margin:0;font-size:28px;font-weight:400}.qa-heading .paper-button{min-height:36px}
.qa-groups{display:grid;grid-template-columns:1fr 1fr 1.25fr 1fr;gap:14px}
.qa-group{min-width:0;padding-right:14px;border-right:2px dashed var(--rule)}.qa-group:last-child{padding-right:0;border:0}
.qa-group>label{display:flex;justify-content:space-between;margin-bottom:9px;color:var(--body)}
.qa-group>small{display:block;margin-top:6px;color:var(--muted)}
.segmented,.qa-row,.background-options{display:flex;gap:6px}.qa-row{margin-top:6px}
.segmented button{flex:1;min-height:32px;border:2px solid var(--ink);border-radius:var(--wonky);background:var(--paper)}.segmented button.active{background:var(--yellow)}
.qa-button{flex:1;justify-content:center;min-height:32px;padding:4px 7px;box-shadow:none}
.background-options button{width:32px;height:32px;border:2px solid var(--ink);border-radius:50%;box-shadow:1px 2px 0 var(--ink)}
.background-options button.active{outline:3px solid var(--yellow);outline-offset:2px}.background-options .dark{background:#111}.background-options .white{background:#fff}.background-options .magenta{background:#f0f}.background-options .cyan{background:#00d9e5}
.light-group input{width:100%;accent-color:var(--yellow)}
.loop-meter{height:10px;overflow:hidden;border:2px solid var(--ink);border-radius:8px;background:var(--card)}.loop-meter i{display:block;width:0;height:100%;background:var(--blue);transition:width .25s}

.share-sheet{position:fixed;inset:0;z-index:30;display:grid;place-items:center;padding:20px;background:rgba(51,48,43,.45)}
.share-sheet>div{position:relative;width:min(520px,100%);padding:28px}.share-sheet h2{margin:0;font-size:34px;font-weight:400}.share-sheet p{color:var(--body)}
.share-close{position:absolute;top:14px;right:14px}
.share-url{display:flex;margin:18px 0 10px}.share-url input{min-width:0;flex:1;height:44px;padding:0 12px;border:2px solid var(--ink);border-radius:var(--wonky);background:var(--paper)}.share-url button{padding:0 18px;border:2px solid var(--ink);background:var(--yellow)}
.danger-link{color:var(--red)}
.hidden{display:none!important}

@media(min-width:901px){.touch-controls{opacity:.3;transition:opacity .18s}.preview-frame-wrap:hover .touch-controls{opacity:1}}
@media(max-width:1200px){.preview-frame-wrap{min-height:440px}}
@media(max-width:900px){.play-page .crayon-grid{grid-template-columns:1fr}.play-main{border-right:0;border-bottom:2px dashed var(--rule)}.preview-frame-wrap{min-height:360px}.qa-groups{grid-template-columns:1fr 1fr}.qa-group:nth-child(2){border-right:0}}
@media(max-width:620px){.play-page{width:calc(100% - 16px);margin:8px auto}.play-main{padding:16px}.preview-frame-wrap{min-height:430px;aspect-ratio:4/5}.stage-footer{flex-wrap:wrap}.stage-footer p{display:none}.telemetry{margin-left:0}.qa-groups{grid-template-columns:1fr}.qa-group{padding:0 0 12px;border-right:0;border-bottom:2px dashed var(--rule)}.play-decisions>*{flex-basis:100%}}
