/* Author: goodjava@qq.com */
.dialog.run-setup-dialog { position:fixed; inset:0; z-index:60; width:100vw; height:100dvh; padding:clamp(8px,2vh,24px); display:grid; place-items:center; box-sizing:border-box; }
.run-setup-dialog .paper.run-setup { display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:16px; width:min(1400px,100%); max-width:none; height:min(860px,100%); max-height:100%; min-height:0; overflow:hidden; padding:24px 28px 18px; border-radius:16px; }
.run-setup > .overlay-close { position:absolute; top:12px; right:12px; float:none; margin:0; width:34px; height:34px; z-index:3; }
.setup-heading { padding:0 38px 12px 0; border-bottom:1px solid #c6b48988; }
.run-setup .setup-heading h2 { margin:0; padding:0; border:0; font-size:30px; line-height:1.2; text-align:left; letter-spacing:.1em; }
.setup-heading p { margin:6px 0 0; font-size:13px; line-height:1.5; color:#786c50; }
.setup-heading .setup-warning { color:#9b573b; }
.setup-body { min-height:0; display:grid; grid-template-columns:minmax(0,1.35fr) minmax(300px,1fr); gap:26px; }
.run-setup h3 { margin:0; font-size:16px; font-weight:500; line-height:1.3; color:#365544; }
.setup-cast { display:grid; grid-template-rows:auto auto minmax(0,1fr); gap:10px; min-width:0; min-height:0; }
.setup-hero-buttons { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.setup-pick { border:1px solid #b9aa81; border-radius:7px; background:#fbf5e6; color:#385342; min-height:42px; padding:8px 12px; font-size:14px; line-height:1.4; box-sizing:border-box; }
.setup-pick.selected { background:#315949; color:#fff2cf; border-color:#b69a5b; box-shadow:inset 0 0 0 1px #c8ae6e; }
.setup-pick:hover:not(.selected) { background:#e9dfc5; }
.setup-hero-buttons .setup-pick { display:flex; align-items:center; gap:8px; min-width:0; padding:5px 9px; text-align:left; }
.setup-hero-buttons img { width:36px; height:52px; object-fit:contain; flex:none; }
.setup-hero-buttons span { display:grid; gap:3px; min-width:0; }
.setup-hero-buttons b { font-size:15px; font-weight:500; white-space:nowrap; }
.setup-hero-buttons small { font-size:11px; opacity:.75; }
.setup-preview { position:relative; min-height:0; border:1px solid #a18c56; border-radius:10px; overflow:hidden; background:#214b3d url('/art/environments/zhulin.png') center/cover; }
.setup-preview::before { content:''; position:absolute; inset:0; background:linear-gradient(90deg,transparent 20%,#143c2c80); pointer-events:none; }
.setup-character { position:absolute; left:0; bottom:0; width:53%; height:98%; object-fit:contain; object-position:bottom; filter:drop-shadow(0 5px 4px #13392855); }
.setup-hero-summary { position:absolute; top:16px; right:14px; width:47%; box-sizing:border-box; padding:12px; background:#163c31de; border:1px solid #b5a16a99; border-radius:6px; color:#f7eac7; }
.setup-hero-summary h3 { font-size:19px; line-height:1.5; color:#f5df9f; }
.setup-hero-summary p { font-size:13px; line-height:1.6; margin:7px 0; }
.setup-hero-summary small { display:block; font-size:11px; line-height:1.5; color:#e1d8b8; }
.setup-relic { position:absolute; bottom:14px; right:14px; width:58%; box-sizing:border-box; display:grid; grid-template-columns:64px minmax(0,1fr); gap:12px; align-items:center; padding:12px; background:#f4ebd4f5; border:1px solid #b69b61; border-radius:7px; box-shadow:0 4px 12px #12302440; }
.setup-relic img { width:64px; height:80px; object-fit:contain; }
.setup-relic small { font-size:11px; line-height:1.4; color:#82704c; }
.setup-relic h3 { font-size:22px; color:#75492d; margin:3px 0 5px; }
.setup-relic p { font-size:13px; line-height:1.6; margin:0; color:#40513d; }
.setup-legacy-note { display:block; }
.setup-options { display:flex; flex-direction:column; min-width:0; min-height:0; gap:18px; }
.setup-encounter-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:8px; }
.run-setup .setup-encounter-note { margin:6px 0 0; font-size:12px; line-height:1.5; color:#827151; }
.setup-roots { flex:1; min-height:0; display:flex; flex-direction:column; gap:8px; }
.setup-root-buttons { display:grid; grid-template-rows:repeat(5,minmax(0,1fr)); gap:7px; flex:1; min-height:0; }
.setup-root-buttons .setup-pick { display:grid; grid-template-columns:110px minmax(0,1fr); gap:10px; align-items:center; text-align:left; min-height:0; }
.setup-root-buttons b { display:flex; align-items:center; gap:8px; font-weight:500; }
.setup-root-buttons b > span { display:grid; place-items:center; width:28px; height:28px; flex:none; border:1px solid #b7a77988; border-radius:50%; font-size:17px; }
.setup-root-buttons em { font-style:normal; font-size:13px; }
.setup-root-buttons small { font-size:12px; line-height:1.5; opacity:.85; }
.run-setup .setup-root-selected { display:none; margin:0; }
.run-setup .setup-root-note { margin:0; font-size:11px; line-height:1.5; color:#847658; }
.setup-footer { display:flex; justify-content:space-between; align-items:center; gap:14px; padding-top:12px; border-top:1px solid #c6b48988; }
.setup-route { display:flex; gap:6px; align-items:center; min-width:0; color:#7a6b49; font-size:13px; }
.setup-route .setup-pick { min-height:36px; padding:6px 15px; font-size:13px; }
.setup-actions { display:flex; gap:10px; flex:none; }
.setup-actions button { min-height:44px; min-width:90px; }
.setup-actions .primary { min-width:180px; font-size:17px; }
@media (max-width:1100px) {
  .run-setup-dialog .paper.run-setup { padding:18px 20px 16px; gap:12px; }
  .setup-body { grid-template-columns:minmax(0,1.15fr) minmax(290px,1fr); gap:16px; }
  .setup-hero-buttons .setup-pick { padding:5px; gap:5px; }
  .setup-hero-buttons img { width:30px; height:46px; }
  .setup-hero-buttons b { font-size:13px; }
  .setup-hero-summary { right:10px; top:10px; width:51%; padding:9px; }
  .setup-hero-summary h3 { font-size:16px; }
  .setup-relic { width:61%; right:10px; bottom:10px; grid-template-columns:46px 1fr; padding:9px; gap:8px; }
  .setup-relic img { width:46px; height:64px; }
  .setup-relic h3 { font-size:19px; }
  .setup-root-buttons .setup-pick { grid-template-columns:98px minmax(0,1fr); gap:8px; padding:6px 9px; }
  .setup-root-buttons small { font-size:11px; }
}
@media (max-width:700px), (max-height:650px) {
  .setup-root-buttons { grid-template-columns:repeat(5,minmax(0,1fr)); grid-template-rows:1fr; flex:none; gap:5px; }
  .setup-root-buttons .setup-pick { display:block; padding:6px 3px; text-align:center; min-height:48px; }
  .setup-root-buttons b { display:grid; justify-items:center; gap:3px; }
  .setup-root-buttons b > span { width:auto; height:auto; border:0; font-size:17px; line-height:1; }
  .setup-root-buttons em { font-size:10px; white-space:nowrap; }
  .setup-root-buttons small { display:none; }
  .run-setup .setup-root-selected { display:block; font-size:12px; line-height:1.5; margin:0; color:#48634e; }
  .run-setup .setup-root-note { font-size:10px; }
}
@media (max-width:700px) and (min-height:521px) {
  .dialog.run-setup-dialog { padding:8px; }
  .run-setup-dialog .paper.run-setup { padding:12px; gap:10px; border-radius:12px; }
  .run-setup > .overlay-close { top:8px; right:8px; width:30px; height:30px; }
  .setup-heading { padding:0 28px 8px 0; }
  .run-setup .setup-heading h2 { font-size:22px; }
  .setup-heading p { font-size:11px; line-height:1.4; margin-top:3px; }
  .setup-body { grid-template-columns:1fr; grid-template-rows:minmax(0,1fr) auto; gap:10px; }
  .setup-cast { gap:6px; }
  .run-setup h3 { font-size:14px; }
  .setup-hero-buttons { gap:5px; }
  .setup-hero-buttons .setup-pick { min-height:46px; padding:4px; gap:4px; }
  .setup-hero-buttons img { height:36px; width:24px; }
  .setup-hero-buttons b { font-size:12px; }
  .setup-hero-buttons small { font-size:10px; }
  .setup-character { width:40%; }
  .setup-hero-summary { top:7px; right:7px; width:60%; padding:6px 8px; border:0; background:#163c31c9; }
  .setup-hero-summary h3 { font-size:14px; }
  .setup-hero-summary p { margin:3px 0; font-size:11px; line-height:1.4; }
  .setup-hero-summary small { font-size:10px; }
  .setup-relic { width:60%; right:7px; bottom:7px; grid-template-columns:34px minmax(0,1fr); gap:6px; padding:6px 8px; }
  .setup-relic img { width:34px; height:42px; }
  .setup-relic small { font-size:9px; }
  .setup-relic h3 { font-size:15px; margin:1px 0 2px; }
  .setup-relic p { font-size:11px; line-height:1.4; }
  .setup-options { gap:10px; }
  .setup-encounter-buttons { margin-top:5px; gap:6px; }
  .setup-encounter-buttons .setup-pick { min-height:34px; padding:5px; font-size:12px; }
  .run-setup .setup-encounter-note { margin-top:0; font-size:10px; }
  .setup-roots { gap:5px; }
  .setup-root-buttons .setup-pick { min-height:42px; padding:4px 1px; }
  .run-setup .setup-root-selected { font-size:11px; }
  .run-setup .setup-root-note { display:none; }
  .setup-footer { padding-top:8px; gap:8px; }
  .setup-route { font-size:11px; gap:4px; }
  .setup-route .setup-pick { min-height:32px; padding:4px; font-size:11px; }
  .setup-actions { gap:6px; }
  .setup-actions button { min-height:36px; min-width:42px; padding:5px 6px; font-size:12px; }
  .setup-actions .primary { min-width:100px; font-size:12px; }
  .setup-footer:has(.setup-route .setup-pick) { display:grid; grid-template-columns:1fr auto; }
  .setup-route > span:only-child { max-width:120px; line-height:1.4; }
}
@media (max-height:650px) and (min-width:701px), (max-height:520px) {
  .dialog.run-setup-dialog { padding:6px; }
  .run-setup-dialog .paper.run-setup { padding:10px 14px; gap:8px; }
  .run-setup > .overlay-close { top:6px; right:6px; width:28px; height:28px; }
  .setup-heading { display:flex; align-items:center; gap:16px; padding:0 34px 7px 0; }
  .run-setup .setup-heading h2 { font-size:22px; flex:none; }
  .setup-heading p { font-size:11px; margin:0; }
  .setup-body { grid-template-columns:minmax(0,1.25fr) minmax(280px,1fr); gap:14px; }
  .run-setup h3 { font-size:13px; }
  .setup-cast { gap:5px; }
  .setup-hero-buttons { gap:5px; }
  .setup-hero-buttons .setup-pick { min-height:38px; padding:3px 5px; }
  .setup-hero-buttons img { height:32px; width:24px; }
  .setup-hero-buttons b { font-size:12px; }
  .setup-hero-buttons small { font-size:10px; }
  .setup-hero-summary { top:7px; right:7px; width:56%; padding:6px 8px; }
  .setup-hero-summary h3 { font-size:14px; }
  .setup-hero-summary p { font-size:11px; line-height:1.4; margin:3px 0; }
  .setup-hero-summary small { font-size:10px; }
  .setup-relic { width:60%; bottom:7px; right:7px; grid-template-columns:34px 1fr; gap:6px; padding:6px 8px; }
  .setup-relic img { width:34px; height:42px; }
  .setup-relic small { font-size:9px; }
  .setup-relic h3 { font-size:15px; margin:1px 0 2px; }
  .setup-relic p { font-size:11px; line-height:1.4; }
  .setup-options { gap:8px; }
  .setup-encounter-buttons { margin-top:5px; }
  .setup-encounter-buttons .setup-pick { min-height:32px; padding:5px; font-size:12px; }
  .run-setup .setup-encounter-note { font-size:10px; margin-top:0; }
  .setup-roots { gap:5px; }
  .setup-root-buttons .setup-pick { min-height:40px; }
  .run-setup .setup-root-selected { font-size:11px; }
  .run-setup .setup-root-note { font-size:10px; }
  .setup-footer { padding-top:7px; }
  .setup-route { font-size:11px; }
  .setup-route .setup-pick { min-height:30px; padding:4px 10px; font-size:11px; }
  .setup-actions button { min-height:34px; padding:5px 15px; }
  .setup-actions .primary { min-width:145px; font-size:14px; }
}
@media (max-width:700px), (max-height:520px) {
  .setup-encounters { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:5px 8px; }
  .setup-encounter-buttons { grid-column:1/-1; grid-row:2; margin-top:0; }
  .run-setup .setup-encounter-note { grid-column:2; grid-row:1; text-align:right; }
}
@media (max-height:650px) and (max-width:700px), (max-height:520px) {
  .setup-preview { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:6px; box-sizing:border-box; align-items:center; }
  .setup-character { display:none; }
  .setup-hero-summary,.setup-relic { position:relative; inset:auto; width:auto; padding:6px; }
  .setup-hero-summary { grid-column:1; }
  .setup-relic { grid-column:2; display:block; }
  .setup-relic > img { display:none; }
  .setup-hero-summary h3 { font-size:13px; line-height:1.25; }
  .setup-relic h3 { font-size:14px; }
  .setup-relic p,.setup-hero-summary p { font-size:11px; line-height:1.35; }
  .setup-hero-summary small { font-size:10px; line-height:1.25; }
  .run-setup .setup-root-note { display:none; }
}
@media (max-width:360px) {
  .setup-route:has(.setup-pick) > span { display:none; }
}
@media (max-width:700px) and (max-height:650px) {
  .setup-hero-buttons .setup-pick { min-height:36px; padding:3px; }
  .setup-hero-buttons img { width:22px; height:28px; }
  .setup-hero-buttons small { display:none; }
}
@media (max-width:700px) and (max-height:520px) {
  .setup-hero-buttons img { display:none; }
  .setup-hero-buttons .setup-pick { min-height:30px; padding:3px; justify-content:center; text-align:center; }
  .setup-hero-summary p:not(.hero-trait-preview),.setup-relic small { display:none; }
}
