/* ============================================================================
   《四象》 UI 样式 —— 墨底、朱砂、旧金。正文黑体，标题衬线。
   ========================================================================== */
:root {
  --ink: #0a090c;
  --ink-2: #121017;
  --ink-3: #1a1720;
  --panel: rgba(18, 15, 22, 0.86);
  --panel-solid: #17141c;
  --line: rgba(214, 178, 108, 0.20);
  --line-strong: rgba(214, 178, 108, 0.45);
  --gold: #d9b45f;
  --gold-soft: #f0d69a;
  --gold-dim: #8d7746;
  --shu: #b23a2e;
  --shu-bright: #e2574a;
  --jade: #6fb79a;
  --sky: #8fd8ff;
  --ivory: #f1e9d8;
  --muted: #9c9288;
  --muted-2: #6e6660;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Noto Sans Mono", monospace;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: var(--ink); color: var(--ivory);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: none; }

/* ------------------------------------------------------------------- panels */
.panel {
  background: linear-gradient(160deg, rgba(26, 22, 32, 0.92), rgba(14, 12, 18, 0.9));
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 235, 200, 0.05);
  backdrop-filter: blur(6px);
}
.panel::before {
  content: ""; position: absolute; inset: 3px; border: 1px solid rgba(214, 178, 108, 0.07);
  border-radius: 2px; pointer-events: none;
}
.panel { position: relative; }

/* ====================================================================== HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud .panel { padding: 10px 12px; }

.topbar {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: grid; grid-template-columns: 300px minmax(340px, 1fr) 260px; gap: 14px;
  align-items: start;
}
.center-top { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.right-top { justify-self: end; width: 260px; }

/* --- party ---------------------------------------------------------------- */
#party .party-row {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center;
  padding: 5px 0; border-bottom: 1px solid rgba(214, 178, 108, 0.08);
}
#party .party-row:last-child { border-bottom: none; }
.party-glyph {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; color: #12100f; font-weight: 700;
}
.party-main { min-width: 0; }
.party-name { font-size: 12px; display: flex; justify-content: space-between; gap: 6px; color: var(--ivory); }
.party-name .lv { color: var(--gold); font-variant-numeric: tabular-nums; }
.party-name .cls { color: var(--muted); font-size: 11px; }
.party-tag { font-size: 10px; border: 1px solid var(--line); padding: 0 4px; border-radius: 2px; color: var(--muted); }
.hp-track { height: 6px; background: rgba(0, 0, 0, 0.6); border-radius: 3px; overflow: hidden; margin-top: 3px; position: relative; }
.hp-fill { height: 100%; background: linear-gradient(90deg, #8d2f28, #d05a45); transition: width 0.12s linear; }
.hp-fill.low { background: linear-gradient(90deg, #7a2018, #ff6b52); }
.es-track { height: 3px; background: rgba(0, 0, 0, 0.55); border-radius: 2px; overflow: hidden; margin-top: 2px; }
.es-fill { height: 100%; background: #6f93e8; opacity: 0.85; transition: width 0.12s linear; }
.party-state { font-size: 10px; color: var(--shu-bright); min-width: 34px; text-align: right; }

/* --- progress ------------------------------------------------------------- */
#progress { padding: 10px 14px 12px; }
.prog-title { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); letter-spacing: 0.12em; margin-bottom: 6px; }
.prog-title b { color: var(--gold); font-weight: 600; letter-spacing: 0; }
.prog-row { display: grid; grid-template-columns: 58px 1fr 74px; gap: 10px; align-items: center; margin: 5px 0; font-size: 12px; }
.prog-track { position: relative; height: 10px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(214, 178, 108, 0.12); border-radius: 2px; overflow: hidden; }
.prog-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #7a5a22, #d9b45f); }
.prog-fill.elite { background: linear-gradient(90deg, #2f4a6a, #7fa6d8); }
.prog-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--shu-bright); opacity: 0.9; }
.prog-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--gold-soft); }
.prog-gate { font-size: 10px; color: var(--muted); margin-left: 6px; }
.prog-gate.open { color: var(--jade); }

/* --- boss ----------------------------------------------------------------- */
#boss-wrap { padding: 8px 14px 10px; background: linear-gradient(180deg, rgba(60, 14, 16, 0.9), rgba(20, 10, 14, 0.85)); border: 1px solid rgba(226, 87, 74, 0.35); border-radius: 3px; box-shadow: var(--shadow); }
.boss-head { display: flex; justify-content: space-between; align-items: baseline; }
#boss-name { font-family: var(--serif); font-size: 16px; letter-spacing: 0.08em; color: #ffd9c8; }
#boss-phase { font-size: 11px; color: #ffb199; letter-spacing: 0.1em; }
.boss-track { position: relative; height: 12px; margin-top: 5px; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(226, 87, 74, 0.3); overflow: hidden; }
#boss-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #5e1518, #e2574a); transition: width 0.15s linear; }
#boss-marks { position: absolute; inset: 0; }
.boss-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 226, 200, 0.65); }
.boss-sub { display: flex; justify-content: space-between; font-size: 10px; color: #d9a89a; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* --- toasts --------------------------------------------------------------- */
#toasts { position: fixed; left: 50%; bottom: 188px; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column-reverse; gap: 5px; align-items: center; min-height: 0; max-width: 70vw; pointer-events: none; }
.toast {
  font-size: 12px; padding: 5px 12px; border-left: 2px solid var(--gold); background: rgba(12, 10, 16, 0.82);
  color: var(--ivory); animation: toastIn 0.25s ease-out; letter-spacing: 0.02em;
}
.toast.good { border-left-color: var(--jade); color: #c8f0dd; }
.toast.warn { border-left-color: var(--gold); color: #f3e0b0; }
.toast.danger { border-left-color: var(--shu-bright); color: #ffc2b6; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* --- minimap / run meta --------------------------------------------------- */
.mini-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 6px; }
#run-timer { color: var(--gold-soft); font-variant-numeric: tabular-nums; }
#minimap { width: 236px; height: 236px; display: block; border: 1px solid rgba(214, 178, 108, 0.14); border-radius: 2px; background: #08070a; }
.mini-foot { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted-2); margin-top: 5px; font-variant-numeric: tabular-nums; }

/* --- objectives ----------------------------------------------------------- */
#objective-panel {
  position: absolute; left: 14px; top: 306px; width: 300px; max-height: calc(100vh - 480px);
  overflow: hidden; padding: 8px 10px;
}
.obj-head { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.16em; color: var(--muted-2); margin-bottom: 4px; }
.obj-item { display: grid; grid-template-columns: 18px 1fr 40px; gap: 7px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(214, 178, 108, 0.06); }
.obj-item:last-child { border-bottom: none; }
.obj-icon { font-size: 12px; text-align: center; }
.obj-name { font-size: 12px; color: var(--ivory); display: flex; align-items: center; gap: 6px; }
.obj-name small { color: var(--muted-2); font-size: 10px; }
.obj-bar { height: 3px; background: rgba(0, 0, 0, 0.6); margin-top: 3px; }
.obj-bar > i { display: block; height: 100%; background: var(--gold); }
.obj-pct { text-align: right; font-size: 11px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.obj-item.done { opacity: 0.42; }
.obj-item.simplified .obj-name::after { content: "闄嶇骇"; font-size: 9px; color: #e0b24a; border: 1px solid #6a5320; padding: 0 3px; margin-left: 2px; }
.obj-item.locked { opacity: 0.4; }
.obj-empty { font-size: 11px; color: var(--muted-2); padding: 4px 0; }

/* --- bonds ---------------------------------------------------------------- */
#bonds { position: absolute; right: 14px; top: 330px; width: 236px; padding: 8px 10px; }
.bond-title { font-size: 10px; letter-spacing: 0.16em; color: var(--muted-2); margin-bottom: 5px; }
.bond-chip { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; padding: 3px 0; border-bottom: 1px dashed rgba(214, 178, 108, 0.08); }
.bond-chip:last-child { border-bottom: none; }
.bond-chip b { color: var(--gold); font-weight: 500; }
.bond-chip.main b { color: #ffe6a6; }
.bond-chip span { color: var(--muted); font-size: 10px; }
.bond-chip.idle { color: var(--muted-2); font-size: 10px; }

/* --- bottom: vitals + skills --------------------------------------------- */
.bottombar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: grid; grid-template-columns: 260px auto 200px; gap: 12px; align-items: end;
}
#vitals { padding: 9px 12px; width: 260px; }
.vit-name { display: flex; justify-content: space-between; font-size: 12px; color: var(--ivory); }
.vit-name .lv { color: var(--gold); }
.vit-hp { height: 12px; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(214, 178, 108, 0.16); margin-top: 5px; position: relative; overflow: hidden; }
.vit-hp > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8d2f28, #d95a45); }
.vit-hp > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; color: #ffe9d6; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.vit-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 5px; }
.vit-track { height: 5px; background: rgba(0, 0, 0, 0.6); position: relative; overflow: hidden; }
.vit-track > i { position: absolute; inset: 0 auto 0 0; background: #6fb79a; }
.vit-track.stam > i { background: #b6a05c; }
.vit-track.res > i { background: #7f8fe0; }
.vit-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted-2); margin-top: 2px; }

#skillbar { display: flex; gap: 7px; align-items: flex-end; }
.skill {
  position: relative; width: 54px; height: 54px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(36, 30, 42, 0.95), rgba(14, 12, 18, 0.95));
  display: grid; place-items: center; border-radius: 3px; overflow: hidden;
}
.skill .glyph { font-size: 18px; color: var(--gold-soft); display: grid; place-items: center; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55)); }
.skill .glyph svg { width: 28px; height: 28px; display: block; }
.skill .glyph { background: radial-gradient(circle at 50% 42%, rgba(255,236,198,.08), transparent 68%); }
.skill.beast .glyph svg { width: 33px; height: 33px; }
.ico-inline { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.skill .key {
  position: absolute; top: 1px; left: 4px; font-size: 9px; color: var(--muted);
  font-family: var(--mono); letter-spacing: 0;
}
.skill .cost { position: absolute; bottom: 1px; right: 4px; font-size: 9px; color: var(--muted); }
.skill .cd {
  position: absolute; inset: 0; background: rgba(5, 4, 8, 0.72);
  display: grid; place-items: center; font-size: 14px; color: #fff; font-variant-numeric: tabular-nums;
}
.skill.ready { border-color: rgba(214, 178, 108, 0.42); box-shadow: 0 0 12px rgba(214, 178, 108, 0.12) inset; }
.skill.locked { opacity: 0.35; }
.skill.beast { width: 60px; height: 60px; border-color: rgba(143, 216, 255, 0.3); }
.skill.beast .glyph { color: #bfe8ff; }
.skill .beast-cd { position: absolute; inset: 0; background: rgba(5, 8, 14, 0.7); display: grid; place-items: center; font-size: 13px; }
.skill-tip {
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%);
  width: 230px; padding: 8px 10px; background: rgba(10, 8, 14, 0.96);
  border: 1px solid var(--line-strong); font-size: 11px; line-height: 1.5;
  color: var(--ivory); display: none; pointer-events: none; z-index: 20;
}
.skill:hover .skill-tip { display: block; }
.skill-tip b { color: var(--gold); display: block; margin-bottom: 2px; font-weight: 500; }

#hints { width: 200px; font-size: 10px; color: var(--muted-2); line-height: 1.7; padding: 8px 10px; }
#hints b { color: var(--muted); font-weight: 500; }

/* --- prompt --------------------------------------------------------------- */
#prompt {
  position: absolute; left: 50%; bottom: 152px; transform: translateX(-50%);
  padding: 6px 14px; background: rgba(10, 8, 14, 0.9); border: 1px solid var(--line-strong);
  font-size: 12px; color: var(--gold-soft); letter-spacing: 0.04em;
}
#prompt kbd { background: #2a2420; border: 1px solid var(--line); padding: 0 5px; margin-right: 6px; font-family: var(--mono); font-size: 11px; color: #fff; }

/* --- big announce --------------------------------------------------------- */
#big-announce {
  position: absolute; left: 50%; top: 24%; transform: translateX(-50%);
  font-family: var(--serif); font-size: 30px; letter-spacing: 0.24em; color: #ffe6c6;
  text-shadow: 0 0 26px rgba(226, 87, 74, 0.55), 0 2px 8px #000; opacity: 0; transition: opacity 0.4s;
  pointer-events: none; white-space: nowrap;
}
#big-announce.show { opacity: 1; }

/* =================================================================== SCREENS */
.screen {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto;
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(120, 42, 36, 0.22), transparent 60%),
    radial-gradient(900px 600px at 90% 110%, rgba(60, 80, 120, 0.18), transparent 60%),
    linear-gradient(180deg, #0a090c, #0d0b10 60%, #08070a);
}
.screen::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.06;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 3px);
}
.lobby-inner { max-width: 1180px; margin: 0 auto; padding: 26px 28px 34px; }

.brand { display: grid; grid-template-columns: 88px 1fr; gap: 18px; align-items: center; margin-bottom: 20px; }
.brand-mark {
  width: 88px; height: 88px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 32px; letter-spacing: 0.1em; color: #ffd9a8;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 30% 20%, rgba(217, 180, 95, 0.18), transparent 60%),
    linear-gradient(160deg, #2a1a20, #120d12);
  box-shadow: 0 0 40px rgba(180, 60, 50, 0.18) inset, var(--shadow);
  position: relative;
}
.brand-mark::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(214, 178, 108, 0.16); }
.brand-copy h1 {
  margin: 0 0 6px; font-family: var(--serif); font-size: 40px; letter-spacing: 0.16em; font-weight: 700;
  color: #f6e6c8; text-shadow: 0 0 30px rgba(217, 180, 95, 0.2);
}
.brand-copy h1 span { font-size: 12px; letter-spacing: 0.5em; color: var(--gold-dim); vertical-align: middle; margin-left: 14px; }
.brand-copy p { margin: 2px 0; color: var(--muted); font-size: 13px; }
.brand-copy .brand-note { font-size: 11.5px; color: var(--muted-2); margin-top: 8px; }

.lobby-block { margin: 16px 0 18px; }

/* --- mode switch ---------------------------------------------------------- */
.mode-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 18px; }
.mode-btn {
  text-align: left; padding: 11px 14px; cursor: pointer; border-radius: 3px;
  background: linear-gradient(170deg, rgba(30, 25, 34, 0.85), rgba(13, 11, 17, 0.95));
  border: 1px solid var(--line); color: var(--muted); transition: 0.15s;
}
.mode-btn b { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: 0.1em; color: var(--ivory); margin-bottom: 4px; }
.mode-btn small { font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.mode-btn:hover { border-color: var(--line-strong); }
.mode-btn.active { border-color: var(--gold); color: var(--gold-soft); box-shadow: 0 0 0 1px var(--gold) inset, 0 10px 30px rgba(217, 180, 95, 0.08); }
.mode-btn.active b { color: #ffe9c0; }

/* --- campaign hud --------------------------------------------------------- */
.cmap-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 7px; align-items: center; padding: 4px 0; border-bottom: 1px solid rgba(214, 178, 108, 0.07); }
.cmap-row:last-child { border-bottom: none; }
.cmap-glyph { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #14100f; font-weight: 700; }
.cmap-main { min-width: 0; }
.cmap-name { font-size: 11.5px; color: var(--ivory); display: flex; justify-content: space-between; gap: 4px; }
.cmap-name small { color: var(--muted-2); font-size: 9.5px; }
.cmap-sub { font-size: 9.5px; color: var(--muted-2); display: flex; gap: 6px; }
.cmap-hp { height: 4px; background: rgba(0,0,0,.6); margin-top: 2px; border-radius: 2px; overflow: hidden; }
.cmap-hp > i { display: block; height: 100%; background: #c0503f; }
.cmap-state { font-size: 10px; text-align: right; }
.cmap-state.ok { color: var(--jade); }
.cmap-state.warn { color: var(--gold); }
.cmap-state.bad { color: var(--shu-bright); }
.seal-track { display: flex; gap: 5px; align-items: center; margin-top: 6px; }
.seal-pip { width: 22px; height: 7px; background: rgba(0,0,0,.55); border: 1px solid var(--line); }
.seal-pip.on { background: linear-gradient(90deg, #d9b45f, #ffe6a6); box-shadow: 0 0 8px rgba(217,180,95,.35); }
.support-card { font-size: 11px; color: var(--muted); }
.support-name { font-family: var(--serif); color: var(--gold-soft); font-size: 13px; letter-spacing: 0.06em; margin-bottom: 3px; }
.energy-track { height: 9px; background: rgba(0,0,0,.6); border: 1px solid rgba(214,178,108,.16); margin: 5px 0 4px; position: relative; overflow: hidden; }
.energy-track > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #5a7ad0, #9bb8ff); transition: width .15s; }
.energy-meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted-2); }
.support-ready { color: #ffe6a6; }
.block-title {
  font-family: var(--serif); font-size: 15px; letter-spacing: 0.14em; color: var(--gold-soft);
  font-weight: 600; display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.block-title .tick { width: 6px; height: 6px; background: var(--shu-bright); transform: rotate(45deg); display: inline-block; }
.block-title em { font-style: normal; font-size: 11px; color: var(--muted-2); letter-spacing: 0.04em; font-family: var(--font); margin-left: auto; }

/* --- class cards ---------------------------------------------------------- */
.class-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.class-card {
  position: relative; padding: 12px 13px 11px; cursor: pointer; text-align: left;
  background: linear-gradient(170deg, rgba(30, 25, 34, 0.9), rgba(13, 11, 17, 0.95));
  border: 1px solid var(--line); border-radius: 3px; color: var(--ivory);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.class-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.class-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 10px 30px rgba(217, 180, 95, 0.08); }
.class-card .cc-glow { position: absolute; right: -40px; top: -50px; width: 140px; height: 140px; border-radius: 50%; filter: blur(30px); opacity: 0.35; }
.cc-top { display: flex; align-items: center; gap: 10px; }
.cc-glyph { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: #14100f; font-weight: 700; }
.cc-name { font-family: var(--serif); font-size: 17px; letter-spacing: 0.08em; }
.cc-en { font-size: 10px; letter-spacing: 0.16em; color: var(--muted-2); }
.cc-role { font-size: 11.5px; color: var(--muted); margin: 10px 0 8px; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; font-size: 10.5px; color: var(--muted); }
.cc-stats b { display: block; color: var(--ivory); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cc-skills { margin-top: 10px; font-size: 10.5px; color: var(--muted-2); border-top: 1px dashed rgba(214, 178, 108, 0.12); padding-top: 8px; }
.cc-skills div { display: flex; justify-content: space-between; gap: 6px; }
.cc-skills span { color: var(--gold-dim); }
.cc-beast { margin-top: 8px; font-size: 10.5px; color: var(--muted); }
.cc-beast b { color: #bfe8ff; font-weight: 500; }

/* --- level grid ----------------------------------------------------------- */
.level-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.level-btn {
  padding: 9px 6px 8px; border: 1px solid var(--line); background: rgba(18, 15, 22, 0.8);
  color: var(--muted); cursor: pointer; text-align: center; border-radius: 2px; transition: 0.15s;
}
.level-btn:hover:not(.locked) { border-color: var(--line-strong); color: var(--ivory); }
.level-btn.active { border-color: var(--gold); color: #ffe9c0; background: rgba(60, 44, 24, 0.5); }
.level-btn.locked { opacity: 0.32; cursor: not-allowed; }
.level-btn b { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }
.level-btn small { font-size: 9px; color: var(--muted-2); }

/* --- lobby bottom --------------------------------------------------------- */
.lobby-bottom { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; border-top: 1px solid var(--line); padding-top: 16px; }
.lobby-actions { display: flex; flex-direction: column; gap: 9px; }
.seed-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted-2); }
.seed-row input {
  flex: 1; min-width: 0; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line);
  color: var(--ivory); padding: 6px 8px; font-family: var(--mono); font-size: 11px; outline: none;
}
.seed-row input:focus { border-color: var(--line-strong); }
.lobby-preview { font-size: 12px; color: var(--muted); line-height: 1.7; }
.lobby-preview h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 14px; letter-spacing: 0.08em; color: var(--gold-soft); font-weight: 600; }
.lobby-preview table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.lobby-preview td { padding: 3px 0; border-bottom: 1px dotted rgba(214, 178, 108, 0.1); }
.lobby-preview td:first-child { color: var(--muted-2); width: 44%; }
.lobby-preview td:last-child { color: var(--ivory); text-align: right; }

button.primary {
  background: linear-gradient(170deg, #d9b45f, #a8842f); color: #1a130a; border: 1px solid #f0d69a;
  padding: 11px 20px; font-size: 14px; letter-spacing: 0.14em; cursor: pointer; border-radius: 2px;
  font-weight: 600; transition: 0.15s;
}
button.primary:hover { filter: brightness(1.08); box-shadow: 0 0 24px rgba(217, 180, 95, 0.3); }
button.primary.big { font-size: 16px; padding: 14px 20px; }
button.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 10px 16px; cursor: pointer; font-size: 12px; letter-spacing: 0.08em; border-radius: 2px;
}
button.ghost:hover { border-color: var(--line-strong); color: var(--ivory); }
button.ghost.small { padding: 5px 9px; font-size: 11px; }
button.ghost.danger { color: #d98a7e; border-color: rgba(226, 87, 74, 0.3); }
button:disabled { opacity: 0.35; cursor: not-allowed; }

.howto { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 12px; color: var(--muted); }
.howto h3 { font-family: var(--serif); color: var(--gold-soft); font-size: 13px; letter-spacing: 0.1em; margin: 10px 0 6px; }
.howto ul { margin: 0 0 6px 18px; padding: 0; }
.howto li { margin: 3px 0; }
.howto b { color: var(--ivory); font-weight: 500; }
.lobby-foot { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted-2); margin-top: 26px; border-top: 1px solid var(--line); padding-top: 12px; }
.start-float {
  position: fixed; right: 30px; bottom: 26px; z-index: 25;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(217, 180, 95, 0.25);
}

/* ==================================================================== MODALS */
.modal {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: rgba(5, 4, 8, 0.72); backdrop-filter: blur(4px);
}
.modal-card {
  background: linear-gradient(170deg, #191520, #0e0c12);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  width: min(1120px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
}
.modal-card.narrow { width: min(440px, calc(100vw - 48px)); padding: 26px; }
.modal-card.wide { }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--muted); padding: 6px 14px;
  cursor: pointer; font-size: 12px; letter-spacing: 0.1em; border-radius: 2px;
}
.tab.active { color: var(--gold-soft); border-color: var(--line); background: rgba(60, 48, 26, 0.3); }
.tab:hover { color: var(--ivory); }
.modal-body { overflow-y: auto; padding: 16px 18px; }
.modal-foot { border-top: 1px solid var(--line); padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.pause-title { font-family: var(--serif); margin: 0 0 6px; font-size: 22px; letter-spacing: 0.2em; color: var(--gold-soft); }
.pause-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

/* --- talent tree ---------------------------------------------------------- */
.tp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.tp-points { font-size: 12px; color: var(--muted); }
.tp-points b { color: var(--gold); font-size: 15px; font-family: var(--mono); }
.tp-class { font-family: var(--serif); font-size: 16px; letter-spacing: 0.1em; color: var(--ivory); }
.tp-class small { color: var(--muted-2); font-size: 11px; letter-spacing: 0.04em; font-family: var(--font); margin-left: 8px; }
.tree { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.branch { border: 1px solid var(--line); background: rgba(12, 10, 16, 0.55); padding: 10px; }
.branch-title { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); letter-spacing: 0.12em; margin-bottom: 8px; }
.branch-title b { color: var(--gold-soft); font-family: var(--serif); font-size: 13px; letter-spacing: 0.08em; }
.tier-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.node {
  position: relative; text-align: left; padding: 7px 8px; min-height: 60px;
  background: rgba(24, 20, 28, 0.9); border: 1px solid rgba(214, 178, 108, 0.12);
  color: var(--muted); cursor: pointer; font-size: 10.5px; line-height: 1.35; border-radius: 2px;
}
.node .nn { display: block; font-size: 11.5px; color: var(--ivory); margin-bottom: 2px; }
.node .nt { font-size: 9px; color: var(--muted-2); }
.node .ne { display: block; color: var(--muted-2); font-size: 9.5px; margin-top: 2px; }
.node.available { border-color: rgba(214, 178, 108, 0.45); box-shadow: 0 0 12px rgba(217, 180, 95, 0.08) inset; }
.node.available:hover { border-color: var(--gold); background: rgba(48, 38, 22, 0.6); }
.node.owned { border-color: var(--gold); background: rgba(62, 48, 24, 0.55); color: var(--gold-soft); }
.node.owned .nn { color: #ffe9c0; }
.node.owned::after { content: "已选"; position: absolute; top: 4px; right: 5px; font-size: 8px; color: var(--gold); }
.node.locked { opacity: 0.45; cursor: not-allowed; }
.node .req { position: absolute; bottom: 4px; right: 5px; font-size: 8.5px; color: var(--muted-2); }
.node:hover .node-tip { display: block; }
.node-tip {
  display: none; position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  width: 220px; background: rgba(8, 7, 11, 0.98); border: 1px solid var(--line-strong);
  padding: 8px 10px; font-size: 11px; color: var(--ivory); text-align: left;
}
.node-tip b { display: block; color: var(--gold); font-weight: 500; margin-bottom: 3px; }
.node-tip em { display: block; margin-top: 4px; color: var(--muted-2); font-style: normal; font-size: 10px; }
.tier-label { font-size: 9px; color: var(--muted-2); letter-spacing: 0.1em; margin: 6px 0 3px; }

/* --- character panel ------------------------------------------------------ */
.chr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chr-block { border: 1px solid var(--line); padding: 12px; background: rgba(12, 10, 16, 0.5); }
.chr-block h4 { margin: 0 0 8px; font-family: var(--serif); font-size: 13px; letter-spacing: 0.1em; color: var(--gold-soft); font-weight: 600; }
.stat-row { display: flex; justify-content: space-between; font-size: 11.5px; padding: 3px 0; border-bottom: 1px dotted rgba(214, 178, 108, 0.09); }
.stat-row span:first-child { color: var(--muted); }
.stat-row span:last-child { color: var(--ivory); font-variant-numeric: tabular-nums; }
.eq-slot { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px dotted rgba(214, 178, 108, 0.1); font-size: 11px; }
.eq-slot .slot-name { color: var(--muted-2); font-size: 10px; letter-spacing: 0.06em; }
.eq-item-name { color: var(--ivory); }
.eq-affix { color: var(--muted); font-size: 10.5px; }
.eq-empty { color: var(--muted-2); font-size: 11px; }
.tag-rarity { font-size: 9px; padding: 0 4px; border: 1px solid currentColor; margin-left: 5px; }
.beast-card { display: flex; gap: 12px; font-size: 11.5px; }
.beast-orb { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; flex: none; }
.beast-card p { margin: 2px 0; color: var(--muted); font-size: 11px; }
.beast-card b { color: #bfe8ff; font-weight: 500; }
.bond-list { font-size: 11.5px; }
.bond-list div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dotted rgba(214, 178, 108, 0.09); }
.bond-list .on { color: var(--jade); }
.bond-list .off { color: var(--muted-2); }

/* --- codex ---------------------------------------------------------------- */
.codex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.codex-card { border: 1px solid var(--line); padding: 12px; background: rgba(12, 10, 16, 0.5); font-size: 11.5px; }
.codex-card h4 { margin: 0 0 6px; font-family: var(--serif); color: var(--gold-soft); font-size: 13px; letter-spacing: 0.08em; }
.codex-card p { margin: 3px 0; color: var(--muted); }
.codex-card b { color: var(--ivory); font-weight: 500; }

/* =================================================================== SETTLE */
.settle-inner { max-width: 820px; margin: 0 auto; padding: 60px 24px; text-align: center; }
.settle-badge { font-family: var(--serif); font-size: 13px; letter-spacing: 0.4em; color: var(--gold); margin-bottom: 10px; }
.settle-badge.win { color: var(--gold-soft); }
.settle-badge.lose { color: var(--shu-bright); }
#settle-title { font-family: var(--serif); font-size: 40px; letter-spacing: 0.2em; margin: 0 0 8px; color: #f6e6c8; }
#settle-sub { font-size: 13px; margin: 0 0 28px; }
.settle-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.settle-stat { border: 1px solid var(--line); padding: 12px; background: rgba(18, 15, 22, 0.7); }
.settle-stat b { display: block; font-family: var(--mono); font-size: 22px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.settle-stat span { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.08em; }
.settle-party { text-align: left; border: 1px solid var(--line); margin-bottom: 20px; }
.settle-party .sp-row { display: grid; grid-template-columns: 1fr 80px 80px 90px; gap: 8px; padding: 7px 12px; font-size: 11.5px; border-bottom: 1px solid rgba(214, 178, 108, 0.07); }
.settle-party .sp-row:last-child { border-bottom: none; }
.settle-party .sp-head { color: var(--muted-2); font-size: 10px; letter-spacing: 0.1em; }
.settle-unlock { font-size: 12px; color: var(--jade); min-height: 22px; margin-bottom: 18px; }
.settle-actions { display: flex; gap: 10px; justify-content: center; }

/* ==================================================================== FATAL */
.fatal {
  position: fixed; inset: 0; z-index: 99; background: #0a080b; color: #ffb3a7;
  padding: 40px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow: auto;
}

/* ================================================================ RESPONSIVE */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: 260px 1fr 220px; }
  .class-grid { grid-template-columns: repeat(2, 1fr); }
  .level-grid { grid-template-columns: repeat(5, 1fr); }
  .lobby-bottom { grid-template-columns: 1fr; }
  #objective-panel { width: 260px; }
}
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr; }
  .mode-row { grid-template-columns: 1fr; }
  .right-top { display: none; }
  #objective-panel { display: none; }
  #bonds { display: none; }
  .bottombar { grid-template-columns: 1fr; }
  #vitals, #hints { display: none; }
  .tree { grid-template-columns: 1fr; }
  .chr-grid, .codex-grid { grid-template-columns: 1fr; }
  .brand { grid-template-columns: 1fr; }
  .brand-mark { display: none; }
}


/* ============================================================== NEW LOBBY */
.new-lobby { max-width: 900px; padding: 16px 20px 26px; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lobby-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark.mini { width: 46px; height: 46px; font-size: 17px; letter-spacing: 0.06em; }
.lobby-brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.lobby-brand-copy b { font-family: var(--serif); font-size: 20px; letter-spacing: 0.22em; color: #f6e6c8; }
.lobby-brand-copy span { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.38em; color: var(--gold-dim); }
.lobby-brand-copy em { font-style: normal; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.lobby-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; cursor: pointer;
  background: rgba(14, 12, 18, 0.72); border: 1px solid var(--line); border-radius: 2px;
  color: var(--muted); font-size: 11px; transition: 0.15s; position: relative;
}
.status-chip:hover { border-color: var(--line-strong); color: var(--ivory); }
.status-chip:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.status-chip.icon-only { font-size: 14px; line-height: 1; padding: 7px 9px; }
.status-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.status-meta b { font-size: 12px; color: var(--ivory); font-weight: 500; font-variant-numeric: tabular-nums; }
.status-meta small { font-size: 9px; color: var(--muted-2); letter-spacing: 0.06em; }
.status-ico { color: var(--gold); font-size: 13px; }
.status-chip .ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-size: 12px; color: #14100f; font-weight: 700;
  background: linear-gradient(160deg, #f0d69a, #b23a2e);
}
.avatar.big { width: 52px; height: 52px; font-size: 22px; }
.dot {
  position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--shu-bright); box-shadow: 0 0 8px rgba(226, 87, 74, 0.9);
}

/* hero ------------------------------------------------------------------- */
.lobby-hero {
  position: relative; margin: 14px 0 16px; border: 1px solid var(--line);
  height: clamp(280px, 38vh, 360px); overflow: hidden; display: flex; flex-direction: column;
  background:
    radial-gradient(680px 320px at 50% 118%, rgba(178, 58, 46, 0.28), transparent 70%),
    radial-gradient(520px 260px at 12% -10%, rgba(217, 180, 95, 0.14), transparent 70%),
    linear-gradient(180deg, #100d14, #08070b);
}
.lobby-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
}
.hero-scene { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding: 0 10px 4px; }
.hero-char { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: auto; padding-bottom: 2px; }
.hc-halo {
  position: absolute; bottom: 22px; width: 78%; max-width: 140px; height: 78%;
  border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 68%);
  opacity: 0.16; filter: blur(7px); animation: heroFloat 7s ease-in-out infinite;
}
.hero-char:nth-child(2) .hc-halo { animation-delay: -1.7s; }
.hero-char:nth-child(3) .hc-halo { animation-delay: -3.4s; }
.hero-char:nth-child(4) .hc-halo { animation-delay: -5.1s; }
@keyframes heroFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.hc-glyph {
  position: relative; z-index: 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; color: #14100f; font-weight: 700; background: var(--c);
  box-shadow: 0 0 18px var(--c); margin-bottom: -4px;
}
.hc-body {
  position: relative; z-index: 1; width: 62px; height: 92px; margin-bottom: 6px;
  border-radius: 48% 48% 16% 16% / 30% 30% 8% 8%;
  background: radial-gradient(circle at 50% 2%, var(--c), rgba(8, 7, 11, 0.94) 72%);
  border: 1px solid rgba(255, 255, 255, 0.05); opacity: 0.62;
}
.hc-name { position: relative; font-family: var(--serif); font-size: 14px; letter-spacing: 0.12em; color: #f1e9d8; }
.hc-role { position: relative; font-size: 9.5px; color: var(--muted-2); margin: 1px 0 5px; }
.hc-beast {
  position: relative; font-size: 9.5px; color: #bfe8ff; border: 1px solid rgba(143, 216, 255, 0.22);
  padding: 1px 6px; border-radius: 10px; background: rgba(20, 30, 40, 0.5);
}
.hero-caption { position: relative; z-index: 2; order: -1; padding: 14px 18px 4px; pointer-events: none; text-shadow: 0 2px 12px #000; flex: none; }
.hero-kicker { font-family: var(--mono); font-size: 9px; letter-spacing: 0.4em; color: var(--gold); opacity: 0.8; }
.hero-caption h2 { margin: 4px 0 4px; font-family: var(--serif); font-size: clamp(18px, 2.4vw, 26px); letter-spacing: 0.28em; color: #f6e6c8; font-weight: 600; }
.hero-caption p { margin: 0; font-size: 11.5px; color: var(--muted); }
.hero-watermark {
  position: absolute; right: 14px; top: 10px; font-family: var(--serif); font-size: 54px; line-height: 1;
  color: rgba(240, 214, 154, 0.06); letter-spacing: 0.1em; pointer-events: none;
}

/* mode cards ------------------------------------------------------------- */
.lobby-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card {
  position: relative; text-align: left; cursor: pointer; overflow: hidden;
  padding: 16px 16px 14px; border-radius: 3px; border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(34, 27, 24, 0.92), rgba(12, 10, 14, 0.96));
  color: var(--ivory); min-height: 116px; display: flex; flex-direction: column; transition: 0.15s;
}
.mode-card::after { content: ""; position: absolute; inset: auto -30% -70% 40%; height: 160px; filter: blur(34px); opacity: 0.3; border-radius: 50%; }
.mode-card.campaign { border-color: rgba(217, 180, 95, 0.34); }
.mode-card.campaign::after { background: radial-gradient(circle, #d9b45f, transparent 68%); }
.mode-card.versus { border-color: rgba(192, 80, 63, 0.4); }
.mode-card.versus::after { background: radial-gradient(circle, #c0503f, transparent 68%); }
.mode-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.mode-card:active { transform: scale(0.99); }
.mode-card:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.mc-badge { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.16em; color: var(--muted-2); }
.mode-card.campaign .mc-badge { color: var(--gold-dim); }
.mode-card.versus .mc-badge { color: #a86252; }
.mode-card b { display: block; font-family: var(--serif); font-size: 23px; letter-spacing: 0.2em; margin: 5px 0 4px; color: #f6e6c8; }
.mode-card small { font-size: 11px; color: var(--muted); line-height: 1.55; }
.mc-arrow { margin-top: auto; padding-top: 10px; font-size: 11px; letter-spacing: 0.1em; color: var(--gold-soft); }
.mode-card.versus .mc-arrow { color: #e0968a; }

/* secondary -------------------------------------------------------------- */
.lobby-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 0; }
.secondary-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer;
  padding: 11px 13px; background: rgba(18, 15, 22, 0.6); border: 1px solid var(--line);
  color: var(--ivory); border-radius: 2px; text-align: left; transition: 0.15s;
}
.secondary-btn:hover { border-color: var(--line-strong); }
.secondary-btn b { font-family: var(--serif); font-size: 13px; letter-spacing: 0.1em; font-weight: 500; }
.secondary-btn small { font-size: 10px; color: var(--muted-2); }
.new-lobby .lobby-foot { margin-top: 18px; align-items: center; }
.new-lobby .lobby-foot span { font-size: 10px; }

/* ================================================================== ROOM */
.room-inner { max-width: 820px; margin: 0 auto; padding: 18px 20px 28px; }
.room-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.room-title { display: flex; align-items: center; gap: 10px; }
.room-title b { font-family: var(--serif); font-size: 20px; letter-spacing: 0.18em; color: #f6e6c8; }
.mode-pill {
  font-size: 10px; letter-spacing: 0.12em; padding: 2px 8px; border-radius: 10px;
  border: 1px solid var(--line-strong); color: var(--gold-soft); background: rgba(60, 48, 26, 0.35);
}
.mode-pill.versus { color: #e8a99e; border-color: rgba(192, 80, 63, 0.5); background: rgba(60, 22, 18, 0.4); }
.room-code { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted-2); justify-self: end; }
#room-back { justify-self: start; }
.room-code b { font-family: var(--mono); font-size: 15px; letter-spacing: 0.22em; color: var(--gold-soft); }
.room-entry { padding-top: 18px; }
.room-h2 { font-family: var(--serif); font-size: 15px; letter-spacing: 0.14em; color: var(--gold-soft); margin: 0 0 12px; font-weight: 600; }
.room-options { display: flex; flex-direction: column; gap: 9px; }
.room-option {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; cursor: pointer;
  padding: 13px 15px; border: 1px solid var(--line); border-left: 2px solid var(--gold-dim);
  background: linear-gradient(90deg, rgba(217, 180, 95, 0.06), rgba(12, 10, 16, 0.7) 42%);
  color: var(--ivory); border-radius: 2px; transition: 0.15s;
}
.room-option:hover { border-color: var(--line-strong); border-left-color: var(--gold); transform: translateX(2px); }
.room-option b { grid-column: 1; grid-row: 1; font-family: var(--serif); font-size: 15px; letter-spacing: 0.1em; font-weight: 500; }
.room-option small { grid-column: 1; grid-row: 2; font-size: 10.5px; color: var(--muted-2); }
.room-option i { grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: end; font-style: normal; color: var(--gold); }
.room-note { font-size: 10.5px; color: var(--muted-2); line-height: 1.7; margin: 14px 0 0; }
.room-prepare { padding-top: 16px; }
.room-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.room-slot {
  border: 1px solid var(--line); background: rgba(14, 12, 18, 0.72); padding: 10px;
  display: flex; flex-direction: column; gap: 7px; min-height: 196px; position: relative;
}
.room-slot.me { border-color: rgba(217, 180, 95, 0.44); }
.room-slot.ready { box-shadow: 0 0 0 1px rgba(111, 183, 154, 0.3) inset; }
.rs-top { display: flex; align-items: center; gap: 8px; }
.rs-top .avatar { width: 30px; height: 30px; font-size: 13px; }
.rs-name { min-width: 0; }
.rs-name b { display: block; font-size: 11.5px; color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-name small { font-size: 9px; color: var(--muted-2); }
.rs-ready { margin-left: auto; font-size: 9.5px; color: var(--jade); white-space: nowrap; }
.rs-ready.off { color: var(--muted-2); }
.rs-class { font-family: var(--serif); font-size: 13px; letter-spacing: 0.08em; color: var(--gold-soft); }
.rs-beast { font-size: 9.5px; color: #bfe8ff; }
.class-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: auto; }
.class-pick button {
  font-size: 10px; padding: 4px 2px; cursor: pointer; background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line); color: var(--muted); border-radius: 2px;
}
.class-pick button:hover { color: var(--ivory); border-color: var(--line-strong); }
.class-pick button.on { color: #ffe9c0; border-color: var(--gold); background: rgba(60, 44, 24, 0.5); }
.rs-lock { font-size: 9.5px; color: var(--muted-2); margin-top: auto; }
.room-seed { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 10.5px; color: var(--muted-2); }
.room-seed input {
  flex: 1; max-width: 220px; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line);
  color: var(--ivory); padding: 6px 8px; font-family: var(--mono); font-size: 11px; outline: none;
}
.room-seed input:focus { border-color: var(--line-strong); }
.room-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.room-actions .primary { margin-left: auto; min-width: 190px; }
.room-actions .primary:disabled { filter: grayscale(0.6); }

/* join / forms ----------------------------------------------------------- */
.code-input {
  width: 100%; text-align: center; letter-spacing: 0.5em; text-transform: uppercase;
  font-family: var(--mono); font-size: 24px; padding: 12px; background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line-strong); color: var(--gold-soft); outline: none; margin: 10px 0 2px;
}
.code-input:focus { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217, 180, 95, 0.3) inset; }
.form-error { color: var(--shu-bright); font-size: 11px; margin: 6px 0 0; min-height: 14px; }
.modal-card .muted { font-size: 11.5px; line-height: 1.7; }

/* settings --------------------------------------------------------------- */
.settings-group { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 4px; }
.settings-row { display: grid; grid-template-columns: 84px 1fr 34px; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); }
.settings-row input[type="range"] { width: 100%; accent-color: var(--gold); }
.settings-row b { font-family: var(--mono); font-size: 11px; color: var(--gold-soft); text-align: right; font-variant-numeric: tabular-nums; }
.settings-row input#set-nickname {
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); color: var(--ivory);
  padding: 6px 8px; font-size: 12px; outline: none; border-radius: 2px;
}
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { background: transparent; border: 0; color: var(--muted); font-size: 11px; padding: 5px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: rgba(60, 48, 26, 0.6); color: #ffe9c0; }
.settings-note { font-size: 10px; color: var(--muted-2); line-height: 1.6; }
.settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.settings-actions button { width: 100%; }

/* profile ---------------------------------------------------------------- */
.profile-card { display: flex; align-items: center; gap: 12px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.profile-card b { font-family: var(--serif); font-size: 18px; letter-spacing: 0.1em; color: #f6e6c8; }
.profile-card p { margin: 4px 0 0; font-size: 10.5px; }

/* codex modal ------------------------------------------------------------ */
#codex-body .codex-grid { grid-template-columns: repeat(2, 1fr); }
.codex-class-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.codex-class-head .cc-glyph { width: 30px; height: 30px; font-size: 14px; }
.codex-class-head b { font-family: var(--serif); font-size: 15px; letter-spacing: 0.08em; }
.codex-class-head small { color: var(--muted-2); font-size: 9.5px; display: block; }
.codex-skill { display: flex; justify-content: space-between; gap: 8px; margin: 3px 0; }
.codex-skill span { color: var(--gold-dim); }
.codex-skill em { font-style: normal; color: var(--muted-2); font-size: 10px; text-align: right; }
.codex-ult { margin-top: 7px; padding-top: 7px; border-top: 1px dashed rgba(214, 178, 108, 0.16); font-size: 10.5px; color: var(--muted); }
.codex-ult b { color: var(--gold-soft); }
.ach-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(214, 178, 108, 0.08); font-size: 11.5px; }
.ach-row .ach-name { color: var(--ivory); }
.ach-row .ach-desc { display: block; font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.ach-row .ach-state { font-size: 10px; color: var(--muted-2); }
.ach-row .ach-state.on { color: var(--jade); }
.ach-row .ach-pts { font-family: var(--mono); color: var(--gold-soft); font-size: 11px; }
.ach-row.locked { opacity: 0.55; }
.skin-note { font-size: 10.5px; color: var(--muted-2); line-height: 1.7; }

/* help ------------------------------------------------------------------- */
.help-block { margin-bottom: 16px; }
.help-block h3 { font-family: var(--serif); font-size: 14px; letter-spacing: 0.12em; color: var(--gold-soft); margin: 0 0 8px; font-weight: 600; }
.help-block p { font-size: 11.5px; color: var(--muted); line-height: 1.8; margin: 4px 0; }
.help-grid { display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; font-size: 11.5px; }
.help-grid b { color: var(--ivory); font-weight: 500; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; }
.help-grid span { color: var(--muted); }
.help-callout { border-left: 2px solid var(--gold-dim); padding: 6px 10px; background: rgba(217, 180, 95, 0.05); font-size: 11px; color: var(--muted); }

/* onboarding ------------------------------------------------------------- */
.onboard-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.onboard-dots i { width: 22px; height: 3px; background: rgba(214, 178, 108, 0.18); display: block; }
.onboard-dots i.on { background: var(--gold); }
.onboard-body { min-height: 176px; text-align: center; }
.onboard-art { font-size: 34px; letter-spacing: 0.2em; color: var(--gold); margin: 6px 0 10px; }
.onboard-body h3 { font-family: var(--serif); font-size: 18px; letter-spacing: 0.14em; color: #f6e6c8; margin: 0 0 8px; font-weight: 600; }
.onboard-body p { font-size: 11.5px; color: var(--muted); line-height: 1.9; margin: 0; }
#onboarding .pause-actions { flex-direction: row; justify-content: flex-end; }

/* notices ---------------------------------------------------------------- */
.notices-body { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.notice-item { border: 1px solid var(--line); background: rgba(14, 12, 18, 0.7); padding: 9px 11px; font-size: 11.5px; color: var(--ivory); }
.notice-item small { display: block; color: var(--muted-2); font-size: 10px; margin-top: 3px; }
.notice-empty { font-size: 11.5px; color: var(--muted-2); text-align: center; padding: 22px 0; }

/* dev modal -------------------------------------------------------------- */
.dev-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; margin: 8px 0; font-size: 11.5px; color: var(--muted); }
.dev-row select {
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); color: var(--ivory);
  padding: 6px 8px; font-size: 11.5px; outline: none;
}
#dev-modal .pause-actions { flex-direction: row; flex-wrap: wrap; }
a#dev-fx { display: inline-flex; align-items: center; padding: 10px 16px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; letter-spacing: 0.08em; border-radius: 2px; text-decoration: none; }
a#dev-fx:hover { border-color: var(--line-strong); color: var(--ivory); }

/* quality ---------------------------------------------------------------- */
html[data-quality="low"] .hc-halo { animation: none; }
html[data-quality="low"] .lobby-hero::after { display: none; }
html[data-quality="low"] .mode-card::after { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hc-halo { animation: none; }
}

/* responsive ------------------------------------------------------------- */
@media (max-width: 720px) {
  #toasts { bottom: 216px; }
  .new-lobby, .room-inner { padding: 12px 14px 22px; }
  .lobby-top { align-items: flex-start; }
  .lobby-status { width: 100%; justify-content: space-between; }
  .status-meta small { display: none; }
  .lobby-hero { height: 300px; }
  .hc-body { width: 48px; height: 72px; }
  .hc-glyph { width: 28px; height: 28px; font-size: 12px; }
  .hc-name { font-size: 11.5px; }
  .hc-role { display: none; }
  .hero-caption { padding: 12px 14px 2px; }
  .hero-caption h2 { font-size: 17px; letter-spacing: 0.18em; }
  .hero-caption p { font-size: 10.5px; }
  .mode-card { min-height: 108px; padding: 13px 12px 12px; }
  .mode-card b { font-size: 19px; letter-spacing: 0.12em; }
  .mode-card small { font-size: 10px; }
  .room-head { grid-template-columns: auto 1fr; }
  .room-title { justify-self: start; }
  .room-code { grid-column: 1 / -1; justify-content: flex-end; }
  .room-slots { grid-template-columns: 1fr 1fr; }
  .room-actions .primary { min-width: 150px; }
}
@media (max-width: 420px) {
  .lobby-status { gap: 4px; }
  .status-chip { padding: 4px 7px; }
  .lobby-modes { gap: 8px; }
  .mode-card small { display: none; }
  .secondary-btn small { display: none; }
}

/* ---- 角色序列帧立绘（格温 / 薇拉 / 科格 / 莉泽） ---- */
.hc-portrait {
  position: relative; z-index: 1;
  width: 118px; height: 118px;
  object-fit: contain;
  margin-bottom: -2px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.72));
  pointer-events: none;
}
.avatar.avatar-portrait { padding: 0; overflow: hidden; background: #17141a; }
.avatar.avatar-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.12); }
.party-glyph.party-portrait { padding: 0; overflow: hidden; background: #17141a; }
.party-glyph.party-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transform: scale(1.18); }
.cmap-glyph.cmap-portrait { padding: 0; overflow: hidden; background: #17141a; }
.cmap-glyph.cmap-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transform: scale(1.18); }
.cc-glyph.cc-portrait { padding: 0; overflow: hidden; background: #17141a; }
.cc-glyph.cc-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; transform: scale(1.15); }
@media (max-width: 720px) {
  .hc-portrait { width: 82px; height: 82px; }
}

.tac-count { position: absolute; bottom: 1px; left: 5px; font-size: 9px; color: #ffe08a; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px #000; }


.quest-guide { margin-top: 10px; padding: 7px 9px; border-left: 2px solid rgba(217,180,95,.65); background: rgba(217,180,95,.06); font-size: 11px; color: #d8cbb2; line-height: 1.6; }
.quest-guide b { color: #f0d28a; margin-right: 6px; }
.quest-guide em { float: right; color: #9c9288; font-style: normal; font-variant-numeric: tabular-nums; }
.quest-guide i { display: block; margin-top: 2px; color: #9c9288; font-style: normal; font-size: 10px; }
.quest-guide span { color: #f1e9d8; }

