*{box-sizing:border-box}:root{font-family:Inter,"Noto Sans JP",system-ui,sans-serif;color:#101010;background:#efefef}body{margin:0}.app{width:min(1480px,calc(100% - 24px));margin:auto;padding:20px 0}header{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:14px}small{letter-spacing:.22em;color:#666}h1{margin:4px 0 0;font-size:34px}.header-actions,.tabs,.editor-bar,.size-row,.section-title{display:flex;gap:8px;align-items:center}button,.file-button{border:2px solid #111;border-radius:10px;background:#fff;padding:8px 11px;font-weight:800;cursor:pointer;color:#111}.dark,.tabs button.active{background:#111;color:#fff}.file-button input{display:none}.tabs{margin-bottom:12px}.workspace{display:grid;grid-template-columns:230px minmax(500px,1fr) 280px;gap:14px;align-items:start}.left-panel,.right-panel,.editor-area{background:#fff;border:2px solid #111;border-radius:15px}.left-panel,.right-panel{padding:12px;max-height:calc(100vh - 130px);overflow:auto}.left-panel section,.right-panel section{padding:8px 0 14px;border-bottom:1px solid #ddd}.left-panel section:last-child,.right-panel section:last-child{border:0}h2{font-size:15px;margin:0 0 10px}.section-title{justify-content:space-between}.section-title h2{margin:0}label{display:grid;gap:4px;font-size:12px;font-weight:700;margin:8px 0}input,select{width:100%;border:1px solid #999;border-radius:7px;padding:7px;background:#fff}.size-row label{width:50%}.check{display:flex;align-items:center}.check input{width:auto}.editor-area{padding:14px}.editor-bar{justify-content:space-between;margin-bottom:12px}.editor-bar span{margin-left:8px;color:#777;font-size:12px}#boardWrap{overflow:auto;padding:12px;background:#111;border-radius:12px;min-height:480px;display:flex;align-items:center;justify-content:center}#board{display:grid;gap:2px;background:#111;border:2px solid #111;user-select:none;touch-action:none}.cell{position:relative;width:58px;height:58px;background:#f9f9f9;display:grid;place-items:center;cursor:crosshair}.cell.wall{background:#171717}.cell.void{background:#777}.cell.goal:after{content:attr(data-goal);position:absolute;inset:14%;border:2px dashed #aaa;border-radius:50%;display:grid;place-items:center;color:#777;font-weight:900}.cell .coord{position:absolute;left:3px;top:2px;font:9px monospace;color:#999}.player-mark{width:22px;height:22px;border-radius:50%;background:#111;border:3px solid #fff;box-shadow:0 0 0 1px #111;z-index:4}.portal{position:absolute;inset:12%;display:grid;place-items:center;border:3px double #111;border-radius:9px;background:white;font-weight:950;z-index:3}.portal:after{content:"";position:absolute;inset:22%;border:2px solid #111;border-radius:50%}.number-block,.dice-block{position:absolute;inset:7%;display:grid;place-items:center;border:3px solid #111;border-radius:8px;background:#fff;font-size:25px;font-weight:950;z-index:3}.dice-block{border-radius:16px;font-size:18px}.arrow{position:absolute;right:3px;bottom:0;font-size:10px;color:#777}.tools{display:grid;grid-template-columns:1fr 1fr;gap:7px}.tool{min-height:44px;font-size:12px}.tool.active{background:#111;color:#fff}.stage-item{display:flex;justify-content:space-between;align-items:center;border:1px solid #bbb;border-radius:8px;padding:7px;margin:5px 0;cursor:pointer}.stage-item.active{border:2px solid #111;font-weight:900}.stage-item button{padding:3px 7px;border-width:1px}.portal-row{border:1px solid #ccc;border-radius:8px;padding:7px;margin:6px 0;font-size:12px}.portal-row select{margin-top:5px}#status{margin-top:10px;min-height:43px;padding:10px;border:1px solid #bbb;border-radius:9px;background:#fafafa;font-size:13px}.test-banner{background:#111;color:#fff;padding:8px;border-radius:8px;margin-bottom:8px}.selected-cell{outline:4px solid #777;outline-offset:-4px}@media(max-width:1050px){.workspace{grid-template-columns:200px 1fr}.right-panel{grid-column:1/-1;max-height:none;display:grid;grid-template-columns:1fr 1fr 1fr;gap:18px}.right-panel section{border:0}.cell{width:48px;height:48px}}@media(max-width:720px){.workspace{display:block}.left-panel,.right-panel{max-height:none;margin-bottom:12px}.right-panel{display:block}.header-actions{flex-wrap:wrap}.cell{width:42px;height:42px}}

#board{position:relative}
.placed-entity{position:relative;z-index:6;pointer-events:none;min-width:0;min-height:0}
.placed-entity .number-block,.placed-entity .dice-block{position:absolute;left:calc(7% / var(--cols,1));right:calc(7% / var(--cols,1));top:calc(7% / var(--rows,1));bottom:calc(7% / var(--rows,1));inset:auto;display:flex;overflow:hidden}
.placed-entity.vertical .number-block{flex-direction:column}
.placed-digit{flex:1;display:grid;place-items:center;border-right:2px solid #bbb;font-size:25px;font-weight:950}
.placed-entity.vertical .placed-digit{border-right:0;border-bottom:2px solid #bbb}
.placed-digit:last-of-type{border:0}
.placed-glyph{display:inline-block;transform:rotate(var(--rotation));line-height:1}
.placed-goal{position:relative;z-index:5;pointer-events:none;min-width:0;min-height:0}
.placed-goal:before{content:"";position:absolute;left:calc(13% / var(--cols,1));right:calc(13% / var(--cols,1));top:calc(13% / var(--rows,1));bottom:calc(13% / var(--rows,1));border:2px dashed #999;border-radius:10px;background:rgba(255,255,255,.55)}
.placed-goal .goal-digits{position:absolute;inset:0;display:flex;z-index:1}
.placed-goal.vertical .goal-digits{flex-direction:column}
.placed-goal .placed-digit{color:#777;font-size:20px;border-color:#bbb}
#transitionOverlay{position:fixed;inset:0;z-index:100;display:grid;place-items:center;background:rgba(0,0,0,.78);opacity:0;visibility:hidden;transition:opacity 160ms ease,visibility 160ms ease;color:#fff;pointer-events:none}
#transitionOverlay.show{opacity:1;visibility:visible}
#transitionOverlay div{text-align:center}.transitionOverlay small,#transitionOverlay small{display:block;color:#bbb;letter-spacing:.3em;margin-bottom:10px}#transitionName{display:block;font-size:clamp(28px,6vw,62px);letter-spacing:.04em}
.stage-name-input{font-size:14px;font-weight:800}

/* Prototype 03: simple game-like number block appearance */
.placed-entity .number-block{
  gap:0;
  align-items:stretch;
  justify-content:stretch;
  border:3px solid #111;
  border-radius:10px;
  background:#fff;
  box-shadow:2px 2px 0 #111;
}
.placed-entity .placed-digit{
  border:0 !important;
  background:transparent;
  font-size:28px;
  font-weight:950;
}
.placed-entity.vertical .number-block{flex-direction:column}
.placed-entity .arrow{right:5px;bottom:1px}

/* Prototype 04: Prototype 01 style, one unified face for the full number block */
.placed-entity .number-block{display:grid;place-items:center}
.placed-block-value{display:inline-block;font-size:28px;font-weight:950;line-height:1;transform:rotate(var(--rotation));white-space:nowrap}
.test-player-moving{z-index:20;will-change:transform}
.portal.arrived{animation:portal-arrival 180ms cubic-bezier(.2,.78,.24,1)}
@keyframes portal-arrival{0%{transform:scale(1)}55%{transform:scale(.92)}100%{transform:scale(1)}}

/* Prototype 05: full-size ordinary number blocks */
.placed-entity{align-self:stretch;justify-self:stretch;width:100%;height:100%;position:relative}
.placed-entity .number-block,.placed-entity .dice-block{width:auto;height:auto;min-width:0;min-height:0;box-sizing:border-box}
.placed-entity .number-block{display:flex;align-items:stretch;justify-content:stretch;padding:0}
.placed-entity .placed-digit{display:grid;place-items:center;flex:1;min-width:0;min-height:0;border-right:2px solid #bbb !important;font-size:28px;font-weight:950}
.placed-entity.vertical .placed-digit{border-right:0 !important;border-bottom:2px solid #bbb !important}
.placed-entity .placed-digit:last-of-type{border:0 !important}
.placed-entity .placed-glyph{display:inline-block;transform:rotate(var(--rotation));line-height:1}
.test-block-moving{z-index:16;will-change:transform}

/* Prototype 06: exact CarryGridPuzzle Prototype 34 block structure */
.cg-entity{
  position:relative;
  z-index:12;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  pointer-events:none;
  --cg-cols:1;
  --cg-rows:1;
}
.cg-shell{
  position:absolute;
  left:calc(7% / var(--cg-cols));
  right:calc(7% / var(--cg-cols));
  top:calc(7% / var(--cg-rows));
  bottom:calc(7% / var(--cg-rows));
  display:flex;
  border:3px solid #111;
  border-radius:9px;
  background:#fff;
  box-shadow:2px 2px 0 #111;
  overflow:hidden;
}
.cg-entity.vertical .cg-shell{flex-direction:column}
.cg-digit{
  flex:1;
  min-width:0;
  min-height:0;
  display:grid;
  place-items:center;
  border-right:2px solid #bbb;
  font-size:34px;
  font-weight:950;
  line-height:1;
}
.cg-entity.vertical .cg-digit{
  border-right:0;
  border-bottom:2px solid #bbb;
}
.cg-digit:last-of-type{border:0}
.cg-glyph{
  display:inline-block;
  transform:rotate(var(--cg-rotation));
  line-height:1;
}
.cg-arrow{
  position:absolute;
  right:4px;
  bottom:0;
  color:#888;
  font-size:11px;
  line-height:1.2;
}
.cg-die{
  position:absolute;
  inset:14%;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(3,1fr);
}
.cg-pip{
  width:42%;
  aspect-ratio:1;
  place-self:center;
  border-radius:50%;
  background:#111;
}
.cg-entity.die-one .cg-pip{background:#d01919}
.cg-moving{z-index:30;will-change:transform}

/* Prototype 07: pixel-positioned entities matching Prototype 34 */
.cg-entity{
  position:absolute;
  left:0;
  top:0;
  width:var(--cg-width);
  height:var(--cg-height);
  transform:translate(var(--cg-left),var(--cg-top));
  transition:transform 165ms cubic-bezier(.2,.78,.24,1);
  will-change:transform;
  backface-visibility:hidden;
}
.cg-shell{
  left:calc(7% / var(--cg-cols));
  right:calc(7% / var(--cg-cols));
  top:calc(7% / var(--cg-rows));
  bottom:calc(7% / var(--cg-rows));
}
.cg-effect-layer{position:absolute;inset:0;z-index:40;pointer-events:none;overflow:hidden}
.cg-merge-ghost{z-index:45;transition:none}
.cg-result-hidden{opacity:0}
.cg-test-player{position:absolute;z-index:50;pointer-events:none;width:58px;height:58px;transform:translate(var(--player-left),var(--player-top));will-change:transform}
.cg-test-player .player-mark{position:absolute;left:18px;top:18px}

.test-queue{font:700 12px ui-monospace,monospace;color:#666;margin-top:8px}
.input-note{margin:6px 0 0;color:#666;font-size:11px;line-height:1.5}

.cg-falling{z-index:60;transform-origin:center;pointer-events:none}
.portal-exit-player{z-index:70}

.cg-expansion-pushed{z-index:28;will-change:transform;backface-visibility:hidden}

.portal-number{position:relative;z-index:2;font:950 20px/1 ui-monospace,monospace;color:#111;text-shadow:0 1px #fff}
.portal[data-order=""] .portal-number{display:none}

/* Prototype 15: responsive walk, based on the old immediate-sync model */
.cg-test-player{transition:none}

.solver-button{background:#111;color:#fff}.solver-overlay{position:fixed;inset:0;z-index:200;display:none;place-items:center;padding:20px;background:rgba(0,0,0,.72)}.solver-overlay.show{display:grid}.solver-dialog{width:min(900px,100%);max-height:calc(100vh - 40px);overflow:auto;padding:18px;border:3px solid #111;border-radius:18px;background:#fff;box-shadow:8px 8px #111}.solver-dialog header{display:flex;justify-content:space-between;align-items:start}.solver-dialog h2{margin:3px 0 14px;font-size:28px}.solver-settings{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.solver-actions{display:flex;gap:8px;margin:8px 0 12px}.solver-progress,.solver-summary{padding:10px;border:1px solid #bbb;border-radius:9px;background:#fafafa;margin:8px 0;font:13px/1.55 ui-monospace,monospace}.solver-summary:empty{display:none}.solver-solution{display:grid;grid-template-columns:70px 1fr auto;gap:10px;align-items:center;padding:9px;border-bottom:1px solid #ddd}.solver-moves{font:700 14px/1.7 ui-monospace,monospace;word-break:break-all}.solver-solution button{padding:6px 8px}.solver-solution-actions{display:flex;gap:5px}.solver-warning{color:#a33;font-weight:800}@media(max-width:650px){.solver-settings{grid-template-columns:1fr}.solver-solution{grid-template-columns:1fr}}

.cg-result-staged{opacity:0;transition:none!important}
.cg-result-staged.cg-result-running{opacity:1}

.test-log-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.test-log-actions button{padding:5px 7px;border:1px solid #fff;background:#fff;color:#111;font-size:11px}.test-log-info{margin-top:6px;font:700 12px ui-monospace,monospace;color:#ccc}

.solver-verify-file{display:inline-flex;align-items:center}.verify-ok{color:#175f25;font-weight:900}.verify-error{color:#a21d1d;font-weight:900}.verify-step{padding:9px;border-bottom:1px solid #ddd;font:13px/1.55 ui-monospace,monospace}.verify-diff{white-space:pre-wrap;word-break:break-word;background:#f6f6f6;border:1px solid #ccc;border-radius:8px;padding:9px;margin-top:6px}

.solver-settings-four{grid-template-columns:repeat(4,1fr)}.solver-mode-note{margin:7px 0;color:#555;font-size:12px;line-height:1.55}@media(max-width:850px){.solver-settings-four{grid-template-columns:repeat(2,1fr)}}@media(max-width:520px){.solver-settings-four{grid-template-columns:1fr}}

.auto-improve-settings{display:flex;gap:10px;align-items:end;margin:6px 0}.auto-improve-settings label{width:150px}.improve-history{margin-top:8px;padding:8px;border:1px solid #ccc;border-radius:8px;background:#fff;font:12px/1.6 ui-monospace,monospace}.solver-safe-stop{color:#9a4d00;font-weight:900}

.portfolio-settings{flex-wrap:wrap}.portfolio-profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-top:8px}.portfolio-profile-row{padding:6px 8px;border:1px solid #ddd;border-radius:7px;background:#fafafa}.portfolio-running{border-color:#111;background:#fff}.portfolio-improved{color:#176b2b;font-weight:900}@media(max-width:650px){.portfolio-profile-grid{grid-template-columns:1fr}}

#boardWrap.camera-active{justify-content:flex-start;align-items:flex-start;scroll-behavior:smooth}#boardWrap.camera-active #board{flex:0 0 auto}.world-solver-actions{padding:9px;border:2px solid #111;border-radius:10px;background:#f7f7f7}.world-route-list{display:grid;gap:7px;margin-top:9px}.world-route-step{padding:8px;border:1px solid #bbb;border-radius:8px;background:#fff}.world-route-current{border-color:#111;box-shadow:2px 2px #111}.route-run-button{background:#fff8d8}

.cg-digit:first-child .cg-glyph{font-variant-numeric:tabular-nums}

.stage-library-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:7px 0}.stage-library-actions>*{font-size:11px;padding:6px}.stage-file-button{display:grid;place-items:center}.generator-overlay{position:fixed;inset:0;z-index:230;display:none;place-items:center;padding:20px;background:rgba(0,0,0,.72)}.generator-overlay.show{display:grid}.generator-dialog{width:min(850px,100%);max-height:calc(100vh - 40px);overflow:auto;padding:18px;border:3px solid #111;border-radius:18px;background:#fff;box-shadow:8px 8px #111}.generator-dialog header{display:flex;justify-content:space-between;align-items:start}.generator-settings{display:grid;grid-template-columns:repeat(5,1fr);gap:9px}.generator-note{font-size:12px;color:#555}.generator-actions{display:flex;gap:8px}.generator-results{display:grid;gap:8px}.generator-result{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:10px;border:1px solid #bbb;border-radius:9px;background:#fafafa}.generator-result.best{border:3px solid #111;background:#fff}.generator-result-actions{display:flex;gap:6px}.generator-metrics{font:12px/1.6 ui-monospace,monospace}@media(max-width:760px){.generator-settings{grid-template-columns:1fr 1fr}.generator-result{grid-template-columns:1fr}}

/* Prototype 56: fixed board geometry independent of viewport width. */
:root{--cg-cell-size:58px;--cg-cell-gap:2px;--cg-step:60px}
#board{gap:var(--cg-cell-gap)}
.cell{width:var(--cg-cell-size)!important;height:var(--cg-cell-size)!important;min-width:var(--cg-cell-size);min-height:var(--cg-cell-size);box-sizing:border-box}
#boardWrap{justify-content:flex-start;align-items:flex-start;max-width:100%;overflow:auto}

/* Rotation floor: an almost inscribed white circle plus a separately centered glyph. */
.cell.effect-floor:before{
  content:"";
  position:absolute;
  inset:2px;
  box-sizing:border-box;
  border:3px solid #111;
  border-radius:50%;
  background:#fff;
  z-index:2;
  pointer-events:none;
}
.cell.effect-floor:after{
  content:attr(data-effect);
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  padding:0 0 2px 0;
  color:#111;
  font-family:"Arial Unicode MS","Noto Sans Symbols 2","Noto Sans Symbols",sans-serif;
  font-size:34px;
  font-weight:700;
  line-height:1;
  text-align:center;
  z-index:3;
  pointer-events:none;
}
.cell.effect-used:before,.cell.effect-used:after{opacity:.22;filter:grayscale(1)}

.profile-toggles{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:9px 0}.profile-toggle{border:2px solid #aaa;border-radius:9px;padding:7px;background:#eee;cursor:pointer;text-align:left;font-size:11px}.profile-toggle.enabled{border-color:#111;background:#fff;box-shadow:2px 2px #111}.profile-toggle b{display:block;font-size:12px}.profile-count{font:900 13px ui-monospace,monospace}.worker-monitor{display:grid;grid-template-columns:220px 1fr;gap:10px;padding:9px;border:1px solid #bbb;border-radius:9px;background:#fafafa;margin:8px 0}.worker-preview-board{display:grid;gap:1px;align-content:start;justify-content:start;background:#222;padding:2px;min-height:90px;overflow:auto}.worker-preview-cell{width:16px;height:16px;background:#fff;position:relative}.worker-preview-cell.wall{background:#222}.worker-preview-cell.void{background:#888}.worker-preview-cell.goal:after{content:"";position:absolute;inset:3px;border:1px dashed #777}.worker-preview-block{position:absolute;inset:2px;background:#fff;border:2px solid #111;font:900 9px/11px ui-monospace;text-align:center;z-index:2}.worker-preview-player{position:absolute;inset:4px;border-radius:50%;background:#111;z-index:3}.solver-solution{grid-template-columns:70px minmax(0,1fr) auto}.solution-meta{font:11px ui-monospace;color:#666}@media(max-width:760px){.profile-toggles{grid-template-columns:repeat(2,1fr)}.worker-monitor{grid-template-columns:1fr}}

.cell.invalid-cell{outline:4px solid #e00000;outline-offset:-4px;background-image:repeating-linear-gradient(135deg,rgba(255,0,0,.22) 0 6px,transparent 6px 12px)}.cell.invalid-cell:before{box-shadow:0 0 0 3px #e00000!important}

.segment-improve-settings{display:grid;grid-template-columns:2fr 1fr 1fr;gap:8px;margin:8px 0;padding:8px;border:1px solid #bbb;border-radius:9px;background:#f7f7f7}@media(max-width:760px){.segment-improve-settings{grid-template-columns:1fr}}

.generator-dialog-wide{width:min(1020px,96vw)}.generator-theme-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:10px 0}.generator-theme-row{display:grid;grid-template-columns:1fr 100px;gap:8px;align-items:center;padding:8px;border:1px solid #bbb;border-radius:9px;background:#fafafa}.generator-theme-row span{display:flex;flex-direction:column}.generator-theme-row small{color:#666;font-size:11px}.generator-theme-row select{margin:0}@media(max-width:720px){.generator-theme-controls{grid-template-columns:1fr}}



.placed-goal .placed-digit.dice-goal-digit{display:grid;place-items:center;color:#777;font-size:20px;border-color:#bbb}.placed-goal .dice-face{width:22px;height:22px;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:1px;color:inherit}.placed-goal .dice-face i{width:4.5px;height:4.5px;border-radius:50%;background:currentColor;place-self:center;visibility:hidden}.dice-1 i:nth-child(5),.dice-2 i:nth-child(1),.dice-2 i:nth-child(9),.dice-3 i:nth-child(1),.dice-3 i:nth-child(5),.dice-3 i:nth-child(9),.dice-4 i:nth-child(1),.dice-4 i:nth-child(3),.dice-4 i:nth-child(7),.dice-4 i:nth-child(9),.dice-5 i:nth-child(1),.dice-5 i:nth-child(3),.dice-5 i:nth-child(5),.dice-5 i:nth-child(7),.dice-5 i:nth-child(9),.dice-6 i:nth-child(1),.dice-6 i:nth-child(3),.dice-6 i:nth-child(4),.dice-6 i:nth-child(6),.dice-6 i:nth-child(7),.dice-6 i:nth-child(9){visibility:visible}
.solution-inspector{margin-top:14px;padding:12px;border:2px solid #111;border-radius:12px;background:#fff}.solution-inspector[hidden]{display:none}.solution-inspector header{display:flex;justify-content:space-between}.solution-inspector h3{margin:2px 0 8px}.inspector-controls{display:grid;grid-template-columns:auto auto 1fr auto auto;gap:6px;align-items:center}.inspector-main{display:grid;grid-template-columns:auto minmax(260px,1fr);gap:14px;margin-top:10px}.inspector-board{display:grid;gap:1px;padding:5px;border:2px solid #222;background:#777}.inspector-cell{width:28px;height:28px;position:relative;display:grid;place-items:center;background:#eee;font:700 10px ui-monospace,monospace}.inspector-cell.wall{background:#333}.inspector-cell.void{background:#111}.inspector-cell.goal{box-shadow:inset 0 0 0 2px #e45}.inspector-cell.effect:after{content:attr(data-effect);position:absolute;color:#166;font-size:18px}.inspector-block{z-index:2;display:grid;place-items:center;min-width:22px;height:22px;padding:0 2px;border:1px solid #111;border-radius:3px;background:#fff}.inspector-block.dice{border-radius:7px}.inspector-player{z-index:3;width:16px;height:16px;display:grid;place-items:center;border-radius:50%;color:#fff;background:#126}.inspector-details{padding:10px;border:1px solid #bbb;border-radius:8px;background:#fafafa;font:13px/1.55 ui-monospace,monospace}.inspector-details hr{border:0;border-top:1px solid #ccc}.inspector-event{display:block;margin:3px 0;padding:3px 6px;border-left:4px solid #777;background:#eee}.inspector-event.merge{border-color:#b60}.inspector-event.rotate{border-color:#068}.inspector-event.goal{border-color:#080}.inspector-event.fall{border-color:#900}.inspector-timeline{display:flex;gap:4px;overflow-x:auto;margin-top:10px;padding-bottom:4px}.inspector-timeline button{min-width:42px;padding:5px}.inspector-timeline button.active{color:#fff;background:#111}@media(max-width:760px){.inspector-main{grid-template-columns:1fr}.inspector-controls{grid-template-columns:auto auto 1fr auto auto}}

.reason-section{display:grid;gap:6px}.reason-purpose{padding:7px;border-left:4px solid #1769aa;background:#eaf4ff;font-weight:800}.reason-verdict{padding:6px;border-radius:6px;font-weight:800}.reason-verdict.best{background:#e7f7e7;color:#164f16}.reason-verdict.path{background:#fff1d6;color:#684500}.reason-alternatives{display:grid;gap:4px}.reason-alt{display:grid;grid-template-columns:80px 90px 1fr auto;gap:6px;align-items:center;padding:5px 7px;border:1px solid #ccc;border-radius:6px;background:#fff}.reason-alt.chosen{border:2px solid #1769aa;background:#eef7ff}.reason-alt.illegal{color:#777;background:#eee}.reason-alt em{padding:2px 5px;border-radius:4px;color:#fff;background:#1769aa;font-style:normal}.reason-deltas{display:flex;flex-wrap:wrap;gap:5px}.reason-delta{padding:4px 6px;border-radius:5px;background:#eee}.reason-delta.improved{color:#145c20;background:#e5f7e8}.reason-delta.worsened{color:#7b3314;background:#fff0e8}.reason-muted{color:#777}@media(max-width:650px){.reason-alt{grid-template-columns:70px 1fr}.reason-alt span:last-of-type{grid-column:1/-1}}

.solution-library{display:none}.solution-summary{display:grid;grid-template-columns:1fr 1fr;gap:7px}.solution-summary .known-choice{grid-column:1/-1;border-color:#1769aa;background:#eef7ff}.solution-summary>div{display:grid;gap:2px;padding:8px;border:1px solid #bbb;border-radius:8px;background:#fafafa}.solution-summary span{font-size:11px;color:#666}.solution-summary b{font-size:18px}.solution-summary small{font-size:10px;color:#777}.solution-actions{display:grid;gap:6px;margin-top:8px}.hint-preview{display:grid;gap:6px;margin-top:10px;padding:8px;border:1px dashed #999;border-radius:8px;background:#fff}.hint-preview>div:first-of-type{display:flex;gap:5px}.hint-preview button{padding:5px 7px}#hintMoves{font:700 13px/1.6 ui-monospace,monospace;word-break:break-all}

.safe-search-panel{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px;border:1px solid #1769aa;border-radius:8px;background:#eef7ff;margin-bottom:8px}.safe-search-panel label{margin:0;font-weight:700}.safe-search-panel #autoSafetySummary{font-size:12px;line-height:1.45}.manual-hidden{display:none!important}

.exact-solver-button{background:#5b2c83!important;color:#fff!important;border-color:#452062!important}.exact-solver-button:disabled{opacity:.5}

.safe-search-panel select{min-width:180px}.safe-search-panel>label:not(.check){display:flex;align-items:center;gap:6px;margin:0}

.screen-off-overlay{position:fixed;inset:0;z-index:10000;background:rgba(0,0,0,.78);display:grid;place-items:center;padding:20px}.screen-off-overlay[hidden]{display:none}.screen-off-overlay section{max-width:680px;background:#fff;border-radius:14px;padding:22px;line-height:1.7}.screen-off-overlay .warning{color:#9b1c1c;font-weight:700}

.line-notify-status{font-size:12px;padding:5px 8px;border-radius:7px;background:#ececec}.line-notify-status.ok{background:#e6f7e9;color:#176b2c}.line-notify-status.warn{background:#fff3cd;color:#7a5b00}.line-notify-status.error{background:#fde8e8;color:#9b1c1c}

.external-exact-button{background:#173f75;color:#fff;font-weight:800}.external-exact-status{grid-column:1/-1;font-size:12px;padding:6px 8px;background:#eef4fb;border-radius:7px;color:#26496d}


/* Prototype 92: rotation hand-off keeps border, glyphs and shadow visually continuous. */
.cg-rotation-ghost,.cg-rotation-ghost .cg-shell{transition:none!important}
.cg-rotation-ghost{z-index:60;will-change:transform,opacity,filter;backface-visibility:hidden}
.cg-rotation-ghost .cg-shell{backface-visibility:hidden}


/* Prototype 95: no decorative glow or opacity handoff. */
.cg-rotation-ghost,.cg-rotation-settled{filter:none!important;transition:none!important;will-change:transform;backface-visibility:hidden}
.cg-rotation-settled{z-index:60}

/* Prototype 96: directional depth shadow and responsive face motion. */
.cg-rotation-ghost{filter:none!important;transition:none!important;will-change:transform;backface-visibility:hidden;transform-style:preserve-3d}
.cg-rotation-ghost .cg-shell{filter:none!important;transition:none!important;will-change:box-shadow,transform;backface-visibility:hidden}
.cg-rotation-ghost .cg-glyph,.cg-rotation-ghost .cg-arrow,.cg-rotation-ghost .cg-die{will-change:transform;backface-visibility:hidden}

/* Prototype 97: identical shell geometry before, during and after a 90-degree rotation. */
.cg-shell{left:4px!important;right:4px!important;top:4px!important;bottom:4px!important}
.cg-rotation-ghost .cg-shell,.cg-rotation-settled .cg-shell{left:4px!important;right:4px!important;top:4px!important;bottom:4px!important}

/* Prototype 98: visible depth is a dedicated layer on the actual rotation ghost. */
.cg-rotation-ghost .cg-shell{box-shadow:none!important;z-index:2}
.cg-rotation-depth{position:absolute;left:4px;right:4px;top:4px;bottom:4px;border:3px solid #111;border-radius:9px;background:#111;z-index:1;pointer-events:none;will-change:transform;transform:translate(2px,2px)}
.cg-rotation-settled .cg-rotation-depth{display:none}

/* Prototype 99: unmistakable black thickness plate on the visible rotation ghost. */
.cg-rotation-ghost{isolation:isolate;overflow:visible!important}
.cg-rotation-ghost .cg-shell{z-index:3!important;box-shadow:none!important;background:#fff}
.cg-rotation-ghost>.cg-rotation-depth{display:block!important;position:absolute;left:4px;right:4px;top:4px;bottom:4px;background:#111;border:3px solid #111;border-radius:9px;z-index:1;pointer-events:none;transform:translate(2px,2px);will-change:transform,opacity;backface-visibility:hidden}
.cg-rotation-settled>.cg-rotation-depth{display:none!important}

/* Prototype 100: retain the original terrain-effect appearance; depth matches normal 2px shadow. */
.cg-rotation-ghost>.cg-rotation-depth{left:4px!important;right:4px!important;top:4px!important;bottom:4px!important;transform:translate(2px,2px);opacity:1!important}

/* Prototype 101: isolated manual depth-render test. */
.depth-test-panel{margin-top:10px;padding:10px;border:2px solid #111;border-radius:10px;background:#fafafa}
.depth-test-head{display:flex;align-items:center;justify-content:space-between}.depth-test-panel p{font-size:12px;color:#555;margin:8px 0}.depth-test-preview{height:115px;display:grid;place-items:center;overflow:visible;background:repeating-linear-gradient(0deg,#eee 0 1px,transparent 1px 20px),repeating-linear-gradient(90deg,#eee 0 1px,transparent 1px 20px);border:1px solid #bbb;border-radius:8px;margin:8px 0}.depth-test-preview .depth-test-block{position:relative!important;left:auto!important;top:auto!important;width:118px!important;height:58px!important;transform:none!important;transition:none!important;overflow:visible!important;isolation:isolate}.depth-test-preview .depth-test-block .cg-shell{z-index:3!important;box-shadow:none!important}.depth-test-preview .depth-test-block>.cg-rotation-depth{display:block!important;position:absolute;left:4px;right:4px;top:4px;bottom:4px;background:#111;border:3px solid #111;border-radius:9px;z-index:1;pointer-events:none;transform:translate(2px,2px);will-change:transform}.depth-test-panel label{grid-template-columns:90px 55px 1fr;align-items:center}.depth-test-panel output{text-align:right;font:12px ui-monospace,monospace}.depth-test-actions{display:flex;gap:8px;margin-top:8px}

/* Prototype 102: manual test and live rotation use the same direct style renderer. */
.cg-rotation-ghost>.cg-rotation-depth,.cg-rotation-ghost .cg-shell,.cg-rotation-ghost .cg-glyph,.cg-rotation-ghost .cg-arrow,.cg-rotation-ghost .cg-die{transition:none!important;animation:none!important}

/* Prototype 103: depth offsets are composed with, never substituted for, glyph orientation. */
.cg-entity{--cg-glyph-offset-x:0px;--cg-glyph-offset-y:0px}
.cg-shell{--cg-face-offset-x:0px;--cg-face-offset-y:0px;transform:translate(var(--cg-face-offset-x),var(--cg-face-offset-y))}
.cg-glyph{transform:translate(var(--cg-glyph-offset-x),var(--cg-glyph-offset-y)) rotate(var(--cg-rotation))!important}
.cg-arrow,.cg-die{transform:translate(var(--cg-glyph-offset-x),var(--cg-glyph-offset-y))!important}
.cg-rotation-ghost .cg-glyph,.depth-test-block .cg-glyph{transform:translate(var(--cg-glyph-offset-x),var(--cg-glyph-offset-y)) rotate(var(--cg-rotation))!important}

.cg-arrow{display:none!important}
.cg-die{transform:translate(var(--cg-glyph-offset-x),var(--cg-glyph-offset-y)) rotate(var(--cg-die-rotation,0deg))!important}
.depth-test-actions{flex-wrap:wrap}

.playable-build-button{background:#176c3b!important;color:#fff!important;border-color:#0d4826!important;font-weight:800}.playable-build-button:hover{background:#0f552e!important}

#trimOuterWalls{width:100%;margin-top:7px;background:#f4ead0}

#trimAllOuterWalls{width:100%;margin-top:7px;background:#e7f0dc}

.placed-goal.player-goal:before{border-style:solid;border-color:#333;border-radius:50%;background:rgba(255,255,255,.62)}
.placed-goal .player-goal-digit{display:grid;place-items:center;font-weight:900;color:#222;font-size:18px}
.worker-preview-cell.goal.player-goal{outline:2px solid #333}

/* Mobile editor and play layout */
.mobile-dpad{display:none;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
@media (pointer:coarse),(max-width:820px){
html,body{max-width:100%;overflow-x:hidden;overscroll-behavior:none}.app{min-width:0!important;width:100%}header{height:auto!important;min-height:64px;gap:8px;flex-wrap:wrap;padding:10px!important}header>div:first-child{min-width:0}header h1{font-size:20px!important}.header-actions{width:100%;overflow-x:auto;display:flex!important;gap:7px;padding-bottom:3px}.header-actions>*{flex:0 0 auto}.tabs{overflow-x:auto;white-space:nowrap}.workspace{display:block!important;height:auto!important}.left-panel,.right-panel{width:100%!important;max-width:none!important}.center-panel{width:100%!important;min-width:0!important}.left-panel,.right-panel{max-height:44vh;overflow:auto}.editor-bar{position:sticky;top:0;z-index:20;flex-wrap:wrap;background:#fff}.board-wrap,#boardWrap{min-height:48vh;height:52vh!important;touch-action:none;overflow:auto!important}.board{touch-action:none}.mobile-test-active .workspace{padding-bottom:210px}.mobile-test-active .left-panel,.mobile-test-active .right-panel{display:none!important}.mobile-test-active .center-panel{width:100%!important}.mobile-dpad{position:fixed;z-index:15000;left:50%;bottom:max(14px,env(safe-area-inset-bottom));transform:translateX(-50%);width:190px;height:174px;grid-template-columns:58px 58px 58px;grid-template-rows:52px 52px 52px;gap:5px;place-content:center;background:#172033e8;border:1px solid #ffffff24;border-radius:24px;padding:8px;box-shadow:0 16px 42px #10182755;backdrop-filter:blur(10px)}.mobile-test-active .mobile-dpad{display:grid}.mobile-dpad button{margin:0!important;padding:0!important;min-width:58px!important;min-height:52px!important;border:0!important;border-radius:14px!important;background:#f8faff!important;color:#172033!important;font-size:22px!important;font-weight:900!important;box-shadow:0 3px 0 #aebbd0;touch-action:none}.mobile-dpad button:active{transform:translateY(2px);box-shadow:0 1px 0 #aebbd0;background:#dfe8f7!important}.dpad-up{grid-column:2;grid-row:1}.dpad-left{grid-column:1;grid-row:2}.dpad-center{grid-column:2;grid-row:2;border-radius:50%;background:#ffffff18;width:30px;height:30px;place-self:center}.dpad-right{grid-column:3;grid-row:2}.dpad-down{grid-column:2;grid-row:3}.cloud-play-mode #boardWrap{height:calc(100dvh - 330px)!important;min-height:260px}.cloud-play-mode .cloud-player-bar{flex-wrap:wrap}.cloud-play-mode header{min-height:52px!important}.admin-solver-error{max-width:720px;margin:60px auto;padding:30px;font-family:system-ui,sans-serif}
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:600px){.mobile-dpad{left:auto;right:max(12px,env(safe-area-inset-right));bottom:50%;transform:translateY(50%);width:174px;height:164px}.mobile-test-active .center-panel{padding-right:190px}.cloud-play-mode #boardWrap{height:calc(100dvh - 160px)!important}.mobile-test-active .workspace{padding-bottom:0}}
