/* ═══════════════════════════════════════════════════════════════
   战国杀 · 水墨卡牌对战
   移动端优先 · 竖屏铺满 · 无外部依赖
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ink: #0b0806;
  --ink-2: #120d09;
  --ink-3: #1c140d;
  --panel: #1a120c;
  --paper: #f0e2c4;
  --paper-2: #dfc79b;
  --gold: #e7c27a;
  --gold-2: #b98a3e;
  --gold-3: #8a622c;
  --theme: #ff8a3d;
  --red: #a9362b;
  --red-2: #7e1f1a;
  --jade: #5e9c7a;
  --azure: #5c8fb5;
  --violet: #9a7bb8;
  --muted: #a08e73;
  --muted-2: #7d6c56;
  --font-brush: "Songti SC", "STSong", "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif CJK SC", "WenQuanYi Micro Hei", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --shadow-panel: 0 14px 34px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070504;
}

body {
  font-family: var(--font-body);
  color: #f0e5ce;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

i, em, b, strong, span, p, h1, h2, h3 {
  font-style: normal;
}

[hidden] {
  display: none !important;
}

#app {
  position: relative;
  width: 100%;
  max-width: 540px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #0a0705;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.85);
  isolation: isolate;
}

.screen {
  position: absolute;
  inset: 0;
}

/* ═══════════════════════════════════════════════════════════════
   选将页
   ═══════════════════════════════════════════════════════════════ */

.start-screen {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 138, 61, 0.12), transparent 48%),
    radial-gradient(ellipse at 50% 110%, rgba(120, 48, 21, 0.12), transparent 55%),
    #0c0907;
}

.start-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.45) 100%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 8px);
}

.start-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(12px + env(safe-area-inset-top)) 0 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.start-scroll::-webkit-scrollbar {
  display: none;
}

/* ---------- 封面 ---------- */

.hero {
  position: relative;
  height: clamp(196px, 29vh, 278px);
  margin: 0 16px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(231, 194, 122, 0.42);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 238, 200, 0.08);
  background: #1a120c;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(231, 194, 122, 0.2);
  border-radius: 14px;
  pointer-events: none;
  z-index: 3;
}

.hero-art {
  position: absolute;
  inset: 0;
  background-image: url("images/gen/gptimg_1795255146_look.png");
  background-repeat: no-repeat;
  background-size: 185% auto;
  background-position: 40% 42%;
  transform: scale(1.03);
  filter: saturate(1.08) contrast(1.05);
  z-index: 0;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(9, 7, 5, 0.12) 0%, rgba(9, 7, 5, 0.24) 38%, rgba(9, 7, 5, 0.92) 100%),
    linear-gradient(90deg, rgba(9, 7, 5, 0.72) 0%, rgba(9, 7, 5, 0.1) 64%),
    radial-gradient(circle at 82% 16%, rgba(255, 138, 61, 0.14), transparent 48%);
}

.hero-inner {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 4;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  border: 1px solid rgba(255, 213, 166, 0.7);
  background: linear-gradient(150deg, #b4432f, #6c1913);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 226, 190, 0.1);
  color: #ffe4b6;
  font-family: var(--font-brush);
  font-size: 21px;
  line-height: 1;
  transform: rotate(-3deg);
}

.brand-sub {
  color: #e6bf7c;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-shadow: 0 2px 8px #000;
}

.brand-title {
  margin: 0;
  color: #f9e9c5;
  font-family: var(--font-brush);
  font-size: clamp(38px, 11.5vw, 54px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.1em;
  text-shadow:
    0 3px 0 rgba(90, 46, 14, 0.5),
    0 8px 26px rgba(0, 0, 0, 0.85),
    0 0 34px rgba(255, 138, 61, 0.16);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}

.brand-desc {
  margin: 4px 0 9px;
  color: #c7b192;
  font-size: 10.5px;
  line-height: 1.6;
  text-shadow: 0 2px 6px #000;
}

.hero-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9e8a6d;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.hero-tags b {
  color: #efca86;
  font-size: 11px;
  font-weight: 600;
  margin-right: 1px;
}

.hero-tags i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(231, 194, 122, 0.45);
}

.rules-fab {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(231, 194, 122, 0.28);
  background: rgba(10, 7, 5, 0.55);
  color: #ddc49a;
  font-size: 10px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rules-fab .mp-icon {
  width: 13px;
  height: 13px;
}

/* ---------- 选将标题 ---------- */

.select-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 16px 11px;
}

.eyebrow {
  margin: 0 0 3px;
  color: #9d7b45;
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.select-title h2 {
  margin: 0;
  color: #efdcb6;
  font-family: var(--font-brush);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.seg {
  display: flex;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid rgba(231, 194, 122, 0.2);
  background: rgba(8, 6, 4, 0.5);
}

.seg-btn {
  height: 28px;
  padding: 0 13px;
  border-radius: 8px;
  color: #8c7a61;
  font-size: 11px;
  letter-spacing: 0.12em;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.seg-btn.active {
  color: #2b1a09;
  background: linear-gradient(180deg, #f4d192, #d69a48);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.35);
  font-weight: 600;
}

/* ---------- 武将卡 ---------- */

.roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px;
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 148px;
  padding: 9px 10px 9px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(231, 194, 122, 0.16);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.045), transparent 48%),
    linear-gradient(155deg, #241a12 0%, #17100b 68%, #110c08 100%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.hero-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--fc, #b98a3e);
  opacity: 0.8;
}

.hero-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 46%;
  background: radial-gradient(circle at 30% 0%, var(--fc, #b98a3e), transparent 62%);
  opacity: 0.1;
  pointer-events: none;
}

.hero-card:active {
  transform: scale(0.985);
}

.hero-card.selected {
  border-color: rgba(255, 190, 112, 0.78);
  box-shadow:
    0 0 0 1px rgba(255, 190, 112, 0.45),
    0 10px 26px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(255, 138, 61, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-card.selected .sigil {
  box-shadow: 0 0 0 2px rgba(255, 196, 122, 0.28), 0 0 18px var(--fc, #b98a3e);
}

.hero-card .selected-mark {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f6d28e, #d99a45);
  color: #2a1708;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.hero-card.selected .selected-mark {
  display: flex;
}

.hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  padding-right: 18px;
}

.hero-card .selected-mark .mp-icon {
  width: 10px;
  height: 10px;
}

.faction-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid rgba(185, 138, 62, 0.55);
  background: rgba(185, 138, 62, 0.15);
  color: var(--fc, #c9a463);
  font-family: var(--font-brush);
  font-size: 10px;
  line-height: 1;
  border-color: color-mix(in srgb, var(--fc, #b98a3e) 55%, transparent);
  background: color-mix(in srgb, var(--fc, #b98a3e) 15%, transparent);
}

.role-chip {
  color: #7e6b52;
  font-size: 8px;
  letter-spacing: 0.16em;
}

.hero-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sigil {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(185, 138, 62, 0.5);
  background: radial-gradient(circle at 34% 24%, #4a3420, #120c08 72%);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  border-color: color-mix(in srgb, var(--fc, #b98a3e) 50%, transparent);
  background:
    radial-gradient(circle at 34% 24%, color-mix(in srgb, var(--fc, #b98a3e) 34%, #1a120c), #120c08 72%);
}

.sigil svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #f4d9a4;
  opacity: 0.3;
}

.sigil b {
  position: relative;
  z-index: 2;
  color: #ffe0a8;
  font-family: var(--font-brush);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 2px 6px #000;
}

.sigil em {
  position: absolute;
  right: 2px;
  bottom: 1px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fc, #b98a3e);
  color: #17100a;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.hero-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.12;
}

.hero-name {
  color: #f2ddb6;
  font-family: var(--font-brush);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.hero-skill-name {
  margin-top: 2px;
  color: var(--fc, #c9a463);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.hero-skill-desc {
  position: relative;
  z-index: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 27px;
  margin-top: 7px;
  color: #a7967d;
  font-size: 9.5px;
  line-height: 1.45;
}

.hero-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(231, 194, 122, 0.09);
}

.pips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.pip {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #e8875c, #a83b28);
  box-shadow: 0 0 5px rgba(232, 135, 92, 0.35);
}

.pip.off {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.hero-foot .pip {
  width: 6px;
  height: 6px;
}

.hero-hand {
  color: #6f5f4b;
  font-size: 8px;
  white-space: nowrap;
}

.select-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 12px 16px 6px;
  color: #6f5f4b;
  font-size: 9px;
  letter-spacing: 0.03em;
  text-align: center;
}

.select-tip .mp-icon {
  width: 12px;
  height: 12px;
  color: #9d7b45;
}

/* ---------- 底部出征栏 ---------- */

.start-dock {
  position: relative;
  z-index: 6;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(231, 194, 122, 0.12);
  background: linear-gradient(180deg, rgba(11, 8, 6, 0.86), rgba(11, 8, 6, 0.98));
  box-shadow: 0 -14px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.picked {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.picked-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(231, 194, 122, 0.3);
  background: radial-gradient(circle at 35% 25%, #3a2819, #100b07 75%);
  color: #e9c987;
  font-family: var(--font-brush);
  font-size: 18px;
  overflow: hidden;
}

.picked-avatar .sigil {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.picked-avatar .sigil b {
  font-size: 18px;
}

.picked-avatar .sigil em {
  display: none;
}

.picked-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.picked-name {
  color: #efd7ab;
  font-family: var(--font-brush);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picked-skill {
  color: #8e7a5e;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picked-hp {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
}

.start-btn {
  flex: none;
  width: 128px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  letter-spacing: 0.16em;
}

.start-btn .mp-icon {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   通用按钮
   ═══════════════════════════════════════════════════════════════ */

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 225, 174, 0.55);
  background: linear-gradient(180deg, #ffc481 0%, var(--theme) 55%, #d2611d 100%);
  color: #2a1206;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow:
    0 6px 16px rgba(255, 138, 61, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.12s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.97);
  filter: brightness(0.96);
}

.btn-primary:disabled {
  opacity: 0.32;
  filter: grayscale(0.55);
  box-shadow: none;
  cursor: default;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid rgba(231, 194, 122, 0.3);
  background: linear-gradient(180deg, rgba(42, 30, 20, 0.86), rgba(18, 13, 9, 0.92));
  color: #d9c39a;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.btn-ghost:active {
  transform: scale(0.97);
  border-color: rgba(231, 194, 122, 0.5);
}

.btn-ghost:disabled {
  opacity: 0.35;
  cursor: default;
}

.btn-skill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(154, 123, 184, 0.55);
  background: linear-gradient(180deg, rgba(89, 65, 118, 0.75), rgba(42, 28, 58, 0.85));
  color: #ddc8f3;
  font-size: 11px;
  letter-spacing: 0.08em;
  box-shadow: 0 0 16px rgba(154, 123, 184, 0.16);
}

.btn-skill:active {
  transform: scale(0.96);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(231, 194, 122, 0.16);
  background: rgba(15, 11, 8, 0.55);
  color: #bca684;
}

.icon-btn:active {
  background: rgba(231, 194, 122, 0.12);
}

.icon-btn .mp-icon {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   对战页
   ═══════════════════════════════════════════════════════════════ */

.battle-screen {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: calc(7px + env(safe-area-inset-top)) 0 calc(6px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 30%, rgba(73, 47, 28, 0.38) 0%, transparent 58%),
    radial-gradient(ellipse at 50% 110%, rgba(122, 47, 19, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, #171009 0%, #0a0705 60%, #080604 100%);
}

.battle-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 6px),
    radial-gradient(circle at 50% 20%, rgba(255, 196, 120, 0.06), transparent 60%);
}

.battle-top {
  position: relative;
  z-index: 4;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 12px;
}

.round-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(231, 194, 122, 0.16);
  background: rgba(10, 7, 5, 0.5);
  color: #cbb58e;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--theme);
  box-shadow: 0 0 7px rgba(255, 138, 61, 0.9);
  animation: pulseDot 1.8s ease-in-out infinite;
}

.round-sep {
  color: #5e4c37;
}

.top-actions {
  display: flex;
  gap: 6px;
}

/* ---------- 武将信息卡 ---------- */

.foe-panel,
.player-panel {
  position: relative;
  z-index: 3;
  flex: none;
  padding: 0 12px;
}

.fighter-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 66px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(231, 194, 122, 0.16);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.035), transparent 46%),
    linear-gradient(120deg, rgba(38, 27, 18, 0.94), rgba(17, 12, 8, 0.92));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.fighter-card.foe {
  border-color: rgba(185, 138, 62, 0.22);
}

.fighter-card.you {
  border-color: rgba(255, 138, 61, 0.28);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 138, 61, 0.07), transparent 48%),
    linear-gradient(120deg, rgba(43, 29, 18, 0.96), rgba(18, 12, 8, 0.94));
}

.fighter-card::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 42%;
  background: radial-gradient(circle at 100% 0%, var(--fc, #b98a3e), transparent 68%);
  opacity: 0.07;
  pointer-events: none;
}

.f-avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(185, 138, 62, 0.6);
  background: radial-gradient(circle at 34% 24%, #45301d, #0f0a07 76%);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.65), 0 0 0 3px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  border-color: color-mix(in srgb, var(--fc, #b98a3e) 60%, transparent);
  background:
    radial-gradient(circle at 34% 24%, color-mix(in srgb, var(--fc, #b98a3e) 30%, #1a120c), #0f0a07 76%);
}

.f-avatar svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #f4d9a4;
  opacity: 0.32;
}

.f-avatar b {
  position: relative;
  z-index: 2;
  color: #ffe2b0;
  font-family: var(--font-brush);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 2px 6px #000;
}

.f-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.f-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.f-name {
  color: #f2ddb6;
  font-family: var(--font-brush);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.f-title {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid rgba(185, 138, 62, 0.48);
  background: rgba(185, 138, 62, 0.12);
  color: #d9b87a;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border-color: color-mix(in srgb, var(--fc, #b98a3e) 48%, transparent);
  background: color-mix(in srgb, var(--fc, #b98a3e) 12%, transparent);
  color: color-mix(in srgb, var(--fc, #b98a3e) 80%, #ffe0a8);
}

.f-role {
  color: #6f5f4b;
  font-size: 8px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.f-hp {
  display: flex;
  align-items: center;
  gap: 6px;
}

.f-hp .pip {
  width: 7px;
  height: 7px;
}

.f-hp-num {
  color: #9a8567;
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.f-skill {
  display: block;
  color: #8f7d64;
  font-size: 9px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.f-skill:active {
  color: #d8bd8c;
}

.f-hand {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 43px;
  gap: 1px;
  padding-left: 7px;
  border-left: 1px solid rgba(231, 194, 122, 0.12);
  color: #8d7a5e;
}

.f-hand .mp-icon {
  width: 13px;
  height: 13px;
  color: #8d7a5e;
}

.f-hand b {
  color: #e6c98f;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.f-hand em {
  color: #6b5a44;
  font-size: 7.5px;
  line-height: 1;
}

.f-hand span {
  color: #6b5a44;
  font-size: 7px;
  letter-spacing: 0.08em;
}

/* ---------- 装备栏 ---------- */

.equip-row {
  display: flex;
  gap: 6px;
  padding: 4px 2px 0;
}

.equip-slot {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 23px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px dashed rgba(231, 194, 122, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: #6f5f4b;
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
}

.equip-slot .mp-icon {
  flex: none;
  width: 12px;
  height: 12px;
  color: #7d6a50;
}

.equip-slot .eq-name {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #c6ae85;
}

.equip-slot .eq-bonus {
  margin-left: auto;
  color: #8f744c;
  font-size: 7.5px;
  letter-spacing: 0.02em;
}

.equip-slot.on {
  border-style: solid;
  border-color: rgba(231, 194, 122, 0.3);
  background: linear-gradient(90deg, rgba(231, 194, 122, 0.1), rgba(0, 0, 0, 0.16));
}

.equip-slot.on .mp-icon {
  color: #e2bf7d;
}

.equip-slot.used {
  opacity: 0.48;
}

/* ---------- 战场 ---------- */

.battlefield {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 88px;
  margin: 0 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(231, 194, 122, 0.14);
  background: #1a120c;
  box-shadow:
    inset 0 0 46px rgba(0, 0, 0, 0.72),
    0 8px 20px rgba(0, 0, 0, 0.24);
}

.battlefield-art {
  position: absolute;
  inset: -7%;
  z-index: 0;
  background-image: url("images/gen/gptimg_1795255146_look.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 44%;
  filter: blur(6px) brightness(0.5) saturate(0.92);
  opacity: 0.5;
  transform: scale(1.05);
}

.battlefield::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 196, 120, 0.1), transparent 56%),
    linear-gradient(180deg, rgba(7, 5, 3, 0.58) 0%, rgba(7, 5, 3, 0.08) 42%, rgba(7, 5, 3, 0.72) 100%);
}

.battlefield::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.battlefield-ring {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 2;
  width: 152px;
  height: 152px;
  margin: -76px 0 0 -76px;
  border-radius: 50%;
  border: 1px solid rgba(231, 194, 122, 0.13);
  box-shadow:
    inset 0 0 0 7px rgba(231, 194, 122, 0.025),
    0 0 0 9px rgba(231, 194, 122, 0.02);
  pointer-events: none;
}

.field-glyph {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 2;
  transform: translate(-50%, -50%);
  color: rgba(231, 194, 122, 0.055);
  font-family: var(--font-brush);
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.pile {
  position: absolute;
  bottom: 9px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.pile.deck {
  left: 11px;
}

.pile.discard {
  right: 11px;
}

.pile-stack {
  position: relative;
  width: 52px;
  height: 68px;
}

.card-back {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  border: 1px solid #b99254;
  background:
    radial-gradient(circle at 50% 42%, rgba(231, 194, 122, 0.16), transparent 45%),
    repeating-linear-gradient(45deg, rgba(231, 194, 122, 0.055) 0 1px, transparent 1px 5px),
    linear-gradient(145deg, #332218 0%, #1a110b 60%, #24170f 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45);
}

.card-back::after {
  content: "战";
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin: -10.5px 0 0 -10.5px;
  border: 1px solid rgba(231, 194, 122, 0.5);
  border-radius: 3px;
  color: rgba(231, 194, 122, 0.78);
  font-family: var(--font-brush);
  font-size: 12px;
  line-height: 1;
  transform: rotate(-4deg);
}

.card-back:nth-child(1) { transform: translate(4px, 4px) rotate(2deg); opacity: 0.55; }
.card-back:nth-child(2) { transform: translate(2px, 2px) rotate(1deg); opacity: 0.8; }
.card-back:nth-child(3) { transform: translate(0, 0); }

.pile-count {
  position: absolute;
  right: -4px;
  bottom: -3px;
  z-index: 5;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid rgba(231, 194, 122, 0.42);
  background: #1a110b;
  color: #e8ca90;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.pile-label {
  color: #7b6a52;
  font-size: 7.5px;
  letter-spacing: 0.12em;
}

.discard-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 48px;
  height: 64px;
  border-radius: 6px;
  border: 1px dashed rgba(231, 194, 122, 0.16);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(231, 194, 122, 0.2);
  font-family: var(--font-brush);
  font-size: 17px;
  overflow: hidden;
}

.discard-top .dc-art {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--cc, #8a4a2a);
}

.discard-top .dc-art svg {
  width: 100%;
  height: 100%;
}

.discard-top .dc-name {
  font-family: var(--font-brush);
  font-size: 12px;
  line-height: 1;
  color: #3a2712;
}

.discard-top.has-card {
  border-style: solid;
  border-color: rgba(231, 194, 122, 0.34);
  background: linear-gradient(160deg, #f0e0bd, #cfb17c);
  color: #31200f;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.discard-count {
  right: 3px;
}

.table-center {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.turn-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 190, 112, 0.35);
  background: rgba(16, 10, 6, 0.72);
  color: #e8c58a;
  font-size: 9px;
  letter-spacing: 0.16em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.turn-chip.foe {
  border-color: rgba(188, 100, 88, 0.4);
  color: #e2a69a;
}

.played-card {
  position: relative;
  width: 62px;
  height: 84px;
  border-radius: 7px;
  border: 1px solid #b99254;
  background: linear-gradient(165deg, #f6e8ca, #dcc08e);
  color: #2a1b0d;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.55), 0 0 24px rgba(255, 138, 61, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  animation: playCardIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.played-card .pc-name {
  font-family: var(--font-brush);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
}

.played-card .pc-name.small {
  font-size: 12px;
  letter-spacing: 0;
}

.played-card .pc-kind {
  color: #8a6c3d;
  font-size: 7px;
  letter-spacing: 0.12em;
}

.played-card .pc-art {
  width: 26px;
  height: 26px;
  color: var(--cc, #8a4a2a);
}

.played-card .pc-art svg {
  width: 100%;
  height: 100%;
}

.played-card.judge {
  width: 66px;
  height: 90px;
  border-color: #e7c27a;
  box-shadow: 0 0 0 1px rgba(231, 194, 122, 0.3), 0 0 30px rgba(231, 194, 122, 0.22);
}

.played-card.judge::after {
  content: "判定";
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  color: #f1d49b;
  font-size: 8px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.ai-thinking {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(10, 7, 5, 0.65);
  border: 1px solid rgba(231, 194, 122, 0.16);
}

.ai-thinking span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d6a45d;
  animation: think 1.2s infinite;
}

.ai-thinking span:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking span:nth-child(3) { animation-delay: 0.3s; }

.ai-thinking em {
  margin-left: 3px;
  color: #a58e6d;
  font-size: 8px;
  letter-spacing: 0.08em;
}

/* ---------- 战报 ---------- */

.log-panel {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  gap: 8px;
  height: 60px;
  margin: 0 12px;
  padding: 6px 8px;
  border-radius: 11px;
  border: 1px solid rgba(231, 194, 122, 0.11);
  background: rgba(9, 6, 4, 0.55);
  overflow: hidden;
}

.log-head {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 36px;
  border-right: 1px solid rgba(231, 194, 122, 0.1);
  color: #9d7b45;
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.log-head .mp-icon {
  width: 13px;
  height: 13px;
}

.log-head .log-more {
  width: 9px;
  height: 9px;
  margin-top: 1px;
  opacity: 0.55;
}

.log-lines {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding-right: 2px;
  color: #a9987f;
  font-size: 10px;
  line-height: 1.5;
  scrollbar-width: none;
}

.log-lines::-webkit-scrollbar {
  display: none;
}

.log-line {
  padding: 0.5px 0;
  white-space: normal;
  word-break: break-all;
}

.log-line .lg-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 4px 2px 0;
  border-radius: 50%;
  background: #8b6a3c;
}

.log-line.you { color: #e8c58a; }
.log-line.foe { color: #dda79d; }
.log-line.bad { color: #f09586; }
.log-line.good { color: #a6d49c; }
.log-line.skill { color: #cbb2e8; }
.log-line.judge { color: #e9c986; }
.log-line.mou { color: #c0a1dc; }
.log-line.turn {
  color: #f3dfb8;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ---------- 行动栏 ---------- */

.action-dock {
  position: relative;
  z-index: 4;
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
}

.selection-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
}

.selection-info b {
  color: #efd5a4;
  font-family: var(--font-brush);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-info span {
  color: #7f6d55;
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-dock .btn-ghost,
.action-dock .btn-primary {
  flex: none;
  height: 40px;
  padding: 0 11px;
  font-size: 11px;
  border-radius: 10px;
}

.action-dock .play-btn {
  min-width: 58px;
}

.action-dock.discard-mode .selection-info b {
  color: #ffb08d;
}

/* ---------- 手牌 ---------- */

.hand-wrap {
  position: relative;
  z-index: 5;
  flex: none;
  height: 128px;
  padding: 11px 12px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.22) 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.hand-wrap::-webkit-scrollbar {
  display: none;
}

.hand {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: max-content;
  min-height: 114px;
  padding: 0 4px;
  scroll-snap-type: x proximity;
}

.hand-card {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  width: 78px;
  height: 114px;
  padding: 5px 5px 4px;
  border-radius: 9px;
  border: 1px solid #b58f53;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.5), transparent 44%),
    linear-gradient(165deg, #f7e9cb 0%, #e8d1a6 55%, #cfb27c 100%);
  color: #2a1c0e;
  text-align: left;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    0 6px 14px rgba(0, 0, 0, 0.45);
  scroll-snap-align: end;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  overflow: hidden;
}

.hand-card::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(90, 60, 25, 0.2);
  border-radius: 6px;
  pointer-events: none;
}

.hand-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--cc, #a77a35);
  opacity: 0.92;
}

.hand-card:active {
  transform: translateY(-4px) scale(0.99);
}

.hand-card.selected {
  transform: translateY(-9px);
  border-color: #f3cf8d;
  box-shadow:
    0 0 0 1px rgba(243, 207, 141, 0.85),
    0 0 22px rgba(255, 176, 90, 0.32),
    0 12px 22px rgba(0, 0, 0, 0.5);
}

.hand-card.dim {
  filter: saturate(0.6) brightness(0.8);
}

.hand-card.discardable {
  border-color: #d46a52;
  box-shadow: 0 0 0 1px rgba(212, 106, 82, 0.55), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.hand-card.discardable::after {
  background: #c14e3a;
}

.discard-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 226, 190, 0.7);
  background: rgba(150, 43, 29, 0.84);
  color: #ffe2b4;
  font-family: var(--font-brush);
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.card-tone {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9a2f23;
  box-shadow: 0 0 4px rgba(154, 47, 35, 0.4);
}

.card-tone.black {
  background: #2d2a26;
  box-shadow: 0 0 4px rgba(45, 42, 38, 0.35);
}

.card-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
  padding-left: 4px;
  min-height: 17px;
}

.card-name {
  color: #35230f;
  font-family: var(--font-brush);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.card-name.long {
  font-size: 10.5px;
  letter-spacing: 0;
  margin-top: 2px;
}

.card-kind {
  margin-top: 1px;
  color: #9b7b4c;
  font-size: 6.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.card-art {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 34px;
  color: var(--cc, #a77a35);
}

.card-art svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.3));
}

.card-desc {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  min-height: 18px;
  padding-top: 2px;
  border-top: 1px solid rgba(90, 60, 25, 0.16);
  color: #6f5632;
  font-size: 7.5px;
  line-height: 1.25;
}

.k-sha { --cc: #a33a2c; }
.k-shan { --cc: #3e7c9e; }
.k-liang { --cc: #5e8b4a; }
.k-mou { --cc: #6e5a9e; }
.k-equip { --cc: #a77a35; }

.hand-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100vw - 24px);
  max-width: 516px;
  height: 104px;
  color: #5f4f3b;
  font-family: var(--font-brush);
  font-size: 14px;
  letter-spacing: 0.12em;
}

/* ═══════════════════════════════════════════════════════════════
   浮层
   ═══════════════════════════════════════════════════════════════ */

.turn-banner {
  position: fixed;
  left: 50%;
  top: 38%;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 28px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.94);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.turn-banner::before,
.turn-banner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 194, 122, 0.7));
}

.turn-banner::before { left: -6px; }
.turn-banner::after { right: -6px; transform: rotate(180deg); }

.turn-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.turn-banner .tb-kicker {
  color: #c79a55;
  font-size: 8px;
  letter-spacing: 0.3em;
  text-align: center;
  text-shadow: 0 2px 8px #000;
}

.turn-banner strong {
  color: #f8e6bf;
  font-family: var(--font-brush);
  font-size: clamp(34px, 10.5vw, 48px);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-align: center;
  text-shadow:
    0 4px 0 rgba(80, 42, 14, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.9),
    0 0 40px rgba(255, 138, 61, 0.22);
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top));
  z-index: 130;
  max-width: 84%;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(231, 194, 122, 0.32);
  background: rgba(18, 12, 8, 0.94);
  color: #ead6ae;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 弹窗 ---------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 2, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.18s ease-out;
}

.modal {
  position: relative;
  width: min(100%, 420px);
  max-height: 84vh;
  max-height: 84dvh;
  overflow-y: auto;
  padding: 18px 17px 16px;
  border-radius: 18px;
  border: 1px solid rgba(231, 194, 122, 0.4);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.045), transparent 40%),
    linear-gradient(160deg, #2a1e14 0%, #160f0a 62%, #110b07 100%);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.72),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  animation: modalIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  scrollbar-width: none;
}

.modal::-webkit-scrollbar {
  display: none;
}

.modal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(231, 194, 122, 0.12);
  border-radius: 13px;
  pointer-events: none;
}

.modal-kicker {
  margin: 0 0 3px;
  color: #a27e45;
  font-size: 8px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.modal-title {
  margin: 0 0 9px;
  color: #f0d9ab;
  font-family: var(--font-brush);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.modal-body {
  position: relative;
  z-index: 1;
  color: #bfae91;
  font-size: 12px;
  line-height: 1.75;
}

.modal-body p {
  margin: 0 0 8px;
}

.modal-body .hl {
  color: #f0cd8e;
}

.modal-body .danger {
  color: #f0a08e;
}

.modal-body .skill-quote {
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 2px solid rgba(231, 194, 122, 0.45);
  border-radius: 0 8px 8px 0;
  background: rgba(231, 194, 122, 0.055);
  color: #d6c19c;
}

.modal-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.modal-actions .btn-ghost,
.modal-actions .btn-primary {
  flex: 1;
  height: 42px;
  padding: 0 10px;
  font-size: 12px;
}

.modal-log {
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: none;
}

.modal-log::-webkit-scrollbar {
  display: none;
}

.modal-log .log-line {
  padding: 1px 0;
  font-size: 10.5px;
}

.modal-card-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 4px;
}

.modal-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 76px;
  height: 104px;
  border-radius: 8px;
  border: 1px solid #b58f53;
  background: linear-gradient(165deg, #f6e8ca, #d9bd8b);
  color: #2a1b0d;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.modal-mini-card .mc-name {
  font-family: var(--font-brush);
  font-size: 18px;
  font-weight: 600;
}

.modal-mini-card .mc-kind {
  color: #8a6c3d;
  font-size: 7px;
}

.modal-mini-card .mc-art {
  width: 32px;
  height: 32px;
  color: var(--cc, #8a4a2a);
}

.modal-mini-card .mc-art svg {
  width: 100%;
  height: 100%;
}

.mini-label {
  display: block;
  margin-top: 5px;
  color: #8f7a5d;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-align: center;
}

/* rules modal */
.rule-section {
  margin-bottom: 13px;
}

.rule-section h3 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 5px;
  color: #e5c78e;
  font-family: var(--font-brush);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.rule-section h3 .mp-icon {
  width: 13px;
  height: 13px;
  color: #b98a3e;
}

.rule-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-section li {
  position: relative;
  margin: 0 0 4px;
  padding-left: 10px;
  color: #a99880;
  font-size: 10.5px;
  line-height: 1.6;
}

.rule-section li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.66em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a37b3f;
}

.rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 21px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(231, 194, 122, 0.18);
  background: rgba(231, 194, 122, 0.06);
  color: #bda67f;
  font-size: 9px;
}

.rule-chip b {
  color: #edca8b;
  font-size: 10px;
}

.rule-chip.sha { border-color: rgba(163, 58, 44, 0.4); color: #df9b8d; }
.rule-chip.shan { border-color: rgba(62, 124, 158, 0.4); color: #91b7cf; }
.rule-chip.liang { border-color: rgba(94, 139, 74, 0.4); color: #a8c996; }
.rule-chip.mou { border-color: rgba(110, 90, 158, 0.4); color: #b7a3d6; }
.rule-chip.equip { border-color: rgba(167, 122, 53, 0.4); color: #d2b37a; }

/* ---------- 结算 ---------- */

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(108, 43, 20, 0.55), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(6, 4, 3, 0.98), rgba(6, 4, 3, 0.9) 60%),
    linear-gradient(180deg, rgba(8, 5, 3, 0.8), rgba(8, 5, 3, 0.96)),
    #0a0705;
  animation: fadeIn 0.4s ease-out;
}

.result-overlay::before {
  content: "";
  position: absolute;
  inset: -4%;
  z-index: 0;
  background-image: url("images/gen/gptimg_1795255146_look.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 42%;
  filter: blur(5px) brightness(0.42) saturate(0.85);
  opacity: 0.34;
  pointer-events: none;
}

.result-rays {
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 1;
  width: 160vmax;
  height: 160vmax;
  margin: -80vmax 0 0 -80vmax;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 8deg,
    rgba(231, 194, 122, 0.045) 8deg 9deg,
    transparent 9deg 20deg
  );
  animation: slowSpin 50s linear infinite;
  pointer-events: none;
}

.result-inner {
  position: relative;
  z-index: 2;
  width: min(100%, 380px);
  padding: 28px 20px 20px;
  border-radius: 24px;
  border: 1px solid rgba(231, 194, 122, 0.34);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 190, 110, 0.07), transparent 50%),
    rgba(13, 9, 6, 0.76);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.78),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: resultIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

.result-inner::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(231, 194, 122, 0.13);
  border-radius: 18px;
  pointer-events: none;
}

.result-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 2px solid #e6bd75;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 223, 170, 0.32), transparent 38%),
    linear-gradient(150deg, #b54a33, #6d1b14 70%);
  color: #ffe3b0;
  font-family: var(--font-brush);
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  box-shadow:
    0 0 0 7px rgba(231, 194, 122, 0.07),
    0 0 44px rgba(255, 138, 61, 0.3),
    inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.result-overlay.lose .result-seal {
  border-color: #8d8a83;
  background:
    radial-gradient(circle at 34% 28%, rgba(220, 225, 230, 0.16), transparent 38%),
    linear-gradient(150deg, #454b50, #1c2024 70%);
  color: #d9dde0;
  box-shadow:
    0 0 0 7px rgba(200, 210, 220, 0.05),
    0 0 36px rgba(100, 120, 135, 0.22),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.result-kicker {
  margin: 0 0 3px;
  color: #b78a46;
  font-size: 8px;
  letter-spacing: 0.36em;
}

.result-title {
  margin: 0;
  color: #f7e0af;
  font-family: var(--font-brush);
  font-size: clamp(30px, 8.5vw, 40px);
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-shadow: 0 5px 20px rgba(0, 0, 0, 0.8), 0 0 28px rgba(255, 138, 61, 0.16);
}

.result-overlay.lose .result-title {
  color: #d5d9dc;
  text-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
}

.result-sub {
  margin: 7px 0 14px;
  color: #9e8a6d;
  font-size: 10px;
  line-height: 1.6;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}

.result-stat {
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid rgba(231, 194, 122, 0.14);
  background: rgba(0, 0, 0, 0.2);
}

.result-stat b {
  display: block;
  color: #efcf95;
  font-family: var(--font-brush);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
}

.result-stat span {
  color: #7f6c52;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.result-btns {
  display: flex;
  gap: 9px;
}

.result-btns .btn-ghost,
.result-btns .btn-primary {
  flex: 1;
  height: 44px;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   动画
   ═══════════════════════════════════════════════════════════════ */

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 7px rgba(255, 138, 61, 0.9); }
  50% { opacity: 0.55; box-shadow: 0 0 3px rgba(255, 138, 61, 0.5); }
}

@keyframes think {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

@keyframes playCardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.86); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes resultIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hand-card.is-new {
  animation: cardIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

#app.shake {
  animation: shake 0.28s ease-in-out;
}

@keyframes hurt {
  0% { box-shadow: 0 0 0 0 rgba(200, 60, 40, 0.5); filter: brightness(1); }
  35% { box-shadow: 0 0 0 2px rgba(220, 80, 55, 0.55); filter: brightness(1.25); }
  100% { box-shadow: 0 0 0 0 rgba(200, 60, 40, 0); filter: brightness(1); }
}

.fighter-card.hurt {
  animation: hurt 0.45s ease-out;
}

@keyframes healGlow {
  0% { box-shadow: 0 0 0 0 rgba(110, 180, 120, 0); filter: brightness(1); }
  40% { box-shadow: 0 0 0 2px rgba(120, 200, 130, 0.35); filter: brightness(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(110, 180, 120, 0); filter: brightness(1); }
}

.fighter-card.heal {
  animation: healGlow 0.55s ease-out;
}

.float-num {
  position: absolute;
  left: 50%;
  top: 18%;
  z-index: 8;
  color: #ff8a72;
  font-family: var(--font-brush);
  font-size: 25px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
}

.float-num.heal {
  color: #9ce0a6;
}

.float-num.miss {
  color: #e9cf9d;
  font-size: 18px;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(0.95); }
}

/* ═══════════════════════════════════════════════════════════════
   小屏 / 大屏适配
   ═══════════════════════════════════════════════════════════════ */

@media (max-height: 720px) {
  .hero {
    height: 186px;
  }
  .brand-title {
    font-size: 38px;
  }
  .brand-desc {
    margin-bottom: 6px;
    font-size: 9.5px;
  }
  .select-head {
    margin-top: 15px;
    margin-bottom: 8px;
  }
  .roster {
    gap: 8px;
  }
  .hero-card {
    min-height: 138px;
    padding: 8px 9px;
  }
  .hero-skill-desc {
    min-height: 25px;
    font-size: 9px;
  }
  .battle-screen {
    gap: 4px;
  }
  .fighter-card {
    min-height: 60px;
    padding: 6px 8px;
  }
  .f-avatar {
    width: 40px;
    height: 40px;
  }
  .f-avatar b {
    font-size: 18px;
  }
  .f-name {
    font-size: 15px;
  }
  .f-skill {
    font-size: 8.5px;
  }
  .log-panel {
    height: 52px;
  }
  .hand-wrap {
    height: 117px;
    padding-top: 9px;
  }
  .hand-card {
    width: 73px;
    height: 105px;
  }
  .hand {
    min-height: 105px;
  }
  .card-art svg {
    width: 32px;
    height: 32px;
  }
  .card-name {
    font-size: 14px;
  }
  .action-dock {
    min-height: 38px;
  }
  .action-dock .btn-ghost,
  .action-dock .btn-primary {
    height: 37px;
    font-size: 10.5px;
  }
}

@media (max-height: 620px) {
  .battle-top {
    height: 26px;
  }
  .fighter-card {
    min-height: 54px;
    padding: 5px 7px;
  }
  .f-avatar {
    width: 36px;
    height: 36px;
  }
  .equip-row {
    padding-top: 2px;
  }
  .equip-slot {
    height: 20px;
    font-size: 8px;
  }
  .log-panel {
    height: 46px;
  }
  .hand-wrap {
    height: 108px;
    padding-top: 8px;
  }
  .hand-card {
    width: 68px;
    height: 97px;
  }
  .hand {
    min-height: 97px;
  }
  .card-desc {
    font-size: 7px;
    min-height: 15px;
  }
  .card-art svg {
    width: 28px;
    height: 28px;
  }
  .battlefield {
    min-height: 74px;
  }
  .pile-stack {
    width: 44px;
    height: 58px;
  }
  .discard-top {
    width: 42px;
    height: 56px;
  }
  .action-dock {
    min-height: 34px;
  }
  .action-dock .btn-ghost,
  .action-dock .btn-primary {
    height: 34px;
    font-size: 10px;
  }
  .selection-info b {
    font-size: 12px;
  }
  .selection-info span {
    font-size: 8px;
  }
}

@media (max-width: 380px) {
  .action-dock {
    gap: 5px;
  }
  .action-dock .btn-ghost,
  .action-dock .btn-primary {
    padding: 0 9px;
    font-size: 10.5px;
  }
  .btn-skill {
    padding: 0 7px;
    font-size: 10px;
  }
  .action-dock .play-btn {
    min-width: 52px;
  }
  .start-btn {
    width: 116px;
    font-size: 13px;
  }
  .picked-hp {
    display: none;
  }
}

@media (min-width: 420px) {
  .roster {
    gap: 12px;
  }
  .hero-card {
    min-height: 156px;
  }
  .hand-card {
    width: 82px;
    height: 118px;
  }
  .hand-wrap {
    height: 132px;
  }
  .hand {
    min-height: 118px;
  }
}

@media (min-width: 500px) {
  .hero {
    height: 300px;
  }
  .hero-art {
    background-size: 170% auto;
    background-position: 42% 42%;
  }
  .brand-title {
    font-size: 56px;
  }
  .roster {
    gap: 14px;
  }
  .hero-card {
    min-height: 164px;
  }
  .battlefield-ring {
    width: 190px;
    height: 190px;
    margin: -95px 0 0 -95px;
  }
  .field-glyph {
    font-size: 124px;
  }
}

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

/* 本局新增规则：沿用原有玄底错金视觉，不覆盖武将演出。 */
.rule-overlay { position:absolute; inset:0; z-index:180; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(7,5,4,.88); }
.rule-dialog { width:100%; max-width:400px; max-height:90%; overflow:auto; padding:22px; border:1px solid var(--gold-2); border-radius:18px; background:var(--panel); box-shadow:var(--shadow-panel); }
.rule-dialog h2 { margin:0 0 10px; color:var(--gold); font:24px var(--font-brush); }
.rule-dialog p { color:var(--paper-2); font-size:13px; line-height:1.7; }
.formation-choice { display:block; width:100%; min-height:64px; margin-top:12px; padding:12px 16px; text-align:left; border:1px solid var(--gold-3); border-radius:12px; background:var(--ink-3); }
.formation-choice b { display:block; color:var(--theme); font-size:18px; }
.formation-choice span { display:block; margin-top:5px; color:var(--paper-2); font-size:12px; line-height:1.6; }
.season-status { display:flex; flex-wrap:wrap; gap:6px; padding:4px 12px; color:var(--paper-2); font-size:11px; }
#season-badge { color:var(--theme); }
#pothu-bar { position:relative; height:32px; margin:28px 8px; border:1px solid var(--gold-3); border-radius:8px; background:linear-gradient(to right,#392b23 0% 20%,#518665 20% 43%,#edc46b 43% 57%,#518665 57% 80%,#392b23 80% 100%); }
#pothu-pointer { position:absolute; top:-8px; bottom:-8px; width:3px; background:#fff4d4; box-shadow:0 0 6px #ff8a3d; transform:translateX(-50%); }
#pothu-stop-btn { width:100%; min-height:48px; border-radius:10px; background:var(--theme); color:var(--ink); font-weight:700; }
#pothu-result { min-height:42px; text-align:center; color:var(--gold); font-size:14px; line-height:1.6; }
