.mode-bar{display:flex;gap:8px;margin:26px 4% 0;align-items:stretch}.mode-bar button{padding:12px 23px;text-align:left;border-radius:6px;font-size:13px;font-weight:700}.mode-bar button span{display:block;font-weight:400;font-size:10px;opacity:.65;margin-top:3px}.mode-bar button[aria-pressed=true]{background:var(--green);color:var(--paper);border-color:var(--green)}.mode-bar button:hover{border-color:var(--green)}.puzzle{display:grid;grid-template-columns:minmax(0,1fr) 330px;margin:18px 4% 0;border:1px solid var(--line);border-radius:8px;overflow:hidden}.puzzle-main{min-width:0;background:radial-gradient(ellipse at 50% 50%,#fffdf7,#e9eadf);position:relative}.puzzle-heading{padding:30px 36px 0}.puzzle-heading h1{font-size:clamp(37px,4vw,61px);margin:14px 0}.puzzle-heading>.eyebrow{font-size:9px;color:var(--muted)}.puzzle-heading>p:last-child{font-size:13px;color:var(--muted)}.puzzle-board{position:relative;aspect-ratio:700/360;margin:0 15px;background-image:radial-gradient(#87957b38 1px,transparent 1px);background-size:23px 23px;isolation:isolate}.puzzle-board>svg{width:100%;height:100%;stroke:none;display:block;overflow:visible}.puzzle-board svg .gear-outline{stroke:#233c2d;stroke-width:1;stroke-linejoin:round}.puzzle-board svg .gear-inner{fill:#f4f1e8;stroke:#294e3c;stroke-width:1.2}.puzzle-board svg .shaft-pin{fill:#304c3f;stroke:#f4f1e8;stroke-width:3}.puzzle-board svg text{font-family:Workshop,'Trebuchet MS',sans-serif;fill:var(--green);font-size:12px;text-anchor:middle;letter-spacing:.09em;font-weight:700}.puzzle-board svg .ghost-axis{fill:#fffdf6;stroke:#98a58e;stroke-width:1.5;stroke-dasharray:4 5}.puzzle-board svg .gear-shadow{fill:#314b3a;opacity:.15}.puzzle-board svg .gear-label{font-size:10px;letter-spacing:.04em}.puzzle-board svg .connection{stroke:#99ac91;stroke-width:2;stroke-dasharray:4 5}.puzzle-board svg .connection.powered{stroke:#476c43;stroke-width:3;stroke-dasharray:none}.puzzle-board svg .wind{stroke:#5a8267;stroke-width:2;fill:none;opacity:.7}.puzzle-board .shaft-target{position:absolute;transform:translate(-50%,-50%);width:12%;min-width:44px;aspect-ratio:1;min-height:44px;padding:0;border:2px solid transparent;border-radius:50%;background:transparent;color:var(--green);touch-action:none}.shaft-target:hover,.shaft-target:focus-visible{background:#aec49b22;border-color:var(--green)}.shaft-target.drop-ready{border:2px dashed var(--accent);background:#da583711}.shaft-target .shaft-symbol{font:700 17px Workshop,sans-serif;background:#f4f1e8;border-radius:50%;width:28px;height:28px;display:inline-grid;place-items:center}.shaft-target.occupied .shaft-symbol{opacity:0}.shaft-target.occupied:hover .shaft-symbol,.shaft-target.occupied:focus-visible .shaft-symbol{opacity:1}.puzzle-machine-line{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 30px;padding:10px 0 14px;border-bottom:1px solid var(--line)}.puzzle-machine-line>span{font-size:8px;font-weight:700;letter-spacing:.12em}.puzzle-machine-line>span:first-child{color:var(--accent)}.puzzle-machine-line button{font-size:10px;min-height:38px;padding:6px 10px}.puzzle-inventory{padding:19px 30px 25px}.inventory-label{display:flex;justify-content:space-between;gap:10px;margin-bottom:12px}.inventory-label>span:last-child{font-size:10px;color:var(--muted)}.puzzle-tray{display:flex;gap:9px;flex-wrap:wrap}.puzzle-piece{position:relative;display:flex;align-items:center;gap:9px;min-width:94px;background:#fffdf6;padding:9px 12px;touch-action:none;text-align:left}.puzzle-piece>svg{width:35px;height:35px;stroke:none;flex-shrink:0}.puzzle-piece strong{display:block;font-size:15px;line-height:1.1}.puzzle-piece small{display:block;font-size:9px;color:var(--muted)}.puzzle-piece[aria-pressed=true]{outline:2px solid var(--accent);border-color:var(--accent);background:#fff0df}.puzzle-piece.used{background:#dde5d5;border-color:#9bae8c}.puzzle-piece.used small{color:var(--green)}.puzzle-piece:hover{border-color:var(--accent)}.puzzle-help{font-size:10px;color:var(--muted);line-height:1.65;margin-top:12px;max-width:620px}.puzzle-side{padding:26px;background:var(--surface);border-left:1px solid var(--line);display:flex;flex-direction:column;min-width:0}.puzzle-progress>.eyebrow{font-size:8px}.puzzle-progress>span{display:block;font-size:11px;color:var(--muted);margin-top:7px}.puzzle-levels{display:flex;gap:6px;margin:16px 0 28px}.puzzle-levels button{width:42px;min-width:0;height:42px;padding:0;border-radius:50%;font-size:12px;font-weight:700}.puzzle-levels button[aria-pressed=true]{background:var(--green);color:var(--paper)}.puzzle-levels button.completed{box-shadow:inset 0 -4px #9ab574}.puzzle-level-number{font-size:9px;color:var(--accent);letter-spacing:.1em;font-weight:700;margin-bottom:10px}.puzzle-side h2{font-size:32px;line-height:1.06;letter-spacing:-.045em}.puzzle-side>p:not(.eyebrow):not(.puzzle-level-number){font-size:12px;line-height:1.7;color:var(--muted);margin-top:14px}.puzzle-target{border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:25px 0;padding:20px 0;display:flex;flex-direction:column;gap:7px}.puzzle-target .eyebrow{font-size:8px;color:var(--muted)}.puzzle-target strong{font-size:18px;letter-spacing:-.03em}.puzzle-target>span:last-child{font-size:11px}.puzzle-result{padding:17px;border:1px solid var(--line);border-radius:5px;background:#f2f2e8;min-height:118px}.puzzle-result h3{font-size:19px;line-height:1.2;letter-spacing:-.025em;margin-bottom:8px}.puzzle-result p{font-size:11px;line-height:1.65;color:var(--muted)}.puzzle-result[data-state=solved]{background:#e5eecf;border-color:#7b9963}.puzzle-result[data-state=error]{background:#fbebdf;border-color:#d18e69}.puzzle-actions{display:flex;flex-direction:column;gap:8px;margin-top:18px}.puzzle-actions button{font-size:11px}.puzzle-actions #puzzle-next{background:var(--green);color:var(--paper);border-color:var(--green);font-weight:700}.puzzle-actions #puzzle-next:hover{background:#1d392c}.puzzle-side #puzzle-hint-text{padding:12px;background:#f0f1e4;border-left:2px solid #acb687;font-size:11px}.puzzle-side .puzzle-session-note{font-size:9px!important;margin-top:auto!important;padding-top:25px}.puzzle-drag-ghost{position:fixed;z-index:1000;pointer-events:none;width:66px;height:66px;border-radius:50%;display:grid;place-items:center;background:#da5837;color:#fffdf6;box-shadow:0 8px 26px #26322630;font:700 18px Workshop,sans-serif;transform:translate(-50%,-50%)}.puzzle-confetti{pointer-events:none;position:absolute;inset:0;overflow:hidden}.puzzle-confetti i{position:absolute;width:6px;height:11px;background:var(--accent);left:var(--x);top:40%;animation:celebrate 950ms ease-out forwards;transform:rotate(var(--r))}.puzzle-confetti i:nth-child(2n){background:var(--green)}@keyframes celebrate{to{transform:translateY(130px) rotate(260deg);opacity:0}}footer nav a{display:inline-flex;align-items:center;min-height:44px}footer a:hover{text-decoration:underline;text-underline-offset:4px}
@media(min-width:1500px){.puzzle{grid-template-columns:minmax(0,1fr) 360px}}
@media(max-width:1050px){.puzzle{grid-template-columns:minmax(0,1fr) 280px;margin-inline:2%}.puzzle-side{padding:20px}.puzzle-heading{padding:26px 24px 0}.puzzle-heading h1{font-size:40px}.puzzle-machine-line{margin-inline:20px}.puzzle-inventory{padding-inline:20px}.puzzle-piece{min-width:87px;padding:8px}.mode-bar{margin-inline:2%}.puzzle-machine-line>span{font-size:7px}}
@media(max-width:700px){.mode-bar{margin:17px 3% 0;gap:6px}.mode-bar button{flex:1;padding:10px 12px;font-size:11px}.mode-bar button span{font-size:9px}.puzzle{display:flex;flex-direction:column;margin:12px 3% 0}.puzzle-heading{padding:23px 20px 0}.puzzle-heading h1{font-size:38px}.puzzle-heading .eyebrow{font-size:7px}.puzzle-heading>p:last-child{font-size:11px}.puzzle-board{margin:8px 2px 0}.puzzle-machine-line{margin-inline:15px;gap:6px}.puzzle-machine-line button{font-size:8px;min-height:40px;padding:4px 6px}.puzzle-machine-line>span{font-size:6px;letter-spacing:.05em}.puzzle-inventory{padding:15px}.puzzle-tray{gap:6px}.puzzle-piece{min-width:80px;gap:6px;padding:7px}.puzzle-piece>svg{width:28px;height:28px}.puzzle-side{border-left:0;border-top:1px solid var(--line);padding:23px}.puzzle-levels{margin:13px 0 20px}.puzzle-side h2{font-size:29px}.puzzle-target{margin:20px 0}.puzzle-side .puzzle-session-note{padding-top:20px}.puzzle-heading h1 br{display:none}.puzzle-heading h1 em{display:block}.shaft-target .shaft-symbol{width:23px;height:23px;font-size:14px}}
@media(prefers-reduced-motion:reduce){.puzzle-confetti{display:none}}
#info-dialog{width:min(920px,94vw);max-height:90dvh;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink)}
#info-dialog::backdrop{background:#17271ecc;backdrop-filter:blur(5px)}
.info-close{padding:12px 20px;display:flex;justify-content:flex-end;background:var(--paper);position:sticky;top:0;z-index:1}
#info-dialog .download-section{margin:0;padding:30px;gap:30px}
#info-dialog .download-section:before{display:none}
#info-dialog .fine-print{padding:24px 30px;gap:30px}
@media(min-width:900px) and (min-height:600px){
  body[data-mode=puzzle]{height:100dvh;display:flex;flex-direction:column}
  body[data-mode=puzzle] .site-header{height:60px;flex-shrink:0;padding:8px 3%}
  body[data-mode=puzzle] main{flex:1;min-height:0;display:flex;flex-direction:column}
  body[data-mode=puzzle] .mode-bar{margin:8px 3% 0;flex-shrink:0}
  body[data-mode=puzzle] .mode-bar button{padding:5px 16px;min-height:40px;font-size:12px}
  body[data-mode=puzzle] .mode-bar button span{display:none}
  body[data-mode=puzzle] .puzzle{flex:1;min-height:0;margin:8px 3% 0;grid-template-columns:minmax(0,1fr) 300px}
  .puzzle-main{display:flex;flex-direction:column;min-height:0}
  .puzzle-heading{padding:14px 22px 0;flex-shrink:0}
  .puzzle-heading>.eyebrow{display:none}
  .puzzle-heading h1{font-size:28px;margin:0 0 5px;letter-spacing:-.045em}
  .puzzle-heading h1 br{display:none}
  .puzzle-heading h1 em{margin-left:.2em}
  .puzzle-heading>p:last-child{font-size:12px}
  .puzzle-main .puzzle-gear-key{padding:5px 22px 0;font-size:9px;flex-shrink:0}
  .puzzle-board-frame{flex:1;min-height:0;display:grid;place-items:center;margin:2px 12px}
  .puzzle-board{width:var(--board-width,100%);margin:0;flex-shrink:0}
  .puzzle-machine-line{flex-shrink:0;margin:0 20px;padding:3px 0 6px}
  .puzzle-machine-line button{min-height:30px;padding:4px 9px}
  .puzzle-inventory{padding:8px 20px 10px;flex-shrink:0}
  .inventory-label{margin-bottom:5px}
  .puzzle-piece{padding:5px 9px;min-width:78px;gap:7px;min-height:44px}
  .puzzle-piece>svg{width:27px;height:27px}
  .puzzle-help{font-size:9px;margin-top:5px;line-height:1.4}
  .puzzle-side{padding:14px 18px}
  .puzzle-progress{display:flex;justify-content:space-between;align-items:center}
  .puzzle-progress>span{margin:0}
  .puzzle-levels{margin:8px 0 12px}
  .puzzle-levels button{width:36px;height:36px;min-height:36px}
  .puzzle-level-number{font-size:8px;margin-bottom:5px}
  .puzzle-side h2{font-size:25px}
  .puzzle-side>p:not(.eyebrow):not(.puzzle-level-number){font-size:11px;line-height:1.45;margin-top:8px}
  .puzzle-target{margin:10px 0;padding:9px 0;gap:3px}
  .puzzle-target strong{font-size:16px}
  .puzzle-result{padding:10px;min-height:0}
  .puzzle-result h3{font-size:17px;margin-bottom:4px}
  .puzzle-result p{font-size:10px;line-height:1.45}
  .puzzle-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:8px}
  .puzzle-actions #puzzle-next{grid-column:1/-1}
  .puzzle-actions button{min-height:34px;padding:5px;font-size:10px}
  .puzzle-side #puzzle-hint-text{font-size:10px;padding:7px;line-height:1.35}
  .puzzle-side:has(#puzzle-hint-text:not([hidden])) .puzzle-result{display:none}
  .puzzle-side .puzzle-session-note{display:none}
  body[data-mode=puzzle] footer{flex-shrink:0;margin:0 3%;padding:0;border:0;min-height:38px;font-size:9px}
  body[data-mode=puzzle] footer nav a{min-height:38px}
}
@media(min-width:900px) and (min-height:600px) and (max-height:720px){
  .puzzle-side{padding:10px 15px}
  .puzzle-levels{margin:5px 0 7px}
  .puzzle-levels button{width:30px;height:30px;min-height:30px}
  .puzzle-side h2{font-size:22px}
  .puzzle-side>p:not(.eyebrow):not(.puzzle-level-number){margin-top:5px;line-height:1.35}
  .puzzle-target{margin:7px 0;padding:6px 0}
  .puzzle-result{padding:7px}
  .puzzle-actions{margin-top:6px}
  .puzzle-actions button{min-height:30px}
}
.puzzle-gear-key{padding:15px 36px 0;font-size:10px;color:var(--muted)}.puzzle-board svg .gear-count{fill:var(--paper);font-size:12px;letter-spacing:0}.puzzle-board svg .gear-id{font-size:10px;letter-spacing:0;paint-order:stroke;stroke:var(--paper);stroke-width:3px}.puzzle-board .shaft-target.occupied{background:transparent}.puzzle-board .shaft-target.occupied .shaft-symbol{display:none}.puzzle-board .shaft-target.occupied:hover{background:transparent;border-color:#304c3f66}.puzzle-board .shaft-target{touch-action:none;-webkit-tap-highlight-color:transparent}.puzzle-piece{-webkit-tap-highlight-color:transparent}@media(max-width:700px){.puzzle-gear-key{padding:12px 20px 0;font-size:9px}}
