/* 短い横画面でも編成の名前・プレビュー・操作を同一ダイアログで確認する。 */
#formationDialog{box-sizing:border-box;width:min(790px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 16px);padding:14px;background:#fff5df;color:#3e352d;border:2px solid #ad8e54;border-radius:14px;overflow:auto;overscroll-behavior:contain;box-shadow:0 12px 40px #0006}
#formationDialog::backdrop{background:#182431c9}.formation-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.formation-head h2{margin:0;font-size:24px}.formation-note,#formationCurrent,#formationNotice{font-size:12px;margin:6px 0}.formation-row{display:grid;grid-template-columns:minmax(100px,1fr) minmax(120px,1.5fr) minmax(130px,1.1fr);gap:9px;align-items:center;padding:8px 0;border-top:1px solid #d9c9a7}.formation-info{min-width:0}.formation-info label{display:block;font-size:10px;color:#785a31;font-weight:bold}.formation-info input{display:block;width:100%;min-width:0;box-sizing:border-box;margin:3px 0;padding:6px;border:1px solid #b9a481;border-radius:5px;background:#fff;color:#38312a;font-size:14px}.formation-info small{font-size:11px}.formation-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:1px;background:#e5d8b8;padding:2px;border-radius:5px}.formation-cell{display:grid;place-items:center;aspect-ratio:1.4;background:#f8efda;min-width:0;overflow:hidden}.formation-cell img{width:100%;height:100%;object-fit:contain;min-height:0;max-height:28px}.formation-cell.locked{opacity:.45}.formation-actions{display:grid;grid-template-columns:1fr 1fr;gap:3px}.formation-actions button,#formationClose{min-height:36px;padding:4px 8px;font-size:12px;white-space:nowrap}#formationNotice{min-height:1.1em;color:#785a31}
@media(orientation:landscape) and (max-height:600px){#formationDialog{padding:8px 10px}.formation-head h2{font-size:18px}.formation-head .eyebrow{font-size:9px}.formation-row{padding:4px 0;gap:5px;grid-template-columns:minmax(90px,1fr) minmax(112px,1.25fr) minmax(120px,1.2fr)}.formation-note,#formationCurrent,#formationNotice{font-size:11px;margin:3px 0}.formation-info input{padding:3px;font-size:12px}.formation-actions button,#formationClose{min-height:32px;padding:3px 6px;font-size:11px}.formation-cell img{max-height:18px}}
@media(max-width:480px){.formation-row{grid-template-columns:1fr 1fr}.formation-actions{grid-column:1/-1;grid-template-columns:repeat(4,1fr)}}
/* 透明余白のある既存スプライトをプレビュー内だけ少し拡大。PNGは無加工。 */
.formation-cell img{transform:scale(1.5)}
@media(orientation:landscape) and (max-height:350px){#formationDialog{padding:5px 8px}.formation-head h2{font-size:16px}.formation-head .eyebrow{font-size:8px}.formation-note,#formationCurrent,#formationNotice{margin:2px 0;font-size:10px;line-height:1.2}.formation-row{padding:2px 0;gap:4px}.formation-info input{margin:1px 0;padding:2px}.formation-info small{font-size:10px}.formation-actions{gap:2px}.formation-actions button,#formationClose{min-height:29px;padding:2px 5px}.formation-cell{aspect-ratio:1.55}}
