:root{color-scheme:light;--ink:#1a353c;--muted:#536e73;--sky:#f3fbfb;--line:#cfdfde;--accent:#136c7d;--accent2:#e7f3f5}*{box-sizing:border-box}html,body{margin:0;padding:0;font-family:system-ui,-apple-system,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;color:var(--ink);background:var(--sky)}body{overflow-x:hidden}.top{padding:13px 16px 12px;background:linear-gradient(120deg,#f3fbfa,#e1f3f2)}.eyebrow{display:block;font-size:10px;font-weight:800;letter-spacing:.1em;color:#448087}.top h1{font-size:clamp(17px,3.8vw,22px);margin:6px 0;line-height:1.25}.top p{font-size:12px;line-height:1.5;color:var(--muted);margin:0}#stage{height:min(74vh,660px);min-height:360px;position:relative;background:radial-gradient(ellipse at 55% 25%,#fff 15%,#e5f2f2 75%);overflow:hidden}#stage canvas{display:block;width:100%;height:100%;touch-action:none}.cover{position:absolute;inset:0;z-index:4;background:linear-gradient(0deg,rgba(240,249,247,.92),rgba(246,253,252,.30) 70%),url('poster-v1.9.1.jpg') center 29%/contain no-repeat;display:grid;place-items:end center;text-align:center;padding:20px}.cover-content{max-width:420px;padding:10px 14px 18px;border-radius:16px;background:rgba(255,255,255,.92);box-shadow:0 5px 28px rgba(23,55,60,.12)}.orbit{display:inline-grid;place-items:center;border-radius:50%;background:var(--accent);color:white;width:34px;height:34px;font-size:13px;font-weight:900;letter-spacing:.03em}.cover h2{font-size:18px;line-height:1.3;margin:8px 0 4px}.cover p{font-size:12px;line-height:1.5;margin:5px 0;color:var(--muted)}button{font:inherit;cursor:pointer;border:1px solid #c5d8db;background:white;color:var(--ink);border-radius:9px;min-height:38px;padding:7px 10px;font-size:12px;font-weight:650}button:hover{background:#e9f5f6}button:focus-visible{outline:3px solid #eea663;outline-offset:1px}button:disabled{opacity:.7;cursor:progress}#start{margin-top:7px;background:var(--accent);color:white;border-color:var(--accent);padding:9px 18px;font-size:13px}#start:not(:disabled):hover{background:#0e5360}.hint{position:absolute;top:10px;left:9px;z-index:2;max-width:calc(100% - 140px);border-radius:8px;padding:6px 8px;color:#245d66;background:rgba(255,255,255,.8);font-size:11px;pointer-events:none}.version{position:absolute;z-index:3;right:9px;bottom:9px;font-size:10px;background:rgba(255,255,255,.89);color:#39737d;padding:6px 8px;border-radius:8px;pointer-events:none}.toolbar{padding:10px;background:#f9fcfc;border-top:1px solid var(--line)}.tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.tabs button{min-width:0;white-space:normal;line-height:1.25;min-height:44px}.actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.actions button{flex:1 1 auto;min-width:48px}.tabs button[aria-pressed=true],.actions button[aria-pressed=true]{border-color:#126c7e;background:#dceef1;color:#114e5a;font-weight:800}footer{padding:7px 12px 10px;background:#f9fcfc;border-top:1px solid var(--line)}footer p{font-size:11px;line-height:1.55;color:#5c737a;margin:0}.night{--sky:#111e24;--ink:#eaf5f7;--muted:#abc4cb;--line:#3d5158;--accent:#237e93;background:#111e24}.night #stage{background:radial-gradient(ellipse at 45% 20%,#31444e,#101c24)}.night .top{background:linear-gradient(120deg,#21363c,#1a3038)}.night .toolbar,.night footer{background:#19282e}.night button{background:#243942;color:#e6f4f7;border-color:#52686f}.night button[aria-pressed=true]{background:#235c69;color:white}.night .cover-content{background:rgba(22,38,45,.93)}[hidden]{display:none!important}@media(max-width:600px){.top{padding:10px 12px}.top p{font-size:11px}#stage{height:min(66svh,600px);min-height:340px}.hint{font-size:10px}.toolbar{padding:8px}.actions{gap:5px}.actions button{font-size:11px;min-height:36px;padding:6px}.cover-content{padding:8px 10px 13px}.cover h2{font-size:16px}.tabs button{font-size:11px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* v1.9.3: Secret mode. All layout is scoped to this viewer. */
#secret{font-weight:800;min-width:90px}
#secret[aria-pressed="true"]{color:#fff;background:#7c258f;border-color:#ad48c1}
.parody-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:9px 0 3px;margin-top:7px;border-top:1px dashed #98aeb1}
.parody-actions button{flex:0 1 auto;border-color:#7f4e9c;background:#f6edff;color:#552c78;min-height:40px}
#launch{background:#f17b45;color:#fff;border-color:#e9662c;font-weight:800}
#launch:disabled{opacity:.65}
#parody-status{font-size:11px;flex:1 1 190px;color:#5a3875;line-height:1.45}
.night #parody-status{color:#e5c9ff}
.night .parody-actions button{background:#453050;color:#fce9ff;border-color:#825996}
.night #launch{background:#b94a2f;color:white;border-color:#e4764a}
#parody-toast{position:absolute;inset:auto 0 54px 0;pointer-events:none;z-index:3;text-align:center;font-size:clamp(18px,5vw,32px);font-weight:900;color:#fff;white-space:pre-wrap;text-shadow:0 2px 15px #081722,0 2px 4px #062d40;opacity:0;transition:opacity .2s}
#parody-toast.show{opacity:1}
@media(max-width:600px){.parody-actions{gap:5px}.parody-actions button{font-size:11px;flex:1 1 auto}#parody-status{flex-basis:100%;text-align:center}}
@media(prefers-reduced-motion:reduce){#parody-toast{transition:none}}

/* v1.9.4: expandable collection of secret-mode actions, responsive on phones */
.parody-menu{flex:1 1 100%;margin-top:4px;border:1px solid #7a78a6;border-radius:12px;background:#faf6ff;padding:0 8px 8px}
.parody-menu summary{cursor:pointer;user-select:none;list-style:revert;padding:11px 6px;font-size:13px;font-weight:800;color:#4d3070}
.parody-description{font-size:11px;color:#57426d;margin:0 3px 8px;line-height:1.5}
.parody-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.parody-grid button{min-width:0;white-space:normal;min-height:41px;padding:8px 3px;line-height:1.25;font-weight:700;font-size:11px}
.parody-grid button[aria-pressed=true]{background:#f7ca8b;border-color:#df8c39;color:#542c19}
.parody-bottom-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:8px}
.parody-bottom-row small{color:#65537d;line-height:1.5;flex:1 1 180px}
#fx-stop{background:#fff1e7;color:#8a3414;border-color:#dfa181;font-weight:700}
.night .parody-menu{background:#2b2544;border-color:#7662a3}
.night .parody-menu summary{color:#e8d1ff}
.night .parody-description,.night .parody-bottom-row small{color:#cab5e8}
.night .parody-grid button[aria-pressed=true]{background:#8b4d79;color:#fff;border-color:#d87ac5}
.night #fx-stop{background:#733f44;color:#fff4ee;border-color:#a45b60}
#parody-vfx{position:absolute;inset:0;z-index:2;pointer-events:none!important;touch-action:none!important;display:block}
#parody-vfx[hidden]{display:none!important}
@media(max-width:700px){.parody-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:400px){.parody-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.parody-grid button{font-size:11px}}

/* v1.9.5 stability update: desktop controls remain visible beside the 3D viewport.
   Scroll ONLY the side panel; do not make readers scroll past the model to find controls. */
@media (min-width:600px) and (pointer:fine){
  html,body{height:100%;max-height:100%;overflow:hidden}
  body{display:grid;grid-template-columns:minmax(0,1fr) clamp(240px,30%,288px);grid-template-rows:auto minmax(0,1fr) auto;min-height:0}
  .top{grid-column:1 / -1;grid-row:1}
  #stage{grid-column:1;grid-row:2;height:100%;min-height:0;min-width:0}
  #toolbar{grid-column:2;grid-row:2;min-width:0;min-height:0;max-height:100%;overflow-y:auto;
    overscroll-behavior:contain;scrollbar-width:thin;padding:10px 12px;border-top:0;border-left:1px solid var(--line)}
  footer{grid-column:1 / -1;grid-row:3}
  .toolbar .tabs{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
  .toolbar .tabs button{min-height:38px}
  .toolbar .actions button{flex:1 1 calc(50% - 6px);min-width:0}
  .toolbar .parody-actions{display:flex;flex-direction:column;align-items:stretch}
  .toolbar .parody-actions > button{width:100%;min-height:37px}
  .toolbar .parody-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .toolbar .parody-menu{width:100%;flex:auto}
  .toolbar .parody-grid button{min-height:36px}
  .toolbar #parody-status{flex:auto;width:100%}
  #stage .hint{max-width:calc(100% - 40px)}
}
/* Fullscreen runs on the iframe document root (not the canvas). */
html:fullscreen, html:-webkit-full-screen{width:100%;height:100%;background:var(--sky)}
@media (min-width:600px) and (pointer:fine){
  html:fullscreen body,html:-webkit-full-screen body{
    height:100dvh;grid-template-columns:minmax(0,1fr) clamp(250px,30vw,360px);grid-template-rows:minmax(0,1fr);}
  html:fullscreen .top,html:fullscreen footer,html:-webkit-full-screen .top,html:-webkit-full-screen footer{display:none}
  html:fullscreen #stage,html:-webkit-full-screen #stage{grid-column:1;grid-row:1;height:100%;min-height:0}
  html:fullscreen #toolbar,html:-webkit-full-screen #toolbar{grid-column:2;grid-row:1;height:100%;max-height:100dvh;overflow-y:auto;display:block}
}
@media (max-width:599px), (pointer:coarse){
  html:fullscreen body,html:-webkit-full-screen body{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
  html:fullscreen .top,html:fullscreen footer,html:-webkit-full-screen .top,html:-webkit-full-screen footer{display:none}
  html:fullscreen #stage,html:-webkit-full-screen #stage{height:58dvh;min-height:0;flex:1 1 auto}
  html:fullscreen #toolbar,html:-webkit-full-screen #toolbar{max-height:42dvh;flex:0 0 auto;overflow-y:auto;overscroll-behavior:contain}
}
/* Large effect list never intercepts dragging the model; focus remains visible. */
.parody-menu summary:focus-visible{outline:3px solid #e6a25c;outline-offset:1px}

/* v1.9.6: independent playback status and accessible stop button. */
#fx-caption{position:absolute;left:12px;bottom:12px;z-index:3;max-width:calc(100% - 144px);
  color:#fff;background:rgba(20,30,45,.84);border:1px solid rgba(150,231,255,.65);
  border-radius:10px;padding:7px 10px;font-size:11px;font-weight:700;pointer-events:none;
  box-shadow:0 3px 9px rgba(0,0,0,.24)}
#fx-caption[hidden]{display:none!important}
.fx-quick-stop{background:#f7d9cf!important;border-color:#c8583d!important;color:#672716!important;font-weight:800}
.night .fx-quick-stop{background:#9a4938!important;color:white!important}
#parody-menu summary{position:sticky;top:0;z-index:1;background:inherit}
#parody-menu button{touch-action:manipulation}
@media (min-width:600px) and (pointer:fine){
  #toolbar{scrollbar-gutter:stable;min-height:0}
  .toolbar .fx-quick-stop{width:100%}
}
@media (max-width:599px),(pointer:coarse){
  #fx-caption{font-size:10px;padding:5px 7px;max-width:calc(100% - 115px)}
}

/* v1.9.8 Building Combination Robot: 3 controllable docking forms */
.robot-combine-controls{margin:9px 0 1px;padding:10px;border:1px solid #a183bb;
 background:linear-gradient(135deg,#f3eafa,#e8f5fe);border-radius:11px;display:grid;gap:7px}
.robot-combine-controls label{font-size:12px;font-weight:800;color:#473072}
.robot-combine-controls select{width:100%;max-width:100%;min-width:0;min-height:41px;font-size:12px;
 padding:7px 6px;border:1px solid #9b80b0;border-radius:8px;background:#fff;color:#302449}
.robot-combine-controls p{font-size:11px;margin:0;color:#5e5173;line-height:1.55}
.night .robot-combine-controls{background:linear-gradient(140deg,#453355,#26384f);border-color:#795c9d}
.night .robot-combine-controls label,.night .robot-combine-controls p{color:#e5d8ff}
.night .robot-combine-controls select{background:#211f35;color:#f9eaff;border-color:#80649c}


/* v1.9.16: Night-blue archive control deck inspired by the approved concept art.
   UI only: no GLB building, arch neon, night controls or secret-mode behavior changed. */
:root{color-scheme:dark;--ink:#eff8fc;--muted:#aed1df;--sky:#09202b;--line:#31596b;--accent:#00b8d5;--accent2:#103c4d}
html,body{background:#09202b;color:var(--ink)}
.top{background:linear-gradient(116deg,#071e2a,#084051 54%,#081b2e);border-bottom:1px solid #157b95;padding:13px 18px 15px}
.eyebrow{color:#b4f1ff;letter-spacing:.08em;font-size:11px}
.top h1{font-weight:850;color:#fff;font-size:clamp(18px,2.3vw,27px);text-shadow:0 2px 15px rgba(0,0,0,.25)}
.title-accent{color:#80eaff;white-space:nowrap}
.top p{color:#d4edf6;font-size:12px}
#stage{background:radial-gradient(ellipse at 52% 32%,#e8f5f9 12%,#c2d8df 78%);border:1px solid #386678;border-radius:13px;min-width:0}
.night #stage{background:radial-gradient(ellipse at 45% 20%,#31444e,#081821)}
.cover{background:linear-gradient(0deg,rgba(5,22,31,.85),rgba(9,29,44,.08) 80%),url('poster-v1.9.1.jpg') center 35%/contain no-repeat}
.cover-content{background:rgba(9,35,49,.93);color:#fff;border:1px solid #348198;box-shadow:0 10px 40px rgba(0,0,0,.3)}
.cover p{color:#bedee9}
#start{background:#0489a5;color:#fff;border-color:#4bdcef;box-shadow:0 0 15px rgba(0,184,213,.24)}
#start:not(:disabled):hover{background:#0eafc6}
.hint{color:#b5dfe9;background:rgba(8,31,44,.78);border:1px solid #537e8d;border-radius:99px}
.version{color:#bde7f3;background:rgba(4,25,38,.77);border:1px solid #4c8797}
.toolbar{background:linear-gradient(160deg,#0d3445,#081f2d);border-top:1px solid #416779;color:#fff}
.toolbar-title{display:flex;align-items:center;justify-content:space-between;gap:6px;color:#f3fdff;font-size:15px;font-weight:850;margin:2px 0 10px}
.toolbar-title small{font-size:9px;letter-spacing:.06em;font-weight:650;color:#79cadc}
.toolbar-heading{border-top:1px solid #376073;padding:11px 0 6px;font-weight:800;font-size:12px;color:#cdebf5;letter-spacing:.02em}
.toolbar .tabs,.toolbar .actions{margin-top:0}
.toolbar button{color:#effcff;background:linear-gradient(160deg,#16465a,#0c2a3c);border:1px solid #537c8e;box-shadow:inset 0 1px rgba(255,255,255,.07);min-height:40px}
.toolbar button:hover{background:#225c6f;border-color:#6addf2}
.toolbar button[aria-pressed="true"],.toolbar .tabs button[aria-pressed="true"],.toolbar .actions button[aria-pressed="true"]{background:linear-gradient(155deg,#079ebc,#086377);border-color:#48efff;color:white;box-shadow:0 0 0 1px rgba(55,226,245,.24),inset 0 1px rgba(255,255,255,.23)}
#secret[aria-pressed="true"]{background:linear-gradient(155deg,#7d2d8c,#4b175e);border-color:#e88aff;color:white}
#full{background:linear-gradient(150deg,#007f9b,#006179);border-color:#00bdde}
.toolbar-hint{padding:10px 1px 5px;font-size:10px;color:#8bb5c5;line-height:1.55}
footer{background:#0b2431;border-top:1px solid #2b596c}
footer p{color:#b0c8d5}
.night .top,.night .toolbar,.night footer{background:linear-gradient(130deg,#092331,#0b3240)}
.night button{background:linear-gradient(155deg,#134154,#0b2b3c);color:#f3fbff;border-color:#496e80}
.night button[aria-pressed=true]{background:#076d82;border-color:#6df6ff}
.parody-menu{background:#1e2540;border-color:#75699f}
.parody-menu summary{color:#e6d7ff}
.parody-description,.parody-bottom-row small{color:#c4b5dc}
#parody-status{color:#e8c5ff}
.robot-combine-controls{background:linear-gradient(140deg,#473254,#223c55);border-color:#8d63a6}
.robot-combine-controls label,.robot-combine-controls p{color:#e9ddfc}
.robot-combine-controls select{color:#f9eaff;background:#20283b;border-color:#80649c}
@media (min-width:600px) and (pointer:fine){
 body{gap:7px;grid-template-columns:minmax(0,1fr) clamp(260px,29%,342px);padding:8px;background:#071e29}
 .top{border:1px solid #245c71;border-radius:12px;grid-column:1/-1}
 #stage{margin:0;min-height:0}
 #toolbar{border:1px solid #245c71;border-radius:13px;scrollbar-gutter:stable}
 footer{border:1px solid #245c71;border-radius:10px;grid-column:1/-1}
}
@media (max-width:599px),(pointer:coarse){
 .top{padding:12px}
 #stage{border-radius:8px}
 .toolbar{padding:11px}
 .toolbar .tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
 .toolbar-title{font-size:14px}
 .toolbar-heading{padding-top:9px}
}
@media (min-width:600px) and (pointer:fine){
 html:fullscreen body,html:-webkit-full-screen body{gap:7px;padding:7px}
 html:fullscreen #toolbar,html:-webkit-full-screen #toolbar{border:1px solid #245c71;border-radius:12px}
}
