#modal.position-editor-modal{width:min(1080px,calc(100vw - 32px));max-width:1080px}.position-editor-modal .modal-inner{padding:28px;max-width:none}.editor-heading{padding-right:30px;margin-bottom:20px}.editor-heading h2{margin:4px 0 7px}.editor-heading p{color:var(--muted);font-size:13px}.editor-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(310px,1fr);gap:26px;align-items:start}.editor-board-area{min-width:0}.editor-board-area .board{width:100%;margin:12px auto}.editor-board-area .piece{font-size:clamp(22px,3vw,32px)}.editor-tools,.editor-reset{display:flex;gap:5px;flex-wrap:wrap}.editor-tools button,.editor-reset button,.editor-fen button{padding:8px 11px;font-size:12px;border-radius:10px;background:#eeeee7}.editor-tools button.active{background:var(--green);color:white}.editor-reset{justify-content:center}.editor-tip{font-size:11px;color:var(--muted);margin:12px 0}.editor-controls{min-width:0}.editor-piece-row{padding:12px;border:1px solid var(--line);border-radius:16px;margin-bottom:10px;background:var(--card,#fffefa)}.editor-piece-row>strong{font-size:12px;display:block;margin-bottom:9px}.editor-piece-row>div{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}.editor-piece-choice{padding:5px 0;border:1px solid transparent;border-radius:10px;display:flex;flex-direction:column;align-items:center;gap:5px}.editor-piece-choice.active{border-color:var(--green);background:#e6ecdf}.editor-piece-choice .piece{position:relative;inset:auto;transform:none;width:34px;height:34px;font-size:23px;display:grid;place-items:center;flex-shrink:0}.editor-piece-choice small{font-size:10px;color:var(--muted)}.editor-settings{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:15px 0}.editor-settings label{display:grid;gap:5px;font-size:12px}.editor-settings select{width:100%;padding:10px;border:1px solid var(--line);background:#fffefa;border-radius:10px;color:var(--ink)}.editor-level{grid-column:1/-1}.editor-validation{padding:12px 14px;background:#edf2e7;border-radius:12px;color:#41573f;font-size:12px;line-height:1.7}.editor-validation p{margin-top:4px}.editor-validation.invalid{background:#fff0e7;color:#974630}.editor-validation ul{margin:5px 0 0;padding-left:18px;max-height:160px;overflow:auto}.editor-fen{margin:15px 0;font-size:12px}.editor-fen textarea{width:100%;resize:vertical;font:11px/1.7 ui-monospace,monospace;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fffefa;color:var(--ink);margin:5px 0}.editor-fen>div{display:flex;gap:8px}.editor-start{display:grid;grid-template-columns:1fr 1fr;gap:9px}.editor-start button{padding:12px 9px;font-size:12px}.editor-save{font-size:11px;color:var(--muted);margin:12px 0 0}.position-tools [data-action="setup"]{color:var(--green);font-weight:600}
@media(max-width:760px){#modal.position-editor-modal{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.position-editor-modal .modal-inner{padding:22px 16px}.editor-layout{grid-template-columns:1fr;gap:14px}.editor-heading{margin-bottom:14px}.editor-heading h2{font-size:24px}.editor-heading p{font-size:12px}.editor-board-area{max-width:480px;width:100%;margin:auto}.editor-board-area .piece{font-size:clamp(20px,6vw,32px)}.editor-tools{justify-content:center}.editor-tools button,.editor-reset button{padding:8px;font-size:11px}.editor-piece-choice .piece{width:34px;height:34px;font-size:22px}.editor-save{padding-bottom:5px}.editor-start{position:sticky;bottom:0;background:#f8f7f1ef;backdrop-filter:blur(12px);padding:10px 0;z-index:3}.editor-validation ul{max-height:none}}

.play-setup-actions{display:flex;align-items:center;gap:18px}.setup-btn{display:flex;align-items:center;gap:5px;font-size:11px;font-weight:600;color:var(--green);padding:8px 10px;border-radius:9px;background:#edf0e5}.setup-btn .icon{width:15px;height:15px}.editor-feedback{min-height:18px;margin-top:5px;font-size:11px;color:var(--green)}.editor-feedback.error{color:#974630}@media(max-width:540px){.play-setup-actions{gap:8px}.play-setup-actions .settings-btn{font-size:0;gap:0}.setup-btn{font-size:10px;padding:7px}.play-toolbar{padding:14px 12px}}

#modal.position-editor-modal{max-height:calc(100dvh - 24px)}.editor-fen summary{cursor:pointer;font-size:12px;color:var(--green);padding:8px 0}.editor-fen-label{display:none}.editor-piece-row{display:flex;align-items:center;gap:8px;padding:8px}.editor-piece-row>strong{width:25px;flex-shrink:0;margin:0}.editor-piece-row>div{flex:1}.editor-piece-choice small{line-height:12px}.editor-heading .eyebrow{font-size:9px}.editor-heading h2{line-height:1.3}.editor-heading p{font-size:12px}.editor-fen textarea{display:block}.editor-fen{margin:8px 0}.editor-feedback:empty{display:none}
@media(min-width:761px){.editor-board-area .board{max-width:max(320px,min(470px,calc((100dvh - 300px)*.9)))}.editor-settings{grid-template-columns:1fr 1fr 1.2fr;gap:8px}.editor-level{grid-column:auto}.editor-settings select{padding:9px 6px;font-size:11px}.position-editor-modal .modal-inner{padding:22px 26px}.editor-heading{margin-bottom:16px}.editor-save{max-width:340px}.editor-tip{margin:9px 0}}

.editor-board-area .board{container-type:inline-size}.editor-board-area .piece{font-size:clamp(17px,6.5cqw,31px)}
