/* ==========================================================================================
   farewell.css — the farewell page (standalone folder). Self-contained on purpose: the folder
   must keep rendering wherever it is hosted, so the design tokens are copied verbatim from
   the game's theme.css and the panel / table / button styles are ported from the game's
   stats.css and components.css (adapted sizes keep the max(rem, Npx) floors the game uses on
   small screens). 1rem = 100 design px @ 1920×1080.
   ========================================================================================== */

:root {
  color-scheme: dark;

  /* surfaces (theme.css :13-37) */
  --bg-0: #0c0f0e;
  --bg-1: #141816;
  --bg-2: #1e2421;
  --line: #2f3a35;
  --line-2: #3e4b45;
  --line-3: #58675f;

  /* accents (theme.css, official hex values) */
  --mint-500: #4ed8af;
  --mint-400: #59f4ca;
  --mint-glow: #17f9b7;
  --mint-700: #2a9e7f;
  --mint-800: #145443;
  --mint-900: #0d2c24;
  --mint-a10: rgba(78, 216, 175, .10);
  --mint-a20: rgba(78, 216, 175, .20);
  --gold: #ffc600;
  --amber: #f6a329;
  --orange: #e85a1a;
  --orange-hi: #ff7a33;
  --red: #e73118;
  --red-abyss: #ff0024;
  --red-premium: #ff5454;
  --ice: #9fd4ff;

  /* text (theme.css :54-59) */
  --text-hi: #f2f2f2;
  --text-md: #c3cbc7;
  --text-lo: #8a948f;
  --text-dim: #5d6863;
  --text-on-mint: #06110d;

  /* difficulty (shared/constants.js DIFFICULTY_COLORS) */
  --diff-funny: #f6a329;
  --diff-normal: #e85a1a;
  --diff-hard: #e73118;
  --diff-abyss: #ff0024;

  /* type (theme.css :84-89) */
  --cjk-faces: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC';
  --font-cjk: var(--cjk-faces), sans-serif;
  --font-num: 'Bender', 'Rajdhani', 'Oxanium', var(--cjk-faces), sans-serif;
  --font-display: 'Novecento', 'Novecento Wide', 'Oxanium', 'Rajdhani', var(--cjk-faces), sans-serif;

  /* motion (theme.css :92-96) */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.6, 0, .3, 1);
  --t-fast: 150ms;
  --t-med: 200ms;
  --t-slow: 250ms;

  /* bracket corners (theme.css :107-110) */
  --bk-c: var(--mint-500);
  --bk-l: .14rem;
  --bk-w: 2px;

  /* text root (theme.css :151): the font sizes carry it like the game's styles do */
  --t: 1rem;
}

/* root scale (theme.css :120-135): 1rem = 100 design px at 1920×1080, clamped so it never
   drops under the CJK minimum-font-size territory */
html {
  font-size: clamp(40px, min(calc(100vw / 19.2), calc(100vh / 10.8)), 240px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@supports (height: 100svh) {
  html { font-size: clamp(40px, min(calc(100vw / 19.2), calc(100svh / 10.8)), 240px); }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: var(--font-cjk);
  font-size: calc(.18 * var(--t));
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
/* a data page: everything is selectable, unlike the game UI */
input, textarea, .fw-page { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
button, .fw-link, .st-tab { -webkit-user-select: none; user-select: none; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--mint-400); text-decoration: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 2px; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); }
::-webkit-scrollbar-thumb:hover { background: var(--mint-700); }

/* ---- typography helpers (theme.css :201-222) --------------------------------------------- */
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.micro {
  font-family: var(--font-display);
  font-size: max(.11rem, 9px);
  line-height: 1.4;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.micro--mint { color: var(--mint-700); }
.micro--gold { color: #9c7c16; }
.icon { fill: currentColor; flex: none; display: inline-block; vertical-align: middle; width: 1em; height: 1em; }

/* ---- global backdrop (theme.css .app-bg :267-298, as a fixed body layer) ------------------ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(78, 216, 175, .045) 1px, transparent 1px) 0 0 / .8rem .8rem,
    linear-gradient(90deg, rgba(78, 216, 175, .045) 1px, transparent 1px) 0 0 / .8rem .8rem,
    radial-gradient(120% 80% at 50% 110%, rgba(23, 249, 183, .10), transparent 55%),
    radial-gradient(80% 60% at 50% 40%, rgba(40, 60, 52, .35), transparent 70%),
    linear-gradient(180deg, #0b0e0d 0%, #0e1311 55%, #0a0d0c 100%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 3px),
    radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, .65) 100%);
  opacity: .9;
}

/* ---- page frame --------------------------------------------------------------------------- */
.fw-page {
  max-width: max(13.4rem, 900px);
  margin: 0 auto;
  padding: .56rem .28rem .44rem;
}
.fw-boot {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .24rem;
  color: var(--text-lo);
}

/* ---- hero --------------------------------------------------------------------------------- */
.fw-hero { position: relative; padding: .06rem 0 .16rem; }
.fw-hero__head { display: flex; align-items: flex-start; gap: .36rem; }
.fw-emblem { width: .74rem; height: .56rem; margin-top: .1rem; color: var(--mint-500); flex: none; filter: drop-shadow(0 0 .1rem rgba(78, 216, 175, .35)); }
.fw-hero__titles { min-width: 0; display: grid; gap: .16rem; }
.fw-title {
  font-size: max(.5rem, 28px);
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.25;
  color: var(--text-hi);
  text-shadow: 0 0 .18rem rgba(23, 249, 183, .25);
}
.fw-lead { max-width: 46em; font-size: max(.18rem, 13px); line-height: 2; color: var(--text-md); }
.fw-hero__acts { display: flex; align-items: center; flex-wrap: wrap; gap: .28rem; margin: .36rem 0 .1rem; }
.fw-notice {
  display: flex; align-items: center; flex-wrap: wrap; gap: .16rem;
  margin: .3rem 0 .02rem; padding: .1rem .22rem;
  background: linear-gradient(90deg, rgba(78, 216, 175, .08), transparent 78%);
  border-left: 2px solid rgba(78, 216, 175, .55);
}
.fw-notice__icon { color: var(--mint-400); }
.fw-notice__body { flex: 1 1 24em; min-width: 0; font-size: max(.17rem, 12px); line-height: 1.8; color: var(--text-md); }
.fw-notice__body a { color: var(--mint-400); border-bottom: 1px dashed rgba(78, 216, 175, .5); }
.fw-hero__hint { flex: 1 1 22em; min-width: 0; font-size: max(.15rem, 11px); line-height: 1.85; color: var(--text-lo); }

/* ---- links -------------------------------------------------------------------------------- */
.fw-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .16rem; margin: .34rem 0 .14rem; }
.fw-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .2rem;
  min-width: 0;
  padding: .2rem .22rem;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  color: var(--text-md);
  transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.fw-link:hover { border-color: var(--mint-700); background: var(--mint-a10); box-shadow: 0 0 .18rem rgba(78, 216, 175, .25); }
.fw-link__icon { display: grid; place-items: center; width: .54rem; height: .54rem; flex: none; background: var(--mint-900); color: var(--mint-400); }
.fw-link__icon .icon { width: .26rem; height: .26rem; }
.fw-link__body { min-width: 0; display: grid; gap: .06rem; }
.fw-link__body b { font-size: max(.2rem, 13px); color: var(--text-hi); letter-spacing: .05em; }
.fw-link__body > span { font-size: max(.14rem, 11px); line-height: 1.75; color: var(--text-lo); }
.fw-link__body .micro { margin-top: .03rem; }
.fw-link__go { margin-left: auto; color: var(--text-dim); flex: none; }
.fw-link:hover .fw-link__go { color: var(--mint-400); }

/* ---- the panel (the game's stats.css .st, adapted to flow) -------------------------------- */
.panel {
  position: relative;
  margin: .24rem 0 .36rem;
  background: var(--bg-0);
  border: 1px solid var(--line);
}
.panel__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 90% at 18% 10%, rgba(78, 216, 175, .07), transparent 60%),
    radial-gradient(60% 70% at 100% 100%, rgba(246, 163, 41, .05), transparent 60%),
    linear-gradient(rgba(78, 216, 175, .035) 1px, transparent 1px) 0 0 / .6rem .6rem,
    linear-gradient(90deg, rgba(78, 216, 175, .035) 1px, transparent 1px) 0 0 / .6rem .6rem,
    linear-gradient(180deg, #0f1312, #090b0a);
}
.panel-note, .panel-tabs, .panel-body { position: relative; }
.panel-note {
  display: flex; align-items: flex-start; gap: .1rem; margin: 0; padding: .12rem .24rem;
  font-size: max(.15rem, 11px); line-height: 1.8; color: var(--text-lo);
  background: linear-gradient(90deg, rgba(78, 216, 175, .08), transparent 70%);
  border-bottom: 1px solid rgba(47, 58, 53, .6);
}
.panel-note .icon { color: var(--mint-500); margin-top: .03rem; }
.panel-note.is-warn { color: var(--amber); background: linear-gradient(90deg, rgba(246, 163, 41, .12), transparent 70%); }
.panel-note.is-warn .icon { color: var(--amber); }
.panel-note b { color: var(--amber); }

.panel-tabs {
  display: flex; align-items: stretch; gap: .06rem;
  padding: 0 .24rem;
  background: linear-gradient(180deg, rgba(8, 10, 9, .95), rgba(10, 13, 12, .6));
  border-bottom: 1px solid var(--line);
}
.panel-tabs::after {
  content: ''; position: absolute; left: .24rem; right: .24rem; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, var(--mint-700), transparent 26%, transparent 74%, var(--mint-700));
}
.st-tab {
  display: inline-flex; align-items: baseline; gap: .08rem;
  padding: .17rem .22rem .14rem;
  font-size: max(.26rem, 14px); font-weight: 900; letter-spacing: .1em; line-height: 1.2;
  color: var(--text-lo); background: transparent; border: 0; border-bottom: 2px solid transparent;
  touch-action: manipulation; white-space: nowrap;
}
.st-tab:hover { color: var(--text-hi); }
.st-tab.is-on { color: var(--text-hi); border-bottom-color: var(--mint-500); }
.st-tab__micro { font-family: var(--font-display); font-size: max(.1rem, 8px); letter-spacing: .14em; color: var(--text-dim); font-weight: 400; }
.st-tab.is-on .st-tab__micro { color: var(--mint-700); }
.panel-tabs__right { margin-left: auto; display: flex; align-items: center; }

.panel-body { padding: .28rem .28rem .42rem; }

/* ---- buttons (components.css .btn, ported) ------------------------------------------------ */
.btn {
  --btn-bg: #1a201d;
  --btn-bg-hover: #222a26;
  --btn-fg: var(--text-hi);
  --btn-bd: var(--line-2);
  --btn-bd-hover: var(--mint-700);
  --btn-glow: rgba(78, 216, 175, .25);
  --bk-c: var(--mint-500);
  --bk-l: .1rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  height: .5rem;
  min-width: .5rem;
  padding: 0 .28rem;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: calc(.18 * var(--t));
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  white-space: nowrap;
  outline-offset: 3px;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(var(--bk-c), var(--bk-c)) top left / var(--bk-l) 2px no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) top left / 2px var(--bk-l) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) top right / var(--bk-l) 2px no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) top right / 2px var(--bk-l) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) bottom left / var(--bk-l) 2px no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) bottom left / 2px var(--bk-l) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) bottom right / var(--bk-l) 2px no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) bottom right / 2px var(--bk-l) no-repeat;
  transform: scale(1.04);
  transition: opacity var(--t-fast) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.btn:not(:disabled):hover {
  background-color: var(--btn-bg-hover);
  border-color: var(--btn-bd-hover);
  box-shadow: 0 0 .18rem var(--btn-glow);
}
.btn:not(:disabled):hover::after { opacity: 1; transform: scale(1); }
.btn:focus-visible::after { opacity: 1; transform: scale(1); }
@media (hover: none) { .btn:not(:disabled):hover::after { opacity: 0; transform: none; } }
.btn:not(:disabled):active { transform: translateY(1px); filter: brightness(.94); }
.btn:disabled { opacity: .45; cursor: default; }
.btn .icon { width: 1.15em; height: 1.15em; }

/* filled variants carry a hatch strip on the right end (components.css :86-106) */
.btn--primary, .btn--danger {
  background-image:
    repeating-linear-gradient(-55deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 45%);
  background-size: .34rem 100%, 100% 100%;
  background-position: right center, 0 0;
  background-repeat: no-repeat;
}
.btn--primary {
  --btn-bg: var(--mint-500);
  --btn-bg-hover: var(--mint-400);
  --btn-fg: var(--text-on-mint);
  --btn-bd: #6fe8c4;
  --btn-bd-hover: #9dffe2;
  --btn-glow: rgba(23, 249, 183, .45);
  --bk-c: var(--mint-400);
}
.btn--danger {
  --btn-bg: var(--red);
  --btn-bg-hover: #ff4a30;
  --btn-fg: #fff;
  --btn-bd: #ff6a52;
  --btn-bd-hover: #ff8a70;
  --btn-glow: rgba(231, 49, 24, .45);
  --bk-c: var(--red-premium);
}
.btn--lg { height: .6rem; padding: 0 .4rem; font-size: calc(.21 * var(--t)); }
.btn--sm { height: max(.4rem, 30px); padding: 0 max(.2rem, 10px); font-size: max(.16rem, 11px); }

/* ---- toasts (the game's toasts style, minimal) -------------------------------------------- */
.toast-host {
  position: fixed;
  top: .2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: grid;
  gap: .08rem;
  justify-items: center;
  pointer-events: none;
}
.toast {
  max-width: max(9rem, 480px);
  padding: .12rem .28rem;
  font-size: max(.16rem, 11px);
  color: var(--text-hi);
  background: rgba(10, 14, 13, .95);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 .2rem rgba(0, 0, 0, .5);
  animation: toast-in 200ms var(--ease-out);
}
.toast--success { border-color: var(--mint-700); color: var(--mint-400); }
.toast--warn { border-color: var(--amber); color: var(--amber); }
.toast--error { border-color: var(--red-premium); color: var(--red-premium); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-.1rem); } }

/* ---- confirm dialog (components.css .modal, minimal) -------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(3, 5, 4, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modal-in 160ms var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; } }
.modal__box {
  position: relative;
  width: min(5.8rem, calc(100vw - 32px));
  padding: .34rem .34rem .28rem;
  background: linear-gradient(180deg, #141816, #101413);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 .3rem rgba(0, 0, 0, .6);
}
.modal__stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: .06rem;
  background: repeating-linear-gradient(-55deg, var(--red) 0 8px, transparent 8px 14px);
  opacity: .7;
}
.modal__title { display: flex; align-items: baseline; gap: .14rem; font-size: max(.26rem, 15px); letter-spacing: .06em; }
.modal__text { margin: .16rem 0 .24rem; font-size: max(.17rem, 12px); line-height: 1.85; color: var(--text-md); }
.modal__acts { display: flex; justify-content: flex-end; gap: .14rem; }

/* ---- overview cards / tables (screens/stats.css, ported) ---------------------------------- */
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(1.6rem, 104px), 1fr)); gap: .12rem; margin-bottom: .24rem; }
.st-card {
  display: flex; flex-direction: column; gap: .05rem; min-width: 0; padding: .14rem .18rem .12rem;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
}
.st-card--mint { border-color: var(--mint-800); background: var(--mint-a10); }
.st-card--gold { border-color: rgba(246, 163, 41, .45); background: rgba(246, 163, 41, .07); }
.st-card__num { font-size: max(.32rem, 19px); font-weight: 900; line-height: 1.2; color: var(--text-hi); overflow-wrap: anywhere; }
.st-card--mint .st-card__num { color: var(--mint-400); }
.st-card--gold .st-card__num { color: var(--amber); }
.st-card__label { font-size: max(.15rem, 11px); color: var(--text-md); letter-spacing: .06em; }

.st-tablewrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: max(.18rem, 12px); }
.st-table th {
  padding: .09rem .14rem; text-align: left; font-size: max(.15rem, 11px); font-weight: 600; letter-spacing: .08em;
  color: var(--text-lo); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.st-table td { padding: .11rem .14rem; color: var(--text-md); border-bottom: 1px solid var(--line); vertical-align: middle; }
.st-table th.num, .st-table td.num { text-align: right; }
.st-table tbody tr:hover td { background: rgba(78, 216, 175, .05); }
.st-table td.st-diff { color: var(--d-color, var(--text-md)); font-weight: 700; white-space: nowrap; }
.st-band { display: inline-flex; align-items: center; gap: .06rem; color: var(--text-hi); white-space: nowrap; vertical-align: middle; }
.st-t { font-family: var(--font-num); font-size: max(.16rem, 11px); color: var(--text-lo); white-space: nowrap; }

.st-res { white-space: nowrap; }
.t-win { color: var(--mint-400); font-weight: 800; }
.t-lose { color: var(--red-premium); font-weight: 800; }
.t-quit { color: var(--amber); font-weight: 800; }
.st-chip {
  display: inline-block; margin-left: .08rem; padding: .01rem .08rem; font-style: normal; font-size: max(.13rem, 10px); letter-spacing: .04em;
  color: var(--text-lo); border: 1px solid var(--line-2); white-space: nowrap;
}
.st-chip.is-modded { color: #ff8a5c; border-color: rgba(255, 106, 61, .55); }
.st-table tbody.is-excluded td { opacity: .6; }
.st-table tr.is-clickable { cursor: pointer; }
.st-table tr.is-clickable:hover td, .st-table tr.is-clickable:focus-visible td { background: rgba(78, 216, 175, .1); color: var(--text-hi); }
.st-go { width: .28rem; color: var(--text-lo); text-align: center; }
.st-go .icon { width: max(.16rem, 12px); height: max(.16rem, 12px); transition: transform var(--t-fast) var(--ease-out); }
.st-go .icon.is-open { transform: rotate(90deg); color: var(--mint-400); }
.st-acts { white-space: nowrap; text-align: right; }
.st-favbtn { color: var(--text-dim); font-size: max(.18rem, 13px); line-height: 1; }
.st-favbtn.is-on { color: var(--gold); }
.st-detail td { background: rgba(10, 14, 13, .6); }
.st-detail__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(1.4rem, 100px), 1fr)); gap: .1rem .2rem; padding: .12rem .12rem .06rem; }
.st-detail__grid span { display: flex; align-items: baseline; justify-content: space-between; gap: .12rem; border-bottom: 1px dashed rgba(47, 58, 53, .5); padding: .05rem 0; }
.st-detail__grid small { color: var(--text-dim); font-size: max(.14rem, 11px); white-space: nowrap; }
.st-detail__grid b { font-weight: 700; color: var(--text-md); font-size: max(.16rem, 12px); overflow-wrap: anywhere; text-align: right; }
.st-detail__lineup { display: flex; align-items: center; flex-wrap: wrap; gap: .08rem; padding: .1rem .12rem .04rem; }
.st-detail__cap { font-size: max(.14rem, 11px); color: var(--text-dim); letter-spacing: .08em; margin-right: .08rem; }
.st-unit {
  position: relative; display: inline-flex; align-items: center; padding: .04rem .12rem;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  font-size: max(.15rem, 11px); color: var(--text-md); white-space: nowrap;
}
.st-unit.is-golden { border-color: rgba(246, 163, 41, .55); color: var(--amber); }
.st-unit__tier { font-style: normal; margin-left: .06rem; font-family: var(--font-display); font-size: max(.12rem, 10px); color: var(--text-dim); }
.st-detail__note { padding: .08rem .12rem; font-size: max(.14rem, 11px); color: var(--text-dim); }
.st-more { display: flex; justify-content: center; margin: .18rem 0 0; }
.st-histbar { display: flex; justify-content: flex-end; margin: .1rem 0 .04rem; }
.st-favfilter {
  display: inline-flex; align-items: center; gap: .06em; padding: .06rem .16rem; background: none; border: 1px solid var(--line);
  color: var(--text-lo); font-size: max(.14rem, 11px); letter-spacing: .06em;
}
.st-favfilter:hover { color: var(--text-hi); border-color: var(--line-3); }
.st-favfilter.is-on { color: var(--gold); border-color: var(--gold); }
.st-hint { margin: .14rem 0 0; font-size: max(.14rem, 11px); line-height: 1.8; color: var(--text-lo); letter-spacing: .03em; }
.st-empty { margin: .7rem auto; text-align: center; font-size: max(.22rem, 14px); color: var(--text-lo); letter-spacing: .05em; padding: 0 .24rem; line-height: 1.9; }
.st-mode-unknown { margin: .08rem 0 0; font-size: max(.15rem, 11px); line-height: 1.5; color: rgba(116, 146, 140, .8); }
.st-sec-h { display: flex; align-items: baseline; gap: .14rem; margin: .3rem 0 .08rem; padding-top: .14rem; border-top: 1px solid rgba(47, 58, 53, .6); flex-wrap: wrap; }
.st-sec-h .ach-bar__title { font-size: max(.24rem, 15px); font-weight: 800; letter-spacing: .1em; color: var(--text-hi); }
.st-export-acts { margin-left: auto; display: flex; gap: .1rem; }
.st-note-inline {
  display: flex; align-items: flex-start; gap: .1rem; margin: 0 0 .2rem; padding: .14rem .18rem;
  font-size: max(.16rem, 12px); line-height: 1.9; color: var(--text-lo);
  background: linear-gradient(90deg, rgba(78, 216, 175, .08), transparent 70%);
  border: 1px solid rgba(47, 58, 53, .6);
}
.st-note-inline .icon { color: var(--mint-500); margin-top: .05rem; }
.st-note-inline b { color: var(--amber); white-space: nowrap; }

/* ---- the plate & achievements (screens/lobby.css .ach-*, adapted) ------------------------- */
.ach-plate-area { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: .3rem; margin: .06rem 0 .28rem; }
.ach-plate { min-width: 0; display: grid; gap: .16rem; }
.ach-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: .22rem;
  padding: .2rem .24rem;
  background: linear-gradient(100deg, rgba(78, 216, 175, .10), rgba(255, 255, 255, .03) 55%);
  border: 1px solid var(--line);
  overflow: hidden;
}
.ach-card__ava { position: relative; flex: none; }
.ach-card__glyph {
  display: grid; place-items: center; width: .66rem; height: .66rem;
  background: var(--mint-900); border: 1px solid var(--mint-800);
  font-size: max(.34rem, 18px); font-weight: 900; color: var(--mint-400);
}
.ach-card__lv {
  position: absolute; top: -.08rem; left: -.12rem;
  display: flex; align-items: baseline; gap: .03rem;
  padding: .03rem .09rem;
  background: var(--bg-2); border: 1px solid var(--line-2);
}
.ach-card__lv b { font-size: max(.17rem, 11px); color: var(--mint-400); }
.ach-card__lv small { font-size: max(.1rem, 8px); color: var(--text-dim); }
.ach-card__who { min-width: 0; display: grid; gap: .05rem; }
.ach-card__name { font-size: max(.27rem, 16px); font-weight: 800; letter-spacing: .05em; overflow-wrap: anywhere; }
.ach-card__id { font-size: max(.14rem, 11px); color: var(--text-lo); }
.ach-card__brand {
  position: absolute; right: .16rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-size: max(.15rem, 11px); line-height: 1.25; letter-spacing: .22em;
  color: rgba(220, 230, 226, .22); text-align: right; pointer-events: none;
}
.ach-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(1.4rem, 100px), 1fr)); gap: .08rem; }
.ach-counts__row {
  display: flex; align-items: center; justify-content: space-between; gap: .12rem;
  padding: .12rem .16rem; background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
}
.ach-counts__row small { display: inline-flex; align-items: center; gap: .06rem; font-size: max(.14rem, 11px); color: var(--text-md); white-space: nowrap; }
.ach-counts__row small .icon { color: var(--mint-500); }
.ach-counts__row b { font-size: max(.22rem, 13px); color: var(--mint-400); white-space: nowrap; }

.ach-modes { min-width: 0; }
.ach-modes__row { display: grid; grid-template-columns: max-content repeat(3, 1fr); align-items: center; background: rgba(106, 106, 106, .08); }
.ach-modes__row + .ach-modes__row { margin-top: 2px; }
.ach-modes__mode {
  display: flex; align-items: center; gap: .1rem; padding: .16rem .18rem;
  background: rgba(77, 255, 216, .08); color: #459181; font-size: max(.17rem, 12px); font-weight: 800; white-space: nowrap;
}
.ach-modes__mode .icon { width: max(.19rem, 13px); height: max(.19rem, 13px); }
.ach-modes__cell { display: grid; gap: .02rem; padding: .13rem .18rem; border-left: 1px solid rgba(48, 105, 91, .2); }
.ach-modes__cell b { font-size: max(.3rem, 17px); font-weight: 500; line-height: 1.15; color: #40eec9; }
.ach-modes__cell small { font-size: max(.14rem, 11px); line-height: 1.4; color: rgba(116, 146, 140, .8); white-space: nowrap; }

/* the hexagon (screens/lobby.css .ach-hex, verbatim geometry) */
.ach-hex { position: relative; min-height: 5rem; min-width: 0; }
.ach-hex__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 .14rem rgba(74, 242, 196, .3)); }
.ach-hex__seg polygon { fill: #5cd3b2; stroke: rgba(225, 255, 246, .32); stroke-width: 1.5; stroke-linejoin: round; }
.ach-hex__ticks line { stroke: rgba(8, 48, 38, .34); stroke-width: 2; }
.ach-hex__hub { fill: #0b100f; stroke: rgba(8, 48, 38, .7); stroke-width: 5; }
.ach-hex__seg { animation: ach-seg 380ms var(--ease-out) calc(60ms + var(--i) * 50ms) both; transform-origin: 0 0; }
@keyframes ach-seg { from { opacity: 0; transform: scale(.72); } }
.ach-hex__cap {
  position: absolute; left: .1rem; top: 0; display: grid; grid-template-columns: auto auto; column-gap: .08rem; align-items: center;
  font-family: var(--font-display); font-size: max(.14rem, 10px); letter-spacing: .04em; color: rgba(220, 230, 226, .3); white-space: nowrap; pointer-events: none;
}
.ach-hex__cap i { width: .06rem; height: .06rem; background: var(--mint-400); }
.ach-hex__cap small { grid-column: 2; width: .5rem; height: .08rem; margin-top: .04rem; background: rgba(74, 242, 196, .4); }
.ach-hex__label {
  position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; line-height: 1.3;
  white-space: nowrap; isolation: isolate;
  animation: ach-pop 320ms var(--ease-out) calc(180ms + var(--i) * 50ms) both;
}
.ach-hex__label b {
  position: relative; padding: 0 .12rem; font-family: var(--font-display); font-size: max(.3rem, 17px); color: #dafff4; font-weight: 600;
  text-shadow: 0 0 .08rem rgba(74, 242, 196, .9);
}
.ach-hex__label b::before {
  content: ''; position: absolute; z-index: -1; inset: 18% -4%; border-radius: .2rem;
  background: rgba(74, 242, 196, .26); filter: blur(.05rem);
}
.ach-hex__label span { font-size: max(.19rem, 12px); color: #dfe6e3; }
@keyframes ach-pop { from { opacity: 0; transform: translateY(.12rem); } }

/* section bars (screens/lobby.css .ach-bar, adapted) */
.ach-bar {
  position: relative; display: flex; align-items: center; gap: .2rem; height: .58rem; margin: .48rem 0 .26rem;
  padding: 0 .26rem 0 1rem;
  background: linear-gradient(90deg, rgba(150, 160, 158, .34), rgba(110, 120, 118, .2) 70%, rgba(110, 120, 118, .1));
}
.ach-bar::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .4;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 7px);
}
.ach-bar__icon {
  position: absolute; left: .16rem; top: -.14rem; width: .58rem; height: .66rem; display: grid; place-items: center;
  background: #2b302f; box-shadow: 0 0 0 2px rgba(200, 210, 206, .32); color: #eef3f1;
}
.ach-bar__icon .icon { width: .3rem; height: .3rem; }
.ach-bar__title { position: relative; z-index: 1; font-size: max(.28rem, 16px); font-weight: 800; color: #f2f6f5; letter-spacing: .06em; }
.ach-bar__micro { position: relative; z-index: 1; margin-left: auto; line-height: 1.2; color: rgba(220, 230, 226, .5); }

/* achievement marks (screens/lobby.css .ach-mark) */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(3rem, 260px), 1fr)); gap: .12rem .24rem; }
.ach-sub { margin: .26rem 0 .14rem; font-size: max(.19rem, 12px); font-weight: 700; color: #b9c2bf; letter-spacing: .04em; }
.ach-sub::before { content: '-'; margin-right: .14rem; }
.ach-empty { margin: .1rem 0 .1rem .32rem; font-size: max(.18rem, 12px); line-height: 1.8; color: #7d8784; }
.ach-mark { position: relative; display: flex; align-items: center; gap: .14rem; padding: .11rem .12rem; }
.ach-mark--row { min-height: .62rem; }
.ach-mark__frame {
  position: relative; display: grid; place-items: center; width: .46rem; height: .46rem; flex: none;
  background: rgba(12, 18, 17, .7); box-shadow: inset 0 0 0 2px rgba(200, 210, 206, .3); color: #cfd8d4;
}
.ach-mark__frame .icon { width: .24rem; height: .24rem; }
.ach-mark.is-done .ach-mark__frame { box-shadow: inset 0 0 0 2px var(--mint-700); color: var(--mint-400); }
.ach-mark__badge {
  position: absolute; right: -.09rem; bottom: -.09rem; display: grid; place-items: center; width: .2rem; height: .2rem;
  background: var(--mint-500); color: var(--text-on-mint);
}
.ach-mark__badge .icon { width: .13rem; height: .13rem; }
.ach-mark--chip .ach-mark__frame { width: .56rem; height: .56rem; }
.ach-mark__text { min-width: 0; flex: 1; display: grid; gap: .03rem; }
.ach-mark__text b { font-size: max(.18rem, 12px); color: var(--text-md); letter-spacing: .04em; }
.ach-mark.is-done .ach-mark__text b { color: var(--text-hi); }
.ach-mark__text small { font-size: max(.14rem, 11px); line-height: 1.6; color: var(--text-dim); }
.ach-mark__got { font-size: max(.14rem, 11px); color: var(--mint-400); letter-spacing: .08em; }
.ach-mark__bar {
  position: relative; display: flex; align-items: center; height: .15rem; margin-top: .04rem;
  background: rgba(0, 0, 0, .45); border: 1px solid var(--line);
}
.ach-mark__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint-700), var(--mint-500)); }
.ach-mark__bar em { position: absolute; right: .05rem; top: 50%; transform: translateY(-50%); font-style: normal; font-size: max(.12rem, 9px); color: var(--text-md); background: rgba(5, 8, 7, .85); padding: 0 .07rem; text-shadow: none; }
.ach-marks { display: flex; flex-wrap: wrap; gap: .12rem .24rem; }

/* 战果纪录 / maxima (screens/lobby.css, adapted) */
.ach-best { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem; align-items: center; padding: .16rem 0 .08rem; }
.ach-best__left { display: flex; flex-direction: column; align-items: center; gap: .12rem; }
.ach-best__mount {
  position: relative; align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .14rem .28rem .16rem; min-width: 1.9rem;
}
.ach-best__mount::before, .ach-best__mount::after {
  content: ''; position: absolute; top: 0; bottom: .1rem; width: .08rem;
  border: 2px solid rgba(200, 210, 206, .3); pointer-events: none;
}
.ach-best__mount::before { left: 0; border-right: 0; }
.ach-best__mount::after { right: 0; border-left: 0; }
.ach-pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .07rem; padding: .05rem .16rem; border-radius: .24rem;
  background: rgba(220, 230, 226, .14); font-size: max(.17rem, 12px); font-weight: 600;
}
.ach-pill .icon { width: max(.14rem, 11px); height: max(.14rem, 11px); }
.ach-best__glyph {
  width: 1rem; height: 1rem; display: grid; place-items: center; background: #121716;
  box-shadow: 0 0 0 3px rgba(200, 210, 206, .32), 0 0 0 .1rem #0b0f0e, 0 0 0 calc(.1rem + 1px) rgba(200, 210, 206, .16);
}
.ach-best__label { font-size: max(.17rem, 12px); color: #dfe6e3; }
.ach-best__num { font-family: var(--font-display); font-size: max(.5rem, 27px); line-height: 1; color: #4af2c4; font-weight: 500; }
.ach-best__src { font-size: max(.13rem, 10px); color: var(--text-dim); font-family: var(--font-num); }
.ach-best__bonds { display: grid; grid-template-columns: repeat(2, auto); gap: .16rem .3rem; align-content: start; }
.sbond { display: inline-flex; align-items: center; gap: .1rem; opacity: .55; }
.sbond.is-on { opacity: 1; }
.sbond__disc { display: grid; place-items: center; width: .48rem; height: .48rem; background: rgba(12, 18, 17, .7); box-shadow: inset 0 0 0 2px rgba(200, 210, 206, .3); }
.sbond b { font-family: var(--font-display); font-size: max(.22rem, 13px); color: #4af2c4; }
.bglyph { width: 100%; height: 100%; display: grid; place-items: center; }
.bglyph__txt { font-size: max(.32rem, 17px); font-weight: 900; color: #4af2c4; }
.bandglyph { width: .56rem; height: .56rem; display: grid; place-items: center; background: rgba(12, 18, 17, .7); box-shadow: inset 0 0 0 2px rgba(200, 210, 206, .3); }
.bandglyph__txt { font-size: max(.26rem, 14px); font-weight: 900; color: #4af2c4; }

.ach-maxima { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .24rem; margin-top: .28rem; }
.ach-max {
  position: relative; height: 1.05rem; display: flex; flex-direction: column; justify-content: center;
  padding: 0 .26rem; overflow: hidden; background: rgba(255, 255, 255, .02);
}
.ach-max::before, .ach-max::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: .08rem;
  border: 2px solid rgba(200, 210, 206, .32); pointer-events: none;
}
.ach-max::before { left: 0; border-right: 0; }
.ach-max::after { right: 0; border-left: 0; }
.ach-max__label { position: relative; z-index: 1; font-size: max(.17rem, 12px); color: #d4dcd9; white-space: nowrap; }
.ach-max__num { position: relative; z-index: 1; display: flex; align-items: baseline; gap: .03rem; line-height: 1.1; margin-top: .03rem; }
.ach-max__num small { font-size: max(.21rem, 12px); color: #f4f7f6; }
.ach-max__num .num { font-family: var(--font-display); font-size: max(.38rem, 21px); font-weight: 500; color: var(--mx, #4af2c4); overflow-wrap: anywhere; }
.ach-max__glyph { position: absolute; right: .22rem; top: 50%; width: .76rem; height: .76rem; margin-top: -.38rem; fill: var(--mx, #4af2c4); opacity: .45; }
.ach-max.is-gold { --mx: #ffcf1f; }
.ach-max.is-orange { --mx: #ff8a2a; }
.ach-max.is-mint { --mx: #3fe3b2; }

/* 盟约纪录 / 策略纪录 tops (screens/lobby.css, adapted) */
.ach-tops { display: flex; gap: .9rem; padding: .06rem 0 .06rem .5rem; flex-wrap: wrap; }
.ach-top { display: flex; flex-direction: column; align-items: center; gap: .12rem; animation: ach-pop 380ms var(--ease-out) both; }
.ach-top__frame {
  position: relative; width: 1rem; height: 1rem; display: grid; place-items: center;
  background: rgba(12, 18, 17, .7); box-shadow: inset 0 0 0 3px rgba(200, 210, 206, .3);
}
.ach-top__rank {
  position: absolute; left: .09rem; top: .06rem; font-family: var(--font-display); font-style: normal;
  font-size: max(.13rem, 10px); color: rgba(220, 230, 226, .5);
}
.ach-top--bond .bglyph__txt, .ach-top--band .bandglyph__txt { font-size: max(.34rem, 18px); }
.ach-top__name { max-width: 2.4rem; font-size: max(.18rem, 12px); color: var(--text-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-top__side { display: grid; justify-items: center; gap: .05rem; }
.ach-top__count { font-size: max(.16rem, 11px); color: var(--text-dim); }
.ach-top__count b { color: var(--mint-400); }

/* ---- 干员调配 / 缓存管理 ------------------------------------------------------------------ */
.disp { display: grid; gap: .2rem; }
.disp-rows { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.disp-row { display: flex; align-items: baseline; gap: .2rem; padding: .15rem .22rem; background: rgba(255, 255, 255, .03); }
.disp-row__label { flex: none; font-size: max(.18rem, 12px); color: var(--text-md); letter-spacing: .04em; }
.disp-row__value { font-size: max(.27rem, 15px); color: var(--mint-400); }
.disp-row__hint { margin-left: auto; font-size: max(.14rem, 11px); color: var(--text-dim); text-align: right; }
.disp-acts { display: flex; align-items: center; flex-wrap: wrap; gap: .18rem; margin-top: .06rem; }
.disp-busy { font-size: max(.15rem, 11px); color: var(--text-lo); }
.disp-busy.is-warn { color: var(--amber); }
.cache-summary { display: flex; flex-wrap: wrap; gap: .12rem .4rem; font-size: max(.17rem, 12px); color: var(--text-md); }
.cache-summary b { color: var(--mint-400); }

/* ---- footer ------------------------------------------------------------------------------- */
.fw-foot {
  display: flex; flex-wrap: wrap; gap: .12rem .36rem; align-items: baseline; justify-content: space-between;
  padding: .24rem .08rem .1rem;
  border-top: 1px solid rgba(47, 58, 53, .6);
  font-size: max(.14rem, 11px); line-height: 1.8; color: var(--text-dim);
}

/* ---- narrow screens ----------------------------------------------------------------------- */
@media (max-width: 760px) {
  .fw-links { grid-template-columns: minmax(0, 1fr); }
  .ach-plate-area { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .ach-hex { min-height: 3.6rem; }
  .ach-maxima { grid-template-columns: minmax(0, 1fr); }
  .ach-best { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .fw-hero__head { flex-direction: column; }
  .st-tab { padding: .12rem .12rem .1rem; }
  .st-tab__micro { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
