/* =========================================================
 * 海克斯21 · style.css
 * 视觉方向：灯下黑（Lamplight Noir）
 *   一盏钨丝灯压在深绿绒布上，其余全黑。
 *   冷色薄荷 (#38F2D8) 降级为「不稳定度」专用故障色。
 * ========================================================= */

/* ---------------- tokens ---------------- */
:root {
  /* 底：暖黑，不是蓝黑 */
  --bg: #0a0703;
  --bg-2: #100b06;
  --panel: rgba(28, 20, 12, 0.82);
  --panel-2: rgba(40, 28, 17, 0.66);
  --line: rgba(242, 164, 76, 0.16);
  --line-soft: rgba(255, 226, 186, 0.08);
  --text: #f2e6d2;
  --dim: #a2927a;
  --dim-2: #6f5f49;

  /* 主光：钨丝琥珀 */
  --cyan: #f2a44c;
  --lamp: #f2a44c;
  --lamp-hi: #ffd79a;
  /* 危险：血红 */
  --magenta: #e0463e;
  /* 金属：做旧黄铜 */
  --violet: #d9ae3c;
  --brass: #c9a227;
  --gold: #e8b84b;
  --danger: #d63e37;
  --ok: #9dbf5a;

  /* 材质 */
  --felt: #123024;
  --felt-lit: #16412c;
  --wood: #3a2418;
  --leather: #2e2013;

  /* 故障色：只给「不稳定度」用，别处不要碰 */
  --glitch: #38f2d8;
  --inst: 0;

  --tier-1: 255, 196, 107;
  --tier-2: 217, 174, 60;
  --tier-3: 224, 70, 62;
  --r: 14px;
  --fs: 1.2;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
  color: inherit;
}

::selection {
  background: rgba(242, 164, 76, 0.3);
}

/* ---------------- background ---------------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(242, 164, 76, 0.09), transparent 60%),
    radial-gradient(700px 500px at 95% 5%, rgba(224, 70, 62, 0.07), transparent 60%),
    radial-gradient(800px 800px at 50% 110%, rgba(217, 174, 60, 0.08), transparent 65%),
    linear-gradient(180deg, #0d0904 0%, #0a0703 60%, #070502 100%);
}

.bg-grid {
  position: absolute;
  inset: -20%;
  background-image: linear-gradient(rgba(255, 245, 228, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 245, 228, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(700px) rotateX(58deg) translateY(20%);
  transform-origin: 50% 100%;
  opacity: 0.55;
  mask-image: linear-gradient(to top, #000 0%, transparent 72%);
}

.bg-glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 340px;
  min-height: 340px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: drift 22s ease-in-out infinite alternate;
}

.bg-glow--a {
  left: -14vw;
  top: -12vw;
  background: #b06f1e;
}

.bg-glow--b {
  right: -16vw;
  bottom: -18vw;
  background: #14402c;
  animation-delay: -9s;
}

.bg-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 245, 228, 0.035) 0px,
    rgba(255, 245, 228, 0.035) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.35;
  mix-blend-mode: overlay;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background: radial-gradient(circle at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4vw, 3vw, 0) scale(1.12);
  }
}

/* ---------------- layout ---------------- */
#app {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ---------------- shared ui ---------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid rgba(255, 245, 228, 0.14);
  background: rgba(255, 245, 228, 0.04);
  color: var(--text);
  font-size: calc(14px * var(--fs));
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 164, 76, 0.4);
  background: rgba(242, 164, 76, 0.08);
}

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

.btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--primary {
  background: linear-gradient(120deg, rgba(242, 164, 76, 0.95), rgba(255, 196, 107, 0.9));
  color: #1a1004;
  border: none;
  box-shadow: 0 10px 32px rgba(242, 164, 76, 0.22);
}

.btn--primary:hover {
  background: linear-gradient(120deg, #ffc46b, #ffd79a);
  box-shadow: 0 14px 42px rgba(242, 164, 76, 0.34);
  border: none;
}

.btn--big {
  padding: 18px 40px;
  font-size: calc(16px * var(--fs));
  letter-spacing: 0.24em;
}

.btn--cta {
  padding: 16px 46px;
  font-size: calc(15px * var(--fs));
  letter-spacing: 0.2em;
  animation: ctaPulse 2.6s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%,
  100% {
    box-shadow: 0 10px 32px rgba(242, 164, 76, 0.2);
  }
  50% {
    box-shadow: 0 10px 46px rgba(242, 164, 76, 0.42);
  }
}

.btn kbd {
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  color: inherit;
  opacity: 0.65;
}

.link-btn {
  background: none;
  border: none;
  color: var(--dim);
  font-size: calc(13px * var(--fs));
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 6px 2px;
}

.link-btn:hover {
  color: var(--cyan);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 245, 228, 0.03);
  color: var(--dim);
  cursor: pointer;
  font-size: calc(15px * var(--fs));
  transition: all 0.18s ease;
}

.icon-btn:hover {
  color: var(--cyan);
  border-color: rgba(242, 164, 76, 0.4);
  background: rgba(242, 164, 76, 0.07);
}

.icon-btn.is-off {
  color: var(--dim-2);
  text-decoration: line-through;
}

/* ---------------- title ---------------- */
.title-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 40px;
  padding: 7vh 7vw 10vh;
  position: relative;
  overflow-x: hidden;
}

.title-inner {
  max-width: 720px;
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.title-kicker {
  font-family: var(--mono);
  font-size: calc(11px * var(--fs));
  letter-spacing: 0.32em;
  color: var(--dim);
  margin-bottom: 26px;
}

.title-kicker b {
  color: var(--magenta);
  font-weight: 600;
}

.logo {
  position: relative;
  margin: 0;
  padding-top: 0.46em;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.logo__mini {
  position: absolute;
  left: 2px;
  top: 0;
  font-family: var(--mono);
  font-size: clamp(11px, 1.4vw, 19px);
  font-weight: 600;
  letter-spacing: 0.3em;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(242, 164, 76, 0.45);
}

.logo__line {
  display: block;
  background: linear-gradient(100deg, #ffffff 10%, #ffe3b0 42%, #ffd79a 70%, #e6c375 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 200, 130, 0.18));
}

.logo__line--main {
  position: relative;
  font-size: calc(clamp(42px, 8.6vw, 112px) * var(--fs));
  /* 字母之间留出呼吸：太紧时 k / J 会撞在一起 */
  letter-spacing: -0.012em;
}

.logo__line--main::before,
.logo__line--main::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.5;
  pointer-events: none;
}

.logo__line--main::before {
  transform: translate(2px, -2px);
  clip-path: inset(0 0 62% 0);
  color: rgba(242, 164, 76, 0.5);
}

.logo__line--main::after {
  transform: translate(-2px, 2px);
  clip-path: inset(58% 0 0 0);
  color: rgba(224, 70, 62, 0.42);
}

.logo-en {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.42em;
  color: var(--dim-2);
}

.title-tag {
  margin: 30px 0 34px;
  font-size: calc(clamp(15px, 1.6vw, 18px) * var(--fs));
  line-height: 1.9;
  color: #cfc1a6;
  max-width: 30em;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.title-meta {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: calc(12px * var(--fs));
  color: var(--dim-2);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

.title-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dim-2);
  opacity: 0.6;
}

.title-side {
  position: relative;
  height: 60vh;
  min-height: 380px;
  pointer-events: none;
}

.float-card {
  position: absolute;
  width: clamp(92px, 10vw, 132px);
  aspect-ratio: 0.68;
  border-radius: 12px;
  background: linear-gradient(160deg, #fdf7ea, #e2d5bd);
  color: #221709;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 245, 228, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px;
  font-family: var(--mono);
  animation: hoverCard 7s ease-in-out infinite alternate;
}

.float-card b {
  font-size: calc(26px * var(--fs));
  line-height: 1;
}

.float-card span {
  font-size: calc(30px * var(--fs));
  align-self: flex-end;
  line-height: 1;
}

.float-card.is-red {
  color: #c01f4b;
}

.float-card--a {
  right: 22%;
  top: 6%;
  rotate: -13deg;
  animation-delay: -1s;
}

.float-card--b {
  right: 2%;
  top: 30%;
  rotate: 8deg;
  animation-delay: -3s;
}

.float-card--c {
  right: 30%;
  bottom: 2%;
  rotate: 17deg;
  animation-delay: -5s;
}

.float-chip {
  position: absolute;
  right: 8%;
  bottom: 4%;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: calc(15px * var(--fs));
  font-weight: 700;
  color: #1a1004;
  background: radial-gradient(circle at 35% 30%, #ffe0a8, #f2a44c 46%, #8a5c12);
  box-shadow: 0 18px 40px rgba(242, 164, 76, 0.25), inset 0 0 0 5px rgba(255, 245, 228, 0.28);
  rotate: -8deg;
  animation: hoverCard 6s ease-in-out infinite alternate;
}

@keyframes hoverCard {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 -14px;
  }
}

.title-foot {
  position: absolute;
  left: 7vw;
  bottom: 3vh;
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.16em;
  color: var(--dim-2);
  opacity: 0.75;
}

/* ---------------- hud ---------------- */
.table-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hud {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: clamp(14px, 2.4vw, 40px);
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 9, 4, 0.55);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.hud__brand {
  font-family: var(--mono);
  font-size: calc(15px * var(--fs));
  letter-spacing: 0.18em;
  color: var(--dim);
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.hud__brand b {
  color: var(--cyan);
  font-size: calc(17px * var(--fs));
  text-shadow: 0 0 16px rgba(242, 164, 76, 0.45);
}

.brand-glitch {
  position: relative;
}

.brand-glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 1px;
  top: 0;
  color: rgba(224, 70, 62, 0.55);
  clip-path: inset(0 0 55% 0);
  opacity: 0.8;
  animation: brandShift 5s steps(2, end) infinite;
}

@keyframes brandShift {
  0%,
  92%,
  100% {
    transform: none;
  }
  94% {
    transform: translateX(1px);
  }
  96% {
    transform: translateX(-2px);
  }
}

.hud__round {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}

.pips {
  display: flex;
  gap: 6px;
}

.pip {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: calc(11px * var(--fs));
  color: var(--dim-2);
  background: rgba(255, 245, 228, 0.02);
}

.pip.is-done {
  border-color: rgba(242, 164, 76, 0.3);
  color: rgba(242, 164, 76, 0.6);
}

.pip.is-on {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 16px rgba(242, 164, 76, 0.2) inset;
  background: rgba(242, 164, 76, 0.08);
}

.pip--small {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 245, 228, 0.12);
  font-size: 0;
}

.pip--small.is-done {
  background: rgba(242, 164, 76, 0.3);
}

.pip--small.is-on {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(242, 164, 76, 0.8);
}

.round-text {
  font-size: calc(13px * var(--fs));
  letter-spacing: 0.08em;
  color: #cdbfa4;
  white-space: nowrap;
}

.hud__instability {
  width: clamp(120px, 16vw, 220px);
}

.inst-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.1em;
  color: var(--dim-2);
  margin-bottom: 6px;
}

.inst-label b {
  color: var(--magenta);
  font-size: calc(12px * var(--fs));
  letter-spacing: 0;
}

.inst-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 245, 228, 0.08);
  overflow: hidden;
}

.inst-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #f2a44c, #e0bc63 55%, #e0463e);
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 12px rgba(224, 70, 62, 0.5);
}

body.is-hot .hud__instability {
  animation: hotPulse 2.4s ease-in-out infinite;
}

@keyframes hotPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

.hud__tools {
  display: flex;
  gap: 7px;
}

/* ---------------- board ---------------- */
.board {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.2vh, 28px);
  padding: clamp(16px, 2.6vw, 34px);
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.board::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 53%;
  width: min(980px, 86vw);
  height: min(520px, 62vh);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(242, 164, 76, 0.075);
  border-radius: 50%;
  box-shadow: inset 0 0 120px rgba(242, 164, 76, 0.035);
  pointer-events: none;
}

.opponents,
.arena-center,
.human-row {
  position: relative;
  z-index: 1;
}

.opponents {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 16px);
}

.seat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: linear-gradient(170deg, rgba(38, 27, 17, 0.68), rgba(18, 12, 6, 0.72));
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  overflow: hidden;
  min-width: 0;
}

.seat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--accent);
  opacity: 0.6;
  border-radius: 2px;
}

.seat:hover {
  border-color: rgba(255, 245, 228, 0.16);
}

.seat--target {
  border-color: rgba(224, 70, 62, 0.45);
  box-shadow: 0 0 0 1px rgba(224, 70, 62, 0.12), 0 16px 40px rgba(224, 70, 62, 0.08);
}

.seat--dead {
  opacity: 0.42;
  filter: grayscale(0.8);
}

.seat--human {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 18px;
  border-color: rgba(242, 164, 76, 0.24);
  background: linear-gradient(170deg, rgba(46, 107, 99, 0.38), rgba(12, 8, 4, 0.8));
}

.seat__avatar {
  position: relative;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 26%, rgba(255, 245, 228, 0.2), rgba(217, 174, 60, 0.14) 58%, rgba(0, 0, 0, 0.22));
  border: 1px solid rgba(255, 245, 228, 0.14);
  font-size: calc(27px * var(--fs));
  line-height: 1;
}

.seat--human .seat__avatar {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  font-size: calc(31px * var(--fs));
}

.seat__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.28;
}

.seat--target .seat__ring {
  opacity: 0.85;
  animation: ringPulse 1.8s ease-in-out infinite;
}

@keyframes ringPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.95;
  }
}

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

.seat__name {
  font-size: calc(13px * var(--fs));
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat__you {
  font-style: normal;
  font-family: var(--mono);
  font-size: calc(8px * var(--fs));
  letter-spacing: 0.12em;
  color: var(--cyan);
  border: 1px solid rgba(242, 164, 76, 0.3);
  border-radius: 4px;
  padding: 1px 4px;
}

.seat__chips {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: calc(15px * var(--fs));
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.seat__chips .coin,
.bside__chips .coin,
.go__rank-chips .coin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3bd, #e8b84b 45%, #a5731b);
  box-shadow: 0 0 8px rgba(232, 184, 75, 0.35);
  display: inline-block;
  flex: 0 0 10px;
}

.seat__bag {
  margin-left: 6px;
  font-size: calc(10px * var(--fs));
  color: var(--dim);
  border: 1px solid var(--line-soft);
  padding: 1px 4px;
  border-radius: 4px;
}

.seat__hexes {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 5px 0 0 -5px;
  padding: 2px 5px;
  width: fit-content;
  min-height: 22px;
  flex-wrap: wrap;
  border-radius: 6px;
  cursor: help;
  transition: background 0.16s ease;
}

.seat__hexes:hover,
.bside__hexes:hover {
  background: rgba(242, 164, 76, 0.1);
}

.seat__hexes:focus-visible,
.bside__hexes:focus-visible {
  background: rgba(242, 164, 76, 0.1);
  outline: 1px solid rgba(242, 164, 76, 0.5);
  outline-offset: 2px;
}

.hex-pip {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: calc(10px * var(--fs));
  background: rgba(242, 164, 76, 0.08);
  border: 1px solid rgba(242, 164, 76, 0.28);
  cursor: help;
}

.seat__stamp {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  font-family: var(--mono);
  font-size: calc(15px * var(--fs));
  font-weight: 800;
  letter-spacing: 0.16em;
  color: rgba(214, 62, 55, 0.8);
  border: 2px solid rgba(214, 62, 55, 0.55);
  padding: 2px 8px;
  border-radius: 5px;
}

.seat__target {
  position: absolute;
  right: 12px;
  bottom: 7px;
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.16em;
  color: var(--magenta);
  opacity: 0.9;
}

/* ---------------- 海克斯悬停详情 ---------------- */
.hex-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  width: min(352px, calc(100vw - 20px));
  max-height: min(62vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 13px;
  border-radius: 12px;
  border: 1px solid rgba(242, 164, 76, 0.22);
  background: linear-gradient(170deg, rgba(40, 28, 17, 0.97), rgba(14, 9, 4, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.66), 0 0 0 1px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}

.hex-tip.is-in {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.htip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 245, 228, 0.1);
}

.htip__who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: calc(14px * var(--fs));
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.htip__av {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: calc(13px * var(--fs));
  background: rgba(255, 245, 228, 0.06);
  border: 1px solid var(--accent, rgba(255, 245, 228, 0.18));
}

.htip__count {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.08em;
  color: var(--dim);
}

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

.htip__row {
  --tier-color: 242, 164, 76;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-left: 8px;
  border-left: 2px solid transparent;
  border-radius: 7px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.htip__row.is-focus {
  border-left-color: rgba(var(--tier-color), 0.85);
  background: linear-gradient(
    90deg,
    rgba(var(--tier-color), 0.13),
    rgba(var(--tier-color), 0) 88%
  );
}

.htip__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: calc(15px * var(--fs));
  line-height: 1;
  background: rgba(var(--tier-color), 0.12);
  border: 1px solid rgba(var(--tier-color), 0.34);
}

.htip__text {
  min-width: 0;
}

.htip__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.htip__title b {
  font-size: calc(13px * var(--fs));
  color: #fff;
  letter-spacing: 0.01em;
}

.htip__title em {
  font-style: normal;
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.08em;
  color: rgb(var(--tier-color));
  opacity: 0.9;
}

.htip__desc {
  margin-top: 3px;
  font-size: calc(12px * var(--fs));
  line-height: 1.6;
  color: #bbac90;
}

.htip__empty {
  font-size: calc(12px * var(--fs));
  line-height: 1.65;
  color: var(--dim);
}

.human-row {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

/* ---------------- center ---------------- */
.arena-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(8px, 2vh, 26px) 10px 4px;
  min-height: 240px;
}

.round-kicker {
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.34em;
  color: var(--dim-2);
  margin-bottom: 14px;
}

.round-title {
  margin: 0 0 12px;
  font-size: calc(clamp(26px, 4vw, 44px) * var(--fs));
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #fff, #ffe3b0 55%, #e0bc63);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.round-sub {
  margin: 0 0 26px;
  max-width: 44em;
  font-size: calc(13px * var(--fs));
  line-height: 1.8;
  color: var(--dim);
}

.cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 66px;
}

.cta-wrap.is-in .btn--cta {
  animation: ctaIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both, ctaPulse 2.6s 0.4s ease-in-out infinite;
}

@keyframes ctaIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cta-hint {
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.1em;
  color: var(--dim-2);
}

.feed {
  margin-top: 22px;
  width: min(640px, 92%);
  max-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 10px;
  text-align: left;
}

.feed__line {
  font-size: calc(11px * var(--fs));
  line-height: 1.5;
  color: var(--dim);
  display: flex;
  gap: 8px;
  text-align: left;
  opacity: 0.86;
}

.feed__line + .feed__line {
  margin-top: 4px;
}

.feed__line:last-child {
  color: #d6c7ab;
  animation: feedIn 0.35s ease both;
}

/* 对战日志 / 回合记录：可见的滚动条 */
.feed::-webkit-scrollbar,
.battle__log::-webkit-scrollbar {
  width: 9px;
}

.feed::-webkit-scrollbar-track,
.battle__log::-webkit-scrollbar-track {
  background: rgba(255, 245, 228, 0.045);
  border-radius: 99px;
}

.feed::-webkit-scrollbar-thumb,
.battle__log::-webkit-scrollbar-thumb {
  background: rgba(242, 164, 76, 0.45);
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}

.feed::-webkit-scrollbar-thumb:hover,
.battle__log::-webkit-scrollbar-thumb:hover {
  background: rgba(242, 164, 76, 0.75);
  background-clip: padding-box;
}

.feed__tag {
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  color: var(--dim-2);
  flex: 0 0 32px;
  padding-top: 1px;
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 0.86;
    transform: none;
  }
}

/* ---------------- overlay base ---------------- */
#overlayRoot {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(4, 3, 9, 0.72);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.24s ease;
  overflow: auto;
}

.overlay.is-open {
  opacity: 1;
}

.overlay__panel {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 245, 228, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(170deg, rgba(48, 34, 20, 0.96), rgba(14, 9, 4, 0.98));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 245, 228, 0.07);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  scrollbar-width: thin;
}

.overlay.is-open .overlay__panel {
  transform: none;
}

.overlay__panel:has(.modal) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.overlay__panel:has(.modal) > .modal {
  flex: 1 1 auto;
  min-height: 0;
}

.modal {
  padding: clamp(22px, 3.4vw, 36px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal .overlay__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.modal .overlay__head,
.modal .overlay__foot {
  flex: 0 0 auto;
}

.modal .overlay__foot {
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
}

.overlay__head {
  text-align: center;
  padding: 0 4px 22px;
}

.overlay__kicker {
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.34em;
  color: var(--dim-2);
  margin-bottom: 10px;
}

.overlay__title {
  margin: 0 0 8px;
  font-size: calc(clamp(24px, 3.6vw, 34px) * var(--fs));
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #fff;
}

.overlay__sub {
  margin: 0;
  font-size: calc(13px * var(--fs));
  line-height: 1.7;
  color: var(--dim);
}

.overlay__body {
  padding-bottom: 8px;
}

.overlay__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 22px;
}

/* ---------------- draft ---------------- */
.overlay:has(.draft) .overlay__panel {
  width: min(1060px, 100%);
  background: none;
  border: none;
  box-shadow: none;
  overflow: visible;
  max-height: none;
}

.overlay:has(.draft) {
  align-items: center;
  padding-top: 24px;
  padding-bottom: 48px;
}

.draft {
  padding: 6px;
}

.draft .overlay__head {
  padding-bottom: 26px;
}

.draft__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 22px);
  align-items: stretch;
}

.draft__foot {
  margin-top: 18px;
  text-align: center;
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.2em;
  color: var(--dim-2);
}

.hex-card {
  --tier: 242, 164, 76;
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 20px;
  min-height: 300px;
  border-radius: 16px;
  border: 1px solid rgba(var(--tier), 0.4);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(var(--tier), 0.22), transparent 60%),
    linear-gradient(170deg, rgba(42, 30, 19, 0.98), rgba(13, 8, 4, 0.99));
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 245, 228, 0.08);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease,
    border-color 0.22s ease;
  animation: hexIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 80ms);
  overflow: hidden;
}

.hex-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    115deg,
    rgba(var(--tier), 0.05) 0px,
    rgba(var(--tier), 0.05) 1px,
    transparent 1px,
    transparent 9px
  );
  opacity: 0.6;
  pointer-events: none;
}

.hex-card:hover {
  transform: translateY(-8px) rotate(-0.4deg);
  border-color: rgba(var(--tier), 0.9);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 40px rgba(var(--tier), 0.15);
}

.hex-card:focus-visible {
  outline: 2px solid rgba(var(--tier), 0.7);
  outline-offset: 3px;
}

.hex-card:not(.hex-card--compact) {
  user-select: none;
}

@keyframes hexIn {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hex-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.hex-card__tag {
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.16em;
  color: rgba(var(--tier), 0.9);
  border: 1px solid rgba(var(--tier), 0.35);
  border-radius: 4px;
  padding: 3px 6px;
}

.hex-card__icon {
  font-size: calc(38px * var(--fs));
  line-height: 1;
  filter: drop-shadow(0 0 18px rgba(var(--tier), 0.45));
}

.hex-card__name {
  font-size: calc(20px * var(--fs));
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.hex-card__desc {
  font-size: calc(13px * var(--fs));
  line-height: 1.75;
  color: #cbbc9f;
  flex: 1;
}

.hex-card__flavor {
  margin-top: 14px;
  font-size: calc(11px * var(--fs));
  line-height: 1.6;
  color: var(--dim-2);
  font-style: italic;
  border-left: 2px solid rgba(var(--tier), 0.3);
  padding-left: 9px;
}

.hex-card__pick {
  margin-top: 18px;
  text-align: center;
  padding: 9px 0;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.28em;
  color: rgba(var(--tier), 0.95);
  background: rgba(var(--tier), 0.09);
  border: 1px solid rgba(var(--tier), 0.25);
}

button.hex-card__pick {
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button.hex-card__pick:hover {
  background: rgba(var(--tier), 0.18);
  border-color: rgba(var(--tier), 0.5);
  color: #fff;
}

.hex-card__pick:focus-visible {
  outline: 2px solid rgba(var(--tier), 0.65);
  outline-offset: 2px;
}

.hex-card__foot {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 18px;
}

.hex-card__foot .hex-card__pick {
  flex: 1 1 auto;
  margin-top: 0;
  min-width: 0;
}

.hex-card__re {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 14px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: #e2d5bd;
  background: rgba(255, 245, 228, 0.05);
  border: 1px solid rgba(255, 245, 228, 0.16);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease,
    transform 0.16s ease;
}

.hex-card__re:hover {
  color: #fff;
  border-color: rgba(255, 245, 228, 0.34);
  background: rgba(255, 245, 228, 0.1);
}

.hex-card__re:active {
  transform: scale(0.96);
}

.hex-card__re:focus-visible {
  outline: 2px solid rgba(242, 164, 76, 0.6);
  outline-offset: 2px;
}

.hex-card__re.is-used {
  opacity: 0.34;
  cursor: default;
}

.hex-card__re.is-used:hover {
  color: #e2d5bd;
  border-color: rgba(255, 245, 228, 0.16);
  background: rgba(255, 245, 228, 0.05);
  transform: none;
}

.hex-card--compact {
  min-height: 0;
  cursor: default;
  padding: 16px;
  animation: none;
}

.hex-card--compact:hover {
  transform: none;
}

.hex-card--compact .hex-card__name {
  font-size: calc(17px * var(--fs));
}

.hex-card--compact .hex-card__icon {
  font-size: calc(30px * var(--fs));
}

/* ---------------- reveal / report ---------------- */
/* 结算面板放得下 5 个对手：不用滚动就能一屏看完 */
.overlay--reveal .overlay__panel {
  width: min(880px, 100%);
}

.reveal {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
  align-items: start;
}

.reveal__label {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.24em;
  color: var(--dim-2);
  margin-bottom: 8px;
}

.reveal__hint {
  font-family: var(--mono);
  font-size: calc(8.5px * var(--fs));
  letter-spacing: 0.06em;
  color: rgba(255, 245, 228, 0.36);
  padding-left: 9px;
  border-left: 1px solid var(--line-soft);
  white-space: nowrap;
}

.reveal__mine .hex-card {
  min-height: 0;
}

.reveal__others {
  min-width: 0;
}

.picks {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pick-row {
  --accent: #f2a44c;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 7px;
  border-radius: 11px;
  border: 1px solid rgba(255, 245, 228, 0.07);
  background: rgba(255, 245, 228, 0.025);
  animation: pickIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes pickIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pick-row__av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 245, 228, 0.05);
  border: 1.5px solid var(--accent);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.pick-row__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(12.5px * var(--fs));
  font-weight: 600;
  color: #e7dac2;
}

/* 海克斯图标：悬停 / 点击都出详情 */
.pick-row__hex {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid rgba(242, 164, 76, 0.28);
  background: rgba(242, 164, 76, 0.08);
  color: #f0e2c6;
  font-family: inherit;
  font-size: calc(11px * var(--fs));
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: help;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease,
    transform 0.16s ease;
}

.pick-row__hex:hover,
.pick-row__hex:focus-visible {
  color: #fff;
  border-color: rgba(242, 164, 76, 0.62);
  background: rgba(242, 164, 76, 0.16);
  outline: none;
}

.pick-row__hex:active {
  transform: scale(0.97);
}

.pick-row__hex-icon {
  font-size: calc(14px * var(--fs));
  line-height: 1;
}

.pick-row__hex-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pick-row__none {
  font-size: calc(11px * var(--fs));
  color: var(--dim-2);
  white-space: nowrap;
}

.report {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mrow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 245, 228, 0.02);
}

.mrow.is-human {
  border-color: rgba(242, 164, 76, 0.26);
  background: rgba(242, 164, 76, 0.045);
}

.mrow__p {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: calc(12px * var(--fs));
}

.mrow__p.is-win {
  color: #fff;
}

.mrow__avatar {
  font-size: calc(17px * var(--fs));
  flex: 0 0 auto;
}

.mrow__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
}

.mrow__p.is-win .mrow__name {
  color: var(--cyan);
}

.mrow__score {
  margin-left: auto;
  font-family: var(--mono);
  font-size: calc(16px * var(--fs));
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.mrow__score.is-bust {
  color: var(--danger);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.mrow__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 74px;
}

.mrow__vs {
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  color: var(--dim-2);
  letter-spacing: 0.1em;
}

.mrow__delta {
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  color: var(--dim-2);
  white-space: nowrap;
}

.mrow__delta b:nth-child(1) {
  color: var(--ok);
}

.mrow__delta b:nth-child(2) {
  color: var(--danger);
}

.mrow__event {
  font-size: calc(9px * var(--fs));
  color: var(--violet);
  border: 1px solid rgba(217, 174, 60, 0.3);
  border-radius: 4px;
  padding: 2px 5px;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report__dead {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(214, 62, 55, 0.35);
  background: rgba(214, 62, 55, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report__dead-label {
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.2em;
  color: var(--danger);
}

.report__dead-p {
  font-size: calc(12px * var(--fs));
  color: #e6c2b0;
}

/* ---------------- battle ---------------- */
.overlay--battle {
  padding: clamp(6px, 1.6vw, 20px);
  background: rgba(6, 4, 1, 0.88);
}

.overlay--battle .overlay__panel {
  width: min(1080px, 100%);
  max-width: none;
  height: min(92vh, 900px);
  max-height: 100%;
  overflow: hidden;
  border-radius: 18px;
  border-color: rgba(255, 245, 228, 0.12);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(242, 164, 76, 0.09), transparent 60%),
    radial-gradient(80% 60% at 50% 110%, rgba(224, 70, 62, 0.08), transparent 60%),
    linear-gradient(180deg, #140e07, #0a0603 60%, #0d0904);
}

.battle {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2vw, 24px) clamp(14px, 2.4vw, 30px);
  position: relative;
}

.battle__hud {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.1em;
  color: var(--dim-2);
}

.battle__tag {
  color: var(--dim);
}

.battle__stake {
  margin-left: auto;
  color: var(--dim);
}

.battle__stake b {
  color: var(--gold);
  font-size: calc(14px * var(--fs));
  letter-spacing: 0;
  margin-left: 4px;
}

.battle__event {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffb3a2;
  border: 1px solid rgba(255, 112, 92, 0.55);
  border-radius: 5px;
  padding: 4px 9px;
  background: linear-gradient(
    180deg,
    rgba(255, 104, 80, 0.24),
    rgba(146, 38, 28, 0.24)
  );
  box-shadow: inset 0 1px 0 rgba(255, 214, 196, 0.28),
    0 0 16px rgba(255, 96, 70, 0.2);
  font-size: calc(10px * var(--fs));
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(255, 126, 100, 0.55);
  cursor: help;
}

/* 事件图标：emoji 不吃 color，用 filter 提一档亮度 */
.battle__event .battle__event-icon {
  font-size: calc(12px * var(--fs));
  line-height: 1;
  filter: saturate(1.15) brightness(1.18);
}

.battle__event .battle__event-name {
  color: #ffc8ba;
}

.battle__event:focus-visible {
  outline: 2px solid rgba(224, 70, 62, 0.55);
  outline-offset: 2px;
}

/* 浮层挂在 body 上：不随对战重渲染被替换，也不会被战场/HUD 遮挡 */
.event-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(224, 70, 62, 0.35);
  background: rgba(16, 10, 5, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
  text-align: left;
  font-size: calc(11px * var(--fs));
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--dim);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  pointer-events: auto;
  overscroll-behavior: contain;
}

.event-tip b {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: calc(12px * var(--fs));
}

.event-tip em {
  font-style: normal;
  color: var(--dim-2);
  font-size: calc(10px * var(--fs));
}

.event-tip.is-in {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.battle__event:empty {
  display: none;
}

.battle__table {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  gap: 6px;
  min-height: 0;
}

.bside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 4px;
}

.bside__info {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: calc(12px * var(--fs));
}

.bside__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: calc(16px * var(--fs));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: radial-gradient(circle at 35% 30%, rgba(255, 245, 228, 0.12), rgba(0, 0, 0, 0.2));
}

.bside__name {
  color: #e2d5bd;
  font-weight: 600;
}

.bside__name em {
  font-style: normal;
  font-family: var(--mono);
  font-size: calc(8px * var(--fs));
  letter-spacing: 0.12em;
  color: var(--dim-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 3px;
}

.bside__chips {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: calc(12px * var(--fs));
  color: var(--gold);
}

.bside__hexes {
  display: flex;
  gap: 3px;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 6px;
  cursor: help;
  transition: background 0.16s ease;
}

.bside__cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 0.9vw, 10px);
  min-height: 96px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.bside__total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  flex: 0 0 auto;
}

.total__num {
  font-family: var(--mono);
  font-size: calc(clamp(22px, 3vw, 32px) * var(--fs));
  font-weight: 700;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.total__num.is-bust {
  color: var(--danger);
}

.total__num.is-safe {
  color: var(--gold);
}

.total__tag {
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.14em;
  color: var(--dim-2);
}

.total__line {
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: rgba(242, 164, 76, 0.9);
  border: 1px solid rgba(242, 164, 76, 0.3);
  background: rgba(242, 164, 76, 0.07);
  border-radius: 4px;
  padding: 1px 5px;
}

.battle__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 0;
}

.battle__vs {
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.4em;
  color: var(--dim-2);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 5px 24px;
}

.battle__turn {
  font-size: calc(12px * var(--fs));
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.battle__msg {
  font-size: calc(10px * var(--fs));
  color: var(--dim-2);
  min-height: 14px;
  text-align: center;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* playing card */
.bcard {
  position: relative;
  width: clamp(56px, 6.4vw, 86px);
  aspect-ratio: 0.7;
  border-radius: 8px;
  background: linear-gradient(160deg, #fbf3e4, #e8dcc4);
  color: #221709;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 245, 228, 0.75);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 7px;
  font-family: var(--mono);
  flex: 0 0 auto;
}

.bcard.is-red {
  color: #b0261e;
}

.bcard__rank {
  font-size: calc(clamp(13px, 1.5vw, 17px) * var(--fs));
  font-weight: 700;
  line-height: 1;
}

.bcard__suit {
  font-size: calc(clamp(17px, 2.1vw, 25px) * var(--fs));
  line-height: 1;
  align-self: flex-end;
}

.bcard__jit {
  position: absolute;
  right: 5px;
  top: 4px;
  font-size: calc(8px * var(--fs));
  color: #b98f2c;
  background: rgba(185, 143, 44, 0.12);
  border-radius: 3px;
  padding: 0 3px;
}

.bcard--back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 245, 228, 0.05) 0 5px, transparent 5px 10px),
    linear-gradient(150deg, #2e2213, #20160c 70%);
  border: 1px solid rgba(217, 174, 60, 0.35);
  color: rgba(255, 245, 228, 0.25);
  display: grid;
  place-items: center;
}

.bcard--back .bcard__backmark {
  font-size: calc(24px * var(--fs));
  font-weight: 700;
  opacity: 0.35;
}

.bcard.is-new {
  animation: dealIn 0.42s cubic-bezier(0.18, 0.9, 0.24, 1.08) both;
}

@keyframes dealIn {
  from {
    opacity: 0;
    transform: translateY(-26px) rotate(-7deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* dock */
.battle__dock {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.dock__items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.dock__label {
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.16em;
  color: var(--dim-2);
}

.dock__label b {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
}

.dock__cap {
  letter-spacing: 0;
  opacity: 0.7;
}

.dock__label.is-full b,
.dock__label.is-full .dock__cap {
  color: var(--gold);
  opacity: 1;
}

.dock__empty {
  font-size: calc(10px * var(--fs));
  color: var(--dim-2);
  opacity: 0.7;
}

.battle__items {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 56px;
  align-items: center;
}

.item-card {
  width: 66px;
  padding: 8px 4px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 245, 228, 0.12);
  background: linear-gradient(170deg, rgba(56, 40, 24, 0.9), rgba(20, 14, 8, 0.9));
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.item-card:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: rgba(242, 164, 76, 0.5);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.item-card:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.item-card__icon {
  font-size: calc(18px * var(--fs));
  line-height: 1;
}

.item-card__name {
  font-size: calc(9px * var(--fs));
  color: #bdae92;
  white-space: nowrap;
}

.battle__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn--action {
  flex-direction: column;
  gap: 2px;
  padding: 11px 20px;
  font-size: calc(14px * var(--fs));
  min-width: 88px;
  background: rgba(255, 245, 228, 0.05);
}

.btn--action kbd {
  background: none;
  font-size: calc(8px * var(--fs));
  opacity: 0.45;
}

.battle__logwrap {
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 7px 10px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 245, 228, 0.02);
}

.battle__log-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.18em;
  color: var(--dim-2);
  margin-bottom: 4px;
}

.battle__log-head em {
  font-style: normal;
  letter-spacing: 0.05em;
  color: rgba(255, 245, 228, 0.22);
}

.battle__log {
  height: clamp(44px, 6.5vh, 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  font-size: calc(10px * var(--fs));
  line-height: 1.55;
  color: var(--dim-2);
}

.blogline {
  padding: 0 0 0 8px;
  border-left: 2px solid rgba(255, 245, 228, 0.08);
  overflow-wrap: anywhere;
}

.blogline--a {
  border-left-color: rgba(242, 164, 76, 0.6);
  color: #a9a094;
}

.blogline--b {
  border-left-color: rgba(224, 70, 62, 0.55);
  color: #b3a48c;
}

.blogline:last-child {
  color: var(--dim);
}

/* event / result flash */
.battle__flash {
  position: absolute;
  inset: 0;
  /* 高于战场（.battle__table > * 的 z-index:1），低于 hexTip/eventTip */
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  padding: 20px;
  background: radial-gradient(
    76% 64% at 50% 46%,
    rgba(8, 5, 2, 0.62),
    rgba(4, 2, 1, 0.86)
  );
  transition: opacity 0.25s ease;
}

.battle__flash.is-on {
  opacity: 1;
  /* 弹窗期间遮住战场，避免点击穿透 */
  pointer-events: auto;
}

@media (max-width: 640px) {
  .battle__flash {
    padding: 12px;
    align-items: center;
  }
}

.event-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 26px 40px;
  border-radius: 16px;
  border: 1px solid rgba(224, 70, 62, 0.4);
  background: linear-gradient(170deg, rgba(26, 12, 12, 0.97), rgba(10, 5, 3, 0.99));
  box-shadow: 0 0 80px rgba(224, 70, 62, 0.18), 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: glitchIn 0.45s steps(3, end) both;
}

.event-banner__icon {
  font-size: calc(32px * var(--fs));
  filter: drop-shadow(0 0 20px rgba(224, 70, 62, 0.5));
}

.event-banner__name {
  font-size: calc(24px * var(--fs));
  font-weight: 700;
  color: #ffd9c2;
  letter-spacing: 0.06em;
  text-shadow: 2px 0 rgba(242, 164, 76, 0.35), -2px 0 rgba(224, 70, 62, 0.5);
}

.event-banner__desc {
  font-size: calc(12px * var(--fs));
  color: #c2a289;
  max-width: 26em;
  line-height: 1.6;
}

@keyframes glitchIn {
  0% {
    opacity: 0;
    transform: scale(1.04) translateX(-4px);
    filter: hue-rotate(90deg);
  }
  40% {
    opacity: 1;
    transform: translateX(3px);
  }
  70% {
    transform: translateX(-2px);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.battle-result {
  pointer-events: auto;
  width: min(360px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 28px 26px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(170deg, #150e07, #0b0703);
  border: 1px solid rgba(255, 245, 228, 0.14);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  animation: resultIn 0.42s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.battle-result.is-win {
  border-color: rgba(94, 240, 168, 0.5);
  box-shadow: 0 0 80px rgba(94, 240, 168, 0.16), 0 30px 90px rgba(0, 0, 0, 0.7);
}

.battle-result.is-lose {
  border-color: rgba(214, 62, 55, 0.5);
  box-shadow: 0 0 80px rgba(214, 62, 55, 0.14), 0 30px 90px rgba(0, 0, 0, 0.7);
}

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

.battle-result__kicker {
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.3em;
  color: var(--dim-2);
}

.battle-result__title {
  margin: 10px 0 6px;
  font-size: calc(30px * var(--fs));
  font-weight: 700;
  letter-spacing: 0.02em;
}

.battle-result.is-win .battle-result__title {
  color: var(--ok);
}

.battle-result.is-lose .battle-result__title {
  color: var(--danger);
}

.battle-result__delta {
  font-family: var(--mono);
  font-size: calc(22px * var(--fs));
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.battle-result__detail {
  margin-top: 8px;
  font-size: calc(11px * var(--fs));
  color: var(--dim);
}

.battle-result__line {
  font-style: normal;
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.06em;
  color: rgba(242, 164, 76, 0.9);
  border: 1px solid rgba(242, 164, 76, 0.28);
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 2px;
  white-space: nowrap;
}

.battle-result__hands {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  color: var(--dim);
  line-height: 1.6;
}

.battle-result__hands span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-result__notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.battle-result__note {
  font-size: calc(10px * var(--fs));
  color: var(--violet);
}

.battle-result .btn {
  margin-top: 20px;
  width: 100%;
}

/* ---------------- game over ---------------- */
.overlay--final .overlay__panel {
  width: min(620px, 100%);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(242, 164, 76, 0.1), transparent 60%),
    linear-gradient(170deg, #1c140b, #0d0904);
}

.overlay--final .overlay__head {
  padding-bottom: 16px;
}

.overlay--final .overlay__foot {
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  margin-top: 6px;
}

.go {
  text-align: center;
  padding: 4px 4px 0;
}

.go__rank {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.go__rank-ord {
  font-size: calc(clamp(54px, 9vw, 84px) * var(--fs));
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #fff, #ffd79a 55%, #e0bc63);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.go__rank-label {
  font-size: calc(14px * var(--fs));
  color: var(--dim);
  letter-spacing: 0.2em;
}

.go__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.go__stat {
  padding: 10px 6px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 245, 228, 0.02);
}

.go__stat b {
  display: block;
  font-family: var(--mono);
  font-size: calc(17px * var(--fs));
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.go__stat span {
  font-size: calc(9px * var(--fs));
  color: var(--dim-2);
  letter-spacing: 0.1em;
}

.go__hexes {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.go__none {
  font-size: calc(11px * var(--fs));
  color: var(--dim-2);
}

.go__ranking {
  text-align: left;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.go__rank-row {
  display: grid;
  grid-template-columns: 22px 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: calc(12px * var(--fs));
  color: var(--dim);
}

.go__rank-row.is-me {
  background: rgba(242, 164, 76, 0.07);
  color: var(--text);
}

.go__rank-row.is-out {
  opacity: 0.5;
}

.go__rank-no {
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  color: var(--dim-2);
}

.go__rank-av {
  font-size: calc(16px * var(--fs));
  line-height: 1;
}

.go__rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.go__rank-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: calc(12px * var(--fs));
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ---------------- rules / codex ---------------- */
.modal--wide {
  width: 100%;
}

.overlay:has(.modal--wide) .overlay__panel {
  width: min(880px, 100%);
}

/* ---------------- discard ---------------- */
.overlay:has(.modal--discard) .overlay__panel {
  width: min(780px, 100%);
}

.discard__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.discard__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 148px;
  padding: 26px 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 245, 228, 0.12);
  background: linear-gradient(170deg, rgba(42, 30, 20, 0.9), rgba(14, 9, 5, 0.94));
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.discard__card:hover,
.discard__card:focus-visible {
  border-color: rgba(255, 61, 139, 0.55);
  background: linear-gradient(170deg, rgba(58, 26, 38, 0.95), rgba(18, 8, 12, 0.96));
  transform: translateY(-3px);
  outline: none;
}

.discard__card.is-new {
  border-color: rgba(242, 164, 76, 0.4);
}

.discard__badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--cyan);
  color: #04201c;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.discard__icon {
  font-size: calc(26px * var(--fs));
  line-height: 1;
}

.discard__name {
  font-size: calc(13px * var(--fs));
  font-weight: 700;
  letter-spacing: 0.02em;
}

.discard__desc {
  flex: 1;
  font-size: calc(10px * var(--fs));
  line-height: 1.5;
  color: var(--dim);
}

.discard__pick {
  margin-top: 2px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 61, 139, 0.3);
  color: var(--magenta);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.18em;
}

.discard__card:hover .discard__pick,
.discard__card:focus-visible .discard__pick {
  background: rgba(255, 61, 139, 0.14);
}

.discard__hint {
  margin-top: 14px;
  text-align: center;
  font-size: calc(10px * var(--fs));
  color: var(--dim-2);
}

.rules__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 26px;
}

.rules h3 {
  margin: 0 0 6px;
  font-size: calc(13px * var(--fs));
  letter-spacing: 0.08em;
  color: var(--cyan);
}

.rules p {
  margin: 0;
  font-size: calc(12px * var(--fs));
  line-height: 1.75;
  color: var(--dim);
}

/* 规则：二十一点拉通两栅，可以把牌面点数写清楚 */
.rules__wide {
  grid-column: 1 / -1;
}

.rules__values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.rules__values span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 10px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 226, 186, 0.14);
  background: rgba(255, 245, 228, 0.03);
  font-size: calc(11px * var(--fs));
  line-height: 1.5;
  color: var(--dim);
}

.rules__values b {
  font-family: var(--mono);
  font-size: calc(12px * var(--fs));
  letter-spacing: 0.04em;
  color: #ffd79a;
}

.rules__list {
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rules__list li {
  position: relative;
  padding-left: 14px;
  font-size: calc(12px * var(--fs));
  line-height: 1.7;
  color: var(--dim);
}

.rules__list li::before {
  content: "·";
  position: absolute;
  left: 2px;
  top: 0;
  color: rgba(56, 242, 216, 0.7);
}

.rules__list b {
  color: #e8d8ba;
  font-weight: 700;
}

.modal--wide .rules__wide p + p {
  margin-top: 8px;
}

.codex__section-title {
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.24em;
  color: var(--dim-2);
  margin: 20px 0 10px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 7px;
}

.codex__section-title:first-child {
  margin-top: 0;
}

.codex__note {
  margin: -2px 0 10px;
  font-size: calc(10px * var(--fs));
  line-height: 1.65;
  color: var(--dim-2);
}

.codex__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
}

.codex__list--cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}

.codex__item {
  display: flex;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid transparent;
}

.codex__item:hover {
  background: rgba(255, 245, 228, 0.03);
  border-color: var(--line-soft);
}

.codex__icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: calc(15px * var(--fs));
  background: rgba(var(--tier-1), 0.09);
  border: 1px solid rgba(var(--tier-1), 0.25);
  flex: 0 0 30px;
}

.codex__icon[data-tier="2"] {
  background: rgba(var(--tier-2), 0.09);
  border-color: rgba(var(--tier-2), 0.3);
}

.codex__icon[data-tier="3"] {
  background: rgba(var(--tier-3), 0.09);
  border-color: rgba(var(--tier-3), 0.35);
}

.codex__icon--hex {
  background: rgba(242, 164, 76, 0.09);
  border-color: rgba(242, 164, 76, 0.3);
}

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

.codex__text b {
  font-size: calc(12px * var(--fs));
  color: #e6d9c1;
  font-weight: 600;
}

.codex__text span {
  font-size: calc(10px * var(--fs));
  line-height: 1.5;
  color: var(--dim);
}

/* 图鉴：右上角关闭 */
.modal--codex {
  position: relative;
}

.modal--codex .overlay__head {
  padding-top: 6px;
}

.modal--codex .overlay__body {
  padding-bottom: 16px;
}

.overlay__x {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: calc(15px * var(--fs));
  line-height: 1;
  color: rgba(242, 230, 210, 0.62);
  background: rgba(255, 245, 228, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease,
    transform 0.2s ease;
}

/* 扩大点击 / 触摸热区 */
.overlay__x::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
}

.overlay__x span {
  display: block;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay__x:hover,
.overlay__x:focus-visible {
  color: var(--cyan);
  border-color: rgba(242, 164, 76, 0.45);
  background: rgba(242, 164, 76, 0.1);
  outline: none;
}

.overlay__x:hover span,
.overlay__x:focus-visible span {
  transform: rotate(90deg);
}

.overlay__x:active {
  transform: scale(0.94);
}

/* ---------------- toast ---------------- */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 245, 228, 0.14);
  background: rgba(22, 15, 9, 0.95);
  font-size: calc(12px * var(--fs));
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.24s ease;
  white-space: nowrap;
}

.toast.is-on {
  opacity: 1;
  transform: none;
}

/* ---------------- misc ---------------- */
.shake {
  animation: shakeIt 0.34s ease;
}

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

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .hud {
    grid-template-columns: auto 1fr auto;
  }

  .hud__tools {
    grid-column: 3;
    grid-row: 1;
  }

  .hud__instability {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .hud__instability .inst-label {
    margin: 0;
    gap: 10px;
    white-space: nowrap;
  }

  .hud__instability .inst-bar {
    flex: 1;
  }

  .title-screen {
    grid-template-columns: 1fr;
  }

  .title-side {
    display: none;
  }
}

@media (max-height: 760px) {
  .overlay:has(.draft) {
    align-items: flex-start;
    padding-top: 20px;
  }
}

@media (max-width: 820px) {
  .board::before {
    display: none;
  }

  .board {
    padding: 16px;
  }

  .overlay:has(.draft) {
    align-items: flex-start;
  }

  .opponents {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .opponents .seat:nth-child(4),
  .opponents .seat:nth-child(5) {
    opacity: 0.95;
  }

  .seat {
    padding: 9px 10px;
    gap: 8px;
  }

  .seat__avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: calc(19px * var(--fs));
  }

  .seat__name {
    font-size: calc(12px * var(--fs));
  }

  .seat__chips {
    font-size: calc(13px * var(--fs));
  }

  .battle__dock {
    flex-direction: column;
    align-items: stretch;
  }

  .battle__actions {
    justify-content: stretch;
  }

  .battle__actions .btn {
    flex: 1;
  }

  .bcard {
    width: clamp(48px, 11vw, 64px);
  }

  .go__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .rules__grid {
    grid-template-columns: 1fr;
  }

  .codex__list--cards {
    grid-template-columns: 1fr;
  }

  .codex__list {
    grid-template-columns: 1fr;
  }

  .reveal {
    grid-template-columns: 1fr;
  }

  .draft__grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hex-card {
    min-height: 0;
    padding: 16px;
  }

  .hex-card__desc {
    flex: none;
  }

  .hex-card__pick {
    margin-top: 12px;
  }

  .overlay:has(.draft) .overlay__panel {
    width: min(520px, 100%);
  }

  .draft {
    padding: 2px;
  }

  .overlay--battle .overlay__panel {
    height: 100%;
  }

  .battle {
    padding: 12px;
  }

  .battle__hud {
    gap: 10px;
    font-size: calc(9px * var(--fs));
  }

  .battle__stake {
    margin-left: 0;
  }

  .battle__event {
    margin-left: auto;
  }

  .bside__cards {
    min-height: 78px;
    gap: 6px;
  }

  .battle__logwrap {
    margin-top: 6px;
    padding: 6px 8px 7px;
  }

  .battle__log {
    height: 44px;
    font-size: calc(9px * var(--fs));
  }

  .battle__log-head {
    font-size: calc(8px * var(--fs));
  }
}

@media (max-width: 560px) {
  .title-screen {
    padding: 10vh 22px 14vh;
  }

  .draft .overlay__head {
    padding-bottom: 16px;
  }

  .draft__grid {
    gap: 8px;
  }

  .hex-card {
    padding: 14px;
  }

  .hex-card__top {
    margin-bottom: 8px;
  }

  .hex-card__name {
    font-size: calc(18px * var(--fs));
    margin-bottom: 6px;
  }

  .hex-card__desc {
    font-size: calc(12px * var(--fs));
    line-height: 1.65;
  }

  .hex-card__flavor {
    margin-top: 8px;
  }

  .hex-card__pick {
    margin-top: 10px;
    padding: 7px 0;
  }

  .board::before {
    display: none;
  }

  .title-tag {
    margin: 22px 0 28px;
  }

  .title-actions {
    gap: 12px;
  }

  .btn--big {
    padding: 15px 30px;
    letter-spacing: 0.16em;
  }

  .hud {
    padding: 10px 12px;
    gap: 10px;
  }

  .hud__brand {
    font-size: calc(12px * var(--fs));
    letter-spacing: 0.1em;
  }

  .hud__round {
    gap: 0;
  }

  .hud__round .pips {
    display: none;
  }

  .hud__tools {
    gap: 4px;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
    font-size: calc(13px * var(--fs));
  }

  .round-text {
    font-size: calc(11px * var(--fs));
  }

  .round-title {
    font-size: calc(25px * var(--fs));
  }

  .round-sub {
    font-size: calc(12px * var(--fs));
    line-height: 1.7;
  }

  .opponents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seat--human {
    max-width: none;
  }

  .feed {
    width: 100%;
    max-height: 76px;
    margin-top: 12px;
    padding-right: 8px;
  }

  .battle__hud {
    flex-wrap: wrap;
  }

  .battle__table {
    gap: 2px;
  }

  .bside__info {
    gap: 6px;
    font-size: calc(11px * var(--fs));
  }

  .bside__avatar {
    width: 24px;
    height: 24px;
    font-size: calc(13px * var(--fs));
  }

  .battle__mid .battle__vs {
    padding: 4px 18px;
  }

  .battle-result {
    padding: 22px 18px;
  }

  .battle-result__title {
    font-size: calc(25px * var(--fs));
  }

  .battle-result__delta {
    font-size: calc(19px * var(--fs));
  }

  .item-card {
    width: 58px;
  }

  .item-card__name {
    font-size: calc(8px * var(--fs));
  }

  .btn--action {
    min-width: 0;
    padding: 9px 10px;
    font-size: calc(12px * var(--fs));
  }

  .mrow {
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
  }

  .mrow__event {
    display: none;
  }

  .mcard__mid {
    min-width: 58px;
  }

  .go__rank-ord {
    font-size: calc(56px * var(--fs));
  }

  .overlay {
    padding: 8px;
  }

  .modal {
    padding: 20px 16px;
  }

  .discard__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .discard__card {
    min-height: 118px;
    padding: 24px 8px 10px;
  }

  .overlay__x {
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    font-size: calc(14px * var(--fs));
  }
}

@media (max-height: 800px) and (min-width: 561px) {
  .overlay--final .modal {
    padding: 22px 26px;
  }

  .overlay--final .go__rank-ord {
    font-size: calc(clamp(46px, 7vw, 68px) * var(--fs));
  }

  .overlay--final .go__rank,
  .overlay--final .go__stats,
  .overlay--final .go__hexes {
    margin-bottom: 10px;
  }

  .overlay--final .go {
    padding-top: 0;
  }

  .overlay--final .overlay__head {
    padding-bottom: 10px;
  }

  /* 矮屏时名次表分两列，避免结算按钮被挤到需要滚动的下面 */
  .overlay--final .go__ranking {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 2px;
  }
}

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

/* =====================================================================
 * ART PASS · 灯下黑（Lamplight Noir）
 * ---------------------------------------------------------------------
 * 只做三件事：换材质、换光、换纸。
 * 全部用「同类选择器 + 后置覆盖」，不动原有布局，出问题删掉这一段即可回滚。
 * ===================================================================== */

/* ---------- 1. 背景：一盏灯，一张绒布，其余全黑 ---------- */
.bg-layer {
  background:
    radial-gradient(1100px 620px at 50% -14%, rgba(242, 164, 76, 0.22), transparent 62%),
    radial-gradient(760px 760px at 12% 6%, rgba(201, 162, 39, 0.1), transparent 60%),
    radial-gradient(980px 900px at 78% 120%, rgba(18, 48, 36, 0.55), transparent 68%),
    linear-gradient(180deg, #0d0905 0%, #0a0603 55%, #050302 100%);
}

/* 原来的透视网格是「后台」味的来源：换成木纹 + 绒布纤维 */
.bg-grid {
  inset: 0;
  background-image:
    repeating-linear-gradient(93deg, rgba(255, 214, 160, 0.022) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(3deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 9px);
  background-size: auto;
  transform: none;
  mask-image: none;
  opacity: 0.6;
}

.bg-glow {
  filter: blur(130px);
  opacity: 0.5;
}

.bg-glow--a {
  background: #b06f1e;
}

.bg-glow--b {
  background: #14402c;
}

/* 扫描线 = 「不稳定度」的可视化：平时几乎看不见，越高越脏 */
.bg-scan {
  background: repeating-linear-gradient(
    0deg,
    rgba(56,242,216,0.07) 0px,
    rgba(56,242,216,0.07) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: calc(0.02 + var(--inst, 0) * 0.55);
  mix-blend-mode: screen;
}

/* 颗粒：内联 feTurbulence，零外部依赖 */
.bg-layer::after {
  content: "";
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  opacity: 0.13;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* 暗角加重，把注意力压回桌子中间 */
body::after {
  background:
    radial-gradient(circle at 50% 45%, transparent 36%, rgba(4, 2, 1, 0.74) 100%),
    linear-gradient(180deg, rgba(4, 2, 1, 0.5) 0%, transparent 24%);
}

/* ---------- 2. 按钮：黄铜拨片，不是薄荷渐变的网页按钮 ---------- */
.btn {
  clip-path: none;
  border-radius: 7px;
  border: 1px solid rgba(255, 226, 186, 0.16);
  background: linear-gradient(180deg, rgba(255, 236, 205, 0.07), rgba(255, 236, 205, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 240, 215, 0.12), 0 2px 0 rgba(0, 0, 0, 0.5);
}

.btn:hover {
  border-color: rgba(242, 164, 76, 0.55);
  background: linear-gradient(180deg, rgba(242, 164, 76, 0.2), rgba(242, 164, 76, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 240, 215, 0.2), 0 6px 22px rgba(242, 164, 76, 0.18);
}

.btn--primary {
  background: linear-gradient(180deg, #ffcf8a 0%, #f2a44c 46%, #c9762a 100%);
  color: #221203;
  border: 1px solid rgba(255, 226, 186, 0.5);
  text-shadow: 0 1px 0 rgba(255, 240, 214, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 247, 232, 0.65), inset 0 -2px 0 rgba(120, 58, 10, 0.45),
    0 10px 30px rgba(242, 164, 76, 0.22);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #ffdba3 0%, #ffb35c 46%, #d8842f 100%);
  border: 1px solid rgba(255, 240, 214, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 247, 232, 0.75), inset 0 -2px 0 rgba(120, 58, 10, 0.45),
    0 14px 40px rgba(242, 164, 76, 0.34);
}

@keyframes ctaPulse {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 247, 232, 0.6), 0 10px 30px rgba(242, 164, 76, 0.2);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 247, 232, 0.6), 0 10px 46px rgba(242, 164, 76, 0.42);
  }
}

/* ---------- 3. 牌桌：空椭圆 → 真的有一张桌子 ---------- */
.board::before {
  width: min(1010px, 88vw);
  height: min(540px, 64vh);
  border: 13px solid var(--wood);
  border-radius: 50%;
  background:
    radial-gradient(ellipse 62% 58% at 50% 32%, rgba(255, 214, 150, 0.16), transparent 70%),
    radial-gradient(ellipse at 50% 40%, var(--felt-lit) 0%, var(--felt) 58%, #07150e 100%);
  box-shadow: inset 0 0 0 2px rgba(242, 164, 76, 0.18), inset 0 30px 90px rgba(0, 0, 0, 0.55),
    inset 0 -20px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.8),
    0 44px 110px rgba(0, 0, 0, 0.75);
}

/* 吊灯打在绒布上的一圈暖光 */
.board::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 53%;
  width: min(720px, 62vw);
  height: min(360px, 44vh);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 28%, rgba(255, 205, 140, 0.16), transparent 66%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- 4. 纸牌：米白纸纹 + 大点数 + 压边 ---------- */
.bcard,
.float-card {
  border-radius: 7px;
  background:
    radial-gradient(120% 90% at 22% 8%, rgba(255, 245, 228, 0.92), rgba(255, 245, 228, 0) 58%),
    repeating-linear-gradient(92deg, rgba(120, 96, 60, 0.035) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #fdf7ea, #e9dcc2);
  color: #1d1408;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 228, 0.85),
    inset 0 0 0 2px rgba(190, 160, 110, 0.25), 0 2px 0 rgba(0, 0, 0, 0.25),
    0 14px 30px rgba(0, 0, 0, 0.55);
}

.bcard.is-red,
.float-card.is-red {
  color: #b0261e;
}

.bcard__rank {
  font-size: calc(clamp(16px, 1.9vw, 24px) * var(--fs));
  letter-spacing: -0.03em;
}

.bcard__suit {
  font-size: calc(clamp(20px, 2.5vw, 30px) * var(--fs));
}

/* 牌背：深酒红 + 黄铜斜纹，不再只是斜线阴影 */
.bcard--back {
  background:
    repeating-linear-gradient(60deg, rgba(201, 162, 39, 0.1) 0 2px, transparent 2px 9px),
    radial-gradient(circle at 50% 50%, rgba(201, 162, 39, 0.22), transparent 62%),
    linear-gradient(150deg, #3b1410, #22090a 72%);
  border: 1px solid rgba(201, 162, 39, 0.42);
  color: rgba(255, 214, 150, 0.4);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35), 0 14px 30px rgba(0, 0, 0, 0.55);
}

/* ---------- 5. 座位 / 面板：皮革与木 ---------- */
.seat {
  background: linear-gradient(170deg, rgba(46, 32, 19, 0.82), rgba(18, 12, 7, 0.86));
  border-color: rgba(255, 226, 186, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 236, 205, 0.06), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.seat__avatar {
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.45), 0 6px 16px rgba(0, 0, 0, 0.5);
}

.hud {
  background: rgba(12, 8, 4, 0.6);
}

.item-card {
  background: linear-gradient(170deg, rgba(58, 40, 24, 0.9), rgba(22, 14, 8, 0.92));
  border-color: rgba(255, 226, 186, 0.12);
}

.hex-card {
  background: linear-gradient(168deg, rgba(48, 33, 20, 0.92), rgba(20, 13, 8, 0.95));
  border-color: rgba(201, 162, 39, 0.22);
}

/* ---------- 6. 标题字：琥珀到铁锈 ---------- */
.logo__line {
  background: linear-gradient(100deg, #fff6e6 8%, #ffd79a 42%, #f2a44c 72%, #b8501f 100%);
  filter: drop-shadow(0 0 34px rgba(242, 164, 76, 0.22)) drop-shadow(0 10px 34px rgba(0, 0, 0, 0.6));
}

/* 上缘只留一丝冷色——那是「脏」，不是主色 */
.logo__line--main::before {
  color: rgba(56,242,216,0.34);
}

.logo__line--main::after {
  color: rgba(224, 70, 62, 0.42);
}

/* ---------- 7. 不稳定度 → 灯在闪 ---------- */
@keyframes lampFlicker {
  0%,
  40%,
  100% {
    opacity: 0.5;
  }
  41% {
    opacity: 0.24;
  }
  43% {
    opacity: 0.5;
  }
  62% {
    opacity: 0.5;
  }
  63% {
    opacity: 0.32;
  }
  65% {
    opacity: 0.5;
  }
}

body.is-hot .bg-glow--a {
  animation: lampFlicker 4.2s steps(1, end) infinite;
}

body.is-hot .bg-scan {
  opacity: calc(0.1 + var(--inst, 0) * 0.7);
}

body.is-hot .bcard,
body.is-hot .hex-card {
  animation: glitchNudge 5.5s ease-in-out infinite;
}

@keyframes glitchNudge {
  0%,
  92%,
  100% {
    transform: translateX(0);
  }
  93% {
    transform: translateX(-1px);
  }
  95% {
    transform: translateX(1px);
  }
  97% {
    transform: translateX(0);
  }
}

/* =====================================================================
 * ART PASS · 修正与微调（在上一段之后覆盖）
 * ===================================================================== */

/* 1) Logo：background 简写会把 background-clip 重置掉，必须补回来 */
.logo__line {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 2) 桌面：上一版太大太扁，缩到「一张桌子」的尺度，加内阴影和压边 */
.board::before {
  width: min(820px, 74vw);
  height: min(440px, 54vh);
  border: 10px solid #33200f;
  background:
    radial-gradient(ellipse 58% 54% at 50% 30%, rgba(255, 214, 150, 0.14), transparent 68%),
    radial-gradient(ellipse at 50% 44%, #17452f 0%, #123024 56%, #0a1f16 100%);
  box-shadow: inset 0 0 0 2px rgba(201, 162, 39, 0.22), inset 0 26px 70px rgba(0, 0, 0, 0.5),
    inset 0 -34px 90px rgba(0, 0, 0, 0.55), 0 30px 90px rgba(0, 0, 0, 0.72);
}

.board::after {
  width: min(560px, 52vw);
  height: min(260px, 32vh);
}

/* 3) 背景左侧那团暖光原来糊成一片污渍，收一点 */
.bg-glow--a {
  opacity: 0.34;
}

.bg-glow--b {
  opacity: 0.3;
}

/* 4) 对局区：真给一块绒布，牌是真的摊在桌上的 */
.battle__table {
  position: relative;
}

.battle__table::before {
  content: "";
  position: absolute;
  inset: -6px -4px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 210, 150, 0.1), transparent 62%),
    radial-gradient(ellipse at 50% 50%, #15412e 0%, #123024 62%, #0a1e15 100%);
  box-shadow: inset 0 0 0 1px rgba(242, 164, 76, 0.16), inset 0 22px 60px rgba(0, 0, 0, 0.5),
    0 20px 54px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 0;
}

.battle__table > * {
  position: relative;
  z-index: 1;
}

/* 5) 行动按钮：现在是三个一样暗的木块，给点黄铜和对比度 */
.btn--action {
  border-color: rgba(201, 162, 39, 0.3);
  background: linear-gradient(180deg, rgba(242, 164, 76, 0.16), rgba(242, 164, 76, 0.04));
  color: #ffe9c9;
  box-shadow: inset 0 1px 0 rgba(255, 236, 205, 0.16), 0 2px 0 rgba(0, 0, 0, 0.5);
}

.btn--action:hover {
  border-color: rgba(242, 164, 76, 0.7);
  background: linear-gradient(180deg, rgba(242, 164, 76, 0.3), rgba(242, 164, 76, 0.1));
}

.btn--action kbd {
  opacity: 0.55;
}

/* =====================================================================
 * TOON PASS · 卡通头像（js/portraits.js 输出的内联 SVG）
 * 这里只管尺寸与基线，线条和颜色都在 SVG 里
 * ===================================================================== */

.toon-av {
  display: inline-flex;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.16em;
  flex: 0 0 auto;
}

.toon-av > svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* 有圆框的容器：撑满圆框，别缩在中间 */
.seat__avatar .toon-av,
.bside__avatar .toon-av,
.htip__av .toon-av,
.pick-row__av .toon-av {
  width: 100%;
  height: 100%;
  vertical-align: 0;
}

/* 头像本身就是一个圆盘，和圆框同形 */
.seat__avatar .toon-av > svg,
.bside__avatar .toon-av > svg,
.htip__av .toon-av > svg {
  border-radius: 50%;
}

/* 出局：头像跟着一起褪色，不再单独写一套灰图 */
.seat--dead .toon-av > svg {
  filter: grayscale(0.85) brightness(0.62);
}

@media (max-width: 720px) {
  .seat__avatar .toon-av {
    width: 100%;
    height: 100%;
  }
}/* 头像外壳撑满格子，不然 1em 会把卡通脸缩成一个小点 */
.seat__emoji {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

/* =====================================================================
 * ANIME PASS · 2D 动漫画风 + 对战页重排（Yu-Gi-Oh! 式九宫格）
 * ---------------------------------------------------------------------
 * 牌面布局：
 *   ┌──────────────┬───────────────┐
 *   │              │  对手道具(上中) │ 对手信息(右上)
 *   ├──────────────┴───────────────┤
 *   │      牌桌：双方扑克牌摊在一起      │
 *   ├──────────────┬───────────────┤
 *   │ 我的信息(左下) │  我的道具(下中) │ 行动(右下)
 *   └──────────────┴───────────────┘
 * 画风：粗墨线 + 平涂 + 硬投影 + 半调网点（cel shading），不用写实渐变
 * ===================================================================== */

:root {
  --ink: #16110c; /* 墨线：所有轮廓都用它，不用纯黑 */
  --cel: #fff6e2; /* 平涂高光（牌面/白纸） */
  --hard: 5px 6px 0 rgba(6, 4, 2, 0.55); /* 漫画硬投影 */
  --hard-sm: 3px 4px 0 rgba(6, 4, 2, 0.5);
}

/* ---------- 1. 分格感：面板被墨线压在纸上，不再漂浮 ---------- */
.btn {
  border: 2px solid var(--ink);
  border-radius: 7px;
  font-weight: 700;
  box-shadow: var(--hard-sm), inset 0 1px 0 rgba(255, 240, 215, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease,
    border-color 0.12s ease;
}

.btn:hover {
  transform: translate(-1px, -2px);
  border-color: var(--ink);
  box-shadow: 4px 7px 0 rgba(6, 4, 2, 0.55), inset 0 1px 0 rgba(255, 240, 215, 0.24);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(6, 4, 2, 0.6);
}

.btn--primary {
  border-color: var(--ink);
  box-shadow: var(--hard-sm), inset 0 1px 0 rgba(255, 247, 232, 0.6),
    inset 0 -2px 0 rgba(120, 58, 10, 0.4);
}

.seat,
.hex-card,
.modal,
.overlay__panel {
  border-width: 2px;
  border-style: solid;
  border-color: var(--ink);
}

.float-card,
.float-chip {
  border: 2.5px solid var(--ink);
  box-shadow: var(--hard-sm);
}

/* ---------- 2. 对战面板：一块被墨线框住的舞台 ---------- */
.overlay--battle {
  padding: clamp(7px, 1.4vw, 18px);
}

/* 对战页要盖过 body::after 的暗角，否则顶部「底注 / 随机事件」会被压暗 */
#overlayRoot:has(.overlay--battle) {
  z-index: 70;
}

.overlay--battle .overlay__panel {
  width: min(1360px, 100%);
  height: min(94vh, 920px);
  border-width: 3px;
  border-radius: 20px;
  box-shadow: 9px 11px 0 rgba(4, 2, 1, 0.55), 0 40px 120px rgba(0, 0, 0, 0.72);
  background:
    radial-gradient(80% 60% at 50% -10%, rgba(242, 164, 76, 0.13), transparent 62%),
    linear-gradient(180deg, #1b120a, #0b0704 58%, #100b05);
}

.battle {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 9px;
  padding: clamp(10px, 1.3vw, 18px) clamp(12px, 1.6vw, 22px);
  position: relative;
}

/* ---------- 3. HUD ---------- */
.battle__hud {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px 9px;
  border-bottom: none;
  font-family: var(--mono);
  font-size: calc(10px * var(--fs));
  letter-spacing: 0.12em;
}

.battle__hud::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 162, 39, 0.6) 18%,
    rgba(201, 162, 39, 0.6) 82%,
    transparent
  );
}

.battle__tag {
  color: var(--gold);
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 5px;
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, rgba(242, 164, 76, 0.24), rgba(242, 164, 76, 0.06));
  box-shadow: 2px 2px 0 rgba(6, 4, 2, 0.5);
  transform: skewX(-9deg);
}

.battle__hudline {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(201, 162, 39, 0.32) 0 5px,
    transparent 5px 11px
  );
}

.battle__stake {
  margin-left: 0;
  color: #e3cfa9;
  letter-spacing: 0.14em;
}

.battle__stake b {
  color: #fffaf0;
  font-size: calc(15px * var(--fs));
  text-shadow: 0 0 16px rgba(255, 205, 130, 0.75), 0 2px 0 rgba(0, 0, 0, 0.65);
}

/* 随机事件：暗底上的通知牌，比普通 HUD 文字再亮一档 */
.battle__event {
  color: #fff1ea;
  font-size: calc(11px * var(--fs));
  padding: 4px 12px;
  border-color: rgba(255, 178, 158, 0.95);
  background: linear-gradient(
    180deg,
    rgba(255, 112, 86, 0.62),
    rgba(156, 40, 30, 0.7)
  );
  box-shadow: inset 0 1px 0 rgba(255, 240, 228, 0.7),
    0 0 22px rgba(255, 92, 66, 0.5);
  text-shadow: 0 0 14px rgba(255, 140, 116, 0.95), 0 1px 0 rgba(0, 0, 0, 0.6);
  animation: eventGlow 3.4s ease-in-out infinite;
}

.battle__event .battle__event-icon {
  font-size: calc(14px * var(--fs));
  filter: saturate(1.6) brightness(1.7)
    drop-shadow(0 0 8px rgba(255, 150, 120, 0.85));
}

.battle__event .battle__event-name {
  color: #fff8f4;
}

@keyframes eventGlow {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 240, 228, 0.6),
      0 0 16px rgba(255, 92, 66, 0.34);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 240, 228, 0.75),
      0 0 28px rgba(255, 104, 78, 0.66);
  }
}

/* ---------- 4. 九宫格舞台 ---------- */
.bstage {
  min-height: 0;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 2.1fr) minmax(0, 0.8fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    ". opp-items opp-info"
    "field field field"
    "me-info my-items actions";
}

/* ---------- 5. 道具槽（上中 / 下中） ---------- */
.bslot {
  --itemw: clamp(46px, 4.4vw, 58px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  align-self: center;
  padding: 5px 9px 8px;
  border-radius: 13px;
  border: 2px solid rgba(22, 17, 12, 0.9);
  background: linear-gradient(180deg, rgba(48, 33, 20, 0.72), rgba(12, 8, 4, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 226, 186, 0.07),
    inset 0 0 0 1px rgba(255, 226, 186, 0.07), var(--hard-sm);
}

.bslot--opp {
  grid-area: opp-items;
  justify-self: center;
  width: 100%;
  max-width: 470px;
}

.bslot--me {
  grid-area: my-items;
  justify-self: center;
  width: 100%;
  max-width: 470px;
}

.bslot__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.18em;
  color: rgba(255, 226, 186, 0.42);
}

.bslot__count {
  color: var(--gold);
  letter-spacing: 0;
  font-weight: 700;
}

.battle__items {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

/* ---------- 6. 对手 / 本家信息牌 ---------- */
.binfo {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "av body"
    "score score";
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  align-self: center;
  padding: 9px 10px;
  border-radius: 15px;
  border: 2.5px solid var(--ink);
  background:
    radial-gradient(120% 90% at 10% 0%, rgba(242, 164, 76, 0.16), transparent 62%),
    linear-gradient(180deg, #352516 0%, #1a1108 100%);
  box-shadow: var(--hard), inset 0 1px 0 rgba(255, 226, 186, 0.14),
    inset 0 0 0 1px rgba(255, 226, 186, 0.1);
  cursor: help;
}

.binfo::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--accent, var(--gold));
  opacity: 0.9;
}

.binfo--opp {
  grid-area: opp-info;
}

.binfo--me {
  grid-area: me-info;
}

.binfo--opp:hover,
.binfo--me:hover,
.binfo--opp:focus-visible,
.binfo--me:focus-visible {
  outline: none;
  border-color: rgba(242, 164, 76, 0.7);
}

.binfo__badge {
  position: absolute;
  top: -10px;
  right: 11px;
  padding: 1px 9px;
  font-family: var(--mono);
  font-size: calc(8px * var(--fs));
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #1a1108;
  background: var(--accent, var(--gold));
  border: 2px solid var(--ink);
  border-radius: 999px;
  transform: rotate(-2.5deg);
  box-shadow: 2px 2px 0 rgba(6, 4, 2, 0.55);
}

.binfo__av {
  grid-area: av;
  width: clamp(38px, 3.7vw, 52px);
  height: clamp(38px, 3.7vw, 52px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #efe2c4;
  border: 2.5px solid var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #f2a44c) 38%, transparent),
    2px 3px 0 rgba(6, 4, 2, 0.5);
}

.binfo__av .toon-av {
  width: 100%;
  height: 100%;
  vertical-align: 0;
}

.binfo__av .toon-av > svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.binfo__body {
  grid-area: body;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.binfo__name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: calc(15px * var(--fs));
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff4e0;
  text-shadow: 1px 2px 0 rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.binfo__name em {
  font-style: normal;
  font-family: var(--mono);
  font-size: calc(8px * var(--fs));
  letter-spacing: 0.14em;
  color: rgba(255, 226, 186, 0.5);
  border: 1.5px solid rgba(255, 226, 186, 0.18);
  border-radius: 4px;
  padding: 0 3px;
}

.binfo__title {
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.12em;
  color: rgba(255, 226, 186, 0.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.binfo__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.binfo__chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: calc(12px * var(--fs));
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.binfo__chips .coin {
  width: 9px;
  height: 9px;
}

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

.binfo__nohex {
  font-size: calc(9px * var(--fs));
  color: rgba(163, 148, 124, 0.45);
}

.binfo__score {
  grid-area: score;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1.5px dashed rgba(255, 226, 186, 0.16);
}

.binfo__score .total__num {
  font-size: calc(clamp(20px, 2.3vw, 30px) * var(--fs));
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

.binfo__score .total__num.is-bust {
  color: #ff6a5f;
}

.binfo__score .total__num.is-safe {
  color: var(--gold);
}

.binfo__score .total__tag {
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.14em;
  color: rgba(255, 226, 186, 0.45);
}

.binfo__score .total__line {
  margin-left: auto;
  align-self: center;
}

/* ---------- 7. 牌桌 ---------- */
.bfield {
  grid-area: field;
  position: relative;
  isolation: isolate;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 2px;
  padding: clamp(8px, 1.4vh, 16px) clamp(10px, 2vw, 26px) clamp(11px, 1.9vh, 20px);
}

.bfield__felt {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 24px;
  border: 9px solid #33200f;
  overflow: hidden;
  background:
    radial-gradient(ellipse 58% 50% at 50% 26%, #22694a 0%, #17492f 46%, #103622 78%, #0a2317 100%);
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 5px rgba(242, 164, 76, 0.2),
    inset 0 30px 0 -8px rgba(255, 255, 255, 0.045),
    inset 0 -30px 60px rgba(0, 0, 0, 0.45), var(--hard);
}

/* 桌面中圈 */
.bfield__felt::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(360px, 36%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed rgba(242, 164, 76, 0.18);
}

/* 半调网点：漫画质感 */
.bfield__felt::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.55) 1px, transparent 1.1px);
  background-size: 8px 8px;
  opacity: 0.15;
  mix-blend-mode: multiply;
}

.bfield__hand {
  width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(6px, 0.9vw, 12px);
  overflow: hidden;
}

/* 牌桌两侧的牌堆（纯装饰） */
.bfield__deck {
  position: absolute;
  top: 50%;
  width: clamp(30px, 3vw, 44px);
  aspect-ratio: 0.68;
  border-radius: 7px;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(45deg, rgba(217, 174, 60, 0.16) 0 2px, transparent 2px 8px),
    radial-gradient(circle at 50% 50%, #7f2721, #3f1112 72%);
  box-shadow: -4px -4px 0 #4a1313, -4px -4px 0 2px var(--ink), 6px 7px 0 rgba(6, 4, 2, 0.45);
  opacity: 0.85;
  pointer-events: none;
}

.bfield__deck--l {
  left: clamp(14px, 2.2vw, 30px);
  transform: translateY(-50%) rotate(-7deg);
}

.bfield__deck--r {
  right: clamp(14px, 2.2vw, 30px);
  transform: translateY(-50%) rotate(6deg) scaleX(-1);
}

.bfield__core {
  display: grid;
  justify-items: center;
  gap: 3px;
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1px 0;
}

/* 中线：一条虚线 + VS，把牌桌分成上下两个半场 */
.bfield__vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  max-width: 360px;
  font-family: var(--mono);
  font-size: calc(9px * var(--fs));
  letter-spacing: 0.5em;
  color: rgba(255, 226, 186, 0.34);
  text-indent: 0.5em;
}

.bfield__vs::before,
.bfield__vs::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 186, 0.3), transparent);
}

.bfield__turn {
  font-size: calc(13px * var(--fs));
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 3px 17px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  color: #1c1206;
  background: linear-gradient(180deg, #ffd79a, #e79a3c);
  box-shadow: var(--hard-sm);
  white-space: nowrap;
}

.bfield__turn[data-side="b"] {
  color: #ffe8dd;
  background: linear-gradient(180deg, #e0463e, #8e211d);
}

.bfield__turn[data-side="done"] {
  color: #e6dcc9;
  background: linear-gradient(180deg, #40301e, #1d140c);
}

.bfield__msg {
  font-size: calc(9.5px * var(--fs));
  color: rgba(255, 236, 208, 0.66);
  max-width: min(100%, 480px);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 8. 扑克牌：白纸平涂 + 墨线 + 硬投影 ---------- */
.bcard {
  position: relative;
  width: clamp(54px, 5.7vw, 88px);
  aspect-ratio: 0.68;
  display: block;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 9px;
  border: 2.5px solid var(--ink);
  color: #1d1408;
  font-family: var(--mono);
  background:
    radial-gradient(120% 90% at 22% 6%, rgba(255, 255, 255, 0.92), transparent 55%),
    linear-gradient(160deg, #fffaf0 0%, #fbf1da 58%, #eeddbd 100%);
  box-shadow: var(--hard-sm), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  rotate: var(--rot, 0deg);
  transform-origin: 50% 92%;
}

.bcard.is-red {
  color: #b0261e;
}

.bcard__corner {
  position: absolute;
  top: 4px;
  left: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
}

.bcard__corner .bcard__rank {
  font-size: calc(clamp(12px, 1.35vw, 16px) * var(--fs));
  font-weight: 800;
  letter-spacing: -0.05em;
}

.bcard__corner .bcard__suit {
  font-size: calc(clamp(9px, 1vw, 12px) * var(--fs));
  align-self: center;
}

.bcard__corner--br {
  top: auto;
  left: auto;
  right: 5px;
  bottom: 4px;
  transform: rotate(180deg);
}

.bcard__pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(clamp(24px, 2.8vw, 40px) * var(--fs));
  opacity: 0.95;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.7));
}

.bcard__jit {
  position: absolute;
  top: 3px;
  right: 4px;
  padding: 0 3px;
  border-radius: 3px;
  font-size: calc(8px * var(--fs));
  font-weight: 700;
  color: #6b4a12;
  background: rgba(201, 162, 39, 0.3);
  border: 1px solid rgba(107, 74, 18, 0.35);
}

.bcard--back {
  display: grid;
  place-items: center;
  border-color: var(--ink);
  color: rgba(255, 214, 150, 0.45);
  background:
    repeating-linear-gradient(45deg, rgba(217, 174, 60, 0.18) 0 2px, transparent 2px 9px),
    radial-gradient(circle at 50% 50%, #8d2a23 0%, #5c1817 58%, #33090b 100%);
  box-shadow: var(--hard-sm), inset 0 0 0 2px rgba(217, 174, 60, 0.35);
}

.bcard--back .bcard__backmark {
  font-size: calc(22px * var(--fs));
  font-weight: 700;
  opacity: 0.4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

/* ---------- 9. 道具牌：三个卡位的小卡片，悬停时"被拿起来" ---------- */
.item-card {
  width: var(--itemw, 52px);
  aspect-ratio: 0.7;
  padding: 0;
  gap: 2px;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid var(--ink);
  color: var(--text);
  background:
    radial-gradient(80% 70% at 50% 0%, rgba(242, 164, 76, 0.22), transparent 62%),
    linear-gradient(170deg, #3f2c1a, #1b1209);
  box-shadow: var(--hard-sm), inset 0 0 0 1.5px rgba(201, 162, 39, 0.4);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.item-card:hover:not(:disabled) {
  transform: translateY(-7px) rotate(-3deg);
  border-color: rgba(242, 164, 76, 0.85);
  box-shadow: 5px 9px 0 rgba(6, 4, 2, 0.5), 0 0 26px rgba(242, 164, 76, 0.3);
}

.item-card:disabled {
  opacity: 0.28;
}

.item-card__icon {
  font-size: calc(17px * var(--fs));
  line-height: 1;
}

.item-card__name {
  font-size: calc(8px * var(--fs));
  color: #cbb694;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card--foe,
.item-card--foe:hover {
  transform: none;
  cursor: default;
  border-color: var(--ink);
  box-shadow: var(--hard-sm), inset 0 0 0 1.5px rgba(217, 174, 60, 0.3);
  background:
    repeating-linear-gradient(45deg, rgba(217, 174, 60, 0.14) 0 2px, transparent 2px 9px),
    radial-gradient(circle at 50% 50%, #7d2620 0%, #4a1313 62%, #2c0b0c 100%);
}

.item-card__back {
  font-family: var(--mono);
  font-size: calc(16px * var(--fs));
  font-weight: 700;
  color: rgba(255, 214, 150, 0.4);
}

/* 空卡位：虚线框，道具区永远是三个槽 */
.item-slot {
  width: var(--itemw, 52px);
  aspect-ratio: 0.7;
  border-radius: 8px;
  border: 2px dashed rgba(255, 226, 186, 0.16);
  background: rgba(255, 245, 228, 0.03);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* ---------- 10. 行动按钮：右下竖排 ---------- */
.bactions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}

.btn--action {
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
  padding: 4px 10px;
  font-size: calc(13px * var(--fs));
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffeacb;
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, rgba(242, 164, 76, 0.28), rgba(110, 56, 16, 0.55));
  box-shadow: var(--hard-sm), inset 0 1px 0 rgba(255, 236, 205, 0.22);
}

.btn--action:hover:not(:disabled) {
  color: #24140a;
  background: linear-gradient(180deg, #ffd79a, #e79a3c);
}

.btn--action kbd {
  font-size: calc(7.5px * var(--fs));
  line-height: 1;
  opacity: 0.5;
}

.btn--action:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

/* ---------- 11. 日志 ---------- */
.battle__logwrap {
  margin-top: 0;
  padding: 6px 10px 7px;
  border: 2px solid rgba(22, 17, 12, 0.85);
  border-radius: 11px;
  background: rgba(8, 5, 2, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 226, 186, 0.05);
}

.battle__log {
  height: clamp(36px, 5vh, 52px);
}

/* ---------- 11b. 宽屏：对战日志上右侧竖槛 ---------- */
@media (min-width: 1200px) {
  .battle {
    grid-template-columns: minmax(0, 1fr) clamp(168px, 13.5vw, 224px);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "hud hud"
      "stage log";
    column-gap: 12px;
  }

  .battle__hud {
    grid-area: hud;
  }

  .bstage {
    grid-area: stage;
  }

  .battle__logwrap {
    grid-area: log;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 8px 9px 9px;
  }

  .battle__log-head {
    flex: 0 0 auto;
    flex-wrap: wrap;
    row-gap: 1px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px dashed rgba(255, 226, 186, 0.12);
  }

  /* 竖槛里日志吃掉整块高度，不用再拖那一小条 */
  .battle__log {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }
}

/* ---------- 12. 结算 / 事件：漫画爆发线 ---------- */
.battle__flash {
  background:
    repeating-conic-gradient(
      from 0deg at 50% 48%,
      rgba(255, 236, 205, 0.04) 0deg 1.1deg,
      transparent 1.1deg 8deg
    ),
    radial-gradient(70% 60% at 50% 46%, rgba(6, 4, 1, 0.76), rgba(3, 2, 1, 0.94));
}

.battle-result {
  border: 3px solid var(--ink);
  border-radius: 15px;
  box-shadow: 8px 10px 0 rgba(4, 2, 1, 0.55), 0 30px 90px rgba(0, 0, 0, 0.7);
}

.battle-result__title {
  font-size: calc(34px * var(--fs));
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55), 0 0 34px currentColor;
}

.battle-result .btn {
  border-width: 2px;
}

.event-banner {
  border: 3px solid var(--ink);
  box-shadow: 8px 10px 0 rgba(4, 2, 1, 0.5), 0 0 80px rgba(224, 70, 62, 0.22),
    0 30px 80px rgba(0, 0, 0, 0.6);
}

/* ---------- 12b. 行动字幕：牌桌上弹出的「要牌 / 停牌 / 加倍 / 道具卡 / 爆牌」 ---------- */
.bcalls {
  position: absolute;
  inset: 0;
  /* 手牌之上、闪光遮罩之下 */
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.bcalls__lane {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

/* 对手的字幕贴在中线以上，本家的贴在中线以下，都把牌面让出来 */
.bcalls__lane--b {
  bottom: calc(50% + clamp(30px, 4.4vh, 44px));
}

.bcalls__lane--a {
  top: calc(50% + clamp(30px, 4.4vh, 44px));
  flex-direction: column-reverse;
}

.bcalls__lane--b .bcall {
  --from: -10px;
}

.bcalls__lane--a .bcall {
  --from: 10px;
}

.bcall {
  --c: #ffd489;
  --tilt: -3deg;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55em;
  padding: 0 13px 2px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(38, 23, 9, 0.95), rgba(11, 6, 2, 0.96));
  box-shadow: 3px 4px 0 rgba(4, 2, 1, 0.55), 0 0 26px rgba(0, 0, 0, 0.45);
  color: var(--c);
  line-height: 1.12;
  white-space: nowrap;
  transform-origin: 50% 62%;
  animation: bcallPop 0.34s cubic-bezier(0.2, 1.5, 0.35, 1) both;
}

.bcall--a {
  --tilt: 2.6deg;
}

/* 字幕背后的一圈爆发线：像漫画里的拟声词 */
.bcall::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190%;
  height: 280%;
  translate: -50% -50%;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    currentColor 0deg 1.4deg,
    transparent 1.4deg 16deg
  );
  -webkit-mask-image: radial-gradient(closest-side, #000 24%, transparent 96%);
  mask-image: radial-gradient(closest-side, #000 24%, transparent 96%);
  opacity: 0.15;
  z-index: -1;
  animation: bcallSpin 0.9s ease-out both;
  pointer-events: none;
}

.bcall__who {
  font-family: var(--mono);
  font-size: calc(8.5px * var(--fs));
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 999px;
  color: #1b1206;
  background: var(--c);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  text-shadow: none;
}

.bcall--b .bcall__who {
  color: #200a06;
}

.bcall__text {
  font-size: calc(clamp(17px, 2vw, 27px) * var(--fs));
  font-weight: 900;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 22px currentColor;
}

/* 按行动类型换色 */
.bcall--hit {
  --c: #ffcf7a;
}

.bcall--stand {
  --c: #a9d8ff;
}

.bcall--double {
  --c: #ffb03a;
}

.bcall--item {
  --c: #cda6ff;
}

.bcall--freeze {
  --c: #7fe4ff;
}

.bcall--natural {
  --c: #ffe9a8;
}

.bcall--bust {
  --c: #ff6f5d;
  background: linear-gradient(180deg, rgba(62, 12, 9, 0.96), rgba(18, 5, 3, 0.97));
  border-color: #2a0a06;
  animation: bcallPop 0.34s cubic-bezier(0.2, 1.5, 0.35, 1) both,
    bcallShake 0.42s 0.3s steps(2, end) both;
}

.bcall--double .bcall__text,
.bcall--bust .bcall__text,
.bcall--natural .bcall__text {
  font-size: calc(clamp(19px, 2.3vw, 31px) * var(--fs));
}

.bcall.is-out {
  animation: bcallOut 0.34s ease-in both;
}

@keyframes bcallPop {
  0% {
    opacity: 0;
    scale: 0.55;
    translate: 0 var(--from, 8px);
    rotate: calc(var(--tilt) * 3);
    filter: blur(5px);
  }
  55% {
    opacity: 1;
    scale: 1.08;
    translate: 0 0;
    rotate: var(--tilt);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    scale: 1;
    translate: 0 0;
    rotate: var(--tilt);
    filter: blur(0);
  }
}

@keyframes bcallOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    scale: 0.86;
    translate: 0 calc(var(--from, 8px) * -1.4);
    rotate: var(--tilt);
    filter: blur(4px);
  }
}

@keyframes bcallShake {
  0%,
  100% {
    translate: 0 0;
  }
  25% {
    translate: -5px 0;
  }
  50% {
    translate: 4px 0;
  }
  75% {
    translate: -2px 0;
  }
}

@keyframes bcallSpin {
  0% {
    rotate: 0deg;
    scale: 0.7;
    opacity: 0.32;
  }
  100% {
    rotate: 20deg;
    scale: 1;
    opacity: 0.15;
  }
}

@media (max-width: 640px) {
  .bcall__text {
    font-size: calc(16px * var(--fs));
  }

  .bcall--double .bcall__text,
  .bcall--bust .bcall__text,
  .bcall--natural .bcall__text {
    font-size: calc(18px * var(--fs));
  }
}

/* ---------- 13. 响应式 ---------- */
/* 平板：信息牌变成横条，道具槽占满整行 */
@media (max-width: 980px) {
  .bstage {
    gap: 7px 10px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-rows: auto auto minmax(150px, 1fr) auto auto;
    grid-template-areas:
      "opp-info opp-info"
      "opp-items opp-items"
      "field field"
      "my-items my-items"
      "me-info actions";
  }

  .binfo {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    grid-template-areas: "av body score";
    gap: 6px 10px;
    padding: 8px 10px;
  }

  .binfo__title {
    display: none;
  }

  .binfo__score {
    margin-top: 0;
    padding-top: 0;
    padding-left: 10px;
    border-top: none;
    border-left: 1.5px dashed rgba(255, 226, 186, 0.16);
    align-self: stretch;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 130px;
  }

  .binfo__score .total__line {
    margin-left: 0;
  }

  .bslot--opp,
  .bslot--me {
    max-width: none;
  }

  .bactions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  .btn--action {
    width: auto;
    flex: 1 1 0;
    padding: 7px 8px;
    font-size: calc(12px * var(--fs));
  }
}

/* 手机：单列，信息牌在道具槽上下 */
@media (max-width: 640px) {
  .overlay--battle {
    padding: 6px;
  }

  .overlay--battle .overlay__panel {
    height: 100%;
    border-radius: 15px;
  }

  .battle {
    gap: 6px;
    padding: 9px;
  }

  .battle__hud {
    gap: 8px;
    font-size: calc(9px * var(--fs));
    padding-bottom: 6px;
  }

  .battle__hudline {
    display: none;
  }

  .battle__stake {
    margin-left: auto;
  }

  .bstage {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(140px, 1fr) auto auto auto;
    grid-template-areas:
      "opp-info"
      "opp-items"
      "field"
      "my-items"
      "me-info"
      "actions";
  }

  .binfo {
    padding: 7px 9px;
  }

  .binfo__av {
    width: 36px;
    height: 36px;
  }

  .binfo__name {
    font-size: calc(13px * var(--fs));
  }

  .binfo__score .total__num {
    font-size: calc(18px * var(--fs));
  }

  .bslot {
    --itemw: 44px;
    padding: 4px 7px 6px;
  }

  .bslot__head {
    font-size: calc(8px * var(--fs));
  }

  .battle__items {
    gap: 6px;
  }

  .item-card__name {
    font-size: calc(7.5px * var(--fs));
  }

  .bfield {
    border-radius: 16px;
    padding: 8px 10px;
  }

  .bfield__felt {
    border-radius: 16px;
  }

  .bfield__deck {
    display: none;
  }

  .bcard {
    width: clamp(46px, 15vw, 68px);
    border-width: 2px;
  }

  .bfield__turn {
    font-size: calc(11px * var(--fs));
    padding: 2px 12px;
  }

  .bfield__msg {
    font-size: calc(8.5px * var(--fs));
  }

  .bactions {
    flex-direction: row;
    justify-content: center;
    gap: 6px;
  }

  .btn--action {
    flex: 1 1 0;
    padding: 8px 6px;
    font-size: calc(12px * var(--fs));
  }

  .battle__log {
    height: 40px;
    font-size: calc(9px * var(--fs));
  }
}

/* =====================================================================
 * LAYOUT PASS · 首页构图收拢
 * ---------------------------------------------------------------------
 * 原先是两栏杆栅：左边文案占 1fr、右边浮动牌占 0.8fr。
 * 屏幕一宽，两栏都被拉得很宽，中间就空出一大块，两侧又贴着边。
 * 做法：整块构图限宽居中（两侧留白变大），栏间距改成可控的 
 * clamp（中间收拢）；浮动牌改用 left 铺满右侧区块，不再挤在右边缘。
 * 只覆盖 ≥1081px：更窄的屏在 max-width:1080px 里已经把右栏隐了。
 * ===================================================================== */
@media (min-width: 1081px) {
  .title-screen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(28px, 4vw, 88px);
    max-width: 1480px;
    margin-inline: auto;
    padding: 6vh clamp(40px, 6.5vw, 96px) 9vh;
  }

  /* min-width:0 允许弹性收缩：窄屏时 Logo 溢出自己的盒子，
     而不是把右侧牌区挤到被 overflow-x 裁掉 */
  .title-inner {
    flex: 1 1 720px;
    max-width: 720px;
    min-width: 0;
  }

  .title-side {
    flex: 0 1 480px;
    width: 480px;
    height: min(60vh, 620px);
    min-height: 380px;
  }

  /* 三张牌 + 筹码铺满右侧区块，互相靠拢 */
  .float-card--a {
    left: 2%;
    right: auto;
    top: 4%;
  }

  .float-card--b {
    left: 55%;
    right: auto;
    top: 31%;
  }

  .float-card--c {
    left: 14%;
    right: auto;
    bottom: 3%;
  }

  .float-chip {
    left: 60%;
    right: auto;
    bottom: 6%;
  }

  /* 左下角小字跟文案左边缘对齐，而不是跟着 7vw 跑 */
  .title-foot {
    left: clamp(40px, 6.5vw, 96px);
  }
}

/* =====================================================================
 * LAYOUT PASS · 牌桌：椭圆 → 大圆桌，HUD 按钮提亮
 * ---------------------------------------------------------------------
 * 1) 桌面改成正圆，直径取 min(900px, 86vw, 82vh)：
 *    上下两个端点正好送到两侧座位卡底下（被座位遮挡），
 *    左右两侧露出弧形桌面，读起来就是一张圆桌。
 * 2) 右上三个图标按钮：墨线 + 黄铜底 + 硬投影，从“隐约可见”提到“看得见”。
 * ===================================================================== */

/* ---------- 1. 圆桌 ---------- */
.board::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(900px, 86vw, 82vh);
  height: auto;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 13px solid #33200f;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background:
    /* 内圈压边线 */
    radial-gradient(
      circle at 50% 50%,
      transparent 0 76.4%,
      rgba(242, 164, 76, 0.16) 76.4% 77.1%,
      transparent 77.1%
    ),
    /* 吊灯打在绒布上的那圈暖光 */
    radial-gradient(
      circle at 50% 34%,
      rgba(255, 214, 150, 0.2) 0%,
      rgba(255, 214, 150, 0.07) 34%,
      transparent 64%
    ),
    /* 绒布 */
    radial-gradient(circle at 50% 44%, #1b5339 0%, #15402c 50%, #0e2c1f 80%, #08200f 100%);
  box-shadow: inset 0 0 0 2px rgba(242, 164, 76, 0.24),
    inset 0 44px 90px rgba(0, 0, 0, 0.42), inset 0 -56px 110px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(0, 0, 0, 0.7), 0 44px 110px rgba(0, 0, 0, 0.6);
}

/* 灯斑也改成圆形，跟着桌面走 */
.board::after {
  top: 50%;
  width: min(720px, 30vw, 66vh);
  height: auto;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 30%, rgba(255, 205, 140, 0.16), transparent 64%);
}

/* ---------- 2. HUD 三个图标按钮 ---------- */
.hud__tools .icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 2px solid var(--ink);
  color: #fff3de;
  font-size: calc(16px * var(--fs));
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, rgba(242, 164, 76, 0.42), rgba(126, 66, 22, 0.6));
  box-shadow: 2px 3px 0 rgba(6, 4, 2, 0.5), inset 0 1px 0 rgba(255, 236, 205, 0.32),
    inset 0 -2px 0 rgba(80, 38, 8, 0.35);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease,
    color 0.14s ease;
}

.hud__tools .icon-btn:hover {
  color: #24140a;
  border-color: var(--ink);
  background: linear-gradient(180deg, #ffd79a, #e79a3c);
  transform: translate(-1px, -2px);
  box-shadow: 3px 6px 0 rgba(6, 4, 2, 0.55), inset 0 1px 0 rgba(255, 247, 232, 0.6),
    0 0 20px rgba(242, 164, 76, 0.35);
}

.hud__tools .icon-btn.is-off {
  color: rgba(255, 214, 160, 0.45);
  background: linear-gradient(180deg, rgba(90, 60, 30, 0.28), rgba(26, 18, 9, 0.5));
  text-decoration: none;
}

@media (max-width: 560px) {
  .hud__tools .icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: calc(14px * var(--fs));
  }
}

/* 窄屏不再画桌子（::before 在 820px 下已经隐藏，灯斑也一并关掉） */
@media (max-width: 820px) {
  .board::before,
  .board::after {
    display: none;
  }
}

/* =====================================================================
 * HUD PASS · 顶栏提亮
 * ---------------------------------------------------------------------
 * 原来顶栏整体是「暗到快消失」：品牌颜色、阶段序号、不稳定度进度条
 * 都在 #6f5f49 一带。这里把整条顶栏拉上一档：
 *   品牌 → 暖白 + 灯色发光；阶段序号 → 当前阶段直接变实心金块；
 *   不稳定度 → 标签提亮 + 进度条加粗、加斜纹、加外发光；
 *   右上图标 → 实心黄铜面 + 墨线描边（像真的按得下去）。
 * ===================================================================== */

/* ---------- 1. 整条顶栏 ---------- */
.hud {
  background: linear-gradient(180deg, rgba(30, 20, 12, 0.92), rgba(12, 8, 4, 0.84));
  border-bottom: 1px solid rgba(201, 162, 39, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 236, 205, 0.07), 0 10px 30px rgba(0, 0, 0, 0.42);
}

/* ---------- 2. 品牌 ---------- */
.hud__brand {
  color: #f2e6d2;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.hud__brand b {
  color: var(--lamp-hi);
  text-shadow: 0 0 16px rgba(242, 164, 76, 0.65);
}

/* ---------- 3. 阶段 / 回合 ---------- */
.pip {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 226, 186, 0.24);
  color: #cbb894;
  background: rgba(255, 245, 228, 0.06);
}

.pip.is-done {
  border-color: rgba(242, 164, 76, 0.55);
  color: #e8b84b;
  background: rgba(242, 164, 76, 0.12);
}

.pip.is-on {
  border: 2px solid var(--ink);
  color: #1f1206;
  font-weight: 800;
  background: linear-gradient(180deg, #ffd79a, #e79a3c);
  box-shadow: 2px 2px 0 rgba(6, 4, 2, 0.5), inset 0 1px 0 rgba(255, 247, 232, 0.7),
    0 0 18px rgba(242, 164, 76, 0.35);
}

.pip--small,
.pips--small .pip {
  width: 7px;
  height: 7px;
  border: none;
  border-radius: 50%;
  font-size: 0;
  background: rgba(255, 226, 186, 0.22);
  box-shadow: none;
}

.pips--small .pip.is-done {
  background: rgba(242, 164, 76, 0.55);
}

.pips--small .pip.is-on {
  border: none;
  background: var(--lamp-hi);
  box-shadow: 0 0 10px rgba(255, 200, 130, 0.9);
}

.round-text {
  color: #ecdfc4;
  font-weight: 600;
}

/* ---------- 4. 不稳定度 ---------- */
.inst-label {
  color: #c8b596;
  font-weight: 600;
  margin-bottom: 5px;
}

.inst-label b {
  color: #ff6a5f;
  font-size: calc(13px * var(--fs));
  font-weight: 800;
  text-shadow: 0 0 14px rgba(224, 70, 62, 0.6);
}

.inst-bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 226, 186, 0.13);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.inst-bar i {
  background:
    repeating-linear-gradient(
      115deg,
      rgba(0, 0, 0, 0.16) 0 4px,
      transparent 4px 9px
    ),
    linear-gradient(90deg, #ffb347 0%, #ffd17a 38%, #ff7a3d 72%, #e0463e 100%);
  box-shadow: 0 0 14px rgba(255, 122, 61, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

@keyframes hotPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

/* ---------- 5. 右上图标：实心黄铜面 ---------- */
.hud__tools .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 2px solid var(--ink);
  color: #1f1206;
  font-size: calc(17px * var(--fs));
  font-weight: 800;
  background: linear-gradient(180deg, #ffd79a 0%, #f0a44c 52%, #c9762a 100%);
  box-shadow: 2px 3px 0 rgba(6, 4, 2, 0.55), inset 0 1px 0 rgba(255, 247, 232, 0.75),
    inset 0 -2px 0 rgba(120, 58, 10, 0.42), 0 0 18px rgba(242, 164, 76, 0.16);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease,
    color 0.14s ease;
}

.hud__tools .icon-btn:hover {
  color: #160d03;
  border-color: var(--ink);
  background: linear-gradient(180deg, #fff2d6 0%, #ffb35c 55%, #d8842f 100%);
  transform: translate(-1px, -2px);
  box-shadow: 3px 6px 0 rgba(6, 4, 2, 0.6), inset 0 1px 0 rgba(255, 247, 232, 0.85),
    0 0 28px rgba(242, 164, 76, 0.45);
}

.hud__tools .icon-btn.is-off {
  color: rgba(28, 17, 8, 0.6);
  background: linear-gradient(180deg, #9a8a6e 0%, #64543c 60%, #453724 100%);
  text-decoration: none;
  box-shadow: 2px 3px 0 rgba(6, 4, 2, 0.5), inset 0 1px 0 rgba(255, 247, 232, 0.3);
}

@media (max-width: 560px) {
  .hud__tools .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: calc(14px * var(--fs));
  }

  .inst-bar {
    height: 6px;
  }
}

/* =====================================================================
 * HUD PASS 2 · 再提一档亮度
 * ---------------------------------------------------------------------
 * 上一版把按钮换成实心黄铜、进度条加到 7px 后，整体读起来还是偏暗。
 * 这一段把顶栏里「文字 / 按钮 / 进度条」三件事统一再提亮一档：
 *   文字提到 #fff6e6 并加粗；序号格子全部可见；
 *   进度条轨道变亮、变粗（9px）并加内描边；
 *   按钮改成接近奶白的黄铜面 + 外发光。
 * ===================================================================== */

.hud {
  background: linear-gradient(180deg, rgba(38, 26, 16, 0.94), rgba(16, 11, 6, 0.9));
  border-bottom: 1px solid rgba(214, 175, 78, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 236, 205, 0.12), 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* ---------- 文字 ---------- */
.hud__brand {
  color: #fff6e6;
}

.hud__brand b {
  color: #ffd79a;
  text-shadow: 0 0 18px rgba(255, 190, 110, 0.75);
}

.round-text {
  color: #fff2dc;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}

.inst-label {
  color: #f0e2c8;
  font-weight: 700;
}

.inst-label b {
  color: #ff9a8f;
  text-shadow: 0 0 16px rgba(255, 106, 95, 0.7);
}

/* ---------- 阶段序号 ---------- */
.pip {
  border: 1px solid rgba(255, 226, 186, 0.38);
  color: #e6d2ac;
  background: rgba(255, 245, 228, 0.1);
  font-weight: 700;
}

.pip.is-done {
  border-color: rgba(255, 200, 110, 0.7);
  color: #ffd79a;
  background: rgba(242, 164, 76, 0.2);
}

.pip.is-on {
  border: 2px solid var(--ink);
  color: #1a0d02;
  font-weight: 800;
  background: linear-gradient(180deg, #ffe6b8 0%, #ffbe6b 48%, #de8a2c 100%);
  box-shadow: 2px 2px 0 rgba(6, 4, 2, 0.55), inset 0 1px 0 rgba(255, 250, 240, 0.85),
    0 0 22px rgba(255, 180, 90, 0.5);
}

.pips--small .pip {
  background: rgba(255, 226, 186, 0.34);
}

.pips--small .pip.is-done {
  background: rgba(255, 200, 110, 0.75);
}

.pips--small .pip.is-on {
  background: #ffe6b8;
  box-shadow: 0 0 12px rgba(255, 208, 140, 1);
}

/* ---------- 不稳定度进度条 ---------- */
.inst-bar {
  height: 9px;
  background: rgba(255, 226, 186, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 226, 186, 0.26), inset 0 1px 3px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.4);
}

.inst-bar i {
  background:
    repeating-linear-gradient(115deg, rgba(0, 0, 0, 0.14) 0 4px, transparent 4px 9px),
    linear-gradient(90deg, #ffc266 0%, #ffe0a0 34%, #ff8a4d 70%, #ff4b3f 100%);
  box-shadow: 0 0 16px rgba(255, 140, 70, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---------- 右上图标：深铜底 + 纯白图形（白要真的跳出来） ---------- */
.hud__tools .icon-btn {
  color: #ffffff;
  text-shadow: 0 0 9px rgba(255, 238, 210, 0.55), 0 1px 2px rgba(34, 14, 0, 0.7);
  background: linear-gradient(180deg, #c1711f 0%, #8f4808 52%, #5a2702 100%);
  box-shadow: 2px 3px 0 rgba(6, 4, 2, 0.55), inset 0 1px 0 rgba(255, 220, 170, 0.42),
    inset 0 -2px 0 rgba(30, 13, 1, 0.6), 0 0 20px rgba(255, 170, 80, 0.18);
}

.hud__tools .icon-btn:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 244, 226, 0.7), 0 1px 2px rgba(34, 14, 0, 0.6);
  background: linear-gradient(180deg, #e79a3c 0%, #bb6812 52%, #7e3703 100%);
  box-shadow: 3px 6px 0 rgba(6, 4, 2, 0.6), inset 0 1px 0 rgba(255, 240, 210, 0.55),
    0 0 30px rgba(255, 190, 110, 0.5);
}

.hud__tools .icon-btn.is-off {
  color: rgba(255, 255, 255, 0.52);
  text-shadow: 0 1px 2px rgba(10, 6, 2, 0.7);
  background: linear-gradient(180deg, #6b5f4b 0%, #4a4030 55%, #2e271b 100%);
  box-shadow: 2px 3px 0 rgba(6, 4, 2, 0.5), inset 0 1px 0 rgba(255, 247, 232, 0.2);
}

@media (max-width: 560px) {
  .inst-bar {
    height: 7px;
  }
}
/* =====================================================================
 * 声音面板（右上 ♪ 展开）
 * 和 HUD 同一套材料：墨线描边 + 黄铜渐变 + 硬投影。
 * ===================================================================== */
.hud__tools {
  position: relative;
}

.audio-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 45;
  width: 214px;
  padding: 12px 13px 13px;
  display: grid;
  gap: 9px;
  border-radius: 13px;
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, #2c1b0d 0%, #150d06 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 186, 0.16),
    0 18px 36px rgba(0, 0, 0, 0.62),
    0 3px 0 rgba(6, 4, 2, 0.55);
  color: #ffe3b0;
  font-size: 12px;
  animation: audioPop 0.16s ease-out;
}

.audio-panel[hidden] {
  display: none;
}

@keyframes audioPop {
  from {
    opacity: 0;
    transform: translateY(-7px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.audio-panel__title {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(201, 162, 39, 0.95);
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
}

.audio-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audio-panel__label {
  color: rgba(255, 227, 176, 0.78);
  letter-spacing: 0.06em;
}

.audio-switch {
  position: relative;
  width: 42px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #47351f;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: background 0.16s ease;
}

.audio-switch i {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 13px;
  height: 13px;
  margin-top: -6.5px;
  border-radius: 50%;
  background: #cbbda2;
  transition: transform 0.16s ease, background 0.16s ease;
}

.audio-switch[aria-pressed='true'] {
  background: linear-gradient(180deg, #ffcf8a, #e08f2c);
}

.audio-switch[aria-pressed='true'] i {
  transform: translateX(19px);
  background: #22150a;
}

.audio-panel input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f2a44c, #c9a227);
  outline: none;
  cursor: pointer;
}

.audio-panel input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffe3b0;
  border: 2px solid var(--ink);
}

.audio-panel input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffe3b0;
  border: 2px solid var(--ink);
}

@media (max-width: 560px) {
  .audio-panel {
    width: 196px;
    padding: 10px 11px 11px;
  }
  .audio-panel input[type='range'] {
    width: 92px;
  }
}
