.puzzle-page{--puzzle-soft:#b8c0cd;--puzzle-border:#343a44}.puzzle-page .wrap{max-width:1240px}.puzzle-intro{padding:38px 0 24px;display:flex;justify-content:space-between;align-items:end;gap:28px}.puzzle-intro h1{font-size:clamp(30px,4.2vw,48px);margin:10px 0 12px}.puzzle-intro .lead{font-size:16px;max-width:680px;margin:0;line-height:1.7}.puzzle-intro .eyebrow{padding:0;background:transparent;letter-spacing:.09em;text-transform:uppercase}.puzzle-intro .local-tag{color:#a9c8ad;white-space:nowrap;font-size:13px;padding-bottom:5px}.puzzle-workspace{display:grid;grid-template-columns:330px minmax(0,1fr);gap:20px;align-items:start}.puzzle-settings{border:1px solid var(--puzzle-border);border-radius:14px;background:#15181e;overflow:hidden}.puzzle-settings h2{font-size:17px;margin:0 0 17px;letter-spacing:0}.settings-section{padding:22px;border-bottom:1px solid #2b3039}.settings-section:last-child{border:0}.puzzle-page label{display:grid;gap:7px;font-size:13px;font-weight:550;color:#e3e6ec;min-width:0}.puzzle-page input,.puzzle-page select,.puzzle-page textarea{width:100%;min-width:0;border:1px solid #424957;border-radius:7px;background:#0e1116;color:#f1f3f6;padding:10px 11px;min-height:44px;font:inherit;font-size:14px;line-height:1.5}.puzzle-page select{cursor:pointer}.puzzle-page textarea{resize:vertical;min-height:180px;font-size:15px;line-height:1.7}.puzzle-page .control-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.puzzle-page .control-stack{display:grid;gap:16px}.puzzle-page .control-note{font-size:12px;line-height:1.7;color:var(--puzzle-soft);margin:8px 0 0}.puzzle-page .subtle{color:var(--puzzle-soft)}.puzzle-page button{font:inherit;cursor:pointer;min-height:44px;border:1px solid #454d5b;border-radius:7px;background:#20252e;color:#eef0f5;padding:9px 13px;font-size:13px;font-weight:550;transition:background .15s,border-color .15s}.puzzle-page button:hover:enabled{background:#2a303b;border-color:#758197}.puzzle-page button:disabled{opacity:.45;cursor:not-allowed}.puzzle-page :focus-visible{outline:3px solid #ffc75c;outline-offset:3px}.puzzle-page .generate-button{width:100%;background:#f5a000;color:#181008;border-color:#f5a000;font-size:15px;font-weight:750}.puzzle-page .generate-button:hover:enabled{background:#ffc052;border-color:#ffc052}.puzzle-page .seed-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.puzzle-page .seed-row button{align-self:end;font-size:12px}.puzzle-page details.advanced{border-top:1px solid #2d333d;margin-top:20px;padding-top:15px}.puzzle-page summary{cursor:pointer;font-size:13px;min-height:36px;align-content:center}.puzzle-page details.advanced[open]>summary{margin-bottom:12px}.puzzle-page [hidden]{display:none!important}.puzzle-preview-panel{min-width:0;border:1px solid var(--puzzle-border);border-radius:14px;background:#11141a;overflow:hidden}.preview-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;border-bottom:1px solid #303641}.preview-toolbar h2{font-size:14px;margin:0}.preview-toolbar .mode-switch{display:flex;border:1px solid #454d5b;border-radius:7px;padding:3px;gap:3px}.preview-toolbar .mode-switch button{border:0;min-height:36px;background:transparent;padding:7px 12px}.preview-toolbar .mode-switch button[aria-pressed=true]{background:#f0f2f5;color:#191c22}.preview-toolbar select{width:auto;max-width:150px;min-height:40px}.preview-toolbar .preview-controls{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.paper-stage{background:radial-gradient(#3b414d 1px,transparent 1px) 0 0/14px 14px,#242933;padding:26px 32px;display:flex;justify-content:center;align-items:start;min-height:320px;position:relative}.paper-stage canvas{display:block;background:white;max-width:100%;width:min(100%,540px);height:auto;box-shadow:0 8px 26px #0007;aspect-ratio:1}.paper-stage.is-stale canvas{opacity:.45}.paper-stage.is-stale::after{content:attr(data-stale);position:absolute;top:40%;inset-inline:20px;text-align:center;background:#15181eee;border:1px solid #667184;border-radius:8px;padding:16px;max-width:420px;margin:auto;font-size:14px}.paper-meta{font-size:12px;color:var(--puzzle-soft);text-align:center;padding:12px;border-bottom:1px solid #303641;direction:ltr}.export-panel{padding:18px 20px}.export-panel h3{font-size:13px;margin:0 0 11px}.download-actions{display:flex;flex-wrap:wrap;gap:8px}.download-actions button:first-child{background:#f5a000;color:#181008;border-color:#f5a000;font-weight:700;min-width:130px}.job-status{display:flex;align-items:start;gap:14px;margin-top:14px;min-height:40px}.job-status p{font-size:13px;line-height:1.7;margin:0;color:#bcd3c1;flex:1;overflow-wrap:anywhere}.job-status p.is-error,.puzzle-page .validation{color:#ffba9c}.job-status button{flex-shrink:0}.puzzle-page progress{width:100%;height:6px;accent-color:#f5a000;margin:12px 0 0}.puzzle-page .normalization{margin-top:14px;padding:10px 12px;background:#1d232c;border:1px solid #465061;border-radius:7px;font-size:12px}.normalization summary{font-size:12px}.normalization ul{padding-inline-start:20px;max-height:150px;overflow:auto;line-height:1.8}.puzzle-page .validation{font-size:12px;line-height:1.7;margin:8px 0 0;overflow-wrap:anywhere}.theme-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.theme-row button{align-self:end}.text-grid-details{padding:0 20px 16px}.text-grid-details pre{font-size:clamp(6px,1vw,13px);direction:ltr;line-height:1.8;white-space:pre;overflow:auto;max-height:400px}.text-grid-details li{font-size:13px}.puzzle-guide{padding:60px 0 50px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px 54px}.puzzle-guide h2{font-size:26px;line-height:1.3;margin:0 0 20px}.puzzle-guide h3{font-size:18px;margin:22px 0 8px}.puzzle-guide p,.puzzle-guide li{font-size:15px;line-height:1.8;color:#bdc5d1}.puzzle-guide ol{padding-inline-start:22px}.puzzle-guide li{padding-inline-start:5px;margin-bottom:15px}.puzzle-guide strong{color:#eef0f5}.puzzle-guide .guide-full{grid-column:1/-1}.puzzle-guide .faq-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 24px;align-items:start}.puzzle-guide .faq-grid details{border:1px solid #363d49;border-radius:12px;padding:0;margin:0;background:#15181e}.puzzle-guide .faq-grid summary{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 20px;font-size:15px;line-height:1.7;min-height:68px;border-radius:12px}.puzzle-guide .faq-grid summary::after{float:none;flex-shrink:0}.puzzle-guide .faq-grid details p{margin:0;padding:0 20px 20px}.puzzle-guide .faq-grid summary:focus-visible{outline-offset:-4px}.example-figure{margin:24px 0 0;border:1px solid #3f4653;border-radius:12px;padding:16px;background:#191e26;display:flex;align-items:center;gap:20px}.example-figure img{width:180px;max-width:42%;height:auto;background:white;border-radius:3px}.example-figure figcaption{font-size:14px;color:#bdc5d1;line-height:1.8}.puzzle-related{display:flex;flex-wrap:wrap;gap:10px}.puzzle-related a{border:1px solid #444c5a;border-radius:8px;padding:12px 17px;font-size:14px;color:#f4c77c}.puzzle-page .skip-link{position:absolute;top:-100px;inset-inline-start:15px;background:#f5a000;color:#111;padding:12px;z-index:100}.puzzle-page .skip-link:focus{top:10px}.puzzle-page footer .links{flex-wrap:wrap}.puzzle-page footer{margin-top:0}html[lang=ar] .puzzle-intro h1{line-height:1.4}html[lang=ar] .puzzle-intro .eyebrow{letter-spacing:0}html[lang=ar] .puzzle-page input,html[lang=ar] .puzzle-page select,html[lang=ar] .puzzle-page button{font-size:14px}
@media(min-width:1000px){.puzzle-preview-panel{position:sticky;top:83px}.paper-stage{max-height:620px;overflow:auto}.paper-stage canvas{max-height:560px;width:auto;max-width:100%;object-fit:contain}}
@media(max-width:900px){.puzzle-workspace{grid-template-columns:290px minmax(0,1fr);gap:14px}.settings-section{padding:18px}.paper-stage{padding:18px;min-height:300px}.puzzle-intro{display:block}.puzzle-intro .local-tag{display:block;margin-top:15px}.preview-toolbar{padding:12px}}
@media(max-width:700px){.puzzle-page .wrap{padding:0 16px}.puzzle-workspace{grid-template-columns:minmax(0,1fr)}.puzzle-intro{padding-top:28px}.puzzle-intro .lead{font-size:15px}.puzzle-page input,.puzzle-page select,.puzzle-page textarea{font-size:16px}.puzzle-guide{grid-template-columns:minmax(0,1fr);gap:30px;padding-top:38px}.puzzle-guide .faq-grid{grid-template-columns:1fr}.settings-section{padding:20px}.paper-stage canvas{width:min(100%,460px)}.preview-toolbar .preview-controls{width:100%;justify-content:space-between}.export-panel{padding:16px}.download-actions button{flex:1}.puzzle-intro h1{font-size:34px}.text-grid-details pre{font-size:9px}}
@media(prefers-reduced-motion:reduce){.puzzle-page *{scroll-behavior:auto!important;transition:none!important}}
.puzzle-page .puzzle-workspace{padding:0}.puzzle-page .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:700px){.puzzle-page summary,.preview-toolbar .mode-switch button{min-height:44px}html[lang=ar] .puzzle-page input,html[lang=ar] .puzzle-page select{font-size:16px}}

.puzzle-page .live-note{color:#d6b67c}.puzzle-page .control-stack>.control-note{margin-top:-8px}.puzzle-page .paper-stage{align-items:center}.puzzle-page .paper-stage canvas{object-fit:contain}.puzzle-page .download-actions button{white-space:normal}

@media(max-width:700px){.puzzle-guide .faq-grid summary{padding:16px}.puzzle-guide .faq-grid details p{padding:0 16px 18px}.example-figure{gap:16px}}

.puzzle-page .endpoint-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px}.endpoint-controls>div{min-width:0}.puzzle-page .field-label{display:block;font-size:13px;font-weight:550;color:#e3e6ec;margin-bottom:7px}.endpoint-controls button{width:100%;text-align:start}.puzzle-page .arrow-controls{display:grid;gap:10px}.puzzle-page .arrow-controls label{font-size:12px}.puzzle-page .position-dialog{width:min(440px,calc(100vw - 28px));max-height:calc(100dvh - 32px);overflow:auto;background:#151a22;color:#eef0f5;border:1px solid #535e70;border-radius:14px;padding:22px;box-shadow:0 24px 80px #0009}.position-dialog::backdrop{background:#000a;backdrop-filter:blur(3px)}.position-dialog .dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.position-dialog .dialog-heading h2{margin:0;font-size:19px}.position-dialog .dialog-heading button{font-size:25px;padding:0;width:40px;min-height:40px;flex-shrink:0}.puzzle-page .illustration-settings{border:1px solid #3b4554;border-radius:9px;background:#181e27;padding:10px 14px}.illustration-settings>summary{font-size:13px;min-height:40px}.illustration-settings[open]>summary{margin-bottom:15px}.puzzle-page .picture-field input[type=file]{font-size:11px;padding:8px;overflow:hidden}.picture-field input::file-selector-button{font:inherit;border:1px solid #535e70;border-radius:5px;padding:7px;background:#252d39;color:#eef0f5;margin-inline-end:8px;cursor:pointer}.picture-preview{display:flex;align-items:center;gap:10px;margin-top:8px}.picture-preview img{object-fit:contain;border:1px solid #535e70;border-radius:6px;background:#fff}.picture-preview button{font-size:12px;min-height:38px}.illustration-settings .control-stack{gap:14px}
@media(max-width:420px){.puzzle-page .position-dialog{padding:16px}.position-dialog .dialog-heading h2{font-size:17px}}

.puzzle-page .switch-label{position:relative;display:flex;align-items:center;gap:11px;min-height:44px;font-size:13px;font-weight:400;line-height:1.6;cursor:pointer}.puzzle-page .switch-label input[role=switch]{position:absolute;inset-inline-start:0;top:50%;transform:translateY(-50%);width:44px;height:44px;min-height:0;padding:0;margin:0;opacity:0;cursor:pointer}.switch-track{position:relative;display:block;flex:0 0 44px;width:44px;height:25px;border:1px solid #667184;border-radius:999px;background:#343c49;pointer-events:none;transition:background .15s,border-color .15s}.switch-track::after{content:"";position:absolute;inset-inline-start:3px;top:3px;width:17px;height:17px;border-radius:50%;background:#f3f5f8;box-shadow:0 1px 3px #0005;transition:inset-inline-start .15s}.switch-label input:checked+.switch-track{background:#f5a000;border-color:#f5a000}.switch-label input:checked+.switch-track::after{inset-inline-start:22px;background:#17130c}.switch-label input:focus-visible+.switch-track{outline:3px solid #ffc75c;outline-offset:3px}.switch-label input:disabled~span{opacity:.45}.puzzle-page .switch-label:has(input:disabled){cursor:not-allowed}@media(prefers-reduced-motion:reduce){.switch-track,.switch-track::after{transition:none}}

.puzzle-page .position-dialog{width:min(500px,calc(100vw - 28px))}
.endpoint-selection{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0 8px}.puzzle-page .endpoint-selection button{display:flex;align-items:center;gap:10px;text-align:start;min-width:0;padding:11px;background:#1d232d}.endpoint-selection strong{display:block;font-size:13px}.endpoint-value{display:block;color:#b8c0cd;font-size:11px;line-height:1.6;margin-top:3px}.puzzle-page .endpoint-selection button[aria-pressed=true]{border-color:#b8c0cd;background:#29313e}.endpoint-key{display:grid;place-items:center;width:26px;height:26px;flex-shrink:0;border-radius:50%;font-size:12px;font-weight:800;background:#f5a000;color:#17130c}.endpoint-key[data-role=start]{background:#91dbc8}
.endpoint-board{position:relative;height:clamp(240px,65vw,330px);display:grid;place-items:center;background:radial-gradient(#3c4551 1px,transparent 1px) 0 0/14px 14px,#10151c;border:1px solid #35404e;border-radius:10px;touch-action:none;user-select:none;margin:16px 0}.endpoint-shape{position:relative;box-sizing:border-box;border:3px solid #cbd3df;background:#1b222c;border-radius:3px}.endpoint-shape[data-shape=polar]{border-radius:50%}.endpoint-dots{position:absolute;inset:-3px}.endpoint-target{position:absolute;transform:translate(-50%,-50%);width:8px;height:8px;border-radius:50%;background:#cbd3df;box-shadow:0 0 0 4px #10151c}.endpoint-target[data-unavailable=true]{opacity:.22}.puzzle-page .endpoint-marker{position:absolute;z-index:2;transform:translate(-50%,-50%);width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;display:grid;place-items:center;cursor:grab;touch-action:none;border-radius:50%}.puzzle-page .endpoint-marker:hover:enabled{background:transparent;border:0}.endpoint-marker span{display:grid;place-items:center;width:31px;height:31px;border:2px solid #10151c;border-radius:50%;background:#f5a000;color:#17130c;font-size:14px;font-weight:800;box-shadow:0 2px 8px #0008;pointer-events:none}.endpoint-marker[data-endpoint=start] span{background:#91dbc8}.endpoint-marker[aria-pressed=true] span{outline:2px solid #eef0f5;outline-offset:2px}.endpoint-board.is-dragging,.endpoint-board.is-dragging .endpoint-marker{cursor:grabbing}.puzzle-page .position-done{display:block;margin-top:18px;margin-inline-start:auto;min-width:100px;background:#f5a000;border-color:#f5a000;color:#17130c}.puzzle-page .position-done:hover:enabled{background:#ffc052;border-color:#ffc052}@media(max-width:420px){.puzzle-page .endpoint-selection button{padding:9px 7px;gap:7px}.endpoint-key{width:23px;height:23px}.puzzle-page .endpoint-controls button{font-size:12px}}

.puzzle-page .picture-field>label{margin-bottom:7px}.picture-input-row{display:flex;align-items:center;gap:7px;min-width:0}.puzzle-page .picture-input-row input[type=file]{flex:1 1 0;width:0;min-width:0;padding:7px 6px;min-height:48px}.puzzle-page .picture-input-row>button{flex:0 0 auto;padding:8px;font-size:11px;min-height:48px}.picture-input-row .picture-preview{flex:0 0 auto;margin:0;gap:4px}.picture-input-row .picture-preview:has(img[hidden]){display:none}.picture-input-row .picture-preview img{width:40px;height:40px}.puzzle-page .picture-input-row .picture-preview button{width:32px;min-height:44px;padding:0;font-size:23px;color:#f3a59b}.puzzle-page .paste-image-hint{border-top:1px solid #35404e;padding-top:14px}
