/* Settings, battle guide and field manual (js/helpscreens.js). */
.st-eyebrow { font-family: var(--head); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gild); }

/* ---------- settings ---------- */
#modal-body.m-settings { width: min(880px, 95vw); padding: 0; }
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 28px 16px; border-bottom: 1px solid var(--panel-edge); background: linear-gradient(180deg, rgba(152, 184, 212, 0.08), transparent); }
.modal .st-head h2 { margin: 2px 0 0; font-size: 28px; color: #dee9f2; }
.st-saved { font-size: 13px; color: #8d9aa7; font-style: italic; }
.st-grid { display: grid; grid-template-columns: 1.15fr 1fr; grid-auto-flow: dense; gap: 14px; padding: 18px 28px 6px; }
.st-card { border: 1px solid #263240; border-radius: 6px; background: linear-gradient(180deg, #131d28, #0d141b); padding: 6px 16px 10px; }
.st-card:first-child { grid-row: span 2; }
.st-card h3 { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gild); }
.st-ic { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid #314c62; background: rgba(152, 184, 212, 0.1); color: var(--gild-hi); }
.st-ic svg { width: 16px; height: 16px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.st-card h3 + .st-row { border-top: 0; }
.st-row.st-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.st-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-text b { font-size: 15.5px; font-weight: 600; color: #dfe8ef; }
.st-text small, .st-desc { font-size: 13px; line-height: 1.4; color: #93a2b1; }
.st-note { margin: 4px 0 6px; font-size: 12.5px; color: #8d9aa7; font-style: italic; }
/* switch */
.st-switch { position: relative; flex: none; width: 50px; height: 28px; padding: 0; border-radius: 14px; border: 1px solid #3d4f63; background: #0b1018; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.st-switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(180deg, #9aa7b4, #5f6c79); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1), background 0.2s; }
.st-switch.on { background: linear-gradient(180deg, #32516d, #6892b7); border-color: var(--gild); }
.st-switch.on i { transform: translateX(22px); background: linear-gradient(180deg, #e5f0f9, #a9c7e1); }
.st-switch:focus-visible { outline: 2px solid var(--gild-hi); outline-offset: 2px; }
/* slider */
.st-slider { --p: 60%; display: flex; align-items: center; gap: 10px; flex: 1; max-width: 300px; }
.st-slider input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--gild) 0 var(--p), #0b1018 var(--p) 100%); box-shadow: inset 0 0 0 1px #27323f; cursor: pointer; }
.st-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(180deg, #e5f0f9, #98b8d4); border: 1px solid #314c62; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6); }
.st-slider input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(180deg, #e5f0f9, #98b8d4); border: 1px solid #314c62; }
.st-slider input[type=range]:focus-visible { outline: 2px solid var(--gild-hi); outline-offset: 4px; }
.st-slider output { width: 40px; text-align: right; font-family: var(--head); font-size: 13px; color: #d5dfe8; font-variant-numeric: tabular-nums; }
.st-slider.off { opacity: 0.4; }
.st-test { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.st-test svg { width: 12px; height: 12px; margin-left: 2px; }
/* segmented */
.st-seg { display: flex; padding: 3px; gap: 3px; border-radius: 6px; background: #0a1016; box-shadow: inset 0 0 0 1px #263240; }
.st-seg button { flex: 1; padding: 8px 10px; border: 0; border-radius: 4px; background: transparent; box-shadow: none; color: #b5c0ca; font-size: 14px; }
.st-seg button:hover:not(.on) { background: rgba(255, 255, 255, 0.05); color: #dfe5ea; }
.st-seg button.on { background: linear-gradient(180deg, #253444, #192431); color: #dee9f2; box-shadow: inset 0 0 0 1px var(--gild), 0 2px 6px rgba(0, 0, 0, 0.4); }
.st-foot { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 28px 22px; background: linear-gradient(0deg, #0c141e 72%, rgba(12, 20, 30, 0)); }
.st-foot .primary { min-width: 200px; padding: 12px 24px; font-family: var(--head); font-size: 16px; letter-spacing: 0.05em; }
.st-reset { background: transparent; border-color: transparent; box-shadow: none; color: #a9b6c2; text-decoration: underline; text-underline-offset: 3px; }
.st-reset:hover { color: #dee9f2; }

/* ---------- battle guide ---------- */
#modal-body.m-guide { width: min(940px, 95vw); padding: 0; }
.gd-head { padding: 22px 28px 14px; border-bottom: 1px solid var(--panel-edge); background: linear-gradient(180deg, rgba(152, 184, 212, 0.08), transparent); }
.modal .gd-head h2 { margin: 2px 0 0; font-size: 26px; color: #dee9f2; }
.gd-body { display: grid; grid-template-columns: 220px 1fr; gap: 0; min-height: 330px; }
.gd-nav { list-style: none; margin: 0; padding: 14px 10px; border-right: 1px solid rgba(255, 255, 255, 0.06); background: rgba(0, 0, 0, 0.15); }
.gd-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px; margin-bottom: 2px; text-align: left; border: 1px solid transparent; background: transparent; box-shadow: none; color: #b5c0ca; font-size: 14.5px; }
.gd-nav button:hover { background: rgba(255, 255, 255, 0.04); color: #dfe8ef; }
.gd-nav button.on { border-color: rgba(152, 184, 212, 0.5); background: linear-gradient(90deg, rgba(152, 184, 212, 0.16), rgba(152, 184, 212, 0.03)); color: #dee9f2; }
.gd-n { font-family: var(--head); font-size: 15px; color: #7e8a96; min-width: 22px; }
.gd-nav button.on .gd-n { color: var(--gild); }
.gd-stage { position: relative; padding: 18px 24px; }
.gd-pane { display: none; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.gd-pane.on { display: grid; animation: gd-in 0.3s ease-out; }
@keyframes gd-in { from { opacity: 0; transform: translateX(10px); } }
body.reduce-motion .gd-pane.on { animation: none; }
.gd-art svg { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 0 0 1px #3d4f3a, 0 10px 26px rgba(0, 0, 0, 0.5); }
.gd-step { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #8d9aa7; }
.gd-copy h3 { margin: 4px 0 8px; font-size: 22px; color: #dee9f2; }
.gd-copy p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.55; color: #d0dae2; }
.gd-copy .gd-tip { padding: 8px 12px; border-left: 3px solid var(--gild); background: linear-gradient(90deg, rgba(152, 184, 212, 0.12), transparent); font-size: 14px; color: #d5dfe8; }
.gd-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 28px; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 13px; color: #a9b6c2; }
.gd-legend span { display: inline-flex; align-items: center; gap: 7px; }
.gd-legend i { display: inline-block; width: 22px; height: 12px; border-radius: 2px; }
.lg-blue { background: #264f78; box-shadow: inset 0 3px 0 #8fc3f0; }
.lg-red { background: #7c2a24; box-shadow: inset 0 3px 0 #f09a8e; }
.gd-legend i.lg-count { width: auto; height: auto; padding: 1px 6px; font-style: normal; font-size: 12px; color: #e2effa; background: #0a131e; border: 1px solid #91b9d8; }
.lg-arc { background: rgba(165, 199, 229, 0.2); border: 1px dashed #a5c7e5; }
.gd-foot { display: flex; align-items: center; gap: 10px; padding: 12px 28px 20px; }
.gd-foot .gd-prev, .gd-foot .gd-next { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; }
.gd-foot svg { width: 16px; height: 16px; }
.gd-dots { display: flex; gap: 7px; margin: 0 auto; }
.gd-dots i { width: 9px; height: 9px; border-radius: 50%; background: #27323f; cursor: pointer; transition: background 0.2s, transform 0.2s; }
.gd-dots i.on { background: var(--gild); transform: scale(1.25); }
.gd-foot .primary { padding: 11px 22px; font-family: var(--head); letter-spacing: 0.04em; }

/* ---------- field manual ---------- */
#screen-rules .page { max-width: 1240px; }
#rules-body.fm { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; max-width: none; padding: 0 24px 0 0; background: linear-gradient(90deg, transparent 219px, rgba(152, 184, 212, 0.18) 219px, rgba(152, 184, 212, 0.18) 220px, transparent 220px), linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 219px, transparent 219px), linear-gradient(180deg, rgba(12, 20, 29, 0.92), rgba(8, 12, 18, 0.94)); }
.fm-toc { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 2px; padding: 22px 10px 22px 14px; }
.fm-toc a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; border-left: 2px solid transparent; font-size: 14.5px; color: #b5c0ca; text-decoration: none; }
.fm-toc a span { font-family: var(--head); font-size: 12px; color: #6b7886; min-width: 18px; }
.fm-toc a:hover { color: #dee9f2; background: rgba(255, 255, 255, 0.04); }
.fm-toc a.on { color: #dee9f2; border-left-color: var(--gild); background: linear-gradient(90deg, rgba(152, 184, 212, 0.14), transparent); }
.fm-toc a.on span { color: var(--gild); }
.fm-main { padding: 12px 0 30px; min-width: 0; }
.fm-sec { padding: 20px 0 22px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); scroll-margin-top: 12px; }
.rules .fm-sec h3 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; font-size: 22px; color: #dee9f2; letter-spacing: 0.02em; }
.fm-num { font-size: 14px; color: var(--gild); }
.fm-sec p { margin: 0 0 10px; font-size: 16px; line-height: 1.6; color: #d0dae2; max-width: 780px; }
.fm-lead { font-size: 18px !important; color: #dfe8ef !important; font-style: italic; }
.fm-facts, .fm-mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin: 12px 0 14px; max-width: 780px; }
.fm-facts div, .fm-mods div { padding: 12px 14px; border: 1px solid #263240; border-radius: 5px; background: linear-gradient(180deg, #141e29, #0d141b); }
.fm-facts b, .fm-mods b { display: block; font-family: var(--head); font-size: 26px; color: var(--gild-hi); line-height: 1.1; }
.fm-facts span, .fm-mods span { font-size: 13.5px; color: #a9b6c2; }
.fm-phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.fm-phase { position: relative; padding: 14px 16px; border: 1px solid #263240; border-top: 3px solid var(--gild); border-radius: 5px; background: linear-gradient(180deg, #141e29, #0d141b); }
.fm-phase > span { position: absolute; top: 8px; right: 12px; font-family: var(--head); font-size: 30px; color: rgba(152, 184, 212, 0.22); }
.fm-phase > b { display: block; margin-bottom: 6px; font-family: var(--head); font-size: 16px; color: #dee9f2; }
.fm-phase p { font-size: 14.5px !important; margin: 0 !important; }
.fm-flow { counter-reset: fl; list-style: none; margin: 0; padding: 0; max-width: 780px; }
.fm-flow li { counter-increment: fl; position: relative; display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 10px 0 10px 40px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.fm-flow li:before { content: counter(fl); position: absolute; left: 0; top: 9px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 13px; color: #090f18; background: linear-gradient(180deg, #c1d8ec, #81a6c6); }
.fm-flow li:not(:last-child):after { content: ""; position: absolute; left: 12px; top: 37px; bottom: -10px; width: 2px; background: rgba(152, 184, 212, 0.25); }
.fm-flow b { font-family: var(--head); font-size: 15px; color: #dbe6f0; padding-top: 3px; }
.fm-flow span { font-size: 15px; line-height: 1.55; color: #d0dae2; }
.fm-spells { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 12px; }
.fm-spell { position: relative; padding: 10px 44px 10px 12px; border: 1px solid #263240; border-left: 3px solid #8a6ad0; border-radius: 4px; background: #0f161f; }
.fm-spell.k-bolt { border-left-color: #79a9d3; } .fm-spell.k-hex { border-left-color: #b04ad0; } .fm-spell.k-buff { border-left-color: #8fb8dc; } .fm-spell.k-heal { border-left-color: #5ad08a; } .fm-spell.k-summon { border-left-color: #6fd0a0; }
.fm-spell > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fm-spell b { font-size: 15px; color: #dbe6f0; }
.fm-spell em { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #8d9aa7; }
.fm-spell > span { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.4; color: #b5c0ca; }
.fm-spell i { position: absolute; top: 10px; right: 10px; font-style: normal; font-family: var(--head); font-size: 14px; color: var(--gild-hi); }
.fm-terrain { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fm-tr { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #263240; border-radius: 5px; background: #0f161f; }
.fm-tr svg { width: 44px; height: 44px; flex: none; }
.fm-tr b { display: block; font-family: var(--head); font-size: 15px; color: #dbe6f0; }
.fm-tr span { font-size: 13.5px; line-height: 1.4; color: #b5c0ca; }
.fm-dice { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 4px; font-size: 14px; color: #c3cdd6; }
.fm-dice span { display: inline-flex; align-items: center; gap: 8px; }
.fm-dice i { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; font-style: normal; font-family: var(--head); font-weight: 700; font-size: 14px; }
.d-hit { background: linear-gradient(180deg, #c1d8ec, #81a6c6); color: #101b2a; }
.d-save { background: linear-gradient(180deg, #a6d98a, #4e8a4e); color: #0f2410; }
.d-fail { background: linear-gradient(180deg, #e9867a, #a8453a); color: #2a0c08; }
.d-miss { background: linear-gradient(180deg, #56616d, #2c333a); color: #c9d3dc; }
.fm-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 18px; }
.fm-key { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.fm-key > span { font-size: 14px; color: #dfe8ef; }
.fm-key em { font-style: normal; font-size: 14px; color: #b5c0ca; }
.fm kbd { display: inline-block; min-width: 24px; padding: 2px 7px; border-radius: 4px; border: 1px solid #50657a; border-bottom-width: 3px; background: linear-gradient(180deg, #1f2b3a, #141e29); color: #dbe6f0; font-family: var(--font); font-size: 12.5px; text-align: center; }
.fm-nodes { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 14px; }
.fm-nodes span { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #c3cdd6; }
.fm-nodes i { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-style: normal; font-size: 15px; color: #d8e7f3; background: radial-gradient(circle at 40% 35%, #b0463a, #6e1f16 70%); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(0, 0, 0, 0.25); }
.fm-factions { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.fm-fac { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid #263240; border-left: 4px solid var(--fc); border-radius: 5px; background: #0f161f; }
.fm-port { width: 58px; height: 70px; flex: none; border-radius: 3px; background-image: url("../assets/faction-portraits.webp"); background-size: 500% auto; background-repeat: no-repeat; box-shadow: 0 0 0 1px #3d4f63; }
.fm-fac b { display: block; font-family: var(--head); font-size: 16px; color: #dbe6f0; }
.fm-fac span { font-size: 14px; line-height: 1.4; color: #b5c0ca; font-style: italic; }
.fm-credit { margin: 18px 0 0; font-size: 13px !important; color: #7e8a96 !important; }

@media (max-width: 860px) {
  .st-grid { grid-template-columns: 1fr; padding: 14px 16px 4px; }
  .st-card:first-child { grid-row: auto; }
  .st-head, .gd-head { padding: 18px 16px 12px; }
  .st-foot { padding: 12px 16px 18px; }
  .st-foot .primary { min-width: 0; flex: 1; }
  .st-slider { max-width: none; }
  .st-row:not(.st-stack) .st-slider { max-width: 190px; }
  .gd-body { grid-template-columns: 1fr; }
  .gd-nav { display: none; }
  .gd-stage { padding: 14px 16px; }
  .gd-pane { grid-template-columns: 1fr; gap: 12px; }
  .gd-legend { padding: 10px 16px; font-size: 12px; }
  .gd-foot { flex-wrap: wrap; padding: 10px 16px 16px; }
  .gd-foot .primary { flex-basis: 100%; }
  #rules-body.fm { grid-template-columns: 1fr; padding: 0 14px; background: linear-gradient(180deg, rgba(12, 20, 29, 0.92), rgba(8, 12, 18, 0.94)); }
  .fm-toc { position: sticky; top: 0; z-index: 2; flex-direction: row; overflow-x: auto; min-height: 0; padding: 8px 0; border-right: 0; border-bottom: 1px solid rgba(152, 184, 212, 0.18); background: #0c121b; }
  .fm-toc a { flex: none; padding: 6px 10px; border-left: 0; border-bottom: 2px solid transparent; }
  .fm-toc a.on { border-bottom-color: var(--gild); }
  .fm-phases { grid-template-columns: 1fr; }
  .fm-flow li { grid-template-columns: 1fr; gap: 2px; }
  .fm-key { grid-template-columns: 120px 1fr; }
  .fm-keys, .fm-factions { grid-template-columns: 1fr; }
}
