/* ================================================================
   大壮群英杀 · 万世对决 — 界面样式（game.css）
   负责人：ui-dev。仅消费 base.css 的设计变量，不改 base.css。
   设计稿：1440 × 810，由 ui.js 等比缩放适配所有桌面窗口。
   ================================================================ */

/* ------------------------------------------------------------------
   0. 应用外壳 / 舞台 / 背景
   ------------------------------------------------------------------ */
.app-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--ink-0);
}

.app-shell__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(232, 195, 122, .10), transparent 55%),
    radial-gradient(80% 60% at 12% 100%, rgba(224, 90, 79, .10), transparent 60%),
    radial-gradient(70% 60% at 92% 88%, rgba(91, 141, 239, .10), transparent 60%),
    linear-gradient(180deg, #080a11 0%, #05060a 100%);
  transition: filter .6s ease, opacity .6s ease;
}

.app-shell__backdrop.is-title {
  background-image:
    linear-gradient(180deg, rgba(5, 6, 10, .42) 0%, rgba(5, 6, 10, .82) 72%, #05060a 100%),
    radial-gradient(100% 80% at 50% 40%, rgba(232, 195, 122, .12), transparent 62%),
    url('../assets/bg/title.png');
  background-size: cover, cover, cover;
  background-position: center, center, center;
  filter: saturate(.9) brightness(.75);
}

.app-shell__backdrop.is-battle {
  background-image:
    linear-gradient(180deg, rgba(5, 6, 10, .55), rgba(5, 6, 10, .88)),
    url('../assets/bg/table.png');
  background-size: cover, cover;
  background-position: center, center;
  filter: blur(6px) brightness(.5) saturate(.9);
}

.app-shell__backdrop.is-result {
  background:
    radial-gradient(90% 70% at 50% 30%, rgba(232, 195, 122, .16), transparent 60%),
    radial-gradient(80% 80% at 50% 110%, rgba(224, 90, 79, .14), transparent 62%),
    linear-gradient(180deg, #0a0c13, #05060a);
}

.app-shell__backdrop.is-lobby {
  background:
    radial-gradient(76% 62% at 18% 18%, rgba(91, 141, 239, .14), transparent 62%),
    radial-gradient(60% 50% at 86% 84%, rgba(232, 195, 122, .13), transparent 64%),
    linear-gradient(160deg, #080b13, #05060a 70%);
}

.app-shell__backdrop.is-deck,
.app-shell__backdrop.is-rules,
.app-shell__backdrop.is-setup {
  background:
    radial-gradient(70% 56% at 78% 12%, rgba(232, 195, 122, .12), transparent 62%),
    radial-gradient(60% 56% at 14% 90%, rgba(224, 90, 79, .10), transparent 64%),
    linear-gradient(170deg, #090c14, #05060a 78%);
}

.app-shell__grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(1px 1px at 18% 26%, rgba(255, 227, 163, .5), transparent 100%),
    radial-gradient(1px 1px at 72% 14%, rgba(255, 227, 163, .3), transparent 100%),
    radial-gradient(1.5px 1.5px at 44% 66%, rgba(255, 255, 255, .2), transparent 100%),
    radial-gradient(1px 1px at 86% 52%, rgba(255, 227, 163, .3), transparent 100%),
    radial-gradient(1px 1px at 32% 86%, rgba(143, 180, 255, .28), transparent 100%),
    radial-gradient(1px 1px at 10% 72%, rgba(255, 255, 255, .16), transparent 100%);
}

.app-shell__stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1440px;
  height: 810px;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  will-change: transform;
  z-index: 2;
}

.app-shell__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .55);
}

.app-shell__screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* 每个界面 */
.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: screen-in .42s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: scale(1.012); }
  to { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------------
   1. 通用控件：按钮 / 输入 / 徽章 / 提示
   ------------------------------------------------------------------ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 20px;
  border-radius: var(--radius-s);
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(232, 195, 122, .12), rgba(232, 195, 122, .035));
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  letter-spacing: .12em;
  cursor: pointer;
  outline: none;
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.btn:hover {
  border-color: rgba(232, 195, 122, .7);
  background: linear-gradient(180deg, rgba(232, 195, 122, .22), rgba(232, 195, 122, .07));
  box-shadow: 0 0 20px rgba(232, 195, 122, .18);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0) scale(.985); }

.btn:disabled,
.btn[disabled] {
  opacity: .34;
  cursor: not-allowed;
  filter: grayscale(.4);
  transform: none;
  box-shadow: none;
}

.btn--primary {
  border-color: #ffe3a3;
  background: linear-gradient(180deg, #ffe0a0 0%, #e8c37a 42%, #b9843c 100%);
  color: #1d1407;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  box-shadow: 0 4px 18px rgba(232, 195, 122, .28), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #fff0c4 0%, #f2d08b 42%, #c9944a 100%);
  box-shadow: 0 6px 26px rgba(232, 195, 122, .45);
}

.btn--outline {
  background: rgba(232, 195, 122, .04);
  border-color: rgba(232, 195, 122, .45);
}

.btn--ghost {
  background: rgba(255, 255, 255, .02);
  border-color: rgba(255, 255, 255, .18);
  color: var(--text-dim);
}

.btn--ghost:hover { color: var(--text); border-color: rgba(232, 195, 122, .5); }

.btn--danger-ghost {
  background: rgba(224, 90, 79, .06);
  border-color: rgba(224, 90, 79, .36);
  color: #eba79f;
}

.btn--danger-ghost:hover {
  border-color: var(--red);
  color: var(--red-bright);
  box-shadow: 0 0 18px rgba(224, 90, 79, .22);
}

.btn--lg {
  min-height: 54px;
  padding: 13px 30px;
  font-size: 17px;
}

.btn--sm { min-height: 32px; padding: 5px 12px; font-size: 12px; }
.btn--block { width: 100%; }
.btn--icon { padding: 8px 12px; }

.btn--back {
  display: inline-flex;
  gap: 6px;
  min-height: 38px;
  padding: 6px 16px;
  background: rgba(5, 6, 10, .45);
  border-color: rgba(255, 255, 255, .14);
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: .2em;
}

.btn--back > span:first-child { font-size: 20px; line-height: 1; transform: translateY(-1px); }
.btn--back:hover { color: var(--gold-bright); }

.btn__icon { font-size: 16px; line-height: 1; }
.btn__arrow { font-size: 18px; line-height: 1; opacity: .7; }

/* 输入 */
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label {
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--text-faint);
}

.field__input {
  height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(232, 195, 122, .22);
  background: rgba(5, 6, 10, .55);
  color: var(--text);
  font-size: 16px;
  letter-spacing: .08em;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field__input::placeholder { color: var(--text-faint); letter-spacing: .06em; }

.field__input:focus {
  border-color: var(--gold);
  background: rgba(10, 13, 21, .8);
  box-shadow: 0 0 0 3px rgba(232, 195, 122, .1), 0 0 22px rgba(232, 195, 122, .12);
}

.field__input.is-shake { animation: shake-x .4s ease; }
.field__input--code {
  font-family: var(--font-num);
  font-size: 22px;
  letter-spacing: .5em;
  text-align: center;
  padding-left: 24px;
}

/* 筛选 chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .025);
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: all .18s ease;
}

.chip i {
  font-style: normal;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text-faint);
}

.chip:hover { color: var(--text); border-color: rgba(232, 195, 122, .45); }

.chip.is-active {
  color: var(--gold-bright);
  border-color: rgba(232, 195, 122, .7);
  background: rgba(232, 195, 122, .1);
  box-shadow: 0 0 16px rgba(232, 195, 122, .16), inset 0 0 12px rgba(232, 195, 122, .08);
}

.chip.is-active i { color: var(--gold); }

/* 势力徽章 */
.faction-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--faction-color) 70%, transparent);
  background: var(--faction-bg);
  color: var(--faction-color);
  font-family: var(--font-title);
  font-size: 12px;
  line-height: 1;
  flex: 0 0 auto;
}

/* 身份徽章 */
.idbadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .4);
  color: var(--text-dim);
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: .12em;
  flex: 0 0 auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}

.idbadge--sm { min-width: 30px; height: 20px; font-size: 11px; }
.idbadge--hidden { color: var(--text-faint); border-style: dashed; }

.idbadge--lord {
  color: #3a2806;
  background: linear-gradient(180deg, #ffe8a8, #d8a548);
  border-color: #ffe3a3;
  font-weight: 700;
  text-shadow: none;
}

.idbadge--loyal {
  color: #ffe1bd;
  border-color: rgba(240, 163, 94, .6);
  background: rgba(240, 163, 94, .16);
}

.idbadge--rebel {
  color: #ffd0c9;
  border-color: rgba(224, 90, 79, .6);
  background: rgba(224, 90, 79, .16);
}

.idbadge--spy {
  color: #e9ccff;
  border-color: rgba(185, 120, 232, .6);
  background: rgba(185, 120, 232, .16);
}

/* 体力勾玉 */
.hp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  --dot: 12px;
}

.hp__dots { display: inline-flex; gap: 4px; align-items: center; }
.hp__num {
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.hp__num i { font-style: normal; font-size: 10px; opacity: .6; }

.hp-dot {
  width: var(--dot);
  height: var(--dot);
  transform: rotate(-45deg);
  border-radius: 50% 50% 50% 14%;
  border: 1px solid rgba(0, 0, 0, .55);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25);
}

.hp-dot.is-on {
  background: radial-gradient(circle at 32% 26%, #ffb3a8 0%, #e05a4f 46%, #8f2f2a 100%);
  box-shadow: 0 0 8px rgba(224, 90, 79, .55), inset 0 1px 1px rgba(255, 255, 255, .35);
}

.hp-dot.is-off { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .12); }

.hp--sm { --dot: 10px; }
.hp--sm .hp__num { font-size: 11px; }
.hp--xs { --dot: 8px; gap: 4px; }
.hp--xs .hp__num { font-size: 10px; }
.hp--self { --dot: 13px; }
.hp--self .hp__num { font-size: 15px; color: var(--text); }

/* 立绘容器 */
.portrait {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, var(--faction-bg), transparent 68%),
    linear-gradient(180deg, #1a2233, #0a0d15);
  color: var(--faction-color);
}

.portrait__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.portrait__svg { width: 100%; height: 100%; display: block; opacity: .9; }

.portrait__fallback-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 13px;
  color: color-mix(in srgb, var(--faction-color) 82%, white);
  letter-spacing: .3em;
  text-indent: .3em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
  padding: 0 6px;
}

.portrait__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .6s ease;
}

.portrait.is-fallback .portrait__img { display: none; }

/* 提示 / 载入 / 空态 */
.toast {
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, .4);
  background: rgba(9, 12, 20, .92);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .55), 0 0 22px rgba(232, 195, 122, .12);
  color: var(--text);
  font-size: 14px;
  letter-spacing: .08em;
  opacity: 0;
  transform: translateY(12px) scale(.97);
  transition: opacity .22s ease, transform .22s ease;
}

.toast.is-in { opacity: 1; transform: translateY(0) scale(1); }
.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(232, 195, 122, .18);
  color: var(--gold-bright);
  font-size: 12px;
  flex: 0 0 auto;
}

.toast--success .toast__icon { background: rgba(79, 214, 184, .18); color: var(--green-bright); }
.toast--warn { border-color: rgba(232, 180, 90, .5); }
.toast--warn .toast__icon { background: rgba(232, 180, 90, .2); color: #f0c070; }
.toast--error { border-color: rgba(224, 90, 79, .55); }
.toast--error .toast__icon { background: rgba(224, 90, 79, .22); color: var(--red-bright); }

.app-shell__toasts {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.app-shell__loading {
  position: absolute;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(5, 6, 10, .6), rgba(5, 6, 10, .86));
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.app-shell__loading.is-on { opacity: 1; pointer-events: auto; }

.loadingbox { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.loadingbox__ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(232, 195, 122, .16);
  border-top-color: var(--gold);
  border-right-color: rgba(232, 195, 122, .5);
  animation: spin 1s linear infinite;
  box-shadow: 0 0 26px rgba(232, 195, 122, .18);
}
.loadingbox__text {
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: .4em;
  color: var(--gold);
  text-indent: .4em;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake-x {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------------
   2. 通用页头
   ------------------------------------------------------------------ */
.screen-head {
  flex: 0 0 84px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 40px;
  position: relative;
  z-index: 5;
}

.screen-head::after {
  content: "";
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 195, 122, .35) 18%, rgba(232, 195, 122, .1) 70%, transparent);
}

.screen-head__titles { flex: 1 1 auto; min-width: 0; }
.screen-head__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--text);
  text-shadow: 0 0 26px rgba(232, 195, 122, .25);
}
.screen-head__sub {
  margin: 3px 0 0;
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: .52em;
  color: var(--text-faint);
}
.screen-head__right { display: flex; align-items: center; gap: 14px; }

/* ------------------------------------------------------------------
   3. 标题页
   ------------------------------------------------------------------ */
.screen--title { align-items: center; justify-content: center; }

.title__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 60% at 50% 34%, rgba(232, 195, 122, .1), transparent 62%),
    linear-gradient(180deg, rgba(5, 6, 10, .35), rgba(5, 6, 10, .9) 78%),
    url('../assets/bg/title.png');
  background-size: cover, cover, cover;
  background-position: center, center, center;
  filter: saturate(.92) brightness(.62);
  animation: title-bg-in 2.4s ease both;
}

.title__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 70% at 50% 46%, transparent 30%, rgba(3, 4, 7, .72) 100%),
    linear-gradient(180deg, rgba(3, 4, 7, .2), rgba(3, 4, 7, .95));
}

@keyframes title-bg-in {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

.title__inksplash {
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .5;
  pointer-events: none;
}

.title__inksplash--a {
  left: -180px;
  top: -140px;
  background: radial-gradient(circle, rgba(224, 90, 79, .26), transparent 66%);
}

.title__inksplash--b {
  right: -200px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(91, 141, 239, .22), transparent 66%);
}

.title__particles { position: absolute; inset: 0; pointer-events: none; }

.title__particles span {
  position: absolute;
  left: calc(8% + (var(--i) * 5.6%));
  top: calc(12% + (var(--i) * 4.9%));
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(255, 227, 163, .8);
  opacity: .25;
  animation: dust-float calc(7s + var(--i) * .8s) ease-in-out infinite;
  animation-delay: calc(var(--i) * -.9s);
}

@keyframes dust-float {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: .12; }
  50% { transform: translate3d(10px, -26px, 0); opacity: .65; }
}

.title__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
  animation: title-content-in 1s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes title-content-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.title__crest {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.title__crest-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(232, 195, 122, .45);
  background: radial-gradient(circle, rgba(232, 195, 122, .12), transparent 68%);
  box-shadow: 0 0 42px rgba(232, 195, 122, .22), inset 0 0 30px rgba(232, 195, 122, .12);
}

.title__crest-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px dashed rgba(232, 195, 122, .35);
  animation: spin 26s linear infinite;
}

.title__crest-char {
  font-family: var(--font-title);
  font-size: 48px;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(232, 195, 122, .55);
  line-height: 1;
}

.title__crest-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.title__crest-dot--1 { left: 12%; top: 20%; }
.title__crest-dot--2 { right: 10%; bottom: 24%; }

.title__logo { display: flex; flex-direction: column; align-items: center; margin: 0; }

.title__logo-main {
  font-family: var(--font-title);
  font-size: 82px;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: .14em;
  text-indent: .14em;
  background: linear-gradient(180deg, #fff6dd 0%, #ffe3a3 34%, #e8c37a 62%, #a97d3c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 22px rgba(232, 195, 122, .4)) drop-shadow(0 1px 0 rgba(255, 255, 255, .3));
}

.title__logo-sub {
  margin-top: 4px;
  font-family: var(--font-title);
  font-size: 27px;
  letter-spacing: .62em;
  text-indent: .62em;
  color: #f5e8cd;
  text-shadow: 0 0 22px rgba(232, 195, 122, .5);
}

.title__en-wrap { display: flex; align-items: center; gap: 16px; margin-top: 16px; }

.title__en-line {
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 195, 122, .65));
}

.title__en-line:last-child { transform: rotate(180deg); }

.title__en {
  margin: 0;
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .56em;
  text-indent: .56em;
  color: rgba(232, 195, 122, .82);
}

.title__tagline {
  margin: 14px 0 26px;
  font-size: 13px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--text-dim);
}

.title__menu {
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 428px;
}

.title-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(232, 195, 122, .2);
  background: linear-gradient(100deg, rgba(10, 13, 21, .72), rgba(10, 13, 21, .38));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: all .2s ease;
  backdrop-filter: blur(6px);
}

.title-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(232, 195, 122, .8), transparent);
  opacity: 0;
  transition: opacity .2s ease;
}

.title-btn:hover {
  border-color: rgba(232, 195, 122, .55);
  background: linear-gradient(100deg, rgba(232, 195, 122, .14), rgba(10, 13, 21, .45));
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45), 0 0 26px rgba(232, 195, 122, .12);
  transform: translateX(6px);
}

.title-btn:hover::before { opacity: 1; }
.title-btn:active { transform: translateX(6px) scale(.99); }

.title-btn--primary {
  border-color: rgba(232, 195, 122, .55);
  background: linear-gradient(100deg, rgba(232, 195, 122, .24), rgba(232, 195, 122, .05) 62%, rgba(10, 13, 21, .3));
  box-shadow: 0 0 30px rgba(232, 195, 122, .12), inset 0 0 26px rgba(232, 195, 122, .05);
}

.title-btn__idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(232, 195, 122, .45);
  background: rgba(232, 195, 122, .08);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 15px;
}

.title-btn__body { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }

.title-btn__label {
  font-family: var(--font-title);
  font-size: 21px;
  letter-spacing: .22em;
  color: var(--text);
  text-shadow: 0 0 18px rgba(232, 195, 122, .18);
}

.title-btn__sub { font-size: 11px; letter-spacing: .16em; color: var(--text-faint); }

.title-btn__arrow {
  font-size: 26px;
  color: rgba(232, 195, 122, .5);
  transform: translateY(-2px);
  transition: transform .2s ease, color .2s ease;
}

.title-btn:hover .title-btn__arrow { color: var(--gold-bright); transform: translate(4px, -2px); }

.title__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--text-faint);
}

.title__foot i { font-style: normal; font-size: 6px; color: rgba(232, 195, 122, .35); }

.title__corner {
  position: absolute;
  width: 96px;
  height: 96px;
  pointer-events: none;
  opacity: .5;
}

.title__corner--tl {
  left: 26px;
  top: 26px;
  border-left: 1px solid rgba(232, 195, 122, .5);
  border-top: 1px solid rgba(232, 195, 122, .5);
}

.title__corner--br {
  right: 26px;
  bottom: 26px;
  border-right: 1px solid rgba(232, 195, 122, .5);
  border-bottom: 1px solid rgba(232, 195, 122, .5);
}

/* ------------------------------------------------------------------
   4. 模式选择
   ------------------------------------------------------------------ */
.screen--setup .screen-head { position: relative; z-index: 2; }

.setup__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(232, 195, 122, .1), transparent 60%),
    radial-gradient(50% 60% at 100% 100%, rgba(91, 141, 239, .1), transparent 62%);
  pointer-events: none;
}

.setup__body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 60px 30px;
  gap: 22px;
}

.setup__modes {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 26px;
  flex: 0 0 400px;
  min-height: 0;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  height: 100%;
  padding: 34px 36px;
  border-radius: 16px;
  border: 1px solid rgba(232, 195, 122, .2);
  background:
    radial-gradient(70% 90% at 18% 0%, rgba(232, 195, 122, .1), transparent 60%),
    linear-gradient(160deg, rgba(18, 23, 36, .94), rgba(7, 9, 15, .92));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform .24s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.mode-card::after {
  content: "印";
  position: absolute;
  right: 14px;
  bottom: -34px;
  font-family: var(--font-title);
  font-size: 220px;
  line-height: 1;
  color: rgba(232, 195, 122, .05);
  pointer-events: none;
  z-index: 0;
}

.mode-card:not(.mode-card--wide)::after { content: "战"; }

.mode-card__glow {
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 195, 122, .18), transparent 68%);
  pointer-events: none;
  transition: opacity .24s ease;
  opacity: 0;
  z-index: 0;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 195, 122, .5);
}

.mode-card:hover .mode-card__glow { opacity: .7; }

.mode-card.is-active {
  border-color: rgba(232, 195, 122, .82);
  box-shadow: 0 0 0 1px rgba(232, 195, 122, .28), 0 18px 50px rgba(0, 0, 0, .5), 0 0 40px rgba(232, 195, 122, .16);
  background:
    radial-gradient(70% 90% at 18% 0%, rgba(232, 195, 122, .17), transparent 60%),
    linear-gradient(160deg, rgba(24, 30, 46, .96), rgba(9, 11, 18, .94));
}

.mode-card.is-active .mode-card__glow { opacity: 1; }

.mode-card__icon,
.mode-card__title,
.mode-card__en,
.mode-card__desc,
.mode-card__lineup { position: relative; z-index: 1; }

.mode-card__badge { z-index: 2; }
.mode-card__check { z-index: 2; }

.mode-card__badge {
  position: absolute;
  right: 24px;
  top: 24px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, .35);
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .12em;
}

.mode-card__icon {
  font-family: var(--font-title);
  font-size: 44px;
  line-height: 1;
  color: var(--gold-bright);
  text-shadow: 0 0 26px rgba(232, 195, 122, .45);
  margin-bottom: 2px;
}

.mode-card__title {
  font-family: var(--font-title);
  font-size: 36px;
  letter-spacing: .18em;
  color: var(--text);
}

.mode-card__en {
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: .5em;
  color: rgba(232, 195, 122, .55);
}

.mode-card__desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-dim);
  max-width: 460px;
}

.mode-card__lineup { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.mode-card__chip {
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .03);
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: .16em;
}

.mode-card__check {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(232, 195, 122, .4);
  color: transparent;
  font-size: 15px;
  transition: all .2s ease;
}

.mode-card.is-active .mode-card__check {
  color: #1d1407;
  background: linear-gradient(180deg, #ffe8a8, #d8a548);
  border-color: #ffe3a3;
  box-shadow: 0 0 18px rgba(232, 195, 122, .4);
}

.setup__bottom {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 20px 4px 0;
  border-top: 1px solid rgba(232, 195, 122, .14);
}

.setup__bottom .field { width: 300px; flex: 0 0 auto; }

.setup__note {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--text-faint);
  line-height: 1.7;
}

.setup__note-icon { color: var(--gold); font-size: 12px; }

.setup__bottom .btn--lg { flex: 0 0 auto; min-width: 210px; }

/* ------------------------------------------------------------------
   5. 武将图鉴
   ------------------------------------------------------------------ */
.screen--codex .screen-head { position: relative; z-index: 3; }

.codex__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% -6%, rgba(232, 195, 122, .08), transparent 60%),
    radial-gradient(40% 40% at 92% 84%, rgba(185, 120, 232, .08), transparent 60%);
  pointer-events: none;
}

.codex__count {
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--text-faint);
}

.codex__count b { font-family: var(--font-num); font-size: 16px; color: var(--gold); }

.codex__filters {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 10px;
  padding: 14px 40px 12px;
}

.codex__grid {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 12px;
  padding: 0 40px;
  perspective: 1200px;
}

.codex-card {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(232, 195, 122, .18);
  border-radius: 12px;
  background: linear-gradient(170deg, rgba(20, 26, 40, .92), rgba(7, 9, 14, .95));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transform-style: preserve-3d;
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease, opacity .28s ease;
  will-change: transform;
}

.codex-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(220px 160px at var(--mx, 50%) var(--my, 50%), rgba(255, 227, 163, .16), transparent 66%);
  opacity: 0;
  transition: opacity .2s ease;
}

.codex-card:hover {
  --lift: -4px;
  border-color: color-mix(in srgb, var(--faction-color) 65%, rgba(232, 195, 122, .5));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 30px color-mix(in srgb, var(--faction-color) 22%, transparent);
  z-index: 5;
}

.codex-card:hover::after { opacity: 1; }

.codex-card.is-filtered-out { opacity: 0; pointer-events: none; transform: scale(.92); }

.codex-card__frame {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(232, 195, 122, .14);
  border-radius: 8px;
  pointer-events: none;
}

.codex-card__frame::before,
.codex-card__frame::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: color-mix(in srgb, var(--faction-color) 80%, transparent);
  border-style: solid;
}

.codex-card__frame::before { left: -1px; top: -1px; border-width: 1px 0 0 1px; }
.codex-card__frame::after { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }

.codex-card__art {
  position: absolute;
  right: 0;
  top: 0;
  width: 64%;
  height: 100%;
  pointer-events: none;
}

.codex-card__art .portrait { width: 100%; height: 100%; }

.codex-card__art .portrait__img { object-position: top center; }

.codex-card__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 9, 14, .96) 0%, rgba(7, 9, 14, .82) 46%, rgba(7, 9, 14, .12) 76%, rgba(7, 9, 14, .35) 100%),
    linear-gradient(0deg, rgba(5, 6, 10, .85) 0%, transparent 42%);
}

.codex-card__body {
  position: absolute;
  inset: 0;
  width: 74%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px 10px;
  z-index: 2;
}

.codex-card__top { display: flex; align-items: center; gap: 8px; }

.codex-card__name { display: flex; align-items: baseline; gap: 7px; margin-top: 2px; }

.codex-card__name b {
  font-family: var(--font-title);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fdf6e6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}

.codex-card__name i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .1em;
  color: color-mix(in srgb, var(--faction-color) 82%, white);
  opacity: .9;
}

.codex-card__era { font-size: 9.5px; letter-spacing: .16em; color: var(--text-faint); }

.codex-card__skills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .35);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--text-dim);
  white-space: nowrap;
}

.skill-tag em {
  font-style: normal;
  font-size: 8px;
  opacity: .55;
  border-left: 1px solid rgba(255, 255, 255, .15);
  padding-left: 4px;
}

.skill-tag__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.skill-tag--active { color: #ffe3a3; border-color: rgba(232, 195, 122, .35); }
.skill-tag--active .skill-tag__dot { background: var(--red-bright); box-shadow: 0 0 6px var(--red); }
.skill-tag--convert { color: var(--blue-bright); border-color: rgba(91, 141, 239, .32); }
.skill-tag--convert .skill-tag__dot { background: var(--blue-bright); box-shadow: 0 0 6px var(--blue); }
.skill-tag--passive .skill-tag__dot { background: var(--text-faint); }

/* 悬停/展开详情 */
.codex-card__detail {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  background:
    radial-gradient(80% 60% at 20% 0%, color-mix(in srgb, var(--faction-color) 14%, transparent), transparent 60%),
    linear-gradient(160deg, rgba(10, 13, 21, .985), rgba(6, 8, 13, .985));
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, .8, .3, 1);
  overflow: hidden;
}

.codex-card:hover .codex-card__detail,
.codex-card.is-open .codex-card__detail,
.codex-card:focus-visible .codex-card__detail {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.codex-detail__head { display: flex; align-items: center; gap: 8px; }

.codex-detail__name {
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: .08em;
  color: #fdf6e6;
  flex: 1;
}

.codex-detail__name em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-dim);
  margin-left: 6px;
}

.codex-detail__era { font-size: 9.5px; letter-spacing: .16em; color: var(--text-faint); }

.codex-detail__quote {
  font-family: var(--font-title);
  font-size: 10px;
  color: rgba(232, 195, 122, .72);
  letter-spacing: .04em;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(232, 195, 122, .12);
}

.codex-detail__skills { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }

.codex-detail__skill { display: flex; flex-direction: column; gap: 1px; }

.codex-detail__skillname {
  font-size: 11px;
  color: var(--faction-color);
  letter-spacing: .08em;
  filter: brightness(1.25);
}

.codex-detail__skillname em {
  font-style: normal;
  font-size: 8px;
  color: var(--text-faint);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 5px;
}

.codex-detail__skilldesc { font-size: 9.5px; line-height: 1.5; color: var(--text-dim); }

.codex-card__corner {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(232, 195, 122, .3);
  border-bottom: 1px solid rgba(232, 195, 122, .3);
  pointer-events: none;
}

.codex__hint {
  position: relative;
  z-index: 2;
  margin: 8px 0 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--text-faint);
}

.codex__hint span { color: var(--gold); margin-right: 6px; }

/* ------------------------------------------------------------------
   6. 玩法说明
   ------------------------------------------------------------------ */
.screen--rules .screen-head { position: relative; z-index: 2; }

.rules__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 60% at 82% 92%, rgba(232, 195, 122, .07), transparent 60%);
  pointer-events: none;
}

.rules__tag {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, .3);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: .2em;
}

.rules__body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 316px;
  gap: 24px;
  padding: 4px 48px 28px;
}

.rules__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  align-content: center;
  gap: 18px;
  min-height: 0;
  padding: 6px 0;
}

.rule-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 168px;
  padding: 20px 20px 18px;
  border-radius: 12px;
  border: 1px solid rgba(232, 195, 122, .16);
  background:
    radial-gradient(70% 60% at 0% 0%, rgba(232, 195, 122, .07), transparent 62%),
    linear-gradient(155deg, rgba(17, 22, 35, .9), rgba(7, 9, 15, .92));
  overflow: hidden;
  animation: rule-in .5s cubic-bezier(.2, .8, .3, 1) both;
  animation-delay: calc(var(--i) * 60ms);
}

@keyframes rule-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rule-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(232, 195, 122, .5), transparent);
}

.rule-card__idx {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(232, 195, 122, .4);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 14px;
  background: rgba(232, 195, 122, .06);
}

.rule-card__content { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.rule-card__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: .16em;
  color: var(--text);
}

.rule-card__body {
  margin: 0;
  font-size: 12px;
  line-height: 1.85;
  color: var(--text-dim);
  letter-spacing: .02em;
}

.rules__side { min-height: 0; }

.rule-legend {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid rgba(232, 195, 122, .16);
  background: linear-gradient(160deg, rgba(15, 19, 30, .9), rgba(7, 9, 14, .94));
  overflow: hidden;
}

.rule-legend__title {
  margin: 4px 0 2px;
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: .34em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.rule-legend__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(232, 195, 122, .35), transparent);
}

.rule-legend__cards { display: flex; flex-direction: column; gap: 5px; }

.rule-legend__card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 5px;
  border-left: 2px solid var(--card-type-color);
  background: rgba(255, 255, 255, .03);
}

.rule-legend__card b { font-size: 12px; color: var(--text); letter-spacing: .1em; font-weight: 600; }
.rule-legend__card i { font-style: normal; font-size: 10px; color: var(--text-faint); margin-left: auto; }
.rule-legend__card--basic { --card-type-color: #c8453c; }
.rule-legend__card--trick { --card-type-color: #4f6fd0; }
.rule-legend__card--delay { --card-type-color: #9a6ddb; }

.rule-legend__suits { display: flex; gap: 8px; }

.rule-suit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
}

.rule-suit b { font-size: 15px; line-height: 1; }
.rule-suit--red b { color: var(--red-bright); }
.rule-suit--black b { color: #d7d2c6; }

.rule-legend__identities { display: flex; flex-direction: column; gap: 4px; }

.rule-legend__identity {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 10px;
  color: var(--text-faint);
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .06);
}

.rule-legend__identity b {
  font-family: var(--font-title);
  font-size: 12px;
  flex: 0 0 34px;
  letter-spacing: .1em;
}

.rule-legend__identity--lord b { color: #ffd76a; }
.rule-legend__identity--loyal b { color: #f0a35e; }
.rule-legend__identity--rebel b { color: var(--red-bright); }
.rule-legend__identity--spy b { color: #cf9cf5; }
.rule-legend__identity i { font-style: normal; line-height: 1.5; }

.rule-legend__seal {
  margin: 8px 0 4px;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(232, 195, 122, .22);
  background: radial-gradient(80% 100% at 50% 0%, rgba(232, 195, 122, .08), transparent 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.rule-legend__sealchar {
  font-family: var(--font-title);
  font-size: 24px;
  letter-spacing: .28em;
  text-indent: .28em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(232, 195, 122, .4);
}

.rule-legend__sealtxt {
  font-family: var(--font-num);
  font-size: 8px;
  letter-spacing: .34em;
  text-indent: .34em;
  color: rgba(232, 195, 122, .55);
}

.rule-legend__sealsub { font-size: 9px; letter-spacing: .18em; color: var(--text-faint); }

.rule-legend__foot {
  margin: auto 0 0;
  font-size: 10px;
  line-height: 1.7;
  color: var(--text-faint);
  border-top: 1px solid rgba(232, 195, 122, .12);
  padding-top: 8px;
}

/* ------------------------------------------------------------------
   7. 联机大厅
   ------------------------------------------------------------------ */
.screen--lobby .screen-head { position: relative; z-index: 3; }

.lobby__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(232, 195, 122, .05) 50%, transparent 50.1%),
    radial-gradient(50% 50% at 24% 40%, rgba(91, 141, 239, .07), transparent 62%),
    radial-gradient(46% 46% at 82% 70%, rgba(232, 195, 122, .08), transparent 62%);
  pointer-events: none;
}

.lobby__glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
  pointer-events: none;
}

.lobby__glow--a { left: -120px; top: 120px; background: rgba(91, 141, 239, .2); }
.lobby__glow--b { right: -140px; bottom: -80px; background: rgba(232, 195, 122, .18); }

.lobby__net {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--text-faint);
}

.lobby__net i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 8px rgba(255, 255, 255, .2);
}

.lobby__net.is-online { color: var(--green); }
.lobby__net.is-online i { background: var(--green); box-shadow: 0 0 10px rgba(79, 214, 184, .7); }

.lobby__body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1.06fr;
  gap: 30px;
  padding: 10px 56px 34px;
}

.lobby__left { display: flex; flex-direction: column; gap: 18px; min-height: 0; }

.lobby__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 28px;
  border-radius: 16px;
  border: 1px solid rgba(232, 195, 122, .2);
  background:
    radial-gradient(80% 70% at 0% 0%, rgba(232, 195, 122, .08), transparent 60%),
    linear-gradient(160deg, rgba(17, 22, 35, .94), rgba(7, 9, 15, .94));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.lobby__panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: .18em;
  color: var(--text);
}

.lobby__panel-title > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid rgba(232, 195, 122, .4);
  background: rgba(232, 195, 122, .08);
  color: var(--gold);
  font-size: 12px;
}

.lobby__panel-title em {
  margin-left: auto;
  font-style: normal;
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--text-faint);
}

.lobby__entry { display: flex; flex-direction: column; gap: 14px; }

.lobby__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--text-faint);
}

.lobby__divider::before,
.lobby__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 195, 122, .2), transparent);
}

.lobby__room {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 16px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px dashed rgba(232, 195, 122, .35);
  background: rgba(232, 195, 122, .05);
}

.lobby__room-label { font-size: 11px; letter-spacing: .3em; color: var(--text-faint); }

.lobby__room-code {
  grid-row: 2;
  font-family: var(--font-num);
  font-size: 42px;
  letter-spacing: .28em;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(232, 195, 122, .35);
  line-height: 1;
}

.lobby__room .btn--icon {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 62px;
  padding: 9px 8px;
  font-size: 10px;
  letter-spacing: .1em;
}

.lobby__room-hint {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--text-faint);
}

.lobby__status {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--text-dim);
}

.lobby__status[data-kind="error"] { color: var(--red-bright); }
.lobby__status[data-kind="success"] { color: var(--green); }

.lobby__tips {
  padding: 18px 22px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .015);
}

.lobby__tips h4 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--gold);
  font-weight: 500;
}

.lobby__tips ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 5px; }

.lobby__tips li { font-size: 11px; line-height: 1.7; color: var(--text-faint); letter-spacing: .04em; }

.lobby__right { display: flex; flex-direction: column; gap: 18px; min-height: 0; }

.lobby__members {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 28px;
  border-radius: 16px;
  border: 1px solid rgba(232, 195, 122, .2);
  background:
    radial-gradient(80% 70% at 100% 0%, rgba(91, 141, 239, .08), transparent 60%),
    linear-gradient(160deg, rgba(17, 22, 35, .94), rgba(7, 9, 15, .94));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.lobby__players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }

.lobby-player {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 64px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .02);
  transition: all .2s ease;
}

.lobby-player.is-self {
  border-color: rgba(232, 195, 122, .4);
  background: rgba(232, 195, 122, .07);
  box-shadow: inset 0 0 20px rgba(232, 195, 122, .06);
}

.lobby-player--empty { border-style: dashed; opacity: .55; }

.lobby-player__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(232, 195, 122, .4);
  background:
    radial-gradient(circle at 30% 25%, hsla(var(--hue, 42), 60%, 62%, .35), transparent 70%),
    rgba(5, 6, 10, .6);
  color: var(--gold-bright);
  font-family: var(--font-title);
  font-size: 17px;
  flex: 0 0 auto;
}

.lobby-player--empty .lobby-player__avatar { border-style: dashed; color: var(--text-faint); }

.lobby-player__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

.lobby-player__name {
  font-size: 14px;
  letter-spacing: .1em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-player__name em { font-style: normal; font-size: 11px; color: var(--gold); }

.lobby-player__tag { font-size: 10px; letter-spacing: .16em; color: var(--text-faint); }

.lobby-player.is-self .lobby-player__tag { color: var(--gold); }

.lobby-player__crown { font-size: 20px; color: var(--gold-bright); text-shadow: 0 0 12px rgba(232, 195, 122, .5); }

.lobby-player__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(79, 214, 184, .55);
}

.lobby__members-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px dashed rgba(232, 195, 122, .18);
  background: rgba(232, 195, 122, .025);
}

.lobby__members-seal {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border-radius: 10px;
  border: 2px solid rgba(232, 195, 122, .28);
  color: rgba(232, 195, 122, .62);
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: .06em;
  line-height: 1.1;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.lobby__members-note p {
  margin: 0;
  font-size: 11px;
  line-height: 1.85;
  letter-spacing: .08em;
  color: var(--text-faint);
}

.lobby__actions { display: flex; flex-direction: column; gap: 10px; }

.lobby__waiting {
  margin: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--text-dim);
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 8px;
  animation: pulse-soft 1.8s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}

/* ==================================================================
   8. 对局桌面
   ================================================================== */
.screen--battle { background: transparent; }

.battle__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 56% at 50% 47%, rgba(62, 52, 34, .42) 0%, rgba(18, 23, 34, .55) 52%, rgba(4, 5, 9, .95) 86%),
    linear-gradient(180deg, #0a0d15 0%, #05060a 100%);
}

.battle__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../assets/bg/table.png') center / cover no-repeat;
  opacity: .42;
  filter: brightness(1.65) saturate(1.15) contrast(1.05);
}

.battle__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 34% 28% at 50% 46%, rgba(232, 195, 122, .1), transparent 72%),
    radial-gradient(ellipse at 50% 48%, transparent 42%, rgba(3, 4, 7, .66) 100%),
    linear-gradient(180deg, rgba(4, 5, 9, .32) 0%, transparent 24%, rgba(4, 5, 9, .4) 100%);
}

.battle__inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 236px;
  grid-template-rows: 48px 1fr;
}

.battle__main {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 254px;
  min-height: 0;
  min-width: 0;
  position: relative;
}

/* ---- 顶部信息栏 ---- */
.battlebar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(232, 195, 122, .16);
  background: linear-gradient(180deg, rgba(8, 10, 17, .94), rgba(8, 10, 17, .5));
  backdrop-filter: blur(8px);
}

.battlebar__left { display: flex; align-items: center; gap: 12px; min-width: 300px; }

.battlebar__logo {
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: .06em;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(232, 195, 122, .35);
  white-space: nowrap;
}

.battlebar__logo em { font-style: normal; margin: 0 3px; opacity: .55; }

.battlebar__mode {
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(232, 195, 122, .28);
  background: rgba(232, 195, 122, .07);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--gold);
}

.battlebar__center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .12em;
  min-width: 0;
}

.battlebar__round { font-family: var(--font-num); font-size: 13px; color: var(--gold); white-space: nowrap; }
.battlebar__sep { width: 1px; height: 14px; background: rgba(255, 255, 255, .12); flex: 0 0 auto; }

.phase-track { display: flex; gap: 5px; align-items: center; flex: 0 0 auto; }

.phase-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  transition: all .3s ease;
}

.phase-dot.is-done { background: rgba(232, 195, 122, .4); }

.phase-dot.is-current {
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold);
  transform: scale(1.35);
}

.battlebar__phase {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: .16em;
  color: var(--text);
  white-space: nowrap;
}

.battlebar__current { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battlebar__current.is-me { color: var(--gold-bright); text-shadow: 0 0 14px rgba(232, 195, 122, .35); }

.battlebar__right { display: flex; gap: 8px; min-width: 240px; justify-content: flex-end; }

.pilechip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .03);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .06em;
  white-space: nowrap;
}

.pilechip b { font-family: var(--font-num); color: var(--text); font-size: 13px; }

.pilechip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  font-size: 9px;
  color: var(--gold);
  background: rgba(232, 195, 122, .12);
}

/* ---- 牌桌区域 ---- */
.table { position: relative; min-height: 0; overflow: hidden; }
.table::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 46% at 50% 52%, rgba(232, 195, 122, .07), transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 60%, rgba(91, 141, 239, .05), transparent 70%);
  pointer-events: none;
}

.table__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 660px;
  height: 396px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(232, 195, 122, .15);
  background: radial-gradient(ellipse at 50% 50%, rgba(22, 29, 44, .55), rgba(8, 10, 17, .2) 62%, transparent 74%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .55), 0 0 60px rgba(232, 195, 122, .04);
  pointer-events: none;
}

.table__ring--inner {
  width: 452px;
  height: 252px;
  border-style: dashed;
  border-color: rgba(232, 195, 122, .1);
  background: transparent;
  box-shadow: none;
}

.table__seats { position: absolute; inset: 0; z-index: 22; }

/* ---- 座位 ---- */
.seat {
  position: absolute;
  width: 226px;
  height: 114px;
  z-index: 22;
  transition: filter .4s ease, opacity .4s ease;
}

.seat--top { left: 50%; top: 5px; transform: translateX(-50%); width: 258px; }
.seat--left { left: 16px; top: 176px; }
.seat--right { right: 16px; top: 176px; }

.seat__frame {
  position: relative;
  display: flex;
  gap: 10px;
  height: 100%;
  padding: 8px 10px 8px 8px;
  border-radius: 12px;
  border: 1px solid rgba(232, 195, 122, .24);
  background: linear-gradient(105deg, rgba(15, 19, 30, .92), rgba(8, 10, 17, .74));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
  backdrop-filter: blur(6px);
}

.seat__frame::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--faction-color), transparent);
  opacity: .6;
}

.seat__portraitwrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(232, 195, 122, .35);
  background: rgba(5, 6, 10, .6);
}

.seat__portraitwrap .portrait { width: 100%; height: 100%; }
.seat__portraitwrap .portrait__img { object-position: top center; }
.seat__portraitwrap .portrait__fallback-name { font-size: 10px; bottom: 5px; }

.seat__turnvignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 100%, rgba(232, 195, 122, .4), transparent 72%);
  animation: pulse-soft 2s ease-in-out infinite;
  pointer-events: none;
}

.seat__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.seat__nameline { display: flex; align-items: baseline; gap: 6px; padding-right: 26px; min-width: 0; }

.seat__name {
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: .05em;
  color: var(--text);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}

.seat__playername {
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: .08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat__title {
  font-size: 9px;
  letter-spacing: .1em;
  color: color-mix(in srgb, var(--faction-color) 60%, var(--text-faint));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat__stats { display: flex; align-items: center; gap: 8px; margin-top: auto; min-height: 17px; }

.seat__handcount {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--text-dim);
}

.mini-cardback {
  width: 10px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(232, 195, 122, .55);
  background: linear-gradient(135deg, #26314a, #0d1220);
  box-shadow: 2px 2px 0 -1px rgba(232, 195, 122, .22);
}

.seat__judges { display: flex; gap: 3px; }

.judge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 3px;
  border: 1px solid rgba(185, 120, 232, .5);
  background: rgba(185, 120, 232, .14);
  color: #dcb9ff;
  font-size: 9px;
  font-family: var(--font-title);
  animation: judge-pulse 2.4s ease-in-out infinite;
}

.judge-icon--shandian {
  border-color: rgba(91, 141, 239, .5);
  background: rgba(91, 141, 239, .14);
  color: #a8c6ff;
}

.mark-chip {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(232, 195, 122, .12);
  color: var(--gold);
  font-size: 8px;
  white-space: nowrap;
}

.seat__id { position: absolute; right: 7px; top: 6px; z-index: 3; }
.seat__faction { position: absolute; left: 10px; top: 10px; z-index: 3; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }

.seat.is-current .seat__frame {
  border-color: rgba(255, 227, 163, .85);
  box-shadow: 0 0 0 1px rgba(232, 195, 122, .35), 0 0 32px rgba(232, 195, 122, .28), 0 12px 30px rgba(0, 0, 0, .5);
  animation: seat-breathe 2.4s ease-in-out infinite;
}

.seat.is-dead { filter: grayscale(1) brightness(.55); opacity: .58; }
.seat.is-dead .seat__frame { animation: none; }

.seat.is-dying .seat__frame {
  border-color: rgba(224, 90, 79, .9);
  animation: dying-pulse 1s ease-in-out infinite;
}

.seat.is-targetable { cursor: crosshair; }

.seat.is-targetable .seat__frame {
  border-color: rgba(255, 215, 106, .95);
  box-shadow: 0 0 0 2px rgba(255, 215, 106, .55), 0 0 42px rgba(255, 215, 106, .35);
  animation: target-pulse 1.15s ease-in-out infinite;
}

.seat.is-targeted .seat__frame {
  border-color: #ffd76a;
  background: linear-gradient(105deg, rgba(232, 195, 122, .22), rgba(8, 10, 17, .8));
  box-shadow: 0 0 0 2px #ffd76a, 0 0 52px rgba(255, 215, 106, .5);
  animation: none;
}

.seat__targethint {
  position: absolute;
  left: 50%;
  bottom: -11px;
  transform: translateX(-50%);
  padding: 2px 12px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, .6);
  background: rgba(10, 8, 4, .92);
  color: var(--gold-bright);
  font-size: 10px;
  letter-spacing: .16em;
  white-space: nowrap;
  z-index: 6;
  box-shadow: 0 0 18px rgba(232, 195, 122, .35);
  animation: pulse-soft 1.4s ease-in-out infinite;
}

.seat__ordernum {
  position: absolute;
  right: -7px;
  top: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid #fff2cf;
  background: linear-gradient(180deg, #ffe8a8, #d8a548);
  color: #241804;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  z-index: 7;
  box-shadow: 0 0 18px rgba(232, 195, 122, .65);
}

.seat__deadmark {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 10, .42);
  color: rgba(255, 255, 255, .78);
  font-family: var(--font-title);
  font-size: 25px;
  letter-spacing: .4em;
  text-indent: .4em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .9);
}

.seat__dyingmark {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 6;
  color: var(--red-bright);
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: .2em;
  animation: pulse-soft .8s ease-in-out infinite;
}

/* ---- 中央牌堆 ---- */
.pile { position: absolute; z-index: 15; display: flex; flex-direction: column; align-items: center; gap: 5px; }

.pile--deck { left: calc(50% - 152px); top: 226px; }
.pile--discard { left: calc(50% + 76px); top: 226px; }

.pile__stack, .pile__top { position: relative; display: block; width: 76px; height: 104px; }

.pile__label { font-size: 9px; letter-spacing: .34em; color: var(--text-faint); text-indent: .34em; }

.pile__count {
  position: absolute;
  right: -8px;
  top: -8px;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe8a8, #c9973f);
  color: #26190a;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .55);
  z-index: 3;
}

.pile__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 104px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, .16);
  color: var(--text-faint);
  font-size: 11px;
}

.pile--deck .cardback {
  box-shadow: 3px 3px 0 0 rgba(23, 32, 51, .95), 6px 6px 0 0 rgba(15, 20, 33, .95), 0 8px 18px rgba(0, 0, 0, .5);
}

.table__center {
  position: absolute;
  left: 50%;
  top: 238px;
  transform: translateX(-50%);
  width: 152px;
  text-align: center;
  z-index: 16;
  pointer-events: none;
}

.table__round {
  display: block;
  font-family: var(--font-title);
  font-size: 30px;
  letter-spacing: .06em;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(232, 195, 122, .45);
  line-height: 1.15;
}

.table__phase {
  display: block;
  font-size: 11px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--text-dim);
  margin-top: 2px;
}

.table__current {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--gold);
  opacity: .85;
}

.table__waiting {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, .25);
  background: rgba(6, 8, 13, .82);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--text-dim);
  z-index: 30;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
}

.waiting__dots { display: flex; gap: 3px; }

.waiting__dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.waiting__dots i:nth-child(2) { animation-delay: .15s; }
.waiting__dots i:nth-child(3) { animation-delay: .3s; }

/* ---- 牌背 ---- */
.cardback {
  position: relative;
  display: block;
  width: 76px;
  height: 104px;
  border-radius: 6px;
  border: 1px solid rgba(232, 195, 122, .55);
  background: linear-gradient(150deg, #1c2740, #0a101c 60%, #131d31);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5);
  overflow: hidden;
}

.cardback__inner {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(232, 195, 122, .32);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, rgba(232, 195, 122, .05) 0 2px, transparent 2px 6px);
}

.cardback__emblem {
  font-family: var(--font-title);
  font-size: 30px;
  color: rgba(232, 195, 122, .55);
  text-shadow: 0 0 16px rgba(232, 195, 122, .3);
}

.cardback__lines {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(232, 195, 122, .14);
  border-radius: 50%;
}

/* ---- 我方区域 ---- */
.selfzone {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr) 118px;
  gap: 12px;
  padding: 6px 12px 10px;
  border-top: 1px solid rgba(232, 195, 122, .14);
  background: linear-gradient(180deg, rgba(6, 8, 13, .3), rgba(6, 8, 13, .8));
  position: relative;
  min-height: 0;
}

.self-card-wrap { position: relative; min-height: 0; }

.self-card {
  position: relative;
  height: 100%;
  border-radius: 12px;
  border: 1px solid rgba(232, 195, 122, .35);
  background: linear-gradient(160deg, #151b2a, #080b12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.self-card--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-title);
  letter-spacing: .2em;
  font-size: 13px;
}

.self-card__art { position: absolute; inset: 0; border-radius: 11px; overflow: hidden; }
.self-card__art .portrait { width: 100%; height: 100%; }
.self-card__art .portrait__img { object-position: 50% 10%; }
.self-card__art .portrait__fallback-name { bottom: 84px; font-size: 15px; }

.self-card__shade {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(5, 7, 12, .12) 0%, rgba(5, 7, 12, .04) 32%, rgba(5, 7, 12, .8) 66%, rgba(5, 7, 12, .98) 100%);
  pointer-events: none;
}

.self-card__top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

.self-card__playername {
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--text-dim);
  background: rgba(5, 6, 10, .55);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .08);
}

.self-card__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 3;
}

.self-card__nameline { display: flex; align-items: baseline; gap: 6px; min-width: 0; }

.self-card__charname {
  font-family: var(--font-title);
  font-size: 23px;
  letter-spacing: .03em;
  color: #fff8ea;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .85);
  white-space: nowrap;
}

.self-card__title {
  font-size: 10px;
  color: var(--faction-color);
  filter: brightness(1.2);
  letter-spacing: .08em;
  white-space: nowrap;
}

.self-card__nameline .faction-badge { margin-left: auto; }

.self-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.self-card__era {
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.self-card__skills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }

.self-card.is-current { border-color: rgba(255, 227, 163, .8); box-shadow: 0 0 0 1px rgba(232, 195, 122, .35), 0 0 34px rgba(232, 195, 122, .25); }
.self-card.is-dead { filter: grayscale(1) brightness(.6); }
.self-card.is-targetable { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(255, 215, 106, .5), 0 0 44px rgba(255, 215, 106, .35); cursor: crosshair; }
.self-card__targethint {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, .6);
  background: rgba(10, 8, 4, .9);
  color: var(--gold-bright);
  font-size: 10px;
  letter-spacing: .16em;
  z-index: 5;
}

.self-card__turnflag {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, #ffe8a8, #c9973f);
  color: #241804;
  font-size: 9px;
  letter-spacing: .18em;
  z-index: 5;
}

/* 技能条 */
.skillchip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(5, 6, 10, .6);
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: .04em;
  cursor: default;
  transition: all .16s ease;
}

.skillchip__name { color: var(--text); font-weight: 600; }
.skillchip__tag { font-size: 8px; color: var(--text-faint); border-left: 1px solid rgba(255, 255, 255, .14); padding-left: 4px; }
.skillchip__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); flex: 0 0 auto; }
.skillchip__cost { font-size: 8px; color: #ffb9a9; border: 1px solid rgba(224, 90, 79, .35); border-radius: 3px; padding: 0 3px; }
.skillchip__targets { font-size: 8px; color: var(--text-faint); }

.skillchip--active { cursor: pointer; border-color: rgba(232, 195, 122, .3); }
.skillchip--active .skillchip__dot { background: var(--red-bright); box-shadow: 0 0 6px var(--red); }
.skillchip--active.is-usable {
  border-color: rgba(232, 195, 122, .8);
  background: rgba(232, 195, 122, .14);
  color: #ffe8b5;
  box-shadow: 0 0 14px rgba(232, 195, 122, .22);
}

.skillchip--active.is-usable:hover { background: rgba(232, 195, 122, .26); transform: translateY(-1px); }
.skillchip--active:not(.is-usable) { opacity: .46; cursor: not-allowed; }
.skillchip--convert .skillchip__dot { background: var(--blue-bright); box-shadow: 0 0 6px var(--blue); }
.skillchip--passive .skillchip__dot { background: var(--gold); }

.skillchip__tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 228px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(232, 195, 122, .4);
  background: rgba(8, 10, 17, .985);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .7);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: .02em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  pointer-events: none;
  z-index: 400;
  white-space: normal;
}

.skillchip__tip b {
  display: block;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: .12em;
  margin-bottom: 3px;
}

.skillchip:hover .skillchip__tip,
.skillchip:focus .skillchip__tip,
.skillchip:focus-visible .skillchip__tip { opacity: 1; visibility: visible; transform: translateY(0); }

.handzone { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.handzone__hint {
  height: 26px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s ease;
}

.handzone__hint[data-kind="myplay"] { color: var(--gold); }
.handzone__hint[data-kind="selecting"] { color: var(--gold-bright); text-shadow: 0 0 12px rgba(232, 195, 122, .3); }
.handzone__hint[data-kind="pending"] { color: var(--red-bright); }

.hand { position: relative; flex: 1; min-height: 0; }
.hand__inner { position: absolute; inset: 0; }

.hand__empty {
  position: absolute;
  inset: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 10px;
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: .4em;
  text-indent: .4em;
  color: var(--text-faint);
}

/* 手牌布局（位置由 ui.js layoutHand 写入 CSS 变量） */
.hand .card {
  position: absolute;
  left: 0;
  top: 42px;
  width: 86px;
  height: 126px;
  transform: translate3d(var(--tx, 0px), calc(var(--ty, 0px) + var(--lift, 0px)), 0)
    rotate(var(--rot, 0deg)) scale(var(--scale, 1));
  transform-origin: 50% 115%;
  z-index: calc(10 + var(--card-i, 0));
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s ease, filter .18s ease;
  will-change: transform;
}

.hand .card:hover {
  --lift: -30px;
  --scale: 1.07;
  z-index: 300;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .62), 0 0 22px rgba(232, 195, 122, .3);
}

.hand .card.is-selected {
  --lift: -46px;
  --scale: 1.1;
  z-index: 320;
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 36px rgba(232, 195, 122, .55), 0 20px 40px rgba(0, 0, 0, .62);
}

.hand .card.is-selected:hover { --lift: -50px; }

.hand .card.is-playable { border-color: rgba(255, 232, 160, .95); }

.hand .card.is-disabled {
  filter: grayscale(.6) brightness(.66);
  cursor: not-allowed;
}

.hand .card.is-disabled:hover { --lift: 0px; --scale: 1; box-shadow: 0 6px 16px rgba(0, 0, 0, .55); }

.hand .card.is-cost {
  box-shadow: 0 0 0 2px var(--red-bright), 0 0 28px rgba(224, 90, 79, .5);
}

.hand.is-locked .card { filter: saturate(.75) brightness(.78); }

/* ---- 操作栏 ---- */
.actionbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(232, 195, 122, .18);
  background: linear-gradient(180deg, rgba(14, 18, 29, .88), rgba(6, 8, 13, .72));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  min-width: 0;
}

.actionbar__round {
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
}

.actionbar__round b { font-family: var(--font-num); color: var(--gold); font-size: 17px; }

.actionbar__phase {
  text-align: center;
  font-size: 9px;
  letter-spacing: .24em;
  text-indent: .24em;
  color: var(--gold);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(232, 195, 122, .14);
  white-space: nowrap;
}

.actionbar__variants { display: flex; flex-direction: column; gap: 6px; }

.actionbar__varianttitle { font-size: 10px; color: var(--text-dim); line-height: 1.5; text-align: center; }

.btn--variant { padding: 6px 8px; font-size: 11px; letter-spacing: .02em; min-height: 0; width: 100%; line-height: 1.35; }

.btn--endturn {
  min-height: 64px;
  padding: 8px 8px;
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: .16em;
  text-indent: .16em;
  color: #211505;
  background: linear-gradient(180deg, #ffe3a3, #d9a94f);
  border-color: #ffe9b5;
  font-weight: 700;
  box-shadow: 0 6px 22px rgba(232, 195, 122, .25);
  line-height: 1.3;
}

.btn--endturn:hover { background: linear-gradient(180deg, #fff0c8, #e6bb66); box-shadow: 0 8px 28px rgba(232, 195, 122, .4); }

.actionbar__confirm {
  min-height: 44px;
  padding: 7px 6px;
  font-size: 12px;
  letter-spacing: .02em;
  line-height: 1.35;
  white-space: normal;
}

.actionbar .btn--ghost { min-height: 32px; font-size: 11px; padding: 4px; }

.actionbar__wait { text-align: center; font-size: 10px; color: var(--text-faint); letter-spacing: .2em; }

/* ---- 日志侧栏 ---- */
.logpanel {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid rgba(232, 195, 122, .16);
  background: linear-gradient(180deg, rgba(7, 9, 15, .82), rgba(5, 6, 10, .9));
  backdrop-filter: blur(10px);
  z-index: 30;
}

.logpanel__head {
  flex: 0 0 auto;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(232, 195, 122, .14);
}

.logpanel__title {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--gold);
}

.logpanel__round { font-style: normal; font-size: 10px; letter-spacing: .08em; color: var(--text-faint); }

.logpanel__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
}

.logitem {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  border-left: 2px solid transparent;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-dim);
  transition: background .3s ease;
}

.logitem__turn { font-family: var(--font-num); font-size: 9px; color: var(--text-faint); flex: 0 0 auto; padding-top: 2px; }

.logitem__dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(232, 195, 122, .35); flex: 0 0 auto; margin-top: 7px; }

.logitem__text { flex: 1; word-break: break-word; }

.logitem.is-latest {
  background: rgba(232, 195, 122, .07);
  border-left-color: var(--gold);
  color: var(--text);
}

.logitem--empty { color: var(--text-faint); justify-content: center; padding-top: 20px; letter-spacing: .2em; font-size: 10px; }

.logpanel__foot {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(232, 195, 122, .12);
}

/* ==================================================================
   9. 卡牌
   ================================================================== */
.card {
  position: relative;
  display: block;
  width: 86px;
  height: 126px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 232, 180, .65);
  background:
    radial-gradient(130% 90% at 50% 0%, #fdf6e7 0%, #f1e5cc 46%, #dcc9a2 100%);
  color: #26190a;
  font-family: var(--font-title);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .35);
  -webkit-tap-highlight-color: transparent;
}

.card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(90, 60, 20, .26);
  border-radius: 5px;
  pointer-events: none;
  z-index: 2;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 55% at 50% 0%, rgba(255, 255, 255, .5), transparent 62%);
  pointer-events: none;
  z-index: 1;
}

.card__typebar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--card-type-color, #c04138);
  z-index: 3;
}

.card--basic { --card-type-color: #c04138; }
.card--trick { --card-type-color: #4059b0; }
.card--delay { --card-type-color: #8458c9; }

.card__corner {
  position: absolute;
  left: 6px;
  top: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  z-index: 3;
  font-family: var(--font-num);
}

.card__rank { font-size: 15px; font-weight: 700; }
.card__suit { font-size: 13px; margin-top: 1px; }
.card__corner.is-red { color: #b2362c; }
.card__corner.is-black { color: #231a10; }

.card__watermark {
  position: absolute;
  right: 2px;
  bottom: 14px;
  font-size: 52px;
  line-height: 1;
  color: rgba(92, 60, 20, .1);
  z-index: 0;
  font-family: var(--font-title);
  pointer-events: none;
}

.card__name {
  position: absolute;
  left: 0;
  right: 0;
  top: 38px;
  z-index: 3;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .08em;
  text-indent: .08em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
  white-space: nowrap;
}

.card__name.is-mid { font-size: 18px; top: 42px; letter-spacing: 0; text-indent: 0; }
.card__name.is-long { font-size: 15px; top: 45px; letter-spacing: 0; text-indent: 0; }

.card__type {
  position: absolute;
  left: 0;
  right: 0;
  top: 68px;
  z-index: 3;
  text-align: center;
  font-size: 8px;
  letter-spacing: .22em;
  text-indent: .22em;
  color: rgba(70, 45, 15, .55);
  font-family: var(--font-sans);
}

.card__desc {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 8px;
  z-index: 3;
  font-family: var(--font-sans);
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: 0;
  color: rgba(52, 34, 12, .75);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__as {
  position: absolute;
  right: 3px;
  top: 3px;
  z-index: 4;
  padding: 2px 3px;
  border-radius: 3px;
  background: rgba(232, 195, 122, .92);
  color: #2a1c06;
  font-family: var(--font-sans);
  font-size: 7px;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

.card__seal {
  position: absolute;
  right: 6px;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 7px var(--gold);
  opacity: 0;
  z-index: 4;
}

.card.has-convert .card__seal { opacity: 1; }

/* 迷你牌（响应 / 选牌 / 整理） */
.card--mini {
  width: 64px;
  height: 94px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}

.card--mini .card__rank { font-size: 12px; }
.card--mini .card__suit { font-size: 10px; }
.card--mini .card__corner { left: 5px; top: 7px; }
.card--mini .card__name { font-size: 17px; top: 30px; }
.card--mini .card__name.is-mid { font-size: 14px; top: 32px; }
.card--mini .card__name.is-long { font-size: 11px; top: 34px; }
.card--mini .card__type { display: none; }
.card--mini .card__desc { display: none; }
.card--mini .card__watermark { font-size: 34px; bottom: 8px; }
.card--mini::before { inset: 3px; }

/* 牌堆顶展示用 */
.card--pile {
  width: 76px;
  height: 104px;
  pointer-events: none;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .5);
}

.card--pile .card__name { font-size: 18px; top: 34px; }
.card--pile .card__type { display: none; }
.card--pile .card__desc { display: none; }

/* ==================================================================
   10. 待决策浮层（pending）
   ================================================================== */
.battle__modal {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pending-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(12, 16, 26, .5), rgba(3, 4, 7, .82) 78%);
  backdrop-filter: blur(3px);
  animation: fade-in .2s ease both;
}

.battle__modal[data-kind="dying"] .pending-scrim {
  background: radial-gradient(ellipse at 50% 46%, rgba(64, 8, 8, .55), rgba(3, 4, 7, .9) 78%);
  animation: fade-in .2s ease both, dying-veil 1.7s ease-in-out .2s infinite;
}

.pending {
  position: relative;
  z-index: 2;
  width: 800px;
  max-width: calc(100% - 120px);
  max-height: 84%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(232, 195, 122, .35);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(232, 195, 122, .1), transparent 62%),
    linear-gradient(160deg, rgba(18, 24, 38, .985), rgba(7, 9, 15, .99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .75), 0 0 60px rgba(232, 195, 122, .08);
  overflow: hidden;
  transform: translateY(-14px);
  animation: pending-in .24s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes pending-in {
  from { opacity: 0; transform: translateY(4px) scale(.975); }
  to { opacity: 1; transform: translateY(-14px) scale(1); }
}

.battle__modal[data-kind="response"] .pending,
.battle__modal[data-kind="dying"] .pending { width: 690px; }

.battle__modal[data-kind="chooseOption"] .pending { width: 640px; }

.battle__modal[data-kind="arrange"] .pending { width: 840px; }

.pending--dying {
  border-color: rgba(224, 90, 79, .65);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .8), 0 0 70px rgba(224, 90, 79, .28);
  animation: pending-in .24s cubic-bezier(.2, .8, .3, 1) both, dying-panel 1.6s ease-in-out .24s infinite;
}

.pending__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 26px 16px;
  border-bottom: 1px solid rgba(232, 195, 122, .14);
}

.pending__sigil {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(232, 195, 122, .5);
  background: rgba(232, 195, 122, .1);
  color: var(--gold-bright);
  font-family: var(--font-title);
  font-size: 22px;
  box-shadow: 0 0 22px rgba(232, 195, 122, .18);
}

.pending__titles { flex: 1; min-width: 0; }

.pending__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fdf6e6;
  text-shadow: 0 0 24px rgba(232, 195, 122, .2);
}

.pending__sub {
  margin: 5px 0 0;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-dim);
  line-height: 1.6;
}

.pending__sourcecard { flex: 0 0 auto; transform: scale(.86); transform-origin: right center; }

.pending__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 26px 6px;
}

.pending__foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px 20px;
  border-top: 1px solid rgba(232, 195, 122, .12);
}

.pending__counter {
  flex: 1;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--text-dim);
}

.pending__counter b { font-family: var(--font-num); font-size: 17px; color: var(--gold-bright); }

.pending__cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 4px;
  padding: 4px 0 10px;
}

.pending__cards--hand { justify-content: flex-start; }

.pending-card {
  position: relative;
  display: block;
  margin: 10px 9px 14px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform .16s cubic-bezier(.2, .8, .3, 1), filter .16s ease;
  transform-origin: 50% 100%;
}

.pending-card .card { transform: scale(1.16); }

.pending-card .card { transition: box-shadow .16s ease, border-color .16s ease, filter .16s ease; }

.pending-card:hover { transform: translateY(-5px); }
.pending-card:hover .card { box-shadow: 0 12px 26px rgba(0, 0, 0, .6), 0 0 20px rgba(232, 195, 122, .3); border-color: var(--gold-bright); }

.pending-card.is-selected { transform: translateY(-9px); }

.pending-card.is-selected .card {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 32px rgba(232, 195, 122, .55), 0 14px 28px rgba(0, 0, 0, .6);
}

.pending-card.is-selected::after {
  content: "✓";
  position: absolute;
  right: -6px;
  top: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe8a8, #d8a548);
  color: #241804;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(232, 195, 122, .6);
  z-index: 6;
}

.pending-card__convert {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(91, 141, 239, .5);
  background: rgba(9, 14, 26, .95);
  color: var(--blue-bright);
  font-size: 9px;
  letter-spacing: .04em;
  white-space: nowrap;
  z-index: 5;
}

.pending__convert-tip {
  margin: 10px 0 2px;
  text-align: center;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--text-faint);
}

.pending__empty {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--text-faint);
}

/* 观星 */
.arrange { display: flex; flex-direction: column; gap: 12px; }

.arrange__row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(232, 195, 122, .18);
  background: rgba(255, 255, 255, .02);
  min-height: 118px;
}

.arrange__row--bottom { border-color: rgba(91, 141, 239, .25); background: rgba(91, 141, 239, .04); }

.arrange__label {
  flex: 0 0 92px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: .14em;
  color: var(--gold);
}

.arrange__label em { font-style: normal; font-family: var(--font-sans); font-size: 9px; letter-spacing: .06em; color: var(--text-faint); }

.arrange__cards { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.arrange__empty { font-size: 11px; color: var(--text-faint); letter-spacing: .1em; }

.arrange-card__zone {
  display: block;
  margin-top: 4px;
  text-align: center;
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--gold);
}

.arrange-card.is-bottom .arrange-card__zone { color: var(--blue-bright); }

/* 二选一 */
.choose-options { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 12px; }

.btn--option {
  min-height: 58px;
  justify-content: flex-start;
  padding: 12px 22px;
  font-size: 15px;
  letter-spacing: .08em;
  text-align: left;
  border-color: rgba(232, 195, 122, .35);
  background: linear-gradient(100deg, rgba(232, 195, 122, .1), rgba(232, 195, 122, .02));
}

.btn--option:hover {
  background: linear-gradient(100deg, rgba(232, 195, 122, .24), rgba(232, 195, 122, .06));
  transform: translateX(4px);
}

/* ==================================================================
   11. 特效 / 动画
   ================================================================== */
.battle__flash {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
}

.battle__flash.is-damage {
  background: radial-gradient(ellipse at 50% 50%, transparent 38%, rgba(224, 90, 79, .3) 100%);
  animation: flash-fade .55s ease both;
}

.battle__flash.is-heal {
  background: radial-gradient(ellipse at 50% 62%, transparent 38%, rgba(79, 214, 184, .22) 100%);
  animation: flash-fade .7s ease both;
}

.battle__fx { position: absolute; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }

.battle__inner.is-shaking { animation: shake-screen .44s cubic-bezier(.36, .07, .19, .97); }

.fx-banner {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  z-index: 75;
  pointer-events: none;
  text-align: center;
  padding: 10px 70px;
  background: radial-gradient(ellipse at center, rgba(4, 5, 9, .62) 0%, rgba(4, 5, 9, .3) 48%, transparent 74%);
  animation: banner-in 1.5s cubic-bezier(.2, .8, .3, 1) both;
}

.fx-banner__line { display: block; position: relative; padding: 6px 40px; }
.fx-banner__line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 195, 122, .55), transparent);
  transform: scaleX(0);
  animation: banner-line 1.4s ease both;
}

.fx-banner__main {
  display: block;
  position: relative;
  font-family: var(--font-title);
  font-size: 62px;
  font-weight: 700;
  letter-spacing: .18em;
  text-indent: .18em;
  line-height: 1.15;
  color: #fff4d8;
  text-shadow: 0 0 40px rgba(232, 195, 122, .75), 0 4px 22px rgba(0, 0, 0, .85);
  filter: drop-shadow(0 0 22px rgba(232, 195, 122, .45));
  background: linear-gradient(180deg, #fff9ea 0%, #ffe3a3 48%, #d3a052 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fx-banner__sub {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--gold);
  opacity: .9;
}

.fx-banner--skill .fx-banner__main { font-size: 74px; letter-spacing: .12em; }
.fx-banner--turn .fx-banner__main { font-size: 36px; letter-spacing: .16em; }
.fx-banner--turn .fx-banner__line { padding: 4px 60px; }
.fx-banner--kill .fx-banner__main {
  background: linear-gradient(180deg, #ffe4dd 0%, #ff7a6c 48%, #a13028 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.fx-banner--death .fx-banner__main { font-size: 48px; color: #d8d2c6; background: none; -webkit-text-fill-color: currentColor; }
.fx-banner--gameover .fx-banner__main { font-size: 56px; }

.fx-float { position: absolute; z-index: 78; pointer-events: none; transform: translate(-50%, -50%); }

.fx-float__text {
  display: block;
  font-family: var(--font-num);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .85), 0 0 22px currentColor;
}

.fx-float__text--damage { color: #ff6b5e; }
.fx-float__text--heal { color: #7ff0d5; }
.fx-float__text--dodge { color: #8ab4ff; font-size: 26px; font-family: var(--font-title); letter-spacing: .2em; }
.fx-float__text--lose { color: #d38cf7; font-size: 26px; font-family: var(--font-title); }
.fx-float__text--card { color: #ffe3a3; font-size: 22px; font-family: var(--font-title); letter-spacing: .1em; }
.fx-float__text--judge { color: #ffc46b; font-size: 22px; font-family: var(--font-title); }

.fx-card {
  position: absolute;
  z-index: 80;
  width: 72px;
  height: 98px;
  border-radius: 6px;
  border: 1px solid rgba(232, 195, 122, .7);
  background: linear-gradient(150deg, #22304d, #0a101c);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 26px rgba(232, 195, 122, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform, opacity;
}

.fx-card__back {
  font-family: var(--font-title);
  font-size: 22px;
  color: rgba(232, 195, 122, .75);
}

/* 座位受击 / 回复 */
.seat.is-hit .seat__frame { animation: seat-hit .46s ease; }
.seat.is-heal .seat__frame { animation: seat-heal .7s ease; }
.seat.is-dodge { animation: seat-dodge .5s ease; }
.self-card.is-hit { animation: seat-hit .46s ease; }

/* ==================================================================
   12. 入场发牌动画
   ================================================================== */
.battle-intro {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(12, 16, 26, .55), rgba(3, 4, 7, .96) 72%);
  cursor: pointer;
  overflow: hidden;
  animation: fade-in .3s ease both;
}

.battle-intro.is-out { animation: fade-out .42s ease forwards; }

.battle-intro__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(3, 4, 7, .8) 100%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(232, 195, 122, .03) 0deg 4deg, transparent 4deg 12deg);
  pointer-events: none;
}

.battle-intro__deck {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  transition: transform .7s cubic-bezier(.2, .8, .3, 1), opacity .6s ease;
}

.battle-intro.is-own .battle-intro__deck { transform: translateY(-96px) scale(.78); opacity: .5; }

.intro-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 154px;
  height: 216px;
  margin-left: -77px;
  margin-top: -108px;
  transform: translateX(var(--x, 0px)) rotate(var(--r, 0deg));
  transition: transform .6s cubic-bezier(.2, .8, .3, 1);
  perspective: 1000px;
}

.battle-intro.is-flipped .intro-card {
  transform: translateX(calc(var(--x, 0px) * 1.28)) translateY(-10px) rotate(calc(var(--r, 0deg) * .5));
}

.intro-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.3, .8, .3, 1);
  transition-delay: var(--delay, 0ms);
}

.battle-intro.is-flipped .intro-card__inner { transform: rotateY(180deg); }

.intro-card__back,
.intro-card__front {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid rgba(232, 195, 122, .55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .65);
  overflow: hidden;
}

.intro-card__back {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, rgba(232, 195, 122, .05) 0 2px, transparent 2px 7px),
    linear-gradient(150deg, #1c2740, #0a101c 60%, #131d31);
}

.intro-card__back .cardback__emblem { font-size: 56px; }

.intro-card__front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #182033, #080b12);
}

.intro-card__front .portrait { width: 100%; height: 100%; }
.intro-card__front .portrait__img { object-position: top center; }

.intro-card__front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(3, 4, 7, .55) 66%, rgba(3, 4, 7, .95) 100%);
}

.intro-card__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  z-index: 2;
  text-align: center;
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: .1em;
  color: #fdf6e6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .9);
}

.intro-card__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 13px;
  z-index: 2;
  text-align: center;
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--gold);
}

.intro-card__front.is-fallback { background: radial-gradient(circle at 50% 30%, rgba(232, 195, 122, .16), #0a0d15 72%); }

.battle-intro__own {
  position: absolute;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  transition: opacity .5s ease, transform .5s ease;
  z-index: 5;
}

.battle-intro.is-own .battle-intro__own { opacity: 1; }

.battle-intro__ownname {
  font-family: var(--font-title);
  font-size: 42px;
  letter-spacing: .16em;
  text-indent: .16em;
  color: var(--gold-bright);
  text-shadow: 0 0 34px rgba(232, 195, 122, .55), 0 4px 16px rgba(0, 0, 0, .8);
}

.battle-intro__owntitle {
  margin-top: 8px;
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: .2em;
  color: var(--text-dim);
}

.battle-intro__ownhint {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: .4em;
  color: var(--text-faint);
  animation: pulse-soft 1.8s ease-in-out infinite;
}

/* ==================================================================
   13. 结算
   ================================================================== */
.screen--result { align-items: center; justify-content: center; }

.result__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 60% at 50% 34%, rgba(232, 195, 122, .14), transparent 62%),
    radial-gradient(80% 70% at 50% 116%, rgba(224, 90, 79, .12), transparent 62%),
    linear-gradient(180deg, rgba(6, 8, 13, .55), #05060a 82%),
    url('../assets/bg/title.png');
  background-size: cover, cover, cover, cover;
  background-position: center, center, center, center;
  filter: saturate(.85) brightness(.5);
}

.result__rays {
  position: absolute;
  left: 50%;
  top: 32%;
  width: 1500px;
  height: 1500px;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg,
    rgba(232, 195, 122, .055) 0deg 2deg,
    transparent 2deg 14deg);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, .95) 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, .95) 0%, transparent 62%);
  animation: spin 120s linear infinite;
  pointer-events: none;
}

.result__particles { position: absolute; inset: 0; pointer-events: none; }

.result__particles span {
  position: absolute;
  left: calc(10% + (var(--i) * 4.6%));
  top: calc(18% + (var(--i) * 3.7%));
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--gold-bright);
  opacity: .2;
  box-shadow: 0 0 8px rgba(255, 227, 163, .8);
  animation: dust-float calc(6s + var(--i) * .7s) ease-in-out infinite;
  animation-delay: calc(var(--i) * -.8s);
}

.result__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
}

.result__eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: .4em;
  text-indent: .4em;
  color: var(--text-faint);
}

.result__verdict-wrap { display: flex; align-items: center; gap: 26px; margin-top: 6px; }

.result__verdict {
  margin: 0;
  font-family: var(--font-title);
  font-size: 82px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .18em;
  text-indent: .18em;
  background: linear-gradient(180deg, #fff9ea 0%, #ffe3a3 40%, #d3a052 72%, #8f6428 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 30px rgba(232, 195, 122, .45)) drop-shadow(0 6px 18px rgba(0, 0, 0, .6));
  animation: verdict-in .9s cubic-bezier(.2, .9, .3, 1) both;
}

.result__verdict--lose {
  background: linear-gradient(180deg, #ffe4dd 0%, #ff7a6c 42%, #a13028 78%, #561410 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 26px rgba(224, 90, 79, .35)) drop-shadow(0 6px 18px rgba(0, 0, 0, .6));
}

@keyframes verdict-in {
  from { opacity: 0; transform: scale(1.3); filter: blur(6px); }
  to { opacity: 1; transform: scale(1); }
}

.result__seal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  border: 3px solid rgba(224, 90, 79, .68);
  background: rgba(224, 90, 79, .08);
  color: var(--red-bright);
  font-family: var(--font-title);
  font-size: 42px;
  transform: rotate(-9deg);
  text-shadow: 0 0 22px rgba(224, 90, 79, .5);
  box-shadow: 0 0 34px rgba(224, 90, 79, .22), inset 0 0 22px rgba(224, 90, 79, .14);
  animation: seal-in .7s .2s cubic-bezier(.2, .9, .3, 1) both;
}

.result__seal.is-win {
  border-color: rgba(232, 195, 122, .72);
  background: rgba(232, 195, 122, .1);
  color: var(--gold-bright);
  text-shadow: 0 0 22px rgba(232, 195, 122, .6);
  box-shadow: 0 0 40px rgba(232, 195, 122, .3), inset 0 0 22px rgba(232, 195, 122, .16);
}

@keyframes seal-in {
  from { opacity: 0; transform: rotate(-9deg) scale(1.5); }
  to { opacity: 1; transform: rotate(-9deg) scale(1); }
}

.result__en {
  margin: 2px 0 0;
  font-family: var(--font-num);
  font-size: 11px;
  letter-spacing: .62em;
  text-indent: .62em;
  color: rgba(232, 195, 122, .6);
}

.result__reason {
  margin: 12px 0 20px;
  font-size: 14px;
  letter-spacing: .16em;
  color: var(--text-dim);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}

.result__players { display: flex; gap: 14px; }

.result-player {
  position: relative;
  width: 198px;
  height: 208px;
  border-radius: 12px;
  border: 1px solid rgba(232, 195, 122, .25);
  background: linear-gradient(160deg, rgba(18, 23, 36, .95), rgba(6, 8, 13, .97));
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  animation: result-card-in .5s cubic-bezier(.2, .8, .3, 1) both;
}

.result-player:nth-child(2) { animation-delay: .06s; }
.result-player:nth-child(3) { animation-delay: .12s; }
.result-player:nth-child(4) { animation-delay: .18s; }

@keyframes result-card-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-player.is-winner {
  border-color: rgba(232, 195, 122, .8);
  box-shadow: 0 0 34px rgba(232, 195, 122, .22), 0 14px 34px rgba(0, 0, 0, .5);
}

.result-player.is-winner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 227, 163, .45);
  animation: pulse-soft 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

.result-player.is-dead { filter: grayscale(.72) brightness(.7); }
.result-player.is-viewer { outline: 1px solid rgba(91, 141, 239, .5); outline-offset: 2px; }

.result-player__art { position: absolute; inset: 0 0 auto 0; height: 66%; }
.result-player__art .portrait { width: 100%; height: 100%; }
.result-player__art .portrait__img { object-position: top center; }

.result-player__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 26%, rgba(6, 8, 13, .5) 58%, rgba(6, 8, 13, .97) 100%);
}

.result-player__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 3;
}

.result-player__nameline { display: flex; align-items: center; gap: 6px; }

.result-player__charname {
  font-family: var(--font-title);
  font-size: 19px;
  letter-spacing: .04em;
  color: #fdf6e6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}

.result-player__crown { font-size: 15px; color: var(--gold-bright); text-shadow: 0 0 12px rgba(232, 195, 122, .7); }

.result-player__playername { font-size: 9px; letter-spacing: .1em; color: var(--text-faint); }
.result-player__playername em { font-style: normal; color: var(--blue-bright); }
.result-player__status { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.result-player__dead { color: var(--red-bright); letter-spacing: .14em; }
.result-player__alive { display: inline-flex; align-items: center; gap: 6px; }

.result-player__identity { font-size: 10px; color: var(--id-color, var(--text-dim)); letter-spacing: .1em; }
.result-player__dmg { font-size: 9px; color: var(--text-faint); }

.result-player__tag {
  position: absolute;
  right: 9px;
  top: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(5, 6, 10, .7);
  border: 1px solid rgba(255, 255, 255, .14);
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-dim);
  z-index: 5;
}

.result-player__tag i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.result-player__tag.is-win { border-color: rgba(232, 195, 122, .5); color: var(--gold-bright); }
.result-player__tag.is-dead { border-color: rgba(224, 90, 79, .4); color: var(--red-bright); }

.result__actions { display: flex; gap: 18px; margin-top: 24px; }
.result__actions .btn { min-width: 190px; }

.result__identity-note { margin: 14px 0 0; font-size: 10px; letter-spacing: .22em; color: var(--text-faint); }

/* ------------------------------------------------------------------
   13.5 小尺寸紧凑模式（窗口比例 < 0.94 时由 ui.js 添加 .is-compact）
   ------------------------------------------------------------------ */
.app-shell.is-compact .hand .card__desc { display: none; }
.app-shell.is-compact .hand .card__name { font-size: 26px; top: 44px; }
.app-shell.is-compact .hand .card__name.is-mid { font-size: 20px; top: 48px; }
.app-shell.is-compact .hand .card__name.is-long { font-size: 16px; top: 52px; }
.app-shell.is-compact .hand .card__type { top: 78px; }
.app-shell.is-compact .hand .card__watermark { font-size: 44px; bottom: 10px; }
.app-shell.is-compact .seat__name { font-size: 18px; }
.app-shell.is-compact .seat__title { font-size: 9.5px; }
.app-shell.is-compact .rule-card__body { font-size: 12.5px; }
.app-shell.is-compact .logitem { font-size: 12px; }
.app-shell.is-compact .title__logo-main { font-size: 86px; }

/* ==================================================================
   14. 关键帧
   ================================================================== */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

@keyframes seat-breathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(232, 195, 122, .3), 0 0 26px rgba(232, 195, 122, .2), 0 12px 30px rgba(0, 0, 0, .5); }
  50% { box-shadow: 0 0 0 1px rgba(255, 227, 163, .55), 0 0 46px rgba(232, 195, 122, .4), 0 12px 30px rgba(0, 0, 0, .5); }
}

@keyframes target-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 215, 106, .4), 0 0 26px rgba(255, 215, 106, .28); }
  50% { box-shadow: 0 0 0 3px rgba(255, 215, 106, .7), 0 0 56px rgba(255, 215, 106, .5); }
}

@keyframes dying-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(224, 90, 79, .4), 0 0 24px rgba(224, 90, 79, .25); }
  50% { box-shadow: 0 0 0 2px rgba(255, 122, 108, .8), 0 0 54px rgba(224, 90, 79, .5); }
}

@keyframes dying-veil {
  0%, 100% { opacity: .8; }
  50% { opacity: 1; }
}

@keyframes dying-panel {
  0%, 100% { box-shadow: 0 30px 90px rgba(0, 0, 0, .8), 0 0 60px rgba(224, 90, 79, .2); }
  50% { box-shadow: 0 30px 90px rgba(0, 0, 0, .8), 0 0 90px rgba(224, 90, 79, .4); }
}

@keyframes judge-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(185, 120, 232, 0); }
  50% { box-shadow: 0 0 10px rgba(185, 120, 232, .45); }
}

@keyframes dot-bounce {
  0%, 100% { transform: translateY(0); opacity: .4; }
  50% { transform: translateY(-3px); opacity: 1; }
}

@keyframes seat-hit {
  0% { transform: translate3d(0, 0, 0); filter: brightness(1); }
  15% { transform: translate3d(-6px, 2px, 0); filter: brightness(1.9) sepia(.4) saturate(2); }
  30% { transform: translate3d(6px, -2px, 0); }
  45% { transform: translate3d(-4px, 1px, 0); filter: brightness(1.4); }
  60% { transform: translate3d(3px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); filter: brightness(1); }
}

@keyframes seat-heal {
  0% { box-shadow: 0 0 0 rgba(79, 214, 184, 0); }
  30% { box-shadow: 0 0 40px rgba(79, 214, 184, .55); filter: brightness(1.25); }
  100% { box-shadow: 0 0 0 rgba(79, 214, 184, 0); filter: brightness(1); }
}

@keyframes seat-dodge {
  0% { transform: translate3d(0, 0, 0); opacity: 1; }
  40% { transform: translate3d(18px, 0, 0) skewX(-6deg); opacity: .55; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes shake-screen {
  0%, 100% { transform: translate3d(0, 0, 0); }
  12% { transform: translate3d(-7px, 3px, 0); }
  24% { transform: translate3d(7px, -3px, 0); }
  36% { transform: translate3d(-5px, 2px, 0); }
  48% { transform: translate3d(5px, -2px, 0); }
  60% { transform: translate3d(-3px, 1px, 0); }
  72% { transform: translate3d(3px, -1px, 0); }
  86% { transform: translate3d(-1px, 0, 0); }
}

@keyframes flash-fade {
  0% { opacity: 0; }
  16% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes banner-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.18); filter: blur(5px); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes banner-line {
  0% { transform: scaleX(0); opacity: 0; }
  24% { transform: scaleX(1); opacity: 1; }
  76% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* ==================================================================
   15. 降低动态效果
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
  .battle-intro,
  .fx-banner,
  .fx-float,
  .fx-card,
  .result__rays,
  .title__particles span,
  .result__particles span {
    display: none !important;
  }

  .screen { animation: none; }
  .result__verdict { animation: none; }
  .result__seal { animation: none; }
  .result-player { animation: none; }
  .rule-card { animation: none; }

  .seat.is-current .seat__frame,
  .seat.is-targetable .seat__frame,
  .seat.is-dying .seat__frame,
  .seat__targethint,
  .waiting__dots i,
  .judge-icon,
  .lobby__waiting {
    animation: none !important;
  }
}

/* ==================================================================
   M. 移动端适配（手机浏览器）
   - 横屏：等比缩放舞台，触控可玩（单机 + 联机）
   - 竖屏：显示「请横屏游玩」提示（横屏后自动隐藏）
   ================================================================== */
.rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(90% 70% at 50% 18%, rgba(232, 195, 122, .14), transparent 62%),
    linear-gradient(180deg, #080a11 0%, #05060a 100%);
  color: var(--text);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.rotate-hint__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 340px;
}

.rotate-hint__phone {
  position: relative;
  width: 78px;
  height: 138px;
  border: 3px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 0 34px rgba(232, 195, 122, .28), inset 0 0 22px rgba(232, 195, 122, .12);
  animation: rotate-phone 2.6s ease-in-out infinite;
}

.rotate-hint__phone::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 24px;
  height: 3px;
  margin-left: -12px;
  border-radius: 2px;
  background: var(--gold);
  opacity: .75;
}

.rotate-hint__phone i {
  position: absolute;
  inset: 7px 6px 16px;
  border-radius: 10px;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(232, 195, 122, .32), transparent 70%),
    linear-gradient(160deg, rgba(232, 195, 122, .18), rgba(91, 141, 239, .14));
}

@keyframes rotate-phone {
  0%, 16% { transform: rotate(0deg); }
  52%, 78% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

.rotate-hint__title {
  margin: 0;
  font-size: 30px;
  letter-spacing: .22em;
  text-indent: .22em;
  color: var(--gold);
  text-shadow: 0 0 22px rgba(232, 195, 122, .4);
}

.rotate-hint__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-dim);
}

.rotate-hint__sub {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--text-faint);
}

/* 手机竖屏（窄屏）时提示旋转；横屏自动隐藏 */
@media (orientation: portrait) and (max-width: 700px) and (pointer: coarse) {
  .rotate-hint { display: flex; }
}
/* 兼容无 pointer 媒体特性的环境（部分安卓 WebView / 桌面窄窗口） */
@media (orientation: portrait) and (max-width: 480px) {
  .rotate-hint { display: flex; }
}

/* 手机横屏：舞台缩到全屏，隐藏仅 hover 可用的提示性浮层 */
@media (orientation: landscape) and (max-height: 520px) {
  .app-shell.is-mobile .title__tagline { display: none; }
  .app-shell.is-mobile .title__en-wrap { margin-top: 8px; }
  .app-shell.is-mobile .title__menu { gap: 8px; }
  .app-shell.is-mobile .title__foot { display: none; }
  .app-shell.is-mobile .battle__hintbar { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .rotate-hint__phone { animation: none; }
}
