/* =========================================================
 * 九州异界志 · 共享 UI 样式
 * 画风参考：幻想水浒传 I·II（HD 重制版）的菜单 ——
 *   · 半透明黑底窗口，细细的灰白单线边框，直角，上方两角有小小的回纹角花
 *   · 全部文字用明朝体（衬线），白字，无描边无渐变
 *   · 选中项是一条从左向右淡出的暗金色横条，顶上一道亮线；没有手形光标
 *   · 多个小窗口各管一件事（指令名、金钱、列表、说明、对话），之间留空露出场景
 *   · 数字右对齐；升降用绿色 ▲ 与红色 ▼
 * 用法：在页面自己的 <style> 之后引入；覆盖 :root 颜色变量、.panel、.btn，并提供
 * .win / .menu / .gauge / .msg / .screen / .tbl 等组件。
 * ========================================================= */
:root {
  --win-a: rgba(10, 10, 10, 0.84);
  --win-b: rgba(0, 0, 0, 0.8);
  --win-line: #d9d9d0;
  --ink: #000;
  --panel: rgba(0, 0, 0, 0.82);
  --panel-hi: rgba(40, 36, 20, 0.9);
  --edge: rgba(217, 217, 208, 0.55);
  --edge-hi: #ffffff;
  --gold: #e8cf6a;
  --paper: #f3f3ec;
  --mist: #a9a9a0;
  --bad: #ff5f5f;
  --good: #3fe090;
  --cyan: #b9c8c4;
  --f-title: "Noto Serif SC", "Songti SC", "SimSun", "MS Mincho", serif;
  --f-body: "Noto Serif SC", "Songti SC", "SimSun", "MS Mincho", serif;
  --f-en: "Noto Serif SC", Georgia, serif;
  /* corner knot: two interlocked little squares, drawn into the top corners of every window */
  --knot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cg fill='none' stroke='%23d9d9d0' stroke-width='1.5'%3E%3Crect x='1' y='1' width='9' height='9'/%3E%3Crect x='6' y='6' width='9' height='9'/%3E%3C/g%3E%3C/svg%3E");
  /* the gold selection bar */
  --pick: linear-gradient(90deg, rgba(196, 164, 40, .96), rgba(158, 128, 24, .82) 55%, rgba(120, 96, 12, .2));
}
html, body { background: var(--ink); color: var(--paper); font-family: var(--f-body); }
body { text-shadow: none; font-weight: 500; }
.en { display: none; }                         /* the reference has no Latin sub-labels */
.num { font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #77776f; } ::-webkit-scrollbar-track { background: rgba(255, 255, 255, .06); }

/* ---------- window ---------- */
.panel, .win {
  background: var(--knot) left top / 17px no-repeat, var(--knot) right top / 17px no-repeat, linear-gradient(180deg, var(--win-a), var(--win-b));
  background-origin: border-box;
  border: 2px solid var(--win-line); border-radius: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .85);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.win { padding: 14px 18px; position: relative; }
.win-title { margin: -2px -4px 10px; padding: 0 4px 8px; border-bottom: 2px solid var(--win-line); }
.win-title b { font: 600 18px var(--f-title); letter-spacing: .12em; }
@keyframes winOpen { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.win.unfold { animation: winOpen .12s ease-out; }

/* ---------- buttons: plain framed labels; gold bar when active ---------- */
.btn {
  background: rgba(0, 0, 0, .78); border: 1px solid var(--win-line); border-radius: 0; color: var(--paper);
  padding: 6px 14px; cursor: pointer; letter-spacing: .12em; white-space: nowrap; font-family: var(--f-body); font-weight: 600;
  box-shadow: none; text-shadow: none; transition: none;
}
.btn:hover:not(:disabled) { background: var(--pick); border-color: #fff; filter: none; }
.btn:active:not(:disabled) { transform: none; filter: brightness(1.15); }
.btn:disabled { color: #6f6f69; border-color: #55554f; cursor: not-allowed; opacity: 1; }
.btn.on { background: var(--pick); border-color: #f4e9a8; color: #fff; }
.btn.primary { background: rgba(0, 0, 0, .78); border: 2px solid var(--gold); color: var(--gold); }
.btn.primary:hover:not(:disabled) { background: var(--pick); color: #fff; }
.btn:focus-visible { outline: 1px solid #fff; outline-offset: 1px; }
.btn.sm { padding: 1px 10px; font-size: 13px; }

/* ---------- command list with the gold selection bar ---------- */
.menu { display: flex; flex-direction: column; gap: 0; }
.menu.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.menu button {
  position: relative; display: flex; justify-content: space-between; gap: 18px; text-align: left; background: transparent; border: 0; border-top: 1px solid transparent; border-radius: 0;
  color: var(--paper); font: 600 16px/1.2 var(--f-body); padding: 7px 12px; cursor: pointer; letter-spacing: .1em; white-space: nowrap;
}
.menu button small { display: none; }
/* one cursor: the bar follows focus only — the pointer moves focus (index.html), it does not paint a second bar */
.menu button:focus, .menu button.cur { background: var(--pick); border-top-color: #f4e9a8; outline: none; }
.menu:focus-within button.cur:not(:focus) { background: transparent; border-top-color: transparent; box-shadow: inset 3px 0 0 var(--gold); }   /* the open page, while the cursor is elsewhere */
.menu button:disabled { color: #6f6f69; cursor: not-allowed; }
.menu button.key { color: var(--gold); }
.menu button.key:focus { color: #fff; }

/* ---------- gauges: flat ---------- */
.gauge { height: 6px; border-radius: 0; background: rgba(255, 255, 255, .1); border: 1px solid #8a8a82; overflow: hidden; }
.gauge i { display: block; height: 100%; background: var(--good); transition: width .3s; }
.gauge.gold i { background: #d8b83a; }
.gauge.blue i { background: #cfcfc6; }
.gauge.warn i { background: var(--bad); }

/* ---------- key/value rows ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--paper); font-size: 14px; } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; }
.kv dd.warn { color: var(--bad); }

/* ---------- message window: a title row, a rule, then the text; choices in their own column ---------- */
.msg { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; padding: 0 12px 7vh; background: rgba(0, 0, 0, .28); }
.msg .win { width: min(860px, 100%); padding: 0; }
.msg .name { position: static; transform: none; display: flex; align-items: baseline; gap: 12px; padding: 10px 22px 9px; background: none; border: 0; border-bottom: 2px solid var(--win-line); border-radius: 0; box-shadow: none; }
.msg .name .crest { width: 12px; height: 12px; border-radius: 0; font-size: 0; align-self: center; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--win-line); flex: none; }
.msg .name b { font: 600 19px var(--f-title); letter-spacing: .14em; }
.msg .name small { font-size: 13px; color: var(--mist); letter-spacing: .08em; }
.msg .body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; align-items: stretch; max-height: 62vh; overflow-y: auto; }
.msg .body > div:first-child { padding: 14px 22px 16px; }
.msg .text { margin: 0; line-height: 1.9; font-size: 17px; letter-spacing: .04em; }
.msg .text q { color: var(--paper); quotes: "「" "」"; }
.msg .note { margin: 8px 0 0; font-size: 13.5px; color: var(--mist); }
.msg .stats { margin: 12px 0 0; padding: 0; background: none; border: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 3px 26px; font-size: 14.5px; }
.msg .stats div { display: flex; justify-content: space-between; gap: 8px; border: 0; }
.msg .stats span { color: var(--mist); }
.msg .choices { min-width: 240px; padding: 8px 6px; border-left: 2px solid var(--win-line); }
@media (max-width: 640px) { .msg .body { grid-template-columns: minmax(0, 1fr); } .msg .choices { border-left: 0; border-top: 2px solid var(--win-line); min-width: 0; } .msg { padding-bottom: 12px; } .msg .text { font-size: 15.5px; } }

/* ---------- full-screen menu screens: separate small windows over the dimmed scene ---------- */
.screen { position: fixed; inset: 0; z-index: 12; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: 18px; background: rgba(0, 0, 0, .5); }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; background: none; border: 0; box-shadow: none; }
.screen-head > div { padding: 9px 26px 10px; border: 2px solid var(--win-line); box-shadow: 0 0 0 1px rgba(0, 0, 0, .85); min-width: 240px;
  background: var(--knot) left top / 17px no-repeat, var(--knot) right top / 17px no-repeat, linear-gradient(180deg, var(--win-a), var(--win-b)); background-origin: border-box; }
.screen-head h2 { margin: 0; font: 600 20px var(--f-title); letter-spacing: .16em; color: var(--paper); }
.screen-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; min-height: 0; align-items: start; }
.screen-body.solo { grid-template-columns: minmax(0, 1fr); }
.screen-body > .win { min-height: 0; max-height: 100%; overflow-y: auto; }
.screen-body > .win.side { padding: 8px 6px; }
.win.side .ver { margin: 8px 6px 0; padding: 7px 10px 2px; border-top: 1px solid var(--win-line); color: var(--paper); font-size: 13.5px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.win.side .ver small { display: block; margin-top: 2px; color: var(--mist); font-size: 12px; letter-spacing: .03em; }
.screen-foot { display: flex; flex-wrap: wrap; gap: 6px 30px; align-items: baseline; padding: 12px 22px; font-size: 15px; min-height: 52px; }
.screen-foot span b { color: var(--paper); margin-left: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.screen-foot span { color: var(--mist); }
.screen-foot .desc { flex: 1 1 280px; color: var(--paper); min-height: 22px; letter-spacing: .04em; }
@media (max-width: 720px) { .screen { padding: 8px; gap: 8px; } .screen-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); } .screen-body > .win.side .menu { flex-direction: row; flex-wrap: wrap; } .menu button { font-size: 15px; } }

/* tables inside windows: one row per line, numbers to the right, gold bar on the row under the pointer */
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th { text-align: right; font-weight: 500; color: var(--mist); font-size: 13px; padding: 2px 12px 8px; border-bottom: 2px solid var(--win-line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { padding: 7px 12px; text-align: right; font-variant-numeric: tabular-nums; border: 0; border-top: 1px solid transparent; white-space: nowrap; letter-spacing: .04em; }
.tbl tbody tr:hover td { background: rgba(176, 146, 30, .9); border-top-color: #f4e9a8; }
.tbl tbody tr:hover td:first-child { background: linear-gradient(90deg, rgba(196, 164, 40, .96), rgba(176, 146, 30, .9)); }
.tbl tbody tr:hover td:last-child { background: linear-gradient(90deg, rgba(176, 146, 30, .9), rgba(120, 96, 12, .2)); }
.tbl .up { color: var(--good); } .tbl .dn { color: var(--bad); }
.tbl tr:hover .up, .tbl tr:hover .dn { text-shadow: 0 0 2px #000, 0 0 2px #000; }
.badge { display: inline-block; font-size: 12px; line-height: 17px; padding: 0 7px; border: 1px solid currentColor; border-radius: 0; color: var(--gold); margin-left: 10px; letter-spacing: 0; }

/* party member rows */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 14px; }
.pcard { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border: 0; border-top: 1px solid transparent; border-radius: 0; background: none; min-width: 0; }
.pcard:hover { background: var(--pick); border-top-color: #f4e9a8; }
.pcard.hurt { color: var(--bad); }
.pcard .face { width: 42px; height: 42px; border-radius: 0; flex: none; background: #1c1c1a center / cover; box-shadow: 0 0 0 1px var(--win-line); }
.pcard .who { min-width: 0; flex: 1; } .pcard .who b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .06em; }
.pcard .who > span { display: block; font-size: 12.5px; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard:hover .who > span { color: #f3ecc8; }
.pcard .gauge { margin-top: 4px; height: 4px; }
.sect { margin: 16px 0 6px; padding-bottom: 5px; border-bottom: 1px solid rgba(217, 217, 208, .5); font: 600 15px var(--f-title); letter-spacing: .2em; color: var(--paper); }
.sect:first-child { margin-top: 0; }

/* ---------- character status screen (after 幻想水浒传 II: who / abilities / weapon, runes, armour / battle arts) ---------- */
.pcard[data-uid] { cursor: pointer; }
.st-list button { align-items: baseline; padding: 6px 10px; font-size: 15px; }
.st-list button span { font-size: 12.5px; color: var(--mist); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.st-list button.cur span, .st-list button:hover span, .st-list button:focus span { color: #f3ecc8; }
.st-list button.hurt { color: var(--bad); }
.st-list .grp { padding: 8px 10px 3px; font-size: 12px; color: var(--mist); letter-spacing: .2em; }
.st-list .grp:first-child { padding-top: 2px; }
.st { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; min-height: 0; max-height: 100%; overflow-y: auto; align-items: start; padding: 1px; }
.st .win { padding: 10px 18px 12px; }
.st h4 { margin: 0 -4px 8px; padding: 0 4px 6px; border-bottom: 2px solid var(--win-line); font: 600 15px var(--f-title); letter-spacing: .24em; }
.st h4:not(:first-child) { margin-top: 10px; }
.st .st-wide { grid-column: 1 / -1; } .st-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.st-id { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 18px; align-items: start; }
.st-face { width: 132px; height: 132px; background: #1c1c1a center / cover; box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--win-line); margin: 3px; display: grid; place-items: center; font: 600 54px var(--f-title); color: #fff; }
.st-body3d { height: 190px; width: auto; display: block; margin: -6px -6px -10px 0; }
.st-name b { display: block; font: 600 24px var(--f-title); letter-spacing: .14em; }
.st-name span { display: block; font-size: 13.5px; color: var(--mist); letter-spacing: .06em; margin-top: 2px; }
.st-vital { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 16px; margin: 10px 0 0; align-items: baseline; font-size: 16px; }
.st-vital dt { font: 600 14px var(--f-title); letter-spacing: .12em; color: var(--gold); }
.st-vital dd { margin: 0; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.st-vital dd small { color: var(--mist); font-size: 12.5px; margin: 0 4px 0 12px; }
.st-vital .gauge { margin-top: 4px; max-width: 240px; }
.st-vital .bad { color: var(--bad); }
.st-mp i { font-style: normal; display: inline-block; min-width: 1.1em; text-align: right; } .st-mp i.zero { color: #77776f; }
.st-ab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; margin: 0; }
.st-ab div, .st-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 8px; border-top: 1px solid transparent; font-size: 16px; }
.st-ab dt { letter-spacing: .14em; } .st-ab dd { margin: 0; font-variant-numeric: tabular-nums; }
.st-ab dd small, .st-row small { color: var(--mist); font-size: 12px; margin-left: 8px; letter-spacing: 0; }
.st-ab .big dd { font-size: 19px; color: var(--gold); }
.st-row { cursor: default; }
.st-ab dd small.up { color: var(--good); } .st-ab dd small.dn { color: var(--bad); }
button.st-pick { width: 100%; background: none; border: 0; border-top: 1px solid transparent; color: inherit; font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
button.st-pick:focus { outline: none; background: var(--pick); border-top-color: #f4e9a8; }
button.st-pick.arm > em { color: var(--gold); }
.st-row > span:first-child { flex: none; width: 3.4em; color: var(--mist); font-size: 13.5px; letter-spacing: .1em; }
.st-row > b { flex: 1; min-width: 0; font-weight: 600; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-row > em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 14.5px; white-space: nowrap; }
.st-row.none > b { color: #77776f; font-weight: 500; }
.st-row[data-desc]:hover, .st-ab div[data-desc]:hover { background: var(--pick); border-top-color: #f4e9a8; }
.st-row[data-desc]:hover > span:first-child, .st-row[data-desc]:hover small, .st-ab div[data-desc]:hover small { color: #f3ecc8; }
@media (max-width: 1000px) { .st { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .st-id { grid-template-columns: auto minmax(0, 1fr); } .st-face { width: 84px; height: 84px; font-size: 36px; } .st-body3d { display: none; } .st-vital { grid-column: 1 / -1; } .st-ab, .st-cols { grid-template-columns: minmax(0, 1fr); } }

/* area title when the caravan crosses into a new region */
.area { position: fixed; left: 50%; top: 20%; transform: translateX(-50%); z-index: 6; text-align: center; pointer-events: none; opacity: 0; padding: 10px 44px 12px;
  background: var(--knot) left top / 17px no-repeat, var(--knot) right top / 17px no-repeat, rgba(0, 0, 0, .78); background-origin: border-box; border: 2px solid var(--win-line); box-shadow: 0 0 0 1px rgba(0, 0, 0, .85); }
.area.on { animation: areaIn 3.2s ease forwards; }
.area b { display: block; font: 600 clamp(22px, 3.4vw, 32px) var(--f-title); letter-spacing: .4em; text-indent: .4em; color: #fff; white-space: nowrap; }
@keyframes areaIn { 0% { opacity: 0; } 12%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- squad-battle overlay picks up the same look ---------- */
#uob, #uoa { background: rgba(0, 0, 0, .62); font-family: var(--f-body); }
#uob .uo-head, #uob .uo-foot, #uoa .uo-head, #uoa .uo-foot { background: rgba(0, 0, 0, .86); border-color: var(--win-line); border-width: 2px; }
#uob .uo-head h2, #uoa .uo-head h2 { font-weight: 600; }
#uob .sqd, #uoa .board, #uoa .uoa-side {
  background: var(--knot) left top / 15px no-repeat, var(--knot) right top / 15px no-repeat, linear-gradient(180deg, var(--win-a), var(--win-b)); background-origin: border-box;
  border: 2px solid var(--win-line); border-radius: 0; }
#uob .sqd:hover:not(:disabled) { background: var(--pick); }
#uob .sqd.sel { border-color: #fff; box-shadow: none; background: var(--pick); }
#uob .sqd.fight { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
#uob .uob-stage { border: 2px solid var(--win-line); border-radius: 0; }
#uob .uob-banner { background: rgba(0, 0, 0, .86); border-top: 2px solid var(--win-line); border-bottom: 2px solid var(--win-line); font-weight: 600; color: #fff; }
#uob .uob-banner.s0, #uob .uob-banner.s1 { color: #fff; } #uob .uob-banner.pas { border-color: var(--mist); }
#uob .plate { background: rgba(0, 0, 0, .8); border-radius: 0; border-width: 1px; }
#uob .uob-result .box { background: var(--knot) left top / 17px no-repeat, var(--knot) right top / 17px no-repeat, rgba(0, 0, 0, .9); background-origin: border-box; border: 2px solid var(--win-line); border-radius: 0; }
#uob .uob-log { background: rgba(0, 0, 0, .7); border-top: 2px solid var(--win-line); }
#uob .hpbar, #uoa .hpbar { border-radius: 0; } #uob .hpbar i { background: var(--good); } #uob .hpbar i.mid { background: #d8b83a; } #uob .hpbar i.low { background: var(--bad); }
#uoa .slot { border-radius: 0; } #uoa .slot.sel { background: var(--pick); border-color: #fff; box-shadow: none; }
#uob .tok, #uoa .tok, #uob .sqd .dot.pt { border-radius: 0; }

/* ---------- realm and trade screens: tab row, two-column sheets, label/value rows, meters ---------- */
.screen-body.wide { grid-template-columns: 250px minmax(0, 1fr); }
.menu button.gone { color: #8a8a82; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.rl-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -2px -4px 12px; padding: 0 4px 10px; border-bottom: 2px solid var(--win-line); }
.rl-head .sw { width: 34px; height: 34px; flex: none; display: grid; place-items: center; font: 600 18px var(--f-title); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--win-line); }
.rl-head b { display: block; font: 600 20px var(--f-title); letter-spacing: .12em; }
.rl-head span { font-size: 13.5px; color: var(--mist); letter-spacing: .04em; }
.rl-head .tabs { margin: 0 0 0 auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; align-items: start; }
.grid2 > div > .sect:first-child { margin-top: 16px; }
.lead { margin: 0 0 4px; line-height: 1.8; font-size: 15px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 8px; border-top: 1px solid transparent; font-size: 15.5px; }
.row > span:first-child { flex: none; color: var(--mist); font-size: 13.5px; letter-spacing: .08em; }
.row > b { flex: 1; min-width: 0; font-weight: 600; letter-spacing: .04em; }
.row > em { font-style: normal; font-variant-numeric: tabular-nums; text-align: right; }
.row[data-nb], .row[data-s], .tbl tr[data-nb], .tbl tr[data-s], .tbl tr[data-n] { cursor: pointer; }
.row[data-nb]:hover, .row[data-s]:hover { background: var(--pick); border-top-color: #f4e9a8; }
.row[data-nb]:hover > span:first-child, .row[data-s]:hover > span:first-child { color: #f3ecc8; }
.meter { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) 2.6em; gap: 12px; align-items: center; padding: 4px 8px; font-size: 13.5px; color: var(--mist); letter-spacing: .08em; }
.meter .gauge { height: 8px; } .meter em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; font-size: 15.5px; color: var(--paper); letter-spacing: 0; }
.swd { display: inline-block; width: 10px; height: 10px; margin-right: 9px; box-shadow: 0 0 0 1px #000, 0 0 0 2px rgba(217, 217, 208, .7); vertical-align: 1px; }
.tbl td small, .row small { color: var(--mist); font-size: 12.5px; margin-left: 6px; letter-spacing: 0; }
.tbl tr:hover td small { color: #f3ecc8; }
.tbl tbody tr.grp td, .tbl tbody tr.grp:hover td { background: none; border-top-color: transparent; border-bottom: 1px solid rgba(217, 217, 208, .4); color: var(--mist); font-size: 13px; letter-spacing: .3em; padding: 12px 12px 4px; }
.warn { color: var(--bad); } .ok { color: var(--good); } .badge.warn { color: var(--bad); } .badge.ok { color: var(--good); }
/* ---------- painted art ---------- */
#backdrop { position: fixed; inset: 0; z-index: 9; background: #000 center / cover no-repeat; }
#backdrop.in { animation: winOpen .35s ease-out; }
#backdrop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
#backdrop video.on { opacity: 1; }
#veil { background-size: cover; background-position: center; }
.msg .face { float: left; width: 116px; height: 116px; margin: 3px 20px 8px 3px; box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--win-line); background: #1c1c1a; }
.gi { width: 26px; height: 26px; vertical-align: -7px; margin-right: 9px; }
.kv dt .gi { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; }
.tbl td .gi { margin-top: -4px; margin-bottom: -4px; }
img.sw { object-fit: cover; }
.rl-head img.sw { width: 44px; height: 44px; }
.rl-head img.sw.face { width: 84px; height: 84px; }
.fallpic { display: block; width: min(100%, 760px); aspect-ratio: 16 / 9; object-fit: cover; margin: 12px 3px; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--win-line); filter: saturate(.8); }
.lead .face { float: left; width: 84px; height: 84px; margin: 4px 16px 4px 3px; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--win-line); cursor: pointer; }
@media (max-width: 640px) { .msg .face { width: 72px; height: 72px; margin-right: 12px; } }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } .screen-body.wide { grid-template-columns: minmax(0, 1fr); } }

/* ---------- dialogue scenes (vn.js): text window with a name tab, busts standing behind it, choices in a command window ---------- */
#vn { position: fixed; inset: 0; z-index: 15; background: linear-gradient(transparent 45%, rgba(0, 0, 0, .5)); }
.vn-box { position: absolute; left: 50%; bottom: 3vh; transform: translateX(-50%); width: min(1040px, calc(100% - 24px)); min-height: 172px; padding: 28px 36px 20px; cursor: pointer; z-index: 1; }
.vn-name { position: absolute; left: 24px; top: -41px; display: flex; align-items: baseline; gap: 14px; padding: 6px 24px 7px; background: rgba(0, 0, 0, .9); border: 2px solid var(--win-line); border-bottom: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .85); }
.vn-name b { font: 600 19px var(--f-title); letter-spacing: .16em; } .vn-name small { color: var(--mist); font-size: 13px; letter-spacing: .06em; }
.vn-text { margin: 0; min-height: 78px; font-size: 19px; line-height: 2; letter-spacing: .06em; white-space: pre-wrap; }
.vn-box.narr .vn-text { color: #dedccf; }
.vn-note { margin: 4px 0 0; font-size: 13px; color: var(--mist); letter-spacing: .04em; }
.vn-tools { position: absolute; right: 28px; top: 5px; display: flex; gap: 2px; }
.vn-tools button { background: none; border: 0; padding: 2px 8px; color: var(--mist); font: 500 12.5px var(--f-body); letter-spacing: .12em; cursor: pointer; }
.vn-tools button:hover, .vn-tools button.on { color: var(--gold); }
.vn-next { position: absolute; right: 32px; bottom: 12px; font-style: normal; font-size: 13px; color: var(--gold); animation: vnNext 1s infinite; }
@keyframes vnNext { 50% { transform: translateY(4px); opacity: .45; } }
.vn-stand { position: absolute; left: 50%; bottom: calc(3vh + 150px); transform: translateX(-50%); width: min(1040px, calc(100% - 24px)); height: 0; pointer-events: none; }
.vn-face { position: absolute; bottom: 0; width: clamp(200px, 46vh, 460px); height: auto; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .65)); transition: filter .25s; }
.vn-face.l { left: 0; transform: scaleX(-1); }            /* the busts are drawn facing left: mirror the one on the left so the two face each other */
.vn-face.r { right: 0; }
.vn-face.px { image-rendering: pixelated; width: clamp(180px, 38vh, 380px); }      /* pixel figures (no painted bust): kept crisp, and they are shot facing right */
.vn-face.l.px { transform: none; } .vn-face.r.px { transform: scaleX(-1); }
.vn-face.dim { filter: brightness(.42) drop-shadow(0 6px 16px rgba(0, 0, 0, .65)); }
.vn-face.in { animation: vnIn .28s ease-out; }
@keyframes vnIn { from { opacity: 0; translate: 0 16px; } }
.vn-box.away, .vn-stand.away { visibility: hidden; }
/* the résumé hangs in the top right corner, wide and low: the bust keeps the left of the screen to itself and the choices sit below the card */
.vn-card { position: absolute; right: max(12px, calc(50% - 520px)); top: max(14px, 3vh); width: min(500px, calc(100% - 24px)); padding: 12px 18px 10px; z-index: 2; font-size: 15px; }
.vn-card.away, .vn-cap.away { visibility: hidden; }
/* a cutscene's title, over the upper part of the painting */
.vn-cap { position: absolute; left: 0; right: 0; top: 0; padding: 7vh 16px 9vh; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .62), transparent); animation: vnCap 1.6s ease-out; }
.vn-cap img { width: 64px; height: 64px; object-fit: cover; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--win-line); filter: saturate(.35) brightness(.8); }
.vn-cap b { font: 600 clamp(26px, 4.4vw, 46px) var(--f-title); letter-spacing: .3em; margin-right: -.3em; text-shadow: 0 2px 10px #000, 0 0 2px #000; }
.vn-cap span { font-size: clamp(13px, 1.6vw, 16px); color: var(--gold); letter-spacing: .22em; text-shadow: 0 1px 6px #000; }
.vn-cap span::before, .vn-cap span::after { content: ''; display: inline-block; vertical-align: middle; width: clamp(24px, 6vw, 80px); height: 1px; margin: 0 14px; background: currentColor; opacity: .6; }
@keyframes vnCap { from { opacity: 0; letter-spacing: .1em; } }
.vn-card h4 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--win-line); font: 600 17px var(--f-title); letter-spacing: .14em; }
.vn-card h4 small { margin-left: 12px; font-size: 12.5px; font-weight: 400; color: var(--mist); letter-spacing: .04em; }
.vn-card dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px 20px; margin: 0; }
.vn-card dl.sum { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--win-line); }
.vn-card dl div { display: flex; justify-content: space-between; align-items: baseline; }
.vn-card dt { letter-spacing: .14em; } .vn-card dd { margin: 0; font-variant-numeric: tabular-nums; }
.vn-card dd small { display: inline-block; width: 1em; margin-left: 5px; font-size: 12px; color: var(--mist); text-align: center; }
.vn-card dd.big { color: var(--gold); }
.vn-card .up { color: var(--good); } .vn-card .dn { color: var(--bad); }
.vn-card h4 em { float: right; font: 400 12px var(--f-body); color: var(--mist); letter-spacing: 0; line-height: 24px; }
.vn-card .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--win-line); }
.vn-card p { margin: 0; font-size: 13.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vn-card p span { display: inline-block; margin-right: 8px; color: var(--mist); font-size: 12.5px; letter-spacing: .1em; } .vn-card p b { margin-right: 14px; font-weight: 600; }
@media (max-width: 640px) { .vn-card .rows { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .vn-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vn-choices { position: absolute; right: max(12px, calc(50% - 520px)); bottom: calc(3vh + 226px); min-width: 300px; padding: 8px 6px; z-index: 2; }
.vn-log { position: absolute; inset: 8vh max(12px, calc(50% - 430px)); overflow-y: auto; z-index: 3; cursor: pointer; }
.vn-log p { margin: 0 0 8px; line-height: 1.8; font-size: 15.5px; } .vn-log p b { display: inline-block; min-width: 7em; color: var(--gold); font-weight: 600; }
@media (max-width: 640px) { .vn-box { min-height: 150px; padding: 22px 18px 16px; } .vn-text { font-size: 16px; line-height: 1.8; } .vn-face { width: 46vw; } .vn-choices { left: 12px; right: 12px; min-width: 0; } }

/* ---------- movable windows ---------- */
.msg.mid { align-items: center; padding-bottom: 0; }
.dragging { cursor: grabbing !important; user-select: none; transition: none !important; }
.msg .name, .rl-head, .win-title, .screen-head > div, #clock, #party .phead, #mini .cap { cursor: grab; }
body.painted #party { z-index: 11; }                 /* above the painting and its message window, below full-screen menus */
#party .sub.warn { color: var(--bad); }

/* a game, not a document: no text selection anywhere (inputs excepted) */
html, body { user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
#party .phead #pMenu { margin-left: auto; align-self: center; padding: 3px 12px; }
body.painted #dock { z-index: 11; }                  /* the system button stays reachable inside a town */

/* market: lot size picker, and deal buttons that spell out what the click will really do */
.tabs.lot { align-items: center; margin: -2px 0 8px; gap: 6px; } .tabs.lot span { font-size: 13.5px; color: var(--mist); margin: 0 6px; }
.tbl td.deal { white-space: nowrap; }
.tbl td.deal .btn { min-width: 92px; padding: 2px 10px; text-align: left; letter-spacing: .04em; }
.tbl td.deal .btn[data-act="sell"] { min-width: 190px; }
.tbl td.deal .btn i { font-style: normal; margin-left: 9px; font-variant-numeric: tabular-nums; }
.tbl td.deal .btn i.up { color: var(--good); } .tbl td.deal .btn i.dn { color: var(--bad); }
.tbl td.deal .btn:disabled i { color: inherit; }

/* ---------- title screen: the key art, the name of the game, a command list with the gold bar ---------- */
.title { position: fixed; inset: 0; z-index: 10; display: grid; grid-template-rows: minmax(0, 1.15fr) auto minmax(24px, .28fr); justify-items: center; background: #0c0f16 center / cover no-repeat; }
.title-logo { align-self: center; text-align: center; padding: 0 16px; }
.title-logo h1 { margin: 0; font: 900 clamp(46px, 9.5vw, 132px)/1.1 var(--f-title); letter-spacing: .22em; text-indent: .22em; white-space: nowrap;
  background: linear-gradient(180deg, #fff7d6 8%, #f0d476 42%, #b98a2a 78%, #7d5712); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #2c1c06) drop-shadow(0 0 22px rgba(0, 0, 0, .7)); }
.title-logo p { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 0; font: 600 clamp(13px, 1.5vw, 19px) var(--f-title); letter-spacing: .42em; text-indent: .42em; color: #fff3d2; text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, .8); }
.title-logo p i { width: clamp(24px, 6vw, 90px); height: 2px; background: linear-gradient(90deg, transparent, #f0d476); } .title-logo p i:last-child { transform: scaleX(-1); }
.title-menu { width: min(360px, calc(100% - 32px)); padding: 10px 8px; background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, .68)); border-top: 2px solid var(--win-line); border-bottom: 2px solid var(--win-line); }
.title-menu button { justify-content: center; align-items: baseline; gap: 14px; font-size: 19px; padding: 9px 12px; letter-spacing: .3em; text-indent: .3em; }
#contBtn { flex-direction: column; align-items: center; gap: 3px; }             /* the save it resumes goes on a line of its own */
.title-menu button span { font-size: 12.5px; letter-spacing: .06em; text-indent: 0; color: #cfcfc4; white-space: nowrap; }
.title-menu button:focus span { color: #f3ecc8; }
@media (max-height: 620px) { .title-menu button { font-size: 16px; padding: 6px 12px; } }
