/* ===== 小丑牌 Balatro 风格 =====
   组织约定：按功能区块追加，媒体查询就近跟随其功能区（窄屏覆盖依赖"基础规则在前、媒体块在后"
   的文档序——合并/搬移选择器前先确认没有跨区的同名覆盖，如 #joker-row 的窄屏 height:auto）。 */
:root {
  color-scheme: dark;
  --bg: #1a4a3a;
  --panel: #17272b;
  --panel2: #223c42;
  --blue: #0092e0;
  --blue-d: #006bb8;
  --red: #f4443e;
  --red-d: #c22e2b;
  --orange: #f5a13a;
  --orange-d: #d07f1d;
  --gold: #f7d774;
  --chip-blue: #0aa5ff;
  --mult-red: #ff4c40;
  --text: #ffffff;
  --dim: #8fa8a0;
  --card-w: 92px;
  --card-h: 128px;
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }

body {
  font-family: "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse at 50% 30%, #2a6a52 0%, #1a4a3a 55%, #0f3328 100%);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* 毛毡质感 + 缓慢流动的光晕 */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.02) 0 2px, transparent 2px 4px);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: -30%;
  background:
    radial-gradient(circle at 30% 40%, rgba(90, 200, 160, .10) 0%, transparent 34%),
    radial-gradient(circle at 70% 60%, rgba(60, 140, 200, .08) 0%, transparent 34%);
  pointer-events: none;
  z-index: 0;
  animation: ambientDrift 18s ease-in-out infinite alternate;
}
@keyframes ambientDrift {
  from { transform: translate(-4%, -3%) rotate(0deg); }
  to { transform: translate(4%, 3%) rotate(6deg); }
}

#game {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== 侧栏 ===== */
#sidebar {
  width: 250px;
  min-width: 250px;
  background: rgba(10, 25, 22, .82);
  border-right: 3px solid rgba(0,0,0,.35);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.panel {
  background: var(--panel);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
}

.blind-panel { border: 2px solid #3a5a62; }
.blind-name {
  text-align: center;
  font-weight: 800;
  font-size: 17px;
  padding: 6px;
  border-radius: 8px;
  background: var(--blue-d);
  text-shadow: 1px 2px 0 rgba(0,0,0,.45);
  margin-bottom: 8px;
}
.blind-name.big-blind { background: var(--orange-d); }
.blind-name.boss-blind { background: #7a1fa0; }

.blind-body { display: flex; align-items: center; gap: 10px; }
.blind-chip {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4dc3ff, #0069c0 70%);
  border: 4px dashed rgba(255,255,255,.55);
  box-shadow: 0 3px 0 rgba(0,0,0,.5), inset 0 0 8px rgba(0,0,0,.35);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.blind-chip.big { background: radial-gradient(circle at 35% 30%, #ffd36e, #cf7c00 70%); }
.blind-chip.boss { background: radial-gradient(circle at 35% 30%, #d76eff, #6a00b0 70%); }

.blind-target-label { font-size: 11px; color: var(--dim); }
.blind-target {
  font-size: 26px;
  font-weight: 900;
  color: var(--red);
  text-shadow: 1px 2px 0 rgba(0,0,0,.5);
}
.blind-reward { font-size: 13px; color: var(--gold); font-weight: 700; }
.blind-effect {
  margin-top: 8px;
  font-size: 12px;
  color: #e9b7ff;
  background: rgba(122, 31, 160, .3);
  border-radius: 6px;
  padding: 5px 7px;
  text-align: center;
}

.score-panel { display: flex; align-items: center; gap: 10px; }
.score-label { font-size: 13px; color: var(--dim); width: 42px; line-height: 1.25; }
.round-score {
  flex: 1;
  text-align: right;
  font-size: 30px;
  font-weight: 900;
  background: #0d1517;
  border-radius: 8px;
  padding: 4px 10px;
  text-shadow: 0 0 12px rgba(255,255,255,.25);
  overflow: hidden;
}

.hand-panel { min-height: 84px; }
.hand-name {
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  min-height: 22px;
  color: #fff;
}
.hand-name .lvl { color: var(--gold); font-size: 12px; }
.calc {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.chips-box, .mult-box {
  flex: 1;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  border-radius: 8px;
  padding: 6px 4px;
  text-shadow: 1px 2px 0 rgba(0,0,0,.4);
  transition: transform .1s;
}
.chips-box { background: var(--chip-blue); }
.mult-box { background: var(--mult-red); }
.chips-box.bump, .mult-box.bump { transform: scale(1.15); }
.times { font-size: 24px; font-weight: 900; color: var(--red); }

.stats-row { display: flex; gap: 10px; }
.stat { flex: 1; text-align: center; padding: 7px 4px; }
.stat-label { font-size: 12px; color: var(--dim); }
.stat-value { font-size: 22px; font-weight: 900; text-shadow: 1px 2px 0 rgba(0,0,0,.4); }
.stat-value.blue { color: var(--chip-blue); }
.stat-value.red { color: var(--mult-red); }
.stat-value.orange { color: var(--orange); }
.dim { color: var(--dim); font-size: 14px; }

.money-panel { text-align: center; padding: 6px; }
.money {
  font-size: 30px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 1px 2px 0 rgba(0,0,0,.5);
}

.small-btn {
  background: var(--panel2);
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.4);
  font-family: inherit;
}
.small-btn:hover { filter: brightness(1.2); }

.hotkeys {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  line-height: 1.5;
  text-align: center;
  padding: 2px 4px;
}

/* ===== 主区域 ===== */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
  min-width: 0;
}

.row-label { font-size: 12px; color: rgba(255,255,255,.55); margin-bottom: 4px; }

#joker-row { height: 158px; display: flex; gap: 14px; }   /* 小丑+消耗品分栏（#joker-sec/#consumable-sec 见下方分栏区） */
#jokers {
  display: flex;
  gap: 10px;
  height: 132px;
  background: rgba(0,0,0,.18);
  border-radius: 12px;
  padding: 4px 10px;
  align-items: center;
}

#play-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 150px;
}

#hand-area { position: relative; }
#hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 168px;
  padding-bottom: 8px;
}
#deck-info {
  position: absolute;
  right: 4px;
  bottom: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  background: rgba(0,0,0,.3);
  cursor: pointer;   /* 点击打开牌库一览（hover 态见牌库区） */
  padding: 4px 10px;
  border-radius: 8px;
}

/* ===== 扑克牌 ===== */
.card {
  width: var(--card-w);
  height: var(--card-h);
  background:
    linear-gradient(155deg, #ffffff 0%, #f6f4ea 45%, #e9e6d6 100%);
  border-radius: 10px;
  border: 1px solid #c9c6b4;
  box-shadow:
    0 4px 8px rgba(0,0,0,.45),
    inset 0 0 0 1px rgba(255,255,255,.8);
  position: relative;
  cursor: pointer;
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .16s;
  flex-shrink: 0;
  color: #222;
  overflow: hidden;
  --rx: 0deg; --ry: 0deg; --gx: 30%; --gy: 20%;
  transform-style: preserve-3d;
}
/* 内边框细线 */
.card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 7px;
  border: 1px solid rgba(0,0,0,.07);
  pointer-events: none;
}
/* 光泽（随鼠标移动的高光） */
.card-gloss {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255,255,255,.5) 0%, rgba(255,255,255,.12) 32%, rgba(255,255,255,0) 60%);
  pointer-events: none;
  z-index: 4;
}
#hand .card { margin: 0 -14px; }
#hand .card:hover {
  transform: translateY(-14px) perspective(560px) rotateX(var(--rx)) rotateY(var(--ry)) !important;
  z-index: 50 !important;
  box-shadow: 0 10px 16px rgba(0,0,0,.5);
  transition: box-shadow .16s;
}
#hand .card.selected {
  transform: translateY(-30px) perspective(560px) rotateX(var(--rx)) rotateY(var(--ry)) !important;
  box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(247,215,116,.45), 0 12px 18px rgba(0,0,0,.5);
  z-index: 40;
}
/* 发牌飞入 */
#hand .card.deal-in {
  animation: dealIn .38s cubic-bezier(.22,1.2,.36,1) backwards;
}
@keyframes dealIn {
  from {
    transform: translate(240px, -60px) rotate(24deg) scale(.55);
    opacity: 0;
  }
}

.card .corner {
  position: absolute;
  font-size: 17px;
  font-weight: 900;
  line-height: .95;
  text-align: center;
  letter-spacing: -.5px;
  z-index: 2;
  font-family: Georgia, "Times New Roman", serif;
}
.card .corner.tl { top: 5px; left: 6px; }
.card .corner.br { bottom: 5px; right: 6px; transform: rotate(180deg); }
.card .corner small { display: block; font-size: 13px; }

/* 数字牌点阵 */
.card .pips { position: absolute; inset: 8px 16px; z-index: 1; }
.card .pip-item {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 19px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.card .pip-item.inv { transform: translate(-50%, -50%) rotate(180deg); }

/* A */
.card .ace-area {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.card .ace-pip {
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.25));
  z-index: 2;
}
.card .ace-ring {
  position: absolute;
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: .22;
}
.card .ace-ring::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed currentColor;
}

/* 人头牌 J/Q/K */
.card .face-frame {
  position: absolute;
  inset: 20px 14px;
  border: 2px solid currentColor;
  border-radius: 6px;
  opacity: .92;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,.035) 0 3px, transparent 3px 7px);
  z-index: 1;
}
.card .face-frame::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid currentColor;
  border-radius: 4px;
  opacity: .35;
}
.card .face-art {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
}
.card .face-char {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 900;
  margin-top: 2px;
  letter-spacing: 1px;
}
.card .face-suit {
  position: absolute;
  font-size: 12px;
  line-height: 1;
}
.card .face-suit.ftl { top: 3px; left: 4px; }
.card .face-suit.fbr { bottom: 3px; right: 4px; transform: rotate(180deg); }

.card.red-suit { color: #c1272d; }
.card.dark-suit { color: #22283a; }

.card.debuffed { filter: grayscale(.9) brightness(.6); }
.card.debuffed::after {
  content: "✖";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,60,60,.8); font-size: 34px;
  z-index: 3;
}

/* 出牌区的卡 */
#play-area .card { cursor: default; }
#play-area .card.scoring { animation: cardPop .3s; }
@keyframes cardPop {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.12); }
  100% { transform: translateY(-10px) scale(1.05); }
}
#play-area .card.scored { transform: translateY(-10px) scale(1.05); }

/* 计分浮字 */
.float-score {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  font-size: 19px;
  font-weight: 900;
  pointer-events: none;
  animation: floatUp .8s forwards;
  white-space: nowrap;
  text-shadow: 1px 2px 0 rgba(0,0,0,.6);
  z-index: 90;
}
.float-score.chips { color: var(--chip-blue); }
.float-score.mult { color: var(--mult-red); }
.float-score.gold { color: var(--gold); }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.6); }
  25% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}

/* ===== 小丑牌 ===== */
.joker {
  width: 96px;
  height: 124px;
  border-radius: 10px;
  padding: 7px 6px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 4px 6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: jokerSway 3.2s ease-in-out infinite;
  overflow: hidden;
}
/* 内框 */
.joker::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.22);
  pointer-events: none;
}
/* 光泽 */
.joker::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 42%);
  pointer-events: none;
}
@keyframes jokerSway {
  0%,100% { transform: rotate(-1.3deg); }
  50% { transform: rotate(1.3deg); }
}
.joker:hover {
  transform: perspective(560px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.1);
  z-index: 30;
  animation: none;
}
.joker .j-icon { font-size: 34px; margin-top: 2px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.joker .j-name { font-size: 12px; font-weight: 800; margin-top: 4px; line-height: 1.15; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.joker .j-tag {
  position: absolute;
  bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,.35);
  border-radius: 5px;
  padding: 1px 6px;
  z-index: 1;
}
.joker.common { background: linear-gradient(160deg, #3d7fc0, #1d4a78); }
.joker.uncommon { background: linear-gradient(160deg, #38bd64, #1d7038); }
.joker.rare { background: linear-gradient(160deg, #d94f3a, #8c2418); }
.joker.legendary { background: linear-gradient(160deg, #a63fe0, #5c1a86); }
/* 稀有 / 传奇：流光 */
.joker.rare::after, .joker.legendary::after {
  background:
    linear-gradient(120deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 42%),
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,.22) 46%, rgba(160,220,255,.18) 52%, transparent 66%);
  background-size: 100% 100%, 250% 100%;
  animation: holoShine 3.6s linear infinite;
}
@keyframes holoShine {
  0% { background-position: 0 0, 130% 0; }
  100% { background-position: 0 0, -130% 0; }
}
.joker.legendary { box-shadow: 0 4px 6px rgba(0,0,0,.45), 0 0 14px rgba(200,110,255,.5); }
.joker.triggered { animation: jokerTrigger .4s; }

/* 双击确认（卖小丑 / 用消耗品共用武装态） */
.joker.confirm-sell, .consumable.confirm-sell {
  box-shadow: 0 0 0 3px var(--red), 0 0 16px rgba(244,68,62,.5);
  animation: none;
}
.sell-badge {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0,0,0,.4);
}
@keyframes jokerTrigger {
  0% { transform: scale(1); }
  40% { transform: scale(1.22) rotate(-4deg); box-shadow: 0 0 18px var(--gold); }
  100% { transform: scale(1); }
}

.empty-slot {
  width: 96px; height: 124px;
  border: 2px dashed rgba(255,255,255,.16);
  border-radius: 10px;
  flex-shrink: 0;
}

/* ===== 控制按钮 ===== */
#controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 8px 0 4px;
}
.btn {
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 19px;
  font-weight: 900;
  padding: 13px 34px;
  cursor: pointer;
  text-shadow: 1px 2px 0 rgba(0,0,0,.35);
  transition: transform .08s, filter .12s;
}
.btn:active { transform: translateY(3px); }
.btn:disabled { filter: grayscale(.7) brightness(.55); cursor: not-allowed; }
.btn-blue { background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); }
.btn-red { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.btn-orange { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); }
.btn:not(:disabled):hover { filter: brightness(1.12); }
.btn.small { font-size: 13px; padding: 7px 14px; }
.btn.big { font-size: 22px; padding: 15px 44px; }

#sort-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.25);
  border-radius: 10px;
  padding: 6px 10px;
}
.sort-label { font-size: 12px; color: rgba(255,255,255,.6); }

/* ===== 弹层 ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 13, .82);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn .25s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.hidden { display: none !important; }

.overlay-title {
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 26px;
  text-shadow: 2px 3px 0 rgba(0,0,0,.5);
  letter-spacing: 4px;
}

#blind-options { display: flex; gap: 20px; }
.blind-option {
  width: 210px;
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  border: 2px solid #3a5a62;
  box-shadow: 0 6px 0 rgba(0,0,0,.4);
}
.blind-option .bo-name {
  font-weight: 900; font-size: 18px;
  padding: 7px; border-radius: 8px; margin-bottom: 10px;
  text-shadow: 1px 2px 0 rgba(0,0,0,.4);
}
.blind-option .bo-chip { font-size: 40px; margin: 6px 0; }
.blind-option .bo-target { font-size: 24px; font-weight: 900; color: var(--red); }
.blind-option .bo-reward { color: var(--gold); font-weight: 700; margin: 6px 0 12px; }
.blind-option .bo-effect { font-size: 12px; color: #e9b7ff; min-height: 32px; margin-bottom: 8px; }
.blind-option button { width: 100%; }
.blind-option.done { opacity: .45; }
.blind-option .bo-done-mark { font-size: 22px; color: #6fdc8c; font-weight: 900; padding: 12px; }

/* 商店 */
.shop-box {
  background: var(--panel);
  border-radius: 16px;
  border: 3px solid #3a5a62;
  padding: 20px 24px;
  min-width: 620px;
  max-width: 760px;
  box-shadow: 0 10px 0 rgba(0,0,0,.4);
}
.shop-header {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 16px;
  letter-spacing: 6px;
  text-shadow: 2px 3px 0 rgba(0,0,0,.5);
}
.shop-header.gold { color: var(--gold); }
#shop-items {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 170px;
  align-items: center;
  max-height: 62vh;    /* 最多 7 件商品，允许滚动 */
  overflow-y: auto;
}
.shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.price-tag {
  font-weight: 900;
  color: var(--gold);
  font-size: 17px;
  text-shadow: 1px 2px 0 rgba(0,0,0,.5);
}
.buy-btn { font-size: 13px; padding: 6px 18px; }
.shop-item.sold { opacity: .35; pointer-events: none; }
.shop-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  gap: 12px;
}
.shop-footer .btn:only-child { margin-left: auto; }

/* 星球牌 */
.planet-card {
  width: 96px; height: 124px;
  border-radius: 10px;
  background: linear-gradient(160deg, #14344e, #0a1a2e);
  border: 2px solid #3a6a9a;
  box-shadow: 0 4px 6px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  padding: 6px;
}
.planet-card .p-icon { font-size: 32px; filter: drop-shadow(0 0 6px rgba(120,190,255,.6)); }
.planet-card .p-name { font-size: 12px; font-weight: 800; color: #9fd0ff; }
.planet-card .p-desc { font-size: 10px; color: var(--dim); line-height: 1.2; }

/* 牌型等级表 */
#hand-levels { max-height: 60vh; overflow-y: auto; }
.hl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: var(--panel2);
  font-size: 14px;
}
.hl-row .hl-lvl { color: var(--gold); font-weight: 800; width: 62px; }
.hl-row .hl-name { flex: 1; font-weight: 700; }
.hl-row .hl-chips { color: var(--chip-blue); font-weight: 800; }
.hl-row .hl-x { color: var(--dim); }
.hl-row .hl-mult { color: var(--mult-red); font-weight: 800; }

/* 回合结算 */
#cashout-lines { padding: 8px 4px; }
.co-line {
  display: flex;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px dashed rgba(255,255,255,.12);
}
.co-line .co-val { color: var(--gold); font-weight: 900; }

/* 结算画面 */
.end-box {
  text-align: center;
  background: var(--panel);
  border-radius: 18px;
  border: 3px solid #3a5a62;
  padding: 44px 70px;
  box-shadow: 0 12px 0 rgba(0,0,0,.4);
  animation: endPop .45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes endPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.end-title {
  font-size: 44px;
  font-weight: 900;
  margin-bottom: 14px;
  text-shadow: 2px 4px 0 rgba(0,0,0,.5);
}
.end-title.win { color: var(--gold); }
.end-title.lose { color: var(--red); }
.end-detail { color: var(--dim); font-size: 17px; margin-bottom: 28px; line-height: 1.7; }

/* Tooltip */
#tooltip {
  position: fixed;
  z-index: 200;
  background: #0d1517;
  border: 2px solid #3a5a62;
  border-radius: 10px;
  padding: 10px 13px;
  max-width: 230px;
  font-size: 13px;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 6px 14px rgba(0,0,0,.6);
}
#tooltip .tt-title { font-weight: 900; font-size: 14px; margin-bottom: 4px; }
#tooltip .tt-rarity { font-size: 11px; margin-bottom: 5px; }
#tooltip .tt-rarity.common { color: #7fb8e8; }
#tooltip .tt-rarity.uncommon { color: #7fe89f; }
#tooltip .tt-rarity.rare { color: #ff8f80; }
#tooltip .tt-rarity.legendary { color: #d79fff; }
#tooltip .tt-desc { color: #cfe0da; }
#tooltip .tt-sell { color: var(--gold); margin-top: 6px; font-size: 12px; }

/* 屏幕震动 */
@keyframes shake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-6px,3px); }
  40% { transform: translate(5px,-4px); }
  60% { transform: translate(-4px,-2px); }
  80% { transform: translate(4px,3px); }
}
#game.shake { animation: shake .35s; }

/* 彩带粒子 */
.confetti {
  position: fixed;
  top: -20px;
  z-index: 400;
  pointer-events: none;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to {
    transform: translate(var(--drift, 0), 105vh) rotate(var(--spin, 720deg));
    opacity: .7;
  }
}

/* 总分爆发 */
.total-burst {
  position: fixed;
  top: 38%;
  left: 50%;
  z-index: 350;
  pointer-events: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-weight: 900;
  text-shadow: 2px 3px 0 rgba(0,0,0,.55);
  animation: burstPop 1.3s cubic-bezier(.22,1.3,.36,1) forwards;
  transform: translateX(-50%);
}
.total-burst .tb-chips { font-size: 34px; color: var(--chip-blue); }
.total-burst .tb-x, .total-burst .tb-eq { font-size: 28px; color: #fff; opacity: .8; }
.total-burst .tb-mult { font-size: 34px; color: var(--mult-red); }
.total-burst .tb-total {
  font-size: 52px;
  color: var(--gold);
  filter: drop-shadow(0 0 14px rgba(247,215,116,.6));
}
@keyframes burstPop {
  0% { transform: translateX(-50%) scale(.3); opacity: 0; }
  18% { transform: translateX(-50%) scale(1.12); opacity: 1; }
  30% { transform: translateX(-50%) scale(1); }
  78% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(.92) translateY(-22px); opacity: 0; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #3a5a62; border-radius: 4px; }

/* ===== 响应式：窄屏 ===== */
@media (max-width: 980px) {
  :root { --card-w: 66px; --card-h: 92px; }
  body { overflow: auto; }
  #game { flex-direction: column; height: auto; min-height: 100vh; }
  #sidebar {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 3px solid rgba(0,0,0,.35);
    gap: 8px;
  }
  #sidebar .panel { flex: 1 1 140px; }
  .blind-panel { flex: 1 1 100%; }
  #main { padding: 8px 10px; }
  #joker-row { height: auto; }
  #jokers { height: auto; min-height: 96px; overflow-x: auto; }
  .joker, .empty-slot { width: 76px; height: 100px; }
  .joker .j-icon { font-size: 26px; }
  #hand { height: 128px; }
  .card .pip-item { font-size: 14px; }
  .card .corner { font-size: 13px; }
  .card .corner small { font-size: 10px; }
  .card .ace-pip { font-size: 34px; }
  .card .face-art { font-size: 22px; }
  .shop-box { min-width: 0; width: 94vw; padding: 14px; }
  .btn { font-size: 16px; padding: 11px 22px; }
  #blind-options { flex-direction: column; gap: 10px; max-height: 80vh; overflow-y: auto; }
  .blind-option { width: 82vw; }
  .total-burst .tb-total { font-size: 38px; }
  .total-burst .tb-chips, .total-burst .tb-mult { font-size: 26px; }
}

/* ===== 提示消息 =====
   #flash-stack 由 ui.flashMessage 自动创建：多条消息纵向堆叠，不再互相遮盖 */
#flash-stack {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
  max-width: min(94vw, 640px);
}
.flash-msg {
  background: rgba(10,20,18,.92);
  border: 2px solid #7a1fa0;
  border-radius: 12px;
  padding: 12px 26px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  animation: fadeIn .2s;
}
.update-toast { pointer-events: auto; cursor: pointer; border-color: #38bd64; }

/* ===== 塔罗牌 ===== */
.tarot-card {
  background: linear-gradient(160deg, #3a1a4e, #180a2e);
  border-color: #8a4ac0;
}
.tarot-card .p-icon { filter: drop-shadow(0 0 6px rgba(200,140,255,.6)); }
.tarot-card .p-name { color: #d0a0ff; }

/* ===== 减少动态效果偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===== 小丑 + 消耗品分栏 =====（#joker-row 的分栏布局并入 158px 高度定义处） */
#joker-sec { flex: 1; min-width: 0; }
#consumable-sec { flex: none; }
#consumables {
  display: flex;
  gap: 8px;
  height: 132px;
  background: rgba(0,0,0,.18);
  border-radius: 12px;
  padding: 4px 8px;
  align-items: center;
}
.consumable {
  position: relative;
  width: 82px; height: 112px;
  border-radius: 10px;
  background: linear-gradient(160deg, #3a1a4e, #180a2e);
  border: 2px solid #8a4ac0;
  box-shadow: 0 4px 6px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s;
}
.consumable:hover { transform: translateY(-4px); }
.consumable .c-icon { font-size: 30px; filter: drop-shadow(0 0 6px rgba(200,140,255,.6)); }
.consumable .c-name { font-size: 11px; font-weight: 800; color: #d0a0ff; }
.consumable-slot {
  width: 82px; height: 112px;
  border-radius: 10px;
  border: 2px dashed rgba(255,255,255,.15);
}

/* ===== 卡牌增强 ===== */
.card.enh-bonus { box-shadow: 0 0 0 2px #2c8fd8, 0 0 12px rgba(44,143,216,.55), 0 4px 8px rgba(0,0,0,.4); }
.card.enh-mult  { box-shadow: 0 0 0 2px #d84c3e, 0 0 12px rgba(216,76,62,.55), 0 4px 8px rgba(0,0,0,.4); }
.enh-mark {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}

/* ===== 种子 / 结束统计 ===== */
.seed-line { cursor: pointer; user-select: none; }
.seed-line:hover { color: #fff; }
.end-stats {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 13px;
  color: rgba(255,255,255,.6);
  line-height: 1.7;
}
#endless-btn { margin-right: 10px; }

/* 窄屏: 消耗品换行 */
@media (max-width: 980px) {
  #joker-row { flex-wrap: wrap; }
  #consumables { height: auto; min-height: 96px; }
  .consumable, .consumable-slot { width: 70px; height: 96px; }
}

/* 盲注选择是常驻主界面：遮罩避开侧边栏，保持「重新开局/今日挑战/牌型等级」可用 */
#blind-select { left: 253px; }
@media (max-width: 980px) { #blind-select { left: 0; } }

/* ===== 卡包 / 优惠券商店卡 ===== */
.pack-card {
  background: linear-gradient(160deg, #1a3a5e, #0a1a3e);
  border-color: #4a7ac0;
}
.pack-card .p-name { color: #a0c8ff; }
.voucher-card {
  background: linear-gradient(160deg, #4e3a1a, #2e1a0a);
  border-color: #c09a4a;
}
.voucher-card .p-icon { filter: drop-shadow(0 0 6px rgba(255,210,120,.6)); }
.voucher-card .p-name { color: #ffd980; }
#pack-choices {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 170px;
  align-items: center;
}

/* ===== 钢铁 / 黄金增强 ===== */
.card.enh-steel { box-shadow: 0 0 0 2px #9ab0bc, 0 0 12px rgba(154,176,188,.6), 0 4px 8px rgba(0,0,0,.4); }
.card.enh-gold  { box-shadow: 0 0 0 2px #e0b040, 0 0 12px rgba(224,176,64,.6), 0 4px 8px rgba(0,0,0,.4); }

/* ===== 小丑牌移动按钮 ===== */
.j-move {
  position: absolute;
  top: 2px;
  width: 20px; height: 20px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  z-index: 5;
}
.j-left { left: 2px; }
.j-right { right: 2px; }
.joker:hover .j-move { opacity: 1; }
.j-move:hover { background: rgba(0,110,190,.85); }
@media (hover: none) { .j-move { opacity: .7; } }

/* ===== 牌库一览 ===== */
#deck-info:hover { color: #fff; background: rgba(0,0,0,.5); }
.dv-hint { font-size: 12px; color: rgba(255,255,255,.55); margin-bottom: 12px; text-align: center; }
#deck-grid { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.dv-row { display: flex; align-items: center; gap: 10px; }
.dv-suit { font-size: 18px; width: 46px; text-align: right; flex: none; }
.dv-suit small { font-size: 10px; color: rgba(255,255,255,.5); margin-left: 2px; }
.dv-red { color: #ff7a70; }
.dv-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.dv-card {
  position: relative;
  min-width: 26px; height: 32px;
  padding: 0 3px;
  border-radius: 5px;
  background: #f4efe1;
  color: #1a2a32;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 3px rgba(0,0,0,.4);
}
.dv-card.dv-red { color: #c62b23; }
.dv-card.dv-used { opacity: .28; }
.dv-card i { position: absolute; bottom: -4px; right: -4px; font-size: 10px; font-style: normal; }

/* ===== 图鉴 ===== */
#collection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 660px;
  max-height: 52vh;
  overflow-y: auto;
}
.cl-item {
  width: 88px;
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.12);
  text-align: center;
}
.cl-item .cl-icon { font-size: 26px; }
.cl-item .cl-name { font-size: 10px; margin-top: 4px; color: rgba(255,255,255,.85); }
.cl-unknown { opacity: .45; }

/* ===== 小丑牌版本 ===== */
.joker.ed-foil { box-shadow: 0 0 0 2px #9ad0e8, 0 0 14px rgba(154,208,232,.5); }
.joker.ed-holo { box-shadow: 0 0 0 2px #e89ad0, 0 0 14px rgba(232,154,208,.5); }
.joker.ed-poly {
  box-shadow: 0 0 0 2px #d0e89a, 0 0 16px rgba(208,232,154,.55);
  background-image: linear-gradient(120deg, rgba(255,120,120,.16), rgba(120,255,180,.16), rgba(120,160,255,.16));
}
.ed-tag {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 8px;
  background: rgba(0,0,0,.75);
  white-space: nowrap;
  z-index: 4;
}
.ed-tag.ed-foil { color: #9ad0e8; border: 1px solid #9ad0e8; }
.ed-tag.ed-holo { color: #e89ad0; border: 1px solid #e89ad0; }
.ed-tag.ed-poly { color: #d0e89a; border: 1px solid #d0e89a; }
.tt-ed { font-size: 12px; color: #d0e89a; margin-top: 5px; }

/* ===== 起始牌组 ===== */
.deck-card {
  background: linear-gradient(160deg, #24424e, #101f2e);
  border-color: #4a90a0;
}
.deck-card .p-name { color: #9adfe8; }
#deck-options {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 170px;
  align-items: center;
}

/* ===== 对局历史 ===== */
.rh-title {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,.7);
  text-align: center;
}
#run-history {
  max-width: 560px;
  margin: 8px auto 0;
  max-height: 20vh;
  overflow-y: auto;
}
.rh-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
}
.rh-row:nth-child(odd) { background: rgba(0,0,0,.2); }
.rh-date { color: rgba(255,255,255,.55); }
.rh-seed { color: rgba(255,255,255,.45); font-family: monospace; }
.rh-replay { padding: 2px 10px; font-size: 12px; }
.rh-empty { justify-content: center; color: rgba(255,255,255,.4); }

/* ===== 竖屏 / 窄屏手机 ===== */
@media (max-width: 640px) {
  :root { --card-w: 54px; --card-h: 76px; }
  #sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px;
  }
  #sidebar .blind-panel, #sidebar .hotkeys { grid-column: 1 / -1; }
  #sidebar .panel { padding: 6px 8px; }
  .round-score { font-size: 22px; }
  .blind-target { font-size: 20px; }
  #sidebar .small-btn { font-size: 12px; padding: 6px 4px; }
  #main { padding: 6px; gap: 6px; }
  #hand { height: 104px; }
  #play-area { min-height: 90px; }
  .joker, .empty-slot { width: 62px; height: 84px; }
  .joker .j-icon { font-size: 20px; }
  .joker .j-name { font-size: 9px; }
  .consumable, .consumable-slot { width: 58px; height: 80px; }
  .consumable .c-icon { font-size: 22px; }
  #controls .btn { font-size: 14px; padding: 9px 14px; }
  .overlay-title { font-size: 22px; margin-bottom: 12px; }
  .planet-card { width: 84px; height: 112px; }
  .planet-card .p-desc { font-size: 9px; }
  .buy-btn { font-size: 11px; padding: 5px 12px; }
  #shop-items { gap: 8px; }
  .total-burst .tb-total { font-size: 30px; }
  .dv-card { min-width: 20px; height: 26px; font-size: 11px; }
  .cl-item { width: 70px; }
}

/* ===== 永久成长筹码标记（徒步者） ===== */
.perm-mark {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 900;
  color: #0092e0;
  background: rgba(255,255,255,.85);
  border-radius: 6px;
  padding: 0 4px;
  z-index: 3;
  pointer-events: none;
}
.dv-card b { position: absolute; top: -6px; left: -4px; font-size: 8px; color: #0092e0; }

/* ===== 幻灵牌 ===== */
.spectral-card, .consumable.spectral {
  background: linear-gradient(160deg, #2a1a4e, #0e0a2e);
  border-color: #7a5ae0;
}
.spectral-card .p-name { color: #b9a0ff; }
.spectral-card .p-icon, .consumable.spectral .c-icon { filter: drop-shadow(0 0 8px rgba(150,110,255,.8)); }

/* ===== 被禁用的小丑（猩红之心） ===== */
.joker.debuffed { filter: grayscale(1) brightness(.55); }
.joker.debuffed::after {
  content: "🚫";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  z-index: 6;
}

/* ===== 帮助 / 引导 ===== */
.help-box { max-width: 620px; }
#help-body {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255,255,255,.88);
  max-width: 560px;
  max-height: 56vh;
  overflow-y: auto;
  text-align: left;
}
#help-body b { color: #f7d774; }
#help-body .hb {
  background: rgba(0,146,224,.25);
  border-radius: 6px;
  padding: 1px 8px;
  font-weight: 900;
}
.tip-msg {
  background: rgba(10, 40, 70, .96);
  border: 1px solid #4a90d0;
  font-size: 14px;
}
#share-btn { margin-top: 10px; }

/* ===== 成就 ===== */
#achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 660px;
  margin-bottom: 6px;
}
.cl-item.ach-on {
  border-color: #f7d774;
  background: rgba(120, 90, 10, .3);
}

/* ===== Boss 登场横幅 ===== */
.boss-banner {
  position: fixed;
  top: 38%;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
  background: linear-gradient(90deg, transparent, rgba(90, 10, 40, .92) 20%, rgba(90, 10, 40, .92) 80%, transparent);
  border-top: 2px solid rgba(255, 80, 120, .5);
  border-bottom: 2px solid rgba(255, 80, 120, .5);
  z-index: 220;
  pointer-events: none;
  animation: bossBanner 2.6s ease forwards;
}
.boss-banner .bb-icon { font-size: 44px; filter: drop-shadow(0 0 12px rgba(255,80,120,.8)); }
.boss-banner .bb-name { font-size: 24px; font-weight: 900; letter-spacing: 3px; }
.boss-banner .bb-desc { font-size: 13px; color: rgba(255,255,255,.8); margin-top: 3px; }
@keyframes bossBanner {
  0% { opacity: 0; transform: scaleY(.2); }
  10% { opacity: 1; transform: scaleY(1); }
  85% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(.4); }
}
@media (prefers-reduced-motion: reduce) { .boss-banner { animation: fadeIn .3s; } }

/* ===== 大额得分冲击 ===== */
.total-burst.big .tb-total { font-size: 54px; }
.total-burst.huge .tb-total {
  font-size: 72px;
  text-shadow: 0 0 24px rgba(247, 215, 116, .95), 3px 4px 0 rgba(0,0,0,.55);
}
.total-burst.huge { animation-duration: 1.7s; }

/* ===== 新购小丑入场 ===== */
.joker.pop { animation: jokerPop .5s cubic-bezier(.2, 2.2, .4, 1); }
@keyframes jokerPop {
  0% { transform: scale(.2) rotate(-14deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ===== 商店内出售已有小丑 ===== */
#shop-owned {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 620px;
  margin: 6px auto 0;
}
.so-joker {
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.3);
  color: #fff;
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.so-joker b { color: #f7d774; margin-left: 4px; }
.so-joker:hover { border-color: #f4443e; background: rgba(120,20,20,.4); }
.so-joker.so-confirm { border-color: #f4443e; background: rgba(160,30,30,.6); }
.so-empty { color: rgba(255,255,255,.35); font-size: 12px; }

/* ===== 成长型小丑的当前值徽章 ===== */
.j-state {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 8px;
  background: rgba(0,0,0,.8);
  border: 1px solid #f7d774;
  color: #f7d774;
  white-space: nowrap;
  z-index: 4;
  pointer-events: none;
}
.tt-state { font-size: 12px; color: #7ad0f0; margin-top: 5px; }

/* ===== 模式选择 ===== */
#mode-options {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.mode-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.3);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.mode-chip small { font-size: 10px; font-weight: 400; color: rgba(255,255,255,.6); }
.mode-chip:hover { border-color: rgba(255,255,255,.5); }
.mode-chip.mode-on { border-color: #f7d774; background: rgba(120,90,10,.35); }

/* ===== 图鉴分区(塔罗/幻灵/优惠券)缩小一号 ===== */
.cl-sub { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 660px; margin: 4px auto; }
.cl-sub .cl-item { width: 72px; padding: 6px 3px; }
.cl-sub .cl-icon { font-size: 20px; }
.cl-sub .cl-name { font-size: 9px; }

/* ===== 移动端手感与安全区（v1.3.0） ===== */
/* 连点选牌不再触发双击缩放/300ms 延迟 */
button, .card, .joker, .consumable, .blind-option, .mode-chip, .so-joker, .dv-card, .cl-item {
  touch-action: manipulation;
}
/* iOS 长按卡牌不弹出系统菜单 */
.card, .joker, .consumable { -webkit-touch-callout: none; }
/* 键盘聚焦可见（鼠标/触摸不显示焦点框） */
.card:focus-visible, .joker:focus-visible, .consumable:focus-visible {
  outline: 3px solid #f7d774;
  outline-offset: 2px;
}
.card:focus:not(:focus-visible), .joker:focus:not(:focus-visible), .consumable:focus:not(:focus-visible) {
  outline: none;
}
/* 禁止下拉刷新/边缘回弹打断对局 */
html, body { overscroll-behavior-y: none; }
/* 刘海屏安全区（配合 viewport-fit=cover） */
@supports (padding: env(safe-area-inset-left)) {
  #game {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
