/* 牌桌：固定设计尺寸的舞台，整体按视口等比缩放。位置全部由 js/table-layout.js 算出后写进行内样式。 */
.table-view[hidden] { display: none; }
.viewport { position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(ellipse at 30% 10%, #6B4422, #2A1A0E 55%, #120B06); }
.stage { position: absolute; transform-origin: 0 0; overflow: hidden; color: var(--paper); }

/* 书房（素材 A1 到之前用 CSS 占位） */
.room { position: absolute; inset: 0; background: url(../assets/table/bg-study.webp?v=77901c2d2a) center top / cover no-repeat #24150B; }
.room::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, rgba(10,5,2,.55)); }

/* 顶栏 */
.hud { position: absolute; left: 0; right: 0; top: 0; height: 54px; display: flex; align-items: center; gap: 16px; padding: 0 18px; z-index: 6;
  background: linear-gradient(to bottom, rgba(20,12,6,.85), rgba(20,12,6,0)); }
.hud-title { font: 800 22px/1 var(--serif); color: var(--gold); white-space: nowrap; text-shadow: 0 2px 2px #000; }
.hud-title small { font: 600 13px var(--sans); color: var(--muted); margin-left: 8px; }
.status { margin: 0 auto; padding: 5px 18px; border-radius: 18px; font: 600 16px var(--serif); white-space: nowrap;
  background: rgba(20,12,6,.75); box-shadow: inset 0 0 0 1.5px var(--brass); }
.status b { color: var(--amber); }
.hud-tools { display: flex; gap: 8px; align-items: center; }
.hud-tools button { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.speed { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* 品牌图例（右下角） */
.legend { position: absolute; z-index: 5; display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.brand { display: grid; grid-template-columns: 36px 1fr; gap: 6px; align-items: center; padding: 4px 6px 4px 4px; border-radius: 6px; position: relative;
  background: var(--paper-2); color: var(--ink); box-shadow: 0 2px 4px rgba(0,0,0,.4); cursor: help; min-width: 0; }
.brand-logo { position: relative; height: 26px; background: #fff; border-radius: 3px; overflow: hidden; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--c); }
.brand-logo img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; }
.brand-logo .nologo { font-size: 8px !important; }
.brand-text { min-width: 0; line-height: 1.15; }
.brand-name { font: 800 12px/1.15 var(--serif); display: block; overflow-wrap: anywhere; }
.brand-text small { font-size: 10px; color: #6b5d48; }
.brand-am { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-weight: 700; color: var(--seal); }
.brand-am .seal.mini { width: 14px; height: 14px; font-size: 9px; }

/* 桌面透视平面 */
.scene { position: absolute; inset: 0; z-index: 1; }
.plane { position: absolute; transform-style: preserve-3d; transform-origin: 50% 50%; }
.rim { position: absolute; background: url(../assets/table/table-top.webp?v=e161c925ee) center / 100% 100% no-repeat; filter: drop-shadow(0 28px 34px rgba(0,0,0,.6)); }
.felt { position: absolute; inset: 0; }
.zone { position: absolute; border-radius: 14px; border: 2px dashed rgba(233,195,90,.45); }
.zone span { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); white-space: nowrap; font: 700 13px var(--serif); color: var(--gold);
  background: #0F2A1C; padding: 0 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(233,195,90,.5); }
.stage[data-preset="phone"] .zone span { font-size: 9px; top: -9px; padding: 0 6px; }

/* ---------- 卡牌（方案 A 老凭证）。外层决定尺寸，内部全用 em ---------- */
.card { position: absolute; inset: 0; border-radius: .5em; background: url(../assets/table/card-paper.webp?v=4dfc028427) center / 100% 100% var(--paper-2); color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 .08em .15em rgba(0,0,0,.55), 0 .35em .6em rgba(0,0,0,.35); }
.card-in { position: absolute; inset: .42em .38em; border: .12em solid var(--c); border-radius: .3em; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
/* 上：品牌色色带（总股数 + 全名） */
.card-band { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .25em; background: var(--c); color: var(--fg); padding: .22em .3em .22em .22em;
  box-shadow: inset 0 -.08em 0 rgba(0,0,0,.18); }
.card-corner { min-width: 1.5em; height: 1.5em; padding: 0 .15em; display: grid; place-items: center; border-radius: 50%;
  background: var(--fg); color: var(--c); font: 900 1em/1 var(--sans); box-shadow: 0 0 0 .08em rgba(0,0,0,.15); }
.card-name { font: 800 1em/1.12 var(--serif); text-align: left; overflow-wrap: anywhere; letter-spacing: .02em; }
.card-name small { display: block; font: 600 .62em/1.2 var(--sans); opacity: .82; letter-spacing: 0; }
.card-name.n2 { font-size: .88em; }
.card-name.n3 { font-size: .76em; letter-spacing: -.02em; }
/* 中：广告画——品牌色放射纹底，上面压大 logo 或大字标 */
.card-art { position: relative; display: grid; place-items: center; padding: .28em; min-height: 0; overflow: hidden;
  background:
    radial-gradient(circle at 50% 55%, rgba(255,250,236,.92) 0 34%, transparent 64%),
    repeating-conic-gradient(from 0deg at 50% 55%, color-mix(in srgb, var(--c) 30%, transparent) 0 9deg, transparent 9deg 18deg),
    color-mix(in srgb, var(--c) 10%, #FBF4E2); }
.card-logo { position: relative; width: 100%; height: 100%; min-height: 0; background: #fff; border-radius: .25em; overflow: hidden;
  box-shadow: 0 .06em .18em rgba(0,0,0,.28), inset 0 0 0 .06em color-mix(in srgb, var(--c) 40%, transparent); }
.card-logo img { position: absolute; inset: .2em; width: calc(100% - .4em); height: calc(100% - .4em); object-fit: contain; display: block; }
.card-art.poster { align-content: center; gap: .15em; }
.wordmark { font: 900 1em/1.05 var(--serif); color: var(--c); text-align: center; letter-spacing: .04em; overflow-wrap: anywhere;
  text-shadow: .04em .05em 0 rgba(255,250,236,.95), .07em .09em 0 color-mix(in srgb, var(--c) 30%, transparent); }
.wm-sub { font: 700 .6em/1.2 var(--sans); color: var(--ink); background: rgba(255,250,236,.85); padding: .1em .45em; border-radius: 1em; justify-self: center;
  box-shadow: inset 0 0 0 .06em var(--c); }
/* 下：凭证条 */
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: .2em; font-size: .56em; color: #5b4d38; padding: .25em .5em .3em;
  border-top: .12em double color-mix(in srgb, var(--c) 60%, #6b5d48); letter-spacing: .05em; }
.card-foot b { color: color-mix(in srgb, var(--c) 75%, #000); font-weight: 800; }
.nologo { font: 900 12px/1.1 var(--serif); text-align: center; padding: 2px; white-space: nowrap; }
.card.new::after { content: "新"; position: absolute; top: -.45em; right: -.45em; background: var(--amber); color: var(--ink); font: 800 .75em/1.6em var(--sans);
  width: 1.6em; text-align: center; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.card.back { background: url(../assets/table/card-back.webp?v=c96cd72af2) center / 100% 100% #1A2B4A; border-radius: 8.6% / 5.75%; overflow: hidden; }
.card.back .card-in { display: none; }

/* 牌堆：按剩余张数显示厚度 */
.deck { position: absolute; }
.deck .card { box-shadow: 0 1px 0 rgba(255,255,255,.3) inset,
  0 calc(var(--layers) * 1px) 0 #1E3352, 0 calc(var(--layers) * 2px) 0 #16263D, 0 calc(var(--layers) * 2px + 6px) 10px rgba(0,0,0,.5); }
.deck-count { position: absolute; left: 50%; bottom: -.2em; transform: translate(-50%, 50%); z-index: 2; font: 800 1.1em/1 var(--sans); color: var(--ink);
  background: var(--paper-2); padding: .15em .5em; border-radius: 1em; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.deck.empty { border: 2px dashed rgba(244,235,211,.35); border-radius: .5em; display: grid; place-items: center; }
.deck-empty { font-size: .8em; color: var(--muted); text-align: center; }

/* 市场牌：本身就是按钮 */
.mcard { position: absolute; padding: 0; min-height: 0; background: none; border-radius: .5em; transition: transform .14s; }
.mcard:disabled { opacity: 1; cursor: default; }
.mcard.can:hover, .mcard.can:focus-visible { transform: translateY(-.35em); }
.mcard.can .card { box-shadow: 0 0 0 .2em var(--amber), 0 .5em .8em rgba(0,0,0,.45); }
.mcard.blocked .card { filter: grayscale(.6) brightness(.8); }
.why-tag { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-6deg); z-index: 3; white-space: nowrap; font: 700 .6em/1.3 var(--sans);
  color: #fff; background: var(--seal); padding: .1em .4em; border-radius: .2em; box-shadow: 0 0 0 1px var(--brass); }

/* 硬币堆：压在牌下沿，带数字 */
.coins { display: inline-flex; align-items: center; position: relative; }
.coins i { width: 1.3em; height: 1.3em; border-radius: 50%; margin-left: -1em;
  background: url(../assets/table/coin-1.webp?v=77a54979b1) center / contain no-repeat; filter: drop-shadow(0 .08em .06em rgba(0,0,0,.55)); }
.coins i:first-child { margin-left: 0; }
.coins b { margin-left: .25em; font: 800 1em/1 var(--sans); color: #4A3510; background: #F4DE98; padding: .1em .35em; border-radius: .7em; box-shadow: inset 0 0 0 .08em #8C6D25; }
.coins.on-card { position: absolute; left: 50%; bottom: -.4em; transform: translateX(-50%); z-index: 2; font-size: 1em; }
.coins.tiny { font-size: 11px; }
.coins.tiny b { background: none; box-shadow: none; color: var(--paper); padding: 0 0 0 2px; }

/* 投资摞：每多一股露出一条牌边，最多 6 层 */
.stack-slot { position: absolute; cursor: help; border-radius: .45em; }
.stack { position: absolute; inset: 0; }
.stack .edge { position: absolute; inset: 0; border-radius: .45em; background: #E2D6B8; box-shadow: inset 0 0 0 1px rgba(80,60,30,.35);
  transform: translateY(calc(var(--i) * .22em)); }
.stack .edge::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .25em; background: var(--c); opacity: .55; border-radius: 0 0 .45em .45em; }
.stack-top { position: absolute; inset: 0; border-radius: .45em; background: url(../assets/table/card-paper.webp?v=4dfc028427) center / 100% 100% var(--paper-2); border: .14em solid var(--c); overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; box-shadow: 0 calc(var(--layers) * .22em + .3em) .5em rgba(0,0,0,.4); }
.stack-band { background: var(--c); padding: .14em; display: flex; }
.stack-band .card-corner { font-size: .82em; }
.stack-top .card-art { padding: .14em; }
.stack-top .card-logo img { inset: .1em; width: calc(100% - .2em); height: calc(100% - .2em); }
.stack-name { background: var(--c); color: var(--fg); font: 800 .72em/1.15 var(--serif); padding: .08em .05em; text-align: center; overflow-wrap: anywhere; }
.stack-name.n2, .stack-name.n3 { font-size: .6em; }
.stack.mine .stack-top { box-shadow: 0 0 0 .12em rgba(255,178,63,.6), 0 calc(var(--layers) * .22em + .3em) .5em rgba(0,0,0,.4); }
.stage[data-preset="phone"] .stack-name { display: none; }
.stage[data-preset="phone"] .stack-top { grid-template-rows: auto 1fr; }

/* 反垄断印章：方形朱印 + 纸色内框 + 金框，压在持有者那一摞的右上角 */
.seal { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; color: var(--seal); font: 900 1.05em/1 var(--serif); transform: rotate(-10deg);
  background: url(../assets/table/seal.webp?v=6fa640a6d8) center / 100% 100% no-repeat, linear-gradient(#F6E9CF, #F6E9CF) center / 76% 76% no-repeat;
  filter: drop-shadow(0 .12em .12em rgba(0,0,0,.5)); }
.stack .seal { position: absolute; right: -.55em; top: -.55em; z-index: 3; font-size: 1.05em; }
.seal.mini { width: 19px; height: 19px; font-size: 11px; transform: rotate(-8deg); }
.seal.flying { position: absolute; z-index: 20; pointer-events: none; }

/* ---------- 座位（立在桌沿上，不跟平面压扁） ---------- */
.seats { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.seat { position: absolute; width: var(--size); height: var(--size); transform: translate(-50%, -50%); pointer-events: auto; }
.avatar { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font: 900 calc(var(--size) * .42)/1 var(--serif); color: var(--ink);
  background: radial-gradient(circle at 40% 35%, #FBF6EA, #CDBF9F); border: 3px solid #4A2117; box-shadow: 0 0 0 2px var(--brass), 0 6px 12px rgba(0,0,0,.55); }
.seat.active .avatar { box-shadow: 0 0 0 3px var(--amber), 0 0 22px rgba(255,178,63,.85); }
.plate { position: absolute; top: 100%; left: 50%; transform: translate(-50%, 5px); display: flex; gap: 6px; align-items: center; white-space: nowrap;
  background: rgba(20,12,6,.86); color: var(--paper); border-radius: 6px; padding: 2px 8px; font-size: 13px; box-shadow: inset 0 0 0 1px rgba(201,162,74,.6); }
.plate b { font-family: var(--serif); }
.plate small { color: var(--muted); font-size: 11px; }
.pc { display: inline-flex; align-items: center; gap: 4px; }
.c3 { font-size: 11px; color: var(--gold); display: inline-flex; align-items: center; gap: 2px; }
.c3::before { content: ""; width: 14px; height: 14px; background: url(../assets/table/coin-3.webp?v=50ee80c403) center / contain no-repeat; }
.hbs { display: inline-flex; padding-left: 4px; }
.hb { width: 9px; height: 13px; margin-left: -3px; border-radius: 1.5px; background: url(../assets/table/card-back.webp?v=c96cd72af2) center / cover #24406A; box-shadow: 0 0 0 .5px rgba(0,0,0,.6); }
.hb.known { background: var(--c); box-shadow: 0 0 0 1px var(--paper); }
.thinking { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); font-size: 12px; font-weight: 700; color: var(--amber); white-space: nowrap; text-shadow: 0 1px 2px #000; }
.bubble { position: absolute; z-index: 4; width: max-content; max-width: 210px; font-size: 13px; line-height: 1.35;
  background: var(--paper-2); color: var(--ink); padding: 5px 9px; border-radius: 8px; box-shadow: 0 3px 8px rgba(0,0,0,.45); animation: pop .25s ease-out; }
.seat .bubble { bottom: calc(100% + 8px); top: auto; transform: none; left: 50%; translate: -50% 0; }
.seat[data-row="top"][data-side="left"] .bubble { bottom: auto; top: 50%; translate: 0 -50%; left: auto; right: calc(100% + 10px); }
.seat[data-row="top"][data-side="right"] .bubble { bottom: auto; top: 50%; translate: 0 -50%; left: calc(100% + 10px); }
.seat.active .thinking + .bubble, .seat .bubble { }
@keyframes pop { from { scale: .85; opacity: 0; } to { scale: 1; opacity: 1; } }

.me-seat { position: absolute; width: var(--size); height: var(--size); transform: translate(-50%, -50%); z-index: 4; }
.me-seat .thinking { display: none; }
.debt { position: absolute; top: -10px; right: -16px; font-size: 11px; background: var(--seal); color: #fff; border-radius: 8px; padding: 0 5px; }

/* 摸牌按钮（挂在牌堆下方） */
.draw-slot { position: absolute; transform: translateX(-50%); z-index: 4; display: grid; justify-items: center; gap: 2px; width: 220px; }
.draw-slot button { min-height: 38px; box-shadow: 0 3px 0 #8C5A12, 0 6px 10px rgba(0,0,0,.4); }
.draw-slot .why { text-align: center; background: rgba(20,12,6,.8); padding: 1px 6px; border-radius: 4px; }

/* 手牌（前景竖立）与操作 */
.hand { position: absolute; z-index: 5; }
.hcard { position: absolute; bottom: 0; padding: 0; min-height: 0; background: none; border-radius: .5em; transition: transform .14s ease-out; }
.hcard:disabled { opacity: 1; cursor: default; }
.hcard .card { box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 .1em .2em rgba(0,0,0,.6), 0 .6em 1em rgba(0,0,0,.5); }
.hcard.can:hover, .hcard.can:focus-visible { transform: translateY(-.5em); }
.hcard.selected { transform: translateY(-1.2em); }
.hcard.selected .card { box-shadow: 0 0 0 .2em var(--amber), 0 .8em 1.2em rgba(0,0,0,.55); }

.actions { position: absolute; z-index: 5; display: grid; gap: 8px; }
.prompt { font: 600 15px/1.45 var(--sans); color: var(--amber); text-shadow: 0 1px 3px #000; }
.place-actions { display: grid; gap: 10px; }
.big { display: grid; justify-items: center; line-height: 1.2; font: 800 20px var(--serif); padding: 10px 14px; min-height: 58px; border-radius: 30px; letter-spacing: .1em; }
.big small { font: 500 12px var(--sans); letter-spacing: 0; opacity: .85; }
.big.gold { background: linear-gradient(#F7D978, #D9A836); color: #3A2508; box-shadow: inset 0 0 0 2px #FFF1B8, 0 0 0 2px #8C6D25, 0 5px 0 #6E4F12, 0 8px 14px rgba(0,0,0,.5); }
.big.ivory { background: linear-gradient(#FBF6EA, #E2D6B8); color: var(--ink); box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #A99470, 0 5px 0 #7C6A4A, 0 8px 14px rgba(0,0,0,.5); }
.place-actions .why { background: rgba(20,12,6,.8); padding: 3px 8px; border-radius: 6px; }

/* 飞行动画层 */
.fx { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.fx .ghost-card { position: absolute; }

/* 日志抽屉 */
.log-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 90vw); z-index: 25; background: rgba(24,15,8,.96); box-shadow: -10px 0 30px rgba(0,0,0,.6);
  display: grid; grid-template-rows: auto 1fr; padding: 12px 14px; border-left: 2px solid var(--brass); }
.log-drawer[hidden] { display: none; }
.log-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.log { list-style: none; margin: 0; padding: 0; overflow-y: auto; font-size: 13px; }
.log li { padding: 4px 0; border-bottom: 1px solid #ffffff12; color: #E6DCC4; }
.log li.me { color: var(--amber); }
.log li.am { color: #FFB7AE; }
.log li.sys { color: #fff; font-weight: 600; }
.log li.warn { color: #FFD08A; }

/* 股东浮层 */
.popover { position: fixed; z-index: 28; width: 250px; background: rgba(24,15,8,.96); color: var(--paper); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 0 0 1.5px var(--brass), 0 12px 28px rgba(0,0,0,.6); pointer-events: none; font-size: 13px; }
.popover[hidden] { display: none; }
.pop-head { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.pop-head .brand-logo { height: 32px; box-shadow: 0 0 0 3px var(--c); }
.pop-head b { font: 800 16px/1.2 var(--serif); display: block; }
.pop-head small { color: var(--muted); }
.pop-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.pop-rows li { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 2px 6px; border-radius: 4px; }
.pop-rows li.lead { background: rgba(255,178,63,.25); font-weight: 700; }
.pop-rows li.tie { background: rgba(255,178,63,.12); }
.pop-rows li.mine b { color: var(--amber); }
.pop-rows .tag { font-size: 11px; color: var(--amber); margin-left: 4px; }
.pop-foot { margin-top: 6px; display: grid; gap: 3px; color: #E6DCC4; }
.pop-foot .seal.mini { margin-right: 4px; vertical-align: -4px; }

/* 竖屏提示 */
.rotate-hint { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; text-align: center; background: #1A120C; color: var(--paper); font: 600 18px var(--serif); }
.rotate-hint[hidden] { display: none; }
.rotate-hint small { display: block; font: 400 13px var(--sans); color: var(--muted); margin-top: 6px; }
.phone-icon { width: 46px; height: 80px; border: 3px solid var(--paper); border-radius: 9px; margin: 0 auto 16px; animation: tilt 2.4s ease-in-out infinite; }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* ---------- 手机横屏预设的细节 ---------- */
.stage[data-preset="phone"] .hud { height: 28px; padding: 0 6px; background: none; gap: 6px; }
.stage[data-preset="phone"] .hud-title { display: none; }
.stage[data-preset="phone"] .status { position: absolute; left: 6px; top: 3px; margin: 0; font-size: 11px; padding: 2px 8px; }
.stage[data-preset="phone"] .hud-tools { position: absolute; right: 6px; top: 2px; gap: 4px; }
.stage[data-preset="phone"] .hud-tools button { min-height: 24px; padding: 0 7px; font-size: 11px; }
.stage[data-preset="phone"] .speed { display: none; }
.stage[data-preset="phone"] .plate { font-size: 9px; padding: 0 4px; gap: 3px; transform: translate(-50%, 2px); }
.stage[data-preset="phone"] .plate small { display: none; }
.stage[data-preset="phone"] .coins.tiny { font-size: 8px; }
.stage[data-preset="phone"] .hb { width: 5px; height: 8px; }
.stage[data-preset="phone"] .avatar { border-width: 2px; }
.stage[data-preset="phone"] .thinking { font-size: 9px; }
.stage[data-preset="phone"] .bubble { font-size: 9px; padding: 2px 5px; max-width: 120px; }
.stage[data-preset="phone"] .prompt { font-size: 10px; line-height: 1.25; }
.stage[data-preset="phone"] .big { font-size: 12px; min-height: 30px; padding: 3px 8px; letter-spacing: .04em; border-radius: 16px; }
.stage[data-preset="phone"] .big small { display: none; }
.stage[data-preset="phone"] .place-actions { gap: 5px; grid-template-columns: 1fr 1fr; }
.stage[data-preset="phone"] .place-actions .why { grid-column: 1 / -1; font-size: 9px; }
.stage[data-preset="phone"] .actions { gap: 3px; }
.stage[data-preset="phone"] .draw-slot { width: 120px; }
.stage[data-preset="phone"] .draw-slot button { min-height: 24px; font-size: 10px; padding: 2px 6px; }
.stage[data-preset="phone"] .draw-slot .why { font-size: 8px; }
.stage[data-preset="phone"] .why-tag { font-size: .5em; }

/* 飞行中的牌和印章（挂在 body 上，视口坐标） */
.fx-fly { font-family: var(--sans); }
.fx-fly > .seal { width: 100%; height: 100%; transform: rotate(-10deg); }
.fx-fly > .card { position: absolute; inset: 0; }
.fx-fly > .coins.flying { font-size: 15px; }
.fx-fly > .coins.flying b { display: none; }

/* 手机：短标签、品牌按钮下拉图例、长按不弹系统菜单 */
.short, .phone-only { display: none; }
.stage[data-preset="phone"] .short { display: inline; }
.stage[data-preset="phone"] .long { display: none; }
.stage[data-preset="phone"] .phone-only { display: inline-block; }
.stage[data-preset="phone"] .legend { display: none; right: 6px; top: 30px; width: 300px; z-index: 8; background: rgba(20,12,6,.92); padding: 6px; border-radius: 8px;
  box-shadow: 0 0 0 1px var(--brass), 0 8px 20px rgba(0,0,0,.6); }
.stage[data-preset="phone"] .legend.open { display: grid; }
.hcard, .mcard, .stack-slot, .brand { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.hcard.can { touch-action: none; }

/* ---------- 手牌拖拽 ---------- */
.hcard.can { touch-action: none; cursor: grab; }
.hcard.dragging-source { opacity: .35; }
.drag-ghost { border-radius: .5em; box-shadow: 0 1.2em 2em rgba(0,0,0,.55); }
.drag-ghost > .card { position: absolute; inset: 0; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.my-zone { position: absolute; border-radius: 14px; border: 2px dashed transparent; pointer-events: none; transition: background .12s, border-color .12s; }
.my-zone span { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); white-space: nowrap; font: 700 13px var(--serif); color: var(--gold);
  background: #0F2A1C; padding: 0 10px; border-radius: 10px; opacity: 0; transition: opacity .12s; }
.drop-ok { border-color: rgba(255,178,63,.85) !important; background: rgba(255,178,63,.10); }
.drop-ok span { opacity: 1; }
.drop-ok.drop-hover { background: rgba(255,178,63,.24); box-shadow: 0 0 0 3px rgba(255,178,63,.5); }
.drop-bad { border-color: rgba(200,55,45,.85) !important; background: repeating-linear-gradient(45deg, rgba(200,55,45,.12) 0 10px, transparent 10px 20px); }
.drop-bad span { opacity: 1; color: #FFB7AE; }
.drop-bad.drop-hover { background: repeating-linear-gradient(45deg, rgba(200,55,45,.28) 0 10px, transparent 10px 20px); }
.drag-hint { position: fixed; z-index: 61; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap; font: 700 13px var(--sans);
  padding: 3px 9px; border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.drag-hint.ok { background: var(--amber); color: var(--ink); }
.drag-hint.bad { background: var(--seal); color: #fff; }
.drag-hint[hidden] { display: none; }

.icon-btn { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border-radius: 6px; font: 600 14px var(--sans); text-decoration: none; }
a.ghost { background: rgba(244,235,211,.12); color: var(--paper); box-shadow: inset 0 0 0 1px rgba(244,235,211,.28); }
.stage[data-preset="phone"] .icon-btn { min-height: 24px; padding: 0 7px; font-size: 11px; }

/* ---------- 座位的投资区容器（桌面平面内） ---------- */
.seat-zone { position: absolute; border-radius: 12px; border: 1.5px solid rgba(233,195,90,.28); background: rgba(8,24,16,.22); pointer-events: none; }
.seat-zone > span { position: absolute; left: 10px; top: -10px; font: 700 12px/18px var(--serif); color: var(--gold); background: #0F2A1C; padding: 0 8px;
  border-radius: 9px; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(233,195,90,.4); opacity: 1; }
.seat-zone.empty { border-style: dashed; background: none; }
.seat-zone.empty > span { color: rgba(233,195,90,.7); }
.my-zone.seat-zone > span { left: 50%; top: -10px; bottom: auto; transform: translateX(-50%); }
.stage[data-preset="phone"] .seat-zone > span { font-size: 8px; line-height: 12px; top: -7px; padding: 0 4px; }
.stage[data-preset="phone"] .my-zone.seat-zone > span { top: auto; bottom: -7px; }

/* ---------- 手牌托盘（底部前景，和桌面分开） ---------- */
.hand-tray { position: absolute; z-index: 4; border-radius: 18px 18px 0 0;
  background: linear-gradient(#3A2213, #24150B 60%, #1A0F07); box-shadow: inset 0 2px 0 rgba(233,195,90,.45), inset 0 0 0 1px rgba(0,0,0,.6), 0 -10px 24px rgba(0,0,0,.45); }
.hand-tray::before { content: ""; position: absolute; inset: 8px 10px 0; border-radius: 12px 12px 0 0; background: radial-gradient(ellipse at 50% 0%, rgba(120,30,30,.35), transparent 70%), #2B170C;
  box-shadow: inset 0 6px 14px rgba(0,0,0,.6); }
.hand-tray > span { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); font: 700 12px/20px var(--serif); color: var(--gold); white-space: nowrap;
  background: #24150B; padding: 0 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(233,195,90,.5); }
.stage[data-preset="phone"] .hand-tray > span { display: none; }
.stage[data-preset="phone"] .hand-tray { border-radius: 10px 10px 0 0; }

/* ================= P1：HUD ================= */
/* 市场：空的时候弱化成一行小字，有牌时才显示边框 */
.zone { transition: border-color .2s, background .2s; }
.zone .zone-empty { display: none; position: absolute; inset: 0; place-items: center; font: 600 14px var(--serif); font-style: normal; color: rgba(233,195,90,.45); }
.zone.is-empty { border-color: rgba(233,195,90,.16); border-style: dashed; }
.zone.is-empty > span { opacity: .55; }
.zone.is-empty .zone-empty { display: grid; }
.stage[data-preset="phone"] .zone .zone-empty { font-size: 9px; }

/* 摸牌按钮：黄铜牌，和「投资」大按钮同一套材质 */
.draw-slot button { background: linear-gradient(#F7D978, #D9A836); color: #3A2508; border-radius: 22px; padding: 6px 18px; font: 800 16px var(--serif); letter-spacing: .06em;
  box-shadow: inset 0 0 0 2px #FFF1B8, 0 0 0 2px #8C6D25, 0 4px 0 #6E4F12, 0 7px 12px rgba(0,0,0,.5); }
.draw-slot button:disabled { background: linear-gradient(#8E8068, #6E6250); color: #2A2016; box-shadow: inset 0 0 0 2px rgba(255,255,255,.2), 0 0 0 2px #4A3E2C, 0 3px 0 #2E261A; opacity: .8; }
.stage[data-preset="phone"] .draw-slot button { font-size: 10px; padding: 2px 8px; border-radius: 12px; }

/* 玩家模块：头像和名牌连成一体 */
.plate { border-radius: 0 0 8px 8px; transform: translate(-50%, -4px); padding: 4px 10px 3px; background: linear-gradient(#2A1A0E, #1A0F07);
  box-shadow: inset 0 0 0 1px rgba(201,162,74,.75), 0 4px 10px rgba(0,0,0,.5); z-index: -1; }
.seat .avatar { position: relative; z-index: 1; }
.seat.active .plate { box-shadow: inset 0 0 0 1.5px var(--amber), 0 0 14px rgba(255,178,63,.45); }
.stage[data-preset="phone"] .plate { transform: translate(-50%, -2px); padding: 1px 5px; }

/* 操作面板：只在轮到你时成为面板，显示「拿一张 → 放一张」 */
.actions.mine { background: linear-gradient(rgba(36,21,11,.92), rgba(26,15,7,.92)); border-radius: 12px; padding: 10px 12px 12px;
  box-shadow: inset 0 0 0 1.5px rgba(201,162,74,.7), 0 8px 20px rgba(0,0,0,.5); }
.prompt { color: var(--paper); text-shadow: none; display: grid; gap: 6px; }
.actions:not(.mine) .prompt { color: var(--muted); font-size: 13px; text-shadow: 0 1px 3px #000; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; counter-reset: st; }
.steps li { counter-increment: st; font: 700 12px var(--sans); color: var(--muted); padding: 2px 10px 2px 4px; border-radius: 12px; background: rgba(244,235,211,.08); display: flex; align-items: center; gap: 5px; }
.steps li::before { content: counter(st); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(244,235,211,.18); color: var(--paper); font-size: 11px; }
.steps li.now { color: var(--ink); background: var(--amber); }
.steps li.now::before { background: var(--ink); color: var(--amber); }
.steps li.done { color: var(--paper); }
.steps li.done::before { content: "✓"; background: #3E8E4F; }
.stage[data-preset="phone"] .actions.mine { padding: 4px 6px 6px; border-radius: 8px; }
.stage[data-preset="phone"] .steps li { font-size: 8px; padding: 0 5px 0 2px; }
.stage[data-preset="phone"] .steps li::before { width: 11px; height: 11px; font-size: 7px; }

/* 品牌速览：默认收起成 6 枚色章（总股数 + 反垄断），展开看全名和持有者 */
.legend { background: rgba(20,12,6,.72); border-radius: 10px; padding: 6px; box-shadow: inset 0 0 0 1px rgba(201,162,74,.5); }
.legend-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; min-height: 28px; padding: 2px 8px; font: 700 13px var(--serif);
  background: none; color: var(--gold); box-shadow: none; }
.legend-head span { font: 500 11px var(--sans); color: var(--muted); }
.legend.collapsed { grid-template-columns: 1fr; width: auto !important; }
.legend-chips { display: flex; gap: 6px; padding: 2px 4px 4px; }
.lchip { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--fg); font: 900 14px var(--sans);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 2px 4px rgba(0,0,0,.5); cursor: help; }
.lchip i { position: absolute; right: -5px; top: -6px; width: 15px; height: 15px; font: 900 9px/15px var(--serif); font-style: normal; text-align: center; color: #fff;
  background: var(--seal); border-radius: 2px; transform: rotate(-8deg); box-shadow: 0 0 0 1px var(--gold); }

/* ================= P2：质感统一 ================= */
:root { --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --sh-1: 0 2px 4px rgba(0,0,0,.45); --sh-2: 0 8px 20px rgba(0,0,0,.5); --brass-line: rgba(201,162,74,.7); }
/* 台灯从左上方照在桌面上：一层很淡的暖光，不抢牌的颜色 */
.felt { background: radial-gradient(ellipse 60% 70% at 32% 28%, rgba(255,214,150,.10), transparent 70%), radial-gradient(ellipse 90% 80% at 50% 50%, transparent 60%, rgba(0,0,0,.22)); border-radius: 30% / 50%; pointer-events: none; }
/* 浮层、日志、速览、操作面板：同一套黄铜细边 + 深木底 */
.popover, .log-drawer, .legend, .actions.mine { border-radius: var(--r-md); }
.popover { background: linear-gradient(#2A1A0E, #1A0F07); box-shadow: inset 0 0 0 1.5px var(--brass-line), var(--sh-2); }
.popover::before { content: ""; position: absolute; inset: 4px; border-radius: 7px; border: 1px solid rgba(201,162,74,.25); pointer-events: none; }
.modal-box { border-radius: var(--r-lg); }
/* 统一的悬停反馈：只抬起一点、短促，不闪烁 */
.stack-slot { transition: transform .12s ease-out; }
.stack-slot:hover, .stack-slot:focus-visible { transform: translateY(-.18em); }
.lchip, .brand { transition: transform .12s ease-out; }
.lchip:hover, .lchip:focus-visible, .brand:hover, .brand:focus-visible { transform: translateY(-2px); }
.hud-tools button, .hud-tools a.ghost { border-radius: var(--r-sm); }
.status { box-shadow: inset 0 0 0 1.5px var(--brass), var(--sh-1); }
/* 桌上的牌叠：接触阴影朝右下（光从左上来） */
.stack-top { box-shadow: .12em calc(var(--layers) * .22em + .3em) .5em rgba(0,0,0,.42); }
.mcard .card { box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, .1em .12em .2em rgba(0,0,0,.5), .25em .5em .7em rgba(0,0,0,.35); }

/* 有产品插画的卡：插画占满中部（contain，底部对齐，不拉伸），色带稍细；图里标签的字不可靠，品牌名照常由程序写 */
.card-art.illus { padding: 0; background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--c) 16%, #FBF4E2), color-mix(in srgb, var(--c) 8%, #F3EAD3) 70%); }
.card-art.illus img { position: absolute; inset: 3% 3% 2%; width: 94%; height: 95%; object-fit: contain; object-position: 50% 100%; display: block; filter: drop-shadow(.04em .06em .08em rgba(0,0,0,.28)); }
.card.has-art .card-band { padding: .14em .3em .14em .16em; }
.card.has-art .card-corner { min-width: 1.3em; height: 1.3em; font-size: .92em; }
.stack.has-art .stack-top .card-art { padding: 0; }
.seat-zone.top > span { top: auto; bottom: -10px; }

/* ================= 第三批素材：头像、按钮底板（九宫格）、弹窗木框（九宫格） ================= */
.avatar.has-img { background-size: cover; background-position: center; background-repeat: no-repeat; background-color: #3A2414; color: transparent; }
/* 按钮：高度固定，九宫格左右切线 = 高度一半，两端正好是半圆 */
.big.gold, .big.ivory, .draw-slot button, .modal-actions button {
  --bh: 58px; height: var(--bh); min-height: 0; box-sizing: border-box; background: none; box-shadow: none; border-radius: 0;
  border: 0 solid transparent; border-image: url(../assets/table/btn-primary.webp?v=3b79d0ad32) 40 80 fill / calc(var(--bh) * .25) calc(var(--bh) * .5) stretch;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.45)); color: #3A2508; padding: 0 calc(var(--bh) * .5); align-content: center; }
.big.ivory, .modal-actions button:not(.primary) { border-image-source: url(../assets/table/btn-secondary.webp?v=0fdbe00f61); color: var(--ink); background: none; }
.big.gold:disabled, .big.ivory:disabled, .draw-slot button:disabled, .modal-actions button:disabled {
  border-image-source: url(../assets/table/btn-disabled.webp?v=99fe68c35c); background: none; box-shadow: none; color: #E6DCC4; opacity: 1; filter: none; text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.big.gold:not(:disabled):hover, .big.ivory:not(:disabled):hover, .draw-slot button:not(:disabled):hover, .modal-actions button:not(:disabled):hover { filter: drop-shadow(0 6px 4px rgba(0,0,0,.5)) brightness(1.06); }
.draw-slot button { --bh: 40px; }
.modal-actions button { --bh: 44px; }
.stage[data-preset="phone"] .big.gold, .stage[data-preset="phone"] .big.ivory { --bh: 30px; padding: 0 12px; }
.stage[data-preset="phone"] .draw-slot button { --bh: 24px; padding: 0 10px; }
/* 弹窗与浮层：红木框，纸底只铺在框里（border 宽度 = 木框可见厚度，框图再盖过内圈圆角） */
.modal-box { border: 20px solid transparent; border-image: url(../assets/table/frame-wood.webp?v=5610582174) 200 / 44px; background: var(--paper-2) padding-box;
  border-radius: 0; box-shadow: none; filter: drop-shadow(0 24px 40px rgba(0,0,0,.6)); padding: 14px 20px; }
.popover { border: 14px solid transparent; border-image: url(../assets/table/frame-wood.webp?v=5610582174) 200 / 31px; background: linear-gradient(#2A1A0E, #1A0F07) padding-box;
  border-radius: 0; box-shadow: none; filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); padding: 6px 8px; }
.popover::before { display: none; }

/* ================= 叠牌厚度：投资摞、牌堆、市场牌 ================= */
/* 投资摞：每张一层纸边（品牌色描边 + 暗分隔线），越往下越暗、轻微错位；接触阴影随层数加深。
   背后的影子用 ::before 按文档顺序垫底，不用负 z-index（WebKit 会逃出层叠上下文）。 */
.stack::before { content: ""; position: absolute; inset: 0; border-radius: .45em; transform: translateY(calc(var(--t, 0em) * var(--ts, 1)));
  box-shadow: 0 0 .1em rgba(0,0,0,.55), .12em calc(.18em + var(--layers) * .04em) calc(.25em + var(--layers) * .05em) rgba(0,0,0,.5); }
.stack .edge { transform: translate(var(--j, 0), calc(var(--o) * var(--ts, 1))); background: #E9DDBE;
  border: .07em solid color-mix(in srgb, var(--c) 70%, #000); border-top-color: transparent;
  box-shadow: inset 0 -.09em 0 color-mix(in srgb, var(--c) 55%, #F1E7CD), 0 .06em 0 rgba(40,25,10,.65); filter: brightness(calc(1 - var(--i) * .04)); }
.stack .edge::after { display: none; }
.stack-top { box-shadow: 0 .05em .1em rgba(0,0,0,.4); }
.stack.mine .stack-top { box-shadow: 0 0 0 .12em rgba(255,178,63,.6), 0 .05em .1em rgba(0,0,0,.4); }
/* 牌堆：侧面是一条条纸边，厚度跟剩余张数走 */
.deck::before { content: ""; position: absolute; left: .06em; right: .06em; top: .6em; bottom: calc(-1 * var(--th, .5em)); border-radius: .5em;
  background: repeating-linear-gradient(#D9CDB0 0 .09em, #8C7B5A .09em .12em), #CDBF9C;
  box-shadow: inset 0 0 0 .08em #1E3352, .15em .35em .5em rgba(0,0,0,.55); }
.deck.empty::before { display: none; }
.deck .card { box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 .06em .1em rgba(0,0,0,.45); }
.deck-count { bottom: calc(-1 * var(--th, .5em)); }
/* 市场里的单张牌：一点纸边厚度 + 落影 */
.mcard .card { box-shadow: 0 .07em 0 #D3C5A2, 0 .13em 0 #8F7E5C, .1em .32em .45em rgba(0,0,0,.5); }
.mcard.can .card { box-shadow: 0 0 0 .2em var(--amber), 0 .13em 0 #8F7E5C, .1em .4em .6em rgba(0,0,0,.5); }

/* ================= 向效果图靠拢：市场硬币、座位铭牌、顶栏 ================= */
/* 市场牌上的硬币：一枚大铜币压在牌底，数字写在币面上（多枚时后面露出币边） */
.coins.on-card { bottom: -.95em; }
.coins.on-card i { width: 2.6em; height: 2.6em; margin-left: -2.3em; }
.coins.on-card i:first-child { margin-left: 0; }
.coins.on-card b { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 2.6em; height: 2.6em; margin: 0; padding: 0; display: grid; place-items: center;
  background: none; box-shadow: none; font: 900 1.35em/1 var(--serif); color: #3A2508; text-shadow: 0 1px 0 rgba(255,240,190,.8); }
/* 座位铭牌：名字和硬币数放大（桌面版） */
.stage:not([data-preset="phone"]) .plate { font-size: 15px; padding: 3px 10px; gap: 8px; }
.stage:not([data-preset="phone"]) .plate b { font-size: 16px; }
.stage:not([data-preset="phone"]) .plate .coins.tiny { font-size: 14px; }
.stage:not([data-preset="phone"]) .plate .coins.tiny b { font: 800 17px/1 var(--serif); color: #F4DE98; padding-left: 4px; }
/* 顶栏：深木底 + 黄铜细边，和牌桌同一套材质，不像网页按钮 */
.hud-tools button.ghost, .hud-tools a.ghost, .hud-tools select {
  background: linear-gradient(#3A2414, #24160B); color: #F4DE98; box-shadow: inset 0 0 0 1.5px var(--brass-line), 0 2px 4px rgba(0,0,0,.5);
  font-family: var(--serif); letter-spacing: .04em; border-radius: 18px; }
.hud-tools button.ghost:disabled { color: rgba(244,222,152,.4); opacity: 1; }
.hud-tools .speed { color: var(--muted); }
.hud-title { font-family: var(--serif); letter-spacing: .03em; }
/* 操作面板高度只有约 166px：桌面版「投资」「放入市场」左右并排，避免被底边截掉 */
.stage:not([data-preset="phone"]) .place-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
.stage:not([data-preset="phone"]) .place-actions .why { grid-column: 1 / -1; }
.stage:not([data-preset="phone"]) .big.gold, .stage:not([data-preset="phone"]) .big.ivory { padding: 0 16px; }
.stage:not([data-preset="phone"]) .big small { font-size: 11px; white-space: nowrap; }

/* ================= 卡面 v4（按 refs/table-mockup-v2.png）：压纹色框 + 旧纸内框 + 圆徽章 + 宋体铭牌 ================= */
.card.full, .stack-top {
  --line: color-mix(in srgb, var(--c) 70%, #2A1A0A); --deep: color-mix(in srgb, var(--c) 72%, #000);
  background:
    linear-gradient(155deg, rgba(255,255,255,.22), transparent 38%, rgba(0,0,0,.18)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 .08em, rgba(0,0,0,.05) .08em .16em),
    var(--c);
  border-radius: .55em; border: 0;
  box-shadow: inset 0 0 0 .06em rgba(255,255,255,.35), inset 0 0 0 .12em var(--deep), 0 .08em .15em rgba(0,0,0,.55), 0 .35em .6em rgba(0,0,0,.35); }
.card.full .card-in, .stack-top .card-in {
  position: absolute; inset: .42em .4em; border: 0; border-radius: .32em; overflow: visible;
  background: url(../assets/table/card-paper.webp?v=4dfc028427) center / 100% 100% #F3E9D2;
  box-shadow: inset 0 0 0 .07em var(--line), inset 0 0 0 .2em #F3E9D2, inset 0 0 0 .25em color-mix(in srgb, var(--line) 70%, transparent), 0 0 0 .05em rgba(0,0,0,.25);
  display: grid; grid-template-rows: 1.25em minmax(0, 1fr) auto .95em; padding: 0 .32em; }
/* 圆徽章：米色圆底 + 品牌色双环，压在内框左上角 */
.card.full .card-corner, .stack-top .card-corner {
  position: absolute; left: -.22em; top: -.22em; z-index: 2; width: 1.75em; height: 1.75em; min-width: 0; padding: 0; border-radius: 50%;
  display: grid; place-items: center; font: 900 1.1em/1 var(--serif); color: var(--deep);
  background: radial-gradient(circle at 40% 35%, #FFF8E6, #EADBB6);
  box-shadow: inset 0 0 0 .07em var(--deep), inset 0 0 0 .13em #F6ECD4, inset 0 0 0 .17em var(--c), 0 .06em .12em rgba(0,0,0,.45); }
.card-sprig { position: absolute; right: .45em; top: .3em; width: 2.6em; height: .8em; color: color-mix(in srgb, var(--c) 60%, #8C6A2A); opacity: .85; }
.card-sprig svg, .card-orn svg { display: block; width: 100%; height: 100%; }
.card.full .card-art { grid-row: 2; background: none; padding: .1em 0 0; }
.card.full .card-art.illus img { inset: 0 2% 0; width: 96%; height: 100%; }
.card.full .card-art.poster, .card.full .card-art:not(.illus) { background: radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%); }
/* 宋体牌名铭牌：细线框 + 两端小缺口 */
.card-plate { grid-row: 3; position: relative; margin: .12em .05em 0; padding: .14em .3em .12em; text-align: center;
  border: .06em solid var(--line); border-radius: .12em; box-shadow: inset 0 0 0 .1em #F3E9D2, inset 0 0 0 .13em color-mix(in srgb, var(--line) 55%, transparent);
  background: rgba(255,250,236,.55); }
.card-plate::before, .card-plate::after { content: ""; position: absolute; top: 50%; width: .3em; height: .3em; border: .06em solid var(--line); border-radius: 50%;
  background: #F3E9D2; transform: translate(-50%, -50%); }
.card-plate::before { left: 0; }
.card-plate::after { left: 100%; }
.card.full .card-name { display: block; white-space: nowrap; text-align: center; color: #2B1D10; font: 900 var(--nf, 1.12em)/1.15 "Songti SC", "STSong", "SimSun", "Noto Serif SC", var(--serif); letter-spacing: .08em; }
.card.full .card-name.n2, .card.full .card-name.n3 { letter-spacing: 0; }
.card.full .card-name small { white-space: nowrap; }
.card.full .card-name small { font: 600 .56em/1.2 var(--sans); color: #6b5d48; letter-spacing: .02em; opacity: 1; }
.card-orn { grid-row: 4; justify-self: center; align-self: center; width: 3.4em; height: .8em; color: color-mix(in srgb, var(--c) 65%, #5A3A1A); opacity: .8; }
.card.full .card-foot, .card.full .card-band { display: none; }
/* 投资摞顶牌：同一套框，只留徽章、麦穗和插画（效果图里小尺寸的牌不写名字，名字在悬停浮层里） */
.stack-top { overflow: visible; display: block; }
.stack-top .card-in { inset: .32em .3em; grid-template-rows: 1em minmax(0, 1fr) .25em; padding: 0 .2em; }
.stack-top .card-corner { font-size: .95em; }
.stack-top .card-sprig { width: 2.2em; top: .2em; right: .3em; }
.stack-top .card-art { grid-row: 2; background: none; padding: 0; }
.stack.has-art .stack-top .card-art.illus { background: none; }
.stack.mine .stack-top { box-shadow: inset 0 0 0 .06em rgba(255,255,255,.35), inset 0 0 0 .12em var(--deep), 0 0 0 .14em rgba(255,178,63,.7), 0 .05em .1em rgba(0,0,0,.4); }
/* 叠牌：每张牌一条品牌色厚边，边缘一道浅色纸芯线，层层向下错位 */
.stack .edge { background: linear-gradient(color-mix(in srgb, var(--c) 92%, #fff), color-mix(in srgb, var(--c) 80%, #000)); border: 0; border-radius: .55em;
  box-shadow: inset 0 -.05em 0 color-mix(in srgb, var(--c) 35%, #FFF6DD), inset 0 -.1em 0 color-mix(in srgb, var(--c) 70%, #000), 0 .05em .04em rgba(0,0,0,.55);
  filter: brightness(calc(1 - var(--i) * .03)); }
.stack::before { border-radius: .55em; }
.mcard .card.full { box-shadow: inset 0 0 0 .06em rgba(255,255,255,.35), inset 0 0 0 .12em var(--deep), 0 .07em 0 color-mix(in srgb, var(--c) 70%, #000), 0 .13em 0 color-mix(in srgb, var(--c) 45%, #000), .1em .32em .45em rgba(0,0,0,.5); }
.mcard.can .card.full { box-shadow: 0 0 0 .2em var(--amber), 0 .13em 0 color-mix(in srgb, var(--c) 45%, #000), .1em .4em .6em rgba(0,0,0,.5); }
.stage[data-preset="phone"] .card-sprig, .stage[data-preset="phone"] .card-orn { display: none; }
.stage[data-preset="phone"] .card.full .card-in { grid-template-rows: .9em minmax(0, 1fr) auto .2em; }

/* ================= 镜头放大（桌面版）：手牌扇形 ================= */
/* 整条 transform 由变量组合：悬停、选中只改 --raise，不会把扇形角度冲掉 */
.hcard, .hcard.can:hover, .hcard.can:focus-visible, .hcard.selected {
  transform: translateY(calc(var(--lift, 0em) - var(--raise, 0em))) rotate(var(--rot, 0deg)); transform-origin: 50% 100%; }
.hcard.can:hover, .hcard.can:focus-visible { --raise: .5em; }
.hcard.selected { --raise: 1.2em; z-index: 2; }
.seat[data-edge="left"][data-row][data-side] .bubble { bottom: auto; top: 50%; translate: 0 -50%; right: auto; left: calc(100% + 10px); }
.seat[data-edge="right"][data-row][data-side] .bubble { bottom: auto; top: 50%; translate: 0 -50%; left: auto; right: calc(100% + 10px); }
/* 上方座位的名牌就在框正上方：框的标签挪到右上角，不和市场标签挤在一起 */
.stage:not([data-preset="phone"]) .seat-zone.top > span { top: -10px; bottom: auto; left: auto; right: 12px; }
/* 扇形手牌中间那张会抬起来：托盘标签挪到左上角 */
.stage:not([data-preset="phone"]) .hand-tray > span { left: 22px; transform: none; }
.stage:not([data-preset="phone"]) .my-zone.seat-zone > span { top: auto; bottom: -10px; }

/* ================= 瑕疵修正：标签不被托盘压住、单张也有纸边、白底 logo / 纯文字牌改成米色徽章 ================= */
/* 「我的手牌」挂在托盘左侧外面（扇形手牌会盖住托盘顶边）；「我的投资区」回到框顶左侧（市场框和它之间留了缝） */
.stage:not([data-preset="phone"]) .hand-tray > span { left: auto; right: calc(100% + 8px); top: 14px; transform: none; text-align: right; line-height: 1.35; padding: 4px 10px; white-space: normal; width: max-content; max-width: 7.5em; }
.stage:not([data-preset="phone"]) .my-zone.seat-zone > span { top: -9px; bottom: auto; left: auto; right: 14px; transform: none; }
/* 只有一张也是实物：底下一道纸边 + 落影 */
.stack-top { box-shadow: inset 0 0 0 .06em rgba(255,255,255,.35), inset 0 0 0 .12em var(--deep), 0 .12em 0 color-mix(in srgb, var(--c) 55%, #000), 0 .18em .2em rgba(0,0,0,.45); }
.stack.mine .stack-top { box-shadow: inset 0 0 0 .06em rgba(255,255,255,.35), inset 0 0 0 .12em var(--deep), 0 0 0 .14em rgba(255,178,63,.7), 0 .12em 0 color-mix(in srgb, var(--c) 55%, #000), 0 .18em .2em rgba(0,0,0,.45); }
.stack .edge { box-shadow: inset 0 -.06em 0 color-mix(in srgb, var(--c) 35%, #FFF6DD), inset 0 -.12em 0 color-mix(in srgb, var(--c) 70%, #000), 0 .06em .05em rgba(0,0,0,.6); }
/* 没有插画的牌：logo 放进米色椭圆徽章，白底用 multiply 融进纸色；纯文字牌同一个徽章，字用品牌深色 */
.card.full .card-art:not(.illus), .stack-top .card-art:not(.illus) { background: none; padding: .3em .12em .15em; }
.card-logo, .card-art.poster::before {
  background: radial-gradient(ellipse at 50% 42%, #FFFBF0 0 45%, #F1E3C2 100%); border-radius: 50% / 46%;
  box-shadow: inset 0 0 0 .07em var(--line, #8C6A2A), inset 0 0 0 .2em #F7EDD5, inset 0 0 0 .26em color-mix(in srgb, var(--c) 60%, transparent), 0 .05em .12em rgba(0,0,0,.22); }
.card-logo img { inset: 22% 16%; width: 68%; height: 56%; mix-blend-mode: multiply; }
.card-art.poster { position: relative; }
.card-art.poster::before { content: ""; position: absolute; inset: .3em .12em .15em; }
.card-art.poster .wordmark, .card-art.poster .wm-sub { position: relative; }
.card-art.poster .wordmark { color: var(--deep, var(--c)); padding: 0 .35em; text-shadow: .03em .04em 0 rgba(255,250,236,.9); }
.card-art.poster .wm-sub { background: none; box-shadow: none; color: #6b5d48; }
.hand-tray > span small { display: block; font: 500 11px/1.3 var(--sans); color: var(--muted); }
.stage:not([data-preset="phone"]) .hand-tray > span { max-width: none; }

/* ================= D1 卡框（九宫格素材，按品牌色预先染好）=================
   坐标按素材原图 600×800：1 单位 = 卡宽 / 600 = cqw / 6。顶部（徽章、麦穗）和底部（铭牌）按卡宽等比缩放，
   竖向多出来的高度只拉伸中间的窗口和两侧边框，徽章不会被压扁。 */
.card.full, .stack-top { container-type: size; background: none; border: 0; border-radius: 6cqw; }
.card.full { box-shadow: 0 .08em .15em rgba(0,0,0,.55), 0 .35em .6em rgba(0,0,0,.35); }
.mcard .card.full { box-shadow: 0 .07em 0 color-mix(in srgb, var(--c) 70%, #000), 0 .13em 0 color-mix(in srgb, var(--c) 45%, #000), .1em .32em .45em rgba(0,0,0,.5); }
.mcard.can .card.full { box-shadow: 0 0 0 .2em var(--amber), 0 .13em 0 color-mix(in srgb, var(--c) 45%, #000), .1em .4em .6em rgba(0,0,0,.5); }
.hcard .card.full { box-shadow: 0 .1em .2em rgba(0,0,0,.6), 0 .6em 1em rgba(0,0,0,.5); }
.hcard.selected .card.full { box-shadow: 0 0 0 .2em var(--amber), 0 .8em 1.2em rgba(0,0,0,.55); }
.stack-top { box-shadow: 0 .12em 0 color-mix(in srgb, var(--c) 55%, #000), 0 .18em .2em rgba(0,0,0,.45); }
.stack.mine .stack-top { box-shadow: 0 0 0 .14em rgba(255,178,63,.7), 0 .12em 0 color-mix(in srgb, var(--c) 55%, #000), 0 .18em .2em rgba(0,0,0,.45); }
.card.full .card-in, .stack-top .card-in { position: absolute; inset: 1cqw; display: block; padding: 0; border: 0; border-radius: 5.5cqw; overflow: visible;
  background: url(../assets/table/card-paper.webp?v=4dfc028427) center / 100% 100% #F3E9D2; box-shadow: none; }
.card-frame { position: absolute; inset: -1cqw; z-index: 1; pointer-events: none; box-sizing: border-box; border-style: solid;
  border-width: calc(190cqw / 6) calc(70cqw / 6) calc(222cqw / 6); border-image-slice: 143 53 167 fill; border-image-repeat: stretch; }
/* 窗口：插画 / logo 徽章 / 字标 */
.card.full .card-art, .stack-top .card-art { position: absolute; z-index: 0; left: calc(64cqw / 6); right: calc(68cqw / 6); top: calc(156cqw / 6); bottom: calc(218cqw / 6);
  padding: 2cqw; background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--c) 14%, #FBF4E2), color-mix(in srgb, var(--c) 7%, #F1E6CC) 75%); min-height: 0; }
.card.full .card-art.illus, .stack-top .card-art.illus { padding: 0; }
.card.full .card-art.illus img, .stack-top .card-art.illus img { inset: 3% 3% 1%; width: 94%; height: 96%; }
/* 徽章：米色凹位里写股数，颜色是品牌色压暗到对比度 ≥ 4.5 */
.card.full .card-corner, .stack-top .card-corner { position: absolute; z-index: 2; left: calc(80cqw / 6); top: calc(40cqw / 6); width: calc(122cqw / 6); height: calc(122cqw / 6);
  min-width: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; background: none; box-shadow: none;
  font: 900 calc(84cqw / 6)/1 "Songti SC", "STSong", "SimSun", var(--serif); color: var(--ink); text-shadow: 0 1px 0 rgba(255,250,236,.8); }
/* 铭牌：牌名（宋体，按名字宽度缩字号、不换行），有产品时下面一行小字 */
.card.full .card-plate, .stack-top .card-plate { position: absolute; z-index: 2; left: calc(98cqw / 6); right: calc(98cqw / 6); bottom: calc(98cqw / 6); height: calc(74cqw / 6);
  margin: 0; padding: 0; border: 0; background: none; box-shadow: none; display: grid; place-items: center; }
.card.full .card-plate::before, .card.full .card-plate::after { display: none; }
.card.full .card-name, .stack-top .card-name { display: block; white-space: nowrap; text-align: center; color: #2B1D10; letter-spacing: .04em;
  font: 900 calc(54cqw / 6 * var(--nf, 1))/1.05 "Songti SC", "STSong", "SimSun", "Noto Serif SC", var(--serif); }
.card.full .card-name small { display: block; margin-top: calc(4cqw / 6); font: 600 calc(20cqw / 6)/1.1 var(--sans); color: #6b5d48; letter-spacing: .02em; }
.stack-top .card-name { color: #2B1D10; background: none; padding: 0; }
.stack .edge, .stack::before { border-radius: .36em; }

/* ================= 精致版卡框 B：整张等比缩放（不做九宫格），牌面固定 3:4 =================
   牌位（手牌、市场、投资摞、飞行动画）是 size 容器；牌面取「放得下的最大 3:4」居中，不拉伸卡框。
   牌面内坐标按素材 600×800：1 单位 = cqw / 6。 */
.hcard, .mcard, .stack-slot, .fx-fly { container-type: size; }
.card.full { inset: auto; left: 50%; top: 50%; width: min(100cqw, 75cqh); height: min(100cqh, calc(400cqw / 3)); translate: -50% -50%; border-radius: 4.5cqw; }
.stack { inset: auto; left: 50%; top: 50%; width: min(100cqw, 75cqh); height: min(100cqh, calc(400cqw / 3)); translate: -50% -50%; }
.stack-top { border-radius: 4.5cqw; }
.card.full .card-in, .stack-top .card-in { inset: 0; border-radius: 4.5cqw; background: none; overflow: hidden; }
.card-frame { inset: 0; border: 0; border-image: none; background-position: center; background-size: 100% 100%; background-repeat: no-repeat; }
.card.full .card-art, .stack-top .card-art { left: calc(67cqw / 6); right: calc(72cqw / 6); top: calc(155cqw / 6); bottom: calc(249cqw / 6); }
.card.full .card-corner, .stack-top .card-corner { left: calc(66cqw / 6); top: calc(46cqw / 6); width: calc(110cqw / 6); height: calc(110cqw / 6); font-size: calc(70cqw / 6); }
.card.full .card-plate, .stack-top .card-plate { left: calc(92cqw / 6); right: calc(95cqw / 6); bottom: calc(138cqw / 6); height: calc(81cqw / 6); }
.card.full .card-name, .stack-top .card-name { font-size: calc(50cqw / 6 * var(--nf, 1)); }
.card.full .card-name small { font-size: calc(19cqw / 6); margin-top: calc(3cqw / 6); }
.stack .edge, .stack::before { border-radius: 4.5cqw; }
.card.full .card-in .card-art, .stack-top .card-in .card-art { background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--c) 10%, #FBF4E2), color-mix(in srgb, var(--c) 6%, #F1E6CC) 75%); }

/* ================= 无插画牌：字标按长度定字号、均衡两行；logo 不顶满椭圆 ================= */
.card.full .card-art.poster, .stack-top .card-art.poster { display: grid; place-content: center; justify-items: center; gap: 1.2cqw; }
.card-art.poster .wordmark { font-size: var(--wm, 14cqw) !important; line-height: 1.12; letter-spacing: .04em; padding: 0; overflow-wrap: normal; white-space: nowrap; display: grid; justify-items: center; }
.card-art.poster .wordmark span { display: block; }
.card-art.poster .wm-sub { font: 600 4.2cqw/1.2 var(--sans); padding: 0; letter-spacing: .1em; }
/* 椭圆徽章内留边：logo 只占内接矩形的约 80% */
.card-logo img { inset: 26% 21%; width: 58%; height: 48%; }

/* ================= 阶段 A：向效果图靠拢（两侧一列横摞、接触影、铭牌、悬停面板、木托盘） ================= */
/* --- 两侧对手：横放牌摞，贴桌沿一列。槽位是普通块（不做 3:4 容器），里面全用 em（字号 = 牌高 / 3.6） --- */
.stack-slot.wide { container-type: normal; border-radius: .4em; }
.stack.wide { inset: 0; left: 0; top: 0; width: auto; height: auto; translate: none; --ts: .42; }
.stack.wide .edge, .stack.wide::before { border-radius: .4em; }
.tile-top { position: absolute; inset: 0; border-radius: .4em; padding: .2em;
  background: linear-gradient(155deg, rgba(255,255,255,.25), transparent 40%, rgba(0,0,0,.2)), var(--c);
  box-shadow: inset 0 0 0 .05em rgba(255,255,255,.4), inset 0 0 0 .1em color-mix(in srgb, var(--c) 70%, #000),
    0 .1em 0 color-mix(in srgb, var(--c) 55%, #000), 0 .16em .14em rgba(0,0,0,.5); }
.tile-in { position: relative; height: 100%; border-radius: .26em; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .2em;
  padding: 0 .2em 0 .12em; background: url(../assets/table/card-paper.webp?v=4dfc028427) center / cover #F3E9D2;
  box-shadow: inset 0 0 0 .05em color-mix(in srgb, var(--c) 70%, #2A1A0A), inset 0 0 0 .14em #F3E9D2, inset 0 0 0 .18em color-mix(in srgb, var(--c) 45%, transparent); }
.tile-in .card-corner { width: 1.45em; height: 1.45em; min-width: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; align-self: start; margin-top: .12em;
  font: 900 .95em/1 var(--serif); color: color-mix(in srgb, var(--c) 72%, #000); background: radial-gradient(circle at 40% 35%, #FFF8E6, #EADBB6);
  box-shadow: inset 0 0 0 .07em color-mix(in srgb, var(--c) 72%, #000), inset 0 0 0 .13em #F6ECD4, inset 0 0 0 .17em var(--c), 0 .05em .1em rgba(0,0,0,.4); }
.tile-name { display: grid; justify-items: center; color: #2B1D10; white-space: nowrap; letter-spacing: .04em;
  font: 900 calc(1.02em * var(--nf, 1))/1.08 "Songti SC", "STSong", "SimSun", "Noto Serif SC", var(--serif); }
.tile-name.two { font-size: calc(.86em * var(--nf, 1)); }
.tile-art { position: relative; width: 2.3em; height: 2.6em; display: block; }
.tile-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 .04em .05em rgba(0,0,0,.3)); }
.tile-logo { position: absolute; inset: .3em 0; border-radius: 50% / 46%; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, #FFFBF0 0 45%, #F1E3C2 100%);
  box-shadow: inset 0 0 0 .06em color-mix(in srgb, var(--c) 70%, #2A1A0A); }
.tile-logo img { position: absolute; inset: 18% 12%; width: 76%; height: 64%; object-fit: contain; mix-blend-mode: multiply; }
.tile-logo .nologo { position: absolute; inset: 0; display: grid; place-items: center; font-size: .5em !important; }
.stack.wide .seal { right: -.5em; top: -.45em; font-size: .9em; }
.stack-slot.wide:hover .tile-top, .stack-slot.wide:focus-visible .tile-top { box-shadow: 0 0 0 .12em #F2C14E, 0 0 .7em rgba(255,200,80,.55), 0 .16em .14em rgba(0,0,0,.5); }
/* 两侧的投资区不画框（效果图没有），只在还没投资时留一行小字 */
.seat-zone.rail { border: 0; background: none; box-shadow: none; }
.seat-zone.rail:not(.empty) > span { display: none; }
.seat-zone.rail.empty > span { left: 8px; top: 6px; }

/* --- 接触阴影：牌贴着桌面，不浮着。一道很紧的深色贴地影 + 一圈压暗呢绒的环境影（光从左上来，影子略偏右下） --- */
.mcard::before, .stack-slot:not(.wide) .stack::after, .deck::after { content: ""; position: absolute; pointer-events: none; border-radius: 12%;
  background: radial-gradient(closest-side, rgba(0,0,0,.42), rgba(0,0,0,.18) 60%, transparent); }
.mcard::before { inset: 2% -5% -6% -2%; translate: 3% 3%; }
.deck::after { inset: 6% -6% calc(-1 * var(--th, .5em) - 6%) -2%; z-index: -1; }
.stack-slot:not(.wide) .stack::after { inset: 0 -6% calc(-1 * var(--t, 0em) - 7%) -2%; z-index: -1; translate: 3% 2%; }
.stack-slot.wide .stack::after { content: ""; position: absolute; pointer-events: none; inset: 4% -4% calc(-1 * var(--t, 0em) * .42 - 16%) -2%; border-radius: 30%;
  background: radial-gradient(closest-side, rgba(0,0,0,.4), rgba(0,0,0,.15) 60%, transparent); }
.stack::before { box-shadow: 0 0 .06em rgba(0,0,0,.7), .1em calc(.12em + var(--layers) * .03em) calc(.16em + var(--layers) * .03em) rgba(0,0,0,.55); }
.mcard .card.full { box-shadow: 0 .02em .03em rgba(0,0,0,.7), 0 .07em 0 color-mix(in srgb, var(--c) 70%, #000), 0 .13em 0 color-mix(in srgb, var(--c) 45%, #000), .08em .22em .22em rgba(0,0,0,.55); }
.mcard.can .card.full { box-shadow: 0 0 0 .2em var(--amber), 0 .13em 0 color-mix(in srgb, var(--c) 45%, #000), .08em .22em .22em rgba(0,0,0,.55); }
/* 桌上的牌受同一盏左上方的暖灯：左上略亮、右下略暗（手牌在前景，不加） */
.mcard .card-in::after, .stack-top .card-in::after, .tile-in::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(140deg, rgba(255,232,180,.16), transparent 45%, rgba(40,20,0,.14)); }

/* --- 座位：头像 + 右侧铭牌（效果图）。头像金框；铭牌两行：名字 / 铜币 + 数字 --- */
.stage:not([data-preset="phone"]) .seat .avatar { border: 3px solid #2A160B;
  box-shadow: 0 0 0 2.5px #E9C35A, 0 0 0 4px #7A5418, inset 0 -6px 10px rgba(0,0,0,.35), 0 6px 14px rgba(0,0,0,.6); }
.stage:not([data-preset="phone"]) .seat.active .avatar { box-shadow: 0 0 0 2.5px #FFD27A, 0 0 0 4px var(--amber), 0 0 24px rgba(255,178,63,.85); }
.stage:not([data-preset="phone"]) .seat:is([data-plate="right"], [data-plate="left"]) .plate {
  top: 50%; transform: translateY(-50%); display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 7px; row-gap: 0;
  min-width: 112px; padding: 5px 14px 5px 24px; border-radius: 0 10px 10px 0; left: calc(100% - 16px); right: auto;
  background: linear-gradient(#2E1D10, #170D06); box-shadow: inset 0 0 0 1.5px #B8913E, inset 0 0 0 3px rgba(0,0,0,.5), inset 0 1px 0 4px rgba(255,220,150,.05), 0 5px 12px rgba(0,0,0,.55); }
.stage:not([data-preset="phone"]) .seat[data-plate="left"] .plate { left: auto; right: calc(100% - 16px); padding: 5px 24px 5px 14px; border-radius: 10px 0 0 10px; }
.stage:not([data-preset="phone"]) .seat:is([data-plate="right"], [data-plate="left"]) .plate b { font: 800 18px/1.15 var(--serif); color: #F6EBD0; letter-spacing: .04em; }
.stage:not([data-preset="phone"]) .seat:is([data-plate="right"], [data-plate="left"]) .plate small { font-size: 11px; color: #BFA97C; }
.stage:not([data-preset="phone"]) .seat:is([data-plate="right"], [data-plate="left"]) .pc { grid-column: 1; }
.stage:not([data-preset="phone"]) .seat:is([data-plate="right"], [data-plate="left"]) .hbs { grid-column: 2; padding-left: 0; }
/* 硬币数：一枚铜币 + 大数字（不再画一串硬币） */
.stage:not([data-preset="phone"]) .plate .coins.tiny i { display: none; }
.stage:not([data-preset="phone"]) .plate .coins.tiny i:first-child { display: block; width: 22px; height: 22px; margin: 0; }
.stage:not([data-preset="phone"]) .plate .coins.tiny b { font: 800 20px/1 var(--serif); color: #F4DE98; padding-left: 6px; }
.stage:not([data-preset="phone"]) .seat.active:is([data-plate="right"], [data-plate="left"]) .plate { box-shadow: inset 0 0 0 1.5px var(--amber), inset 0 0 0 3px rgba(0,0,0,.5), 0 0 14px rgba(255,178,63,.45); }
/* 「你」：名字做成红色绶带 */
.stage:not([data-preset="phone"]) .me-seat .plate > b { justify-self: start; padding: 1px 16px 1px 10px; margin-left: -8px; color: #FBE7B4; font-size: 17px;
  background: linear-gradient(#B8332A, #7E1C16); clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.stage:not([data-preset="phone"]) .me-seat .plate { min-width: 104px; }
/* 「思考中…」挂在头像下面，上面留给气泡 */
.stage:not([data-preset="phone"]) .seat:is([data-plate="right"], [data-plate="left"]) .thinking { bottom: auto; top: calc(100% + 6px); transform: translateX(-50%); }
/* 气泡：上方座位放在铭牌外侧或头像左侧；两侧座位放在头像上方，朝桌心展开 */
.stage:not([data-preset="phone"]) .seat[data-bubble] .bubble { translate: none; right: auto; left: auto; bottom: auto; top: auto; }
.stage:not([data-preset="phone"]) .seat[data-bubble="after"] .bubble { top: 50%; translate: 0 -50%; left: calc(100% - 16px + 138px + 10px); }
.stage:not([data-preset="phone"]) .seat[data-bubble="before"] .bubble { top: 50%; translate: 0 -50%; right: calc(100% + 10px); }
.stage:not([data-preset="phone"]) .seat[data-bubble="above"] .bubble { bottom: calc(100% + 10px); }
.stage:not([data-preset="phone"]) .seat[data-bubble="above"][data-side="left"] .bubble { left: -6px; }
.stage:not([data-preset="phone"]) .seat[data-bubble="above"][data-side="right"] .bubble { right: -6px; }

/* --- 股东浮层：效果图那种大面板——深色底、金线框、白底圆 logo、大字品牌名；带一个指向那张牌的小尖角 --- */
.stage ~ .popover, .popover { width: 320px; padding: 14px 18px 14px; border: 2px solid #C9A24A; border-image: none; border-radius: 12px;
  background: linear-gradient(160deg, #2B1B0E, #140B05 70%);
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255,226,160,.22), 0 0 22px rgba(233,195,90,.28), 0 16px 34px rgba(0,0,0,.65); font-size: 14px; }
.popover::before { display: none; }
.popover::after { content: ""; position: absolute; top: var(--ay, 50%); width: 14px; height: 14px; background: #24170C; border: 2px solid #C9A24A; translate: 0 -50%; rotate: 45deg; display: none; }
.popover[data-arrow="left"]::after { display: block; left: -9px; border-top-color: transparent; border-right-color: transparent; }
.popover[data-arrow="right"]::after { display: block; right: -9px; border-bottom-color: transparent; border-left-color: transparent; }
.popover .pop-head { grid-template-columns: 58px 1fr; gap: 12px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(201,162,74,.45); }
.popover .pop-head .brand-logo { width: 58px; height: 58px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #E9C35A, 0 0 0 4px var(--c), 0 3px 8px rgba(0,0,0,.5); }
.popover .pop-head .brand-logo img { inset: 16%; width: 68%; height: 68%; }
.popover .pop-head b { font: 900 24px/1.15 var(--serif); color: #F6EBD0; letter-spacing: .06em; }
.popover .pop-head small { font-size: 13px; color: #CDBFA0; }
.popover .pop-rows { gap: 4px; }
.popover .pop-rows li { padding: 4px 8px; font-size: 15px; }
.popover .pop-rows li b { font: 800 16px/1.2 var(--serif); color: #F4DE98; }
.popover .pop-rows .tag { font-size: 12px; }
.popover .pop-foot { margin-top: 10px; gap: 4px; font-size: 14px; }
.popover .pop-foot .seal.mini { width: 22px; height: 22px; font-size: 12px; }
@media (max-height: 520px) { .popover { width: 240px; padding: 8px 10px; font-size: 12px; }
  .popover .pop-head { grid-template-columns: 40px 1fr; gap: 8px; margin-bottom: 6px; padding-bottom: 6px; }
  .popover .pop-head .brand-logo { width: 40px; height: 40px; } .popover .pop-head b { font-size: 16px; }
  .popover .pop-rows li { font-size: 12px; padding: 2px 6px; } .popover .pop-rows li b { font-size: 13px; } .popover .pop-foot { font-size: 12px; margin-top: 6px; } }

/* --- 手牌托盘：红木实物（CSS 先做，素材 T3 到了换图）：上沿挡板、内凹底、两端挡块、前沿压住牌脚 --- */
.stage:not([data-preset="phone"]) .hand-tray { border-radius: 14px 14px 0 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.35), transparent 6%, transparent 94%, rgba(0,0,0,.35)),
    repeating-linear-gradient(91deg, rgba(255,190,120,.05) 0 2px, transparent 2px 7px, rgba(0,0,0,.08) 7px 9px, transparent 9px 17px),
    repeating-linear-gradient(89.3deg, transparent 0 23px, rgba(30,10,0,.18) 23px 25px, transparent 25px 61px),
    linear-gradient(#7A3A1E, #5A2814 40%, #3E1B0D);
  box-shadow: inset 0 2px 0 rgba(255,200,140,.35), inset 0 0 0 1px rgba(0,0,0,.6), 0 -8px 22px rgba(0,0,0,.5); }
.stage:not([data-preset="phone"]) .hand-tray::before { inset: 12px 30px 0; border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(90.6deg, rgba(255,180,110,.04) 0 3px, transparent 3px 11px, rgba(0,0,0,.1) 11px 13px, transparent 13px 29px),
    linear-gradient(#2A1209, #3C1B0D 55%, #4A2311);
  box-shadow: inset 0 10px 16px rgba(0,0,0,.75), inset 6px 0 10px rgba(0,0,0,.45), inset -6px 0 10px rgba(0,0,0,.45), 0 -1px 0 rgba(255,210,160,.25); }
.hand-lip { position: absolute; z-index: 6; pointer-events: none; display: none; }
.stage:not([data-preset="phone"]) .hand-lip { display: block; border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(90.5deg, rgba(255,190,120,.07) 0 2px, transparent 2px 9px, rgba(0,0,0,.12) 9px 11px, transparent 11px 23px),
    linear-gradient(#8A4424, #63301A 45%, #43200F);
  box-shadow: inset 0 2px 0 rgba(255,214,160,.45), inset 0 -2px 0 rgba(0,0,0,.4), 0 -4px 8px rgba(0,0,0,.45); }

/* ================= 第四批素材：斜俯视牌桌 T1、书房 T2、木托盘 T3、「你」的头像 T5、横版卡框 T6 ================= */
/* 斜俯视桌子画在屏幕层，铺满舞台（素材 16:9，和舞台同比例）；桌面平面只负责摆牌。?table=classic 回到旧桌子 */
.table-art { position: absolute; inset: 0; background: center / 100% 100% no-repeat; pointer-events: none; filter: drop-shadow(0 18px 26px rgba(0,0,0,.55)); }
.table-art[hidden] { display: none; }
.stage[data-table="oblique"] .room { background-image: url(../assets/table/bg-room.webp?v=92d740172a); background-position: center; }
.stage[data-table="oblique"] .room::after { background: radial-gradient(ellipse 80% 75% at 50% 48%, transparent 60%, rgba(10,5,2,.45)); }
/* 呢绒上那层左上暖光由素材自己画了，CSS 的只留四周压暗 */
.stage[data-table="oblique"] .felt { background: none; }

/* 横版卡框：素材盖在最上层，圆洞（徽章）和方洞（插画窗）透出下面的内容。坐标按素材 1782×570 的洞位换算成百分比 */
.tile-top { padding: 0; background: none; border-radius: .3em; box-shadow: 0 .08em 0 color-mix(in srgb, var(--c) 55%, #000), 0 .14em .14em rgba(0,0,0,.5); }
.tile-frame { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: center / 100% 100% no-repeat; }
.tile-in { position: absolute; inset: 0; display: block; padding: 0; border-radius: .3em; box-shadow: none;
  background: radial-gradient(ellipse at 50% 50%, #FBF4E2, #EFE3C6); }
.tile-in .card-corner { position: absolute; z-index: 1; left: 4.8%; top: 50%; translate: 0 -50%; width: 18.4%; height: auto; aspect-ratio: 1; margin: 0; box-shadow: none;
  font-size: 1.3em; background: radial-gradient(circle at 40% 35%, #FFF8E6, #EADBB6); }
.tile-name { position: absolute; z-index: 3; left: 25%; right: 29%; top: 0; bottom: 0; align-content: center; }
.tile-art { position: absolute; z-index: 1; left: 72.3%; right: 7.4%; top: 19.1%; bottom: 19.6%; width: auto; height: auto;
  background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--c) 12%, #FBF4E2), color-mix(in srgb, var(--c) 6%, #F1E6CC) 75%); }
.tile-art > img { inset: 6%; width: 88%; height: 88%; }
.tile-logo { inset: 8% 4%; }
.tile-in::after { z-index: 4; }
.stack.wide .seal { z-index: 5; }
.stack-slot.wide:hover .tile-top, .stack-slot.wide:focus-visible .tile-top { box-shadow: 0 0 0 .12em #F2C14E, 0 0 .7em rgba(255,200,80,.55), 0 .14em .14em rgba(0,0,0,.5); }

/* 手牌（斜俯视桌子，桌面版）：不要托盘，平时只露上面 2/3；轮到你出牌时整手升起露出全貌，悬停 / 聚焦的那张压到最上层，选中的再高一点 */
.stage[data-table="oblique"]:not([data-preset="phone"]) :is(.hand-tray, .hand-lip) { display: none; }
.stage[data-table="oblique"]:not([data-preset="phone"]) .hcard.can { --raise: 2.9em; }
.stage[data-table="oblique"]:not([data-preset="phone"]) .hcard.can:is(:hover, :focus-visible) { --raise: 3.7em; z-index: 3; }
.stage[data-table="oblique"]:not([data-preset="phone"]) .hcard.selected { --raise: 4.3em; z-index: 2; }
.stage[data-table="oblique"]:not([data-preset="phone"]) .hcard.selected:is(:hover, :focus-visible) { --raise: 4.3em; }
.stage[data-table="oblique"]:not([data-preset="phone"]) .hcard { transition: transform .16s ease-out; }

/* 「你」有照片头像了：不再显示「你」字圆章 */
.me-seat .avatar.has-img { color: transparent; }
/* 没有插画也没有 logo 的品牌：小窗里放品牌色的首字 */
.tile-word { position: absolute; inset: 0; display: grid; place-items: center; font: 900 1.5em/1 "Songti SC", "STSong", "SimSun", var(--serif); text-shadow: 0 1px 0 rgba(255,250,236,.9); }
/* 拖动中的幽灵牌也是 3:4 牌位容器：卡框 B 的尺寸按 cqw 算，不设容器会按整个视口算，牌被放大到半屏 */
.drag-ghost { container-type: size; }
/* 对手手牌张数：头像右下角的小牌背角标（有从市场拿走的已知牌时描一圈琥珀色，悬停看是哪几张） */
.hand-n { position: absolute; right: -4%; bottom: -4%; z-index: 2; min-width: 34%; height: 34%; padding: 0 3px; display: grid; place-items: center; border-radius: 4px;
  font: 800 calc(var(--size) * .2)/1 var(--sans); color: #F6EBD0; cursor: help;
  background: url(../assets/table/card-back.webp?v=c96cd72af2) center / cover #24406A; box-shadow: 0 0 0 1.5px #E9C35A, 0 2px 4px rgba(0,0,0,.6); text-shadow: 0 1px 2px #000; }
.hand-n.has-known { box-shadow: 0 0 0 1.5px var(--amber), 0 0 6px rgba(255,178,63,.7), 0 2px 4px rgba(0,0,0,.6); }

/* ================= 强制横屏 + 手机横屏新桌子 ================= */
/* 触屏设备竖着拿、正在对局：#app 整体顺时针转 90°。--fw / --fh 是真实视口宽高（js 写入，避开 iOS 100vh 的问题）。
   转过以后 #app 里的 position: fixed 都以 #app 为准，浮层、日志抽屉、结算弹窗跟着一起转。 */
html.force-land, html.force-land body { overflow: hidden; height: 100%; overscroll-behavior: none; }
html.force-land #app { position: fixed; left: 0; top: 0; width: var(--fh); height: var(--fw); transform-origin: 0 0; transform: translate(var(--fw), 0) rotate(90deg); }
html.force-land .rotate-hint { display: none; }

/* 桌面图按宽铺满（手机舞台更扁，上下裁一点；桌面版 16:9 正好铺满） */
.table-art { background-size: cover; background-position: center; }

/* 手机：不要托盘，手牌平时只露上面 2/3；轮到你出牌时整手升起露出全貌（点数、品牌名都看得到），点选的那张再高一点 */
.stage[data-table="oblique"][data-preset="phone"] :is(.hand-tray, .hand-lip) { display: none; }
.stage[data-table="oblique"][data-preset="phone"] .hcard.can { --raise: 3.6em; }
.stage[data-table="oblique"][data-preset="phone"] .hcard.selected { --raise: 4.2em; z-index: 2; }
.stage[data-table="oblique"][data-preset="phone"] .hcard { transition: transform .16s ease-out; }
/* 转过来的手机：浮层用手机尺寸（媒体查询看的是真实竖屏高度，矮屏规则不生效） */
html.force-land .popover { width: 240px; padding: 8px 10px; font-size: 12px; }
html.force-land .popover .pop-head { grid-template-columns: 40px 1fr; gap: 8px; margin-bottom: 6px; padding-bottom: 6px; }
html.force-land .popover .pop-head .brand-logo { width: 40px; height: 40px; }
html.force-land .popover .pop-head b { font-size: 16px; }
html.force-land .popover .pop-rows li { font-size: 12px; padding: 2px 6px; }
html.force-land .popover .pop-rows li b { font-size: 13px; }
html.force-land .popover .pop-foot { font-size: 12px; margin-top: 6px; }
/* 牌上的图片不能被浏览器当成「拖图片」（会打断拖牌） */
.card img, .stack img { -webkit-user-drag: none; user-select: none; }

/* ================= 桌面去框（2026-11-05）：市场、投资区、对手区平时不画框、不写字；拖牌时目标区才亮出来 ================= */
.zone, .my-zone, .seat-zone { border-color: transparent !important; background: none !important; box-shadow: none !important; }
.zone > span, .zone .zone-empty, .my-zone > span, .seat-zone > span { display: none !important; }
/* 拖牌时：能放的地方一圈暖金色柔光，鼠标移上去更亮；不能放的红色斜纹（hand-drag.js 加的 drop-ok / drop-bad） */
.zone.drop-ok, .my-zone.drop-ok { border: 2px solid rgba(255,196,96,.55) !important; background: radial-gradient(closest-side, rgba(255,190,90,.16), rgba(255,190,90,.05) 70%, transparent) !important; }
.zone.drop-ok.drop-hover, .my-zone.drop-ok.drop-hover { border-color: rgba(255,214,130,.95) !important; background: radial-gradient(closest-side, rgba(255,200,100,.3), rgba(255,190,90,.1) 75%, transparent) !important;
  box-shadow: 0 0 24px rgba(255,190,90,.35) !important; }
.zone.drop-bad, .my-zone.drop-bad { border: 2px solid rgba(200,55,45,.7) !important; background: repeating-linear-gradient(45deg, rgba(200,55,45,.12) 0 10px, transparent 10px 20px) !important; }

/* ================= 牌堆：一摞有厚度的牌，本身就是「摸牌」按钮 ================= */
#draw-slot:empty { display: none; }
.deck-hit { all: unset; position: absolute; inset: 0; display: block; cursor: default; border-radius: 8.6% / 5.75%;
  transition: transform .16s ease, filter .16s ease; }
.deck-hit .card { position: absolute; inset: 0; }
/* 侧面纸边更厚、更明显：一层层错开的牌边 + 底部落影；厚度跟剩余张数走（--th） */
.deck::before { left: .04em; right: -.02em; top: .5em; bottom: calc(-1 * var(--th, .5em)); border-radius: .55em;
  background:
    linear-gradient(90deg, rgba(0,0,0,.35), transparent 12%, transparent 88%, rgba(0,0,0,.35)),
    repeating-linear-gradient(#E6DAB9 0 .07em, #9C8A64 .07em .1em, #CDBE98 .1em .16em), #CDBF9C;
  box-shadow: inset 0 0 0 .07em #1B2C47, .2em .45em .6em rgba(0,0,0,.6), .05em .12em .1em rgba(0,0,0,.5); }
.deck .card { box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 .05em 0 #1E3352, 0 .1em .12em rgba(0,0,0,.45); }
/* 轮到你拿牌：牌堆描一圈暖金色，悬停抬起一点 */
.deck.can .deck-hit { cursor: pointer; }
.deck.can .deck-hit .card { box-shadow: 0 0 0 .07em #F4D58A, 0 0 .9em rgba(255,196,96,.55), 0 .1em .12em rgba(0,0,0,.45); }
/* 牌堆不抬起：摸完重画时会一下掉回去，看着像抖；悬停只靠发光 */
.deck.can .deck-hit:is(:hover, .armed) .card { box-shadow: 0 0 0 .2em #FFC548, 0 0 1.8em .45em rgba(240,155,20,.85), 0 .1em .12em rgba(0,0,0,.45) !important; }
/* 剩余张数：左下角一个小签，不压牌背图案 */
.deck-left { position: absolute; left: -.45em; bottom: calc(-1 * var(--th, .5em) - .1em); z-index: 3; min-width: 1.6em; padding: .12em .35em; border-radius: .8em;
  font: 800 .62em/1.2 var(--sans); color: #F4E3B4; text-align: center; background: #1B2C47; box-shadow: 0 0 0 .1em #C9A24A, 0 .15em .3em rgba(0,0,0,.5); pointer-events: none; }
/* 摸牌要付几枚：右下角一枚铜币 */
.deck-cost { position: absolute; right: -.7em; bottom: calc(-1 * var(--th, .5em) - .2em); z-index: 3; display: flex; align-items: center; gap: .2em;
  padding: .15em .5em .15em 1.55em; border-radius: 1em; font: 700 .62em/1.2 var(--serif); color: #3A2508; white-space: nowrap; pointer-events: none;
  background: url(../assets/table/coin-1.webp?v=77a54979b1) .2em 50% / 1.2em no-repeat, linear-gradient(#F7D978, #D9A836); box-shadow: 0 .15em .3em rgba(0,0,0,.5); }
.deck-cost b { font: 900 1.25em/1 var(--serif); }
.deck-cost.free { padding-left: .6em; background: linear-gradient(#F7D978, #D9A836); }
.deck:not(.can) .deck-cost { filter: grayscale(.7) brightness(.8); }
.deck-count { display: none; }
/* 两侧对手：气泡在铭牌下面（上面是自己的牌） */
.stage:not([data-preset="phone"]) .seat[data-bubble="below"] .bubble { top: calc(100% + 40px); }
.stage:not([data-preset="phone"]) .seat[data-bubble="below"][data-side="left"] .bubble { left: -6px; }
.stage:not([data-preset="phone"]) .seat[data-bubble="below"][data-side="right"] .bubble { right: -6px; }
/* 牌堆空了：只留一圈很淡的位置，不写字 */
.deck.empty { border: 1.5px solid rgba(233,195,90,.18); }
.deck-empty { display: none; }
/* 牌堆更立体：纸边朝下、朝右两面都露出来（光从左上来）；最上面两张略微错开，像一摞真的牌 */
.deck::before { right: calc(-.3 * var(--th, .5em)); top: .9em; border-radius: .5em .6em .6em .5em;
  background:
    linear-gradient(90deg, transparent calc(100% - .3 * var(--th, .5em) - .1em), rgba(0,0,0,.28) calc(100% - .3 * var(--th, .5em))),
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,.18)),
    repeating-linear-gradient(#EADFC0 0 .06em, #8E7C56 .06em .09em, #D4C6A1 .09em .15em), #CDBF9C; }
.deck-hit::before, .deck-hit::after { content: ""; position: absolute; inset: 0; border-radius: 8.6% / 5.75%; pointer-events: none;
  background: url(../assets/table/card-back.webp?v=c96cd72af2) center / 100% 100% #1A2B4A; box-shadow: 0 .05em .1em rgba(0,0,0,.5); }
.deck-hit::before { rotate: -2.2deg; translate: -.12em .22em; filter: brightness(.7); }
.deck-hit::after { rotate: 1.4deg; translate: .1em .12em; filter: brightness(.82); }
.deck-hit .card { z-index: 1; }
.deck.empty .deck-hit::before, .deck.empty .deck-hit::after { display: none; }

/* ================= 拖牌反馈：不画框。落点所在的区域被一片暖光照亮、牌提亮抬起；另一块区域压暗 ================= */
.zone.drop-ok, .my-zone.drop-ok, .zone.drop-bad, .my-zone.drop-bad { border: 0 !important; background: none !important; box-shadow: none !important; }
.zone, .my-zone { transition: background .18s ease, opacity .18s ease; }
/* 落在能放的区域：中间亮、边缘自然散开的一片灯光（没有硬边） */
.zone.drop-ok.drop-hover, .my-zone.drop-ok.drop-hover { background: radial-gradient(closest-side, rgba(255,214,140,.4), rgba(255,196,110,.18) 60%, transparent) !important; }
/* 落在不能放的区域（比如刚从市场拿的牌不能放回去）：一片暗红 */
.zone.drop-bad.drop-hover, .my-zone.drop-bad.drop-hover { background: radial-gradient(closest-side, rgba(170,30,25,.42), rgba(120,20,15,.18) 60%, transparent) !important; }
#market .mcard, #stacks .stack-slot[data-seat="0"] { transition: filter .18s ease, translate .18s ease; }
/* 悬在市场上：市场牌提亮抬起，你的投资区压暗；悬在投资区：反过来 */
#stage:has(#zone.drop-ok.drop-hover) #market .mcard,
#stage:has(#my-zone.drop-ok.drop-hover) #stacks .stack-slot[data-seat="0"] { filter: brightness(1.12) saturate(1.05); translate: 0 -.12em; }
#stage:has(#zone.drop-hover) #stacks .stack-slot[data-seat="0"],
#stage:has(#my-zone.drop-hover) #market .mcard { filter: brightness(.5) saturate(.6); }
#stage:has(#zone.drop-bad.drop-hover) #market .mcard { filter: brightness(.6) saturate(.5) sepia(.3); }
/* 拖着但还没进任何区域：两块都略暗一点，提示「可以放这两处」 */
#stage:has(.drop-ok):not(:has(.drop-hover)) #market .mcard,
#stage:has(.drop-ok):not(:has(.drop-hover)) #stacks .stack-slot[data-seat="0"] { filter: brightness(.85); }
.zone.drop-ok.drop-hover, .my-zone.drop-ok.drop-hover, .zone.drop-bad.drop-hover, .my-zone.drop-bad.drop-hover { border: 0 !important; box-shadow: none !important; }

/* ================= 手牌和桌子是一个空间：同一盏灯、往桌面方向倾、影子落在呢绒上 ================= */
/* 往桌面方向倾一点（远边略窄），悬停 / 选中时立起来朝向你 */
.stage:not([data-preset="phone"]) #hand { perspective: 1500px; perspective-origin: 50% -20%; }
.stage:not([data-preset="phone"]) .hcard, .stage:not([data-preset="phone"]) .hcard.can:hover,
.stage:not([data-preset="phone"]) .hcard.can:focus-visible, .stage:not([data-preset="phone"]) .hcard.selected {
  transform: translateY(calc(var(--lift, 0em) - var(--raise, 0em))) rotate(var(--rot, 0deg)) rotateX(var(--tilt, 16deg)); }
.stage:not([data-preset="phone"]) .hcard.can:is(:hover, :focus-visible), .stage:not([data-preset="phone"]) .hcard.selected { --tilt: 4deg; }
.stage:not([data-preset="phone"]) .hcard { transition: transform .18s ease-out, filter .18s ease-out; }
/* 同一盏灯（左上暖光）：左上微暖、右下和牌脚压暗；整体和桌上的牌同一调子，不再是「贴在屏幕上的亮图」 */
.hcard .card { filter: sepia(.1) saturate(.92) brightness(.93); }
.hcard .card-in::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(140deg, rgba(255,214,150,.16), transparent 35%, transparent 55%, rgba(20,12,4,.22) 100%),
              linear-gradient(180deg, transparent 45%, rgba(15,8,2,.3) 100%); }
.hcard.can:is(:hover, :focus-visible) .card, .hcard.selected .card { filter: sepia(.04) saturate(1) brightness(1.02); }
/* 纸牌厚度 + 影子落在呢绒上（光从左上来，影子往右下） */
.stage:not([data-preset="phone"]) .hcard .card.full {
  box-shadow: 0 .05em 0 #CFC09A, 0 .1em 0 #8F7C55, .05em .14em .06em rgba(0,0,0,.45), .5em .9em 1.1em rgba(0,0,0,.55); }
.stage:not([data-preset="phone"]) .hcard.selected .card.full {
  box-shadow: 0 0 0 .2em var(--amber), 0 .1em 0 #8F7C55, .6em 1.4em 1.4em rgba(0,0,0,.5); }
/* 手牌的厚度：右边和下边露出一层纸芯（光从左上来，右下是背光面），左上边缘一道受光的细亮线 */
.stage:not([data-preset="phone"]) .hcard .card.full {
  box-shadow: .045em .05em 0 #E4D7B4, .09em .1em 0 #B9A57C, .13em .15em 0 #7C6A47,
              .16em .2em .1em rgba(0,0,0,.5), .6em 1em 1.2em rgba(0,0,0,.55); }
.stage:not([data-preset="phone"]) .hcard.selected .card.full {
  box-shadow: 0 0 0 .2em var(--amber), .2em .25em 0 #7C6A47, .7em 1.5em 1.5em rgba(0,0,0,.5); }
.hcard .card-in::after { box-shadow: inset .05em .05em 0 rgba(255,244,214,.55), inset -.04em -.04em 0 rgba(40,22,6,.35); }

/* ================= 龙头标记（替换「反」字印章）：一枚放在桌上的圆形筹码，不写字 ================= */
/* 持股唯一最多的人面前，压在那一摞右下角的呢绒上；颜色跟品牌色走（--c），中间一顶小冠 */
.seal.token { width: 2.6em; height: 2.6em; border-radius: 50%; transform: none; font-size: 1em; color: transparent; filter: none; position: relative;
  --tc: var(--c, #B23A2E); }
.seal.token > i { position: absolute; inset: 27%; background: linear-gradient(#FFF6D8, #E9C76A 70%, #B98A2E);
  clip-path: polygon(0 88%, 0 22%, 25% 52%, 50% 8%, 75% 52%, 100% 22%, 100% 88%); filter: drop-shadow(0 .04em 0 rgba(0,0,0,.45)); }
.stack .seal.token { position: absolute; top: auto; right: -.75em; bottom: calc(-1 * var(--t, 0em) - .7em); z-index: 4; }
.stack.wide .seal.token { right: -.6em; top: auto; bottom: calc(-1 * var(--t, 0em) * .42 - .5em); font-size: .85em; }
/* A. 铜章：黄铜外圈 + 滚边齿纹，中间一圈品牌色珐琅 */
[data-token="brass"] .seal.token {
  background:
    radial-gradient(circle, var(--tc) 0 47%, #3A2410 48% 50%, transparent 51%),
    radial-gradient(circle at 34% 30%, #FFF1B8, #E2B85A 38%, #B3832F 66%, #7A521A 100%);
  box-shadow: inset 0 0 0 .1em #8A5E1E, inset 0 0 0 .18em rgba(255,236,170,.55), 0 .1em 0 #6E4A16, 0 .16em 0 #4E3410, .12em .28em .35em rgba(0,0,0,.55); }
/* B. 品牌色筹码：品牌色圆盘，外圈六块象牙色嵌片，内圈一道虚线 */
[data-token="chip"] .seal.token, .seal.token.mini, .fx-fly > .seal.token {
  background:
    radial-gradient(circle, var(--tc) 0 44%, rgba(255,245,220,.85) 45% 47%, var(--tc) 48% 60%, transparent 61%),
    repeating-conic-gradient(#F4EAD2 0 18deg, var(--tc) 18deg 60deg);
  box-shadow: inset 0 0 0 .08em rgba(0,0,0,.35), 0 .1em 0 color-mix(in srgb, var(--tc) 60%, #000), 0 .16em 0 color-mix(in srgb, var(--tc) 40%, #000), .12em .28em .35em rgba(0,0,0,.55); }
/* 小号（品牌速览、浮层里）：同一枚，缩小 */
.seal.token.mini { width: 18px; height: 18px; vertical-align: -4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.5); }
.lchip .seal.token.lchip-token { position: absolute; right: -6px; top: -7px; width: 16px; height: 16px; }
.brand-am .seal.token.mini { width: 14px; height: 14px; }
.lchip .seal.token > i { position: absolute; inset: 27%; width: auto; height: auto; right: auto; top: auto; transform: none; box-shadow: none; border-radius: 0;
  background: linear-gradient(#FFF6D8, #E9C76A 70%, #B98A2E); }

/* ================= 卡框 C（B 图鉴风雕版框）：插画窗比卡框 B 大一圈；徽章、铭牌位置不变 ================= */
.card.full .card-art, .stack-top .card-art { left: calc(56cqw / 6); right: calc(61cqw / 6); top: calc(144cqw / 6); bottom: calc(239cqw / 6); }
/* 插画窗挖空了：投资摞上有插画的牌也要垫米色底（上面 .stack.has-art … { background: none } 会把它清掉） */
.stack.has-art .stack-top .card-in .card-art.illus { background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--c) 10%, #FBF4E2), color-mix(in srgb, var(--c) 6%, #F1E6CC) 75%); }

/* ================= 试玩反馈（2026-11-06） ================= */
/* 卡框 C 裁掉了四周透明边、贴满牌面：几何按裁后的 600×800 算（由 scripts/prepare-card-frame-c.py 生成，2026-11-06 换新母版） */
.card.full .card-art, .stack-top .card-art { left: calc(56.8cqw / 6); right: calc(60.9cqw / 6); top: calc(147.5cqw / 6); bottom: calc(129.6cqw / 6); }
/* 牌名（2026-11-06 第二版，照效果图）：粗黑体大字，米白胶囊压在插画窗底边；名字按宽度缩字号，5 个字以内不缩 */
.card.full .card-plate, .stack-top .card-plate { display: grid; left: calc(62cqw / 6) !important; right: calc(66cqw / 6) !important; bottom: calc(118cqw / 6) !important; height: calc(104cqw / 6) !important;
  border-radius: calc(52cqw / 6); background: linear-gradient(#FFFBEF, #F1E6CC); box-shadow: inset 0 0 0 calc(5cqw / 6) color-mix(in srgb, var(--c) 80%, #000), 0 calc(4cqw / 6) calc(8cqw / 6) rgba(0,0,0,.3); }
.card.full .card-name, .stack-top .card-name { font: 900 calc(78cqw / 6 * var(--nf, 1))/1 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", var(--sans) !important; letter-spacing: .02em; color: #24170B; }
.card.full .card-name small { display: none; }
/* 股数：粗体大数字 */
.card.full .card-corner, .stack-top .card-corner { font: 900 calc(92cqw / 6)/1 "PingFang SC", "Hiragino Sans GB", var(--sans) !important; color: #24170B; text-shadow: 0 1px 0 rgba(255,250,236,.9); }
.card.full .card-corner, .stack-top .card-corner { left: calc(61.3cqw / 6); top: calc(40.6cqw / 6); width: calc(110.4cqw / 6); height: calc(110.4cqw / 6); font-size: calc(70.7cqw / 6); }
.card.full .card-plate, .stack-top .card-plate { left: calc(81.8cqw / 6); right: calc(84.3cqw / 6); bottom: calc(134.2cqw / 6); height: calc(77.6cqw / 6); }
/* 摸完牌牌堆按钮变 disabled：不要全局 button:disabled 的半透明（会透出下面的纸边，看着发白） */
.deck-hit:disabled { opacity: 1; cursor: default; }
/* 自己的投资摞不再描金框 */
.stack.mine .stack-top { box-shadow: 0 .12em 0 color-mix(in srgb, var(--c) 55%, #000), 0 .18em .2em rgba(0,0,0,.45); }
/* 桌上的牌竖向拉回 3:4（--unsq = 1/cos θ，renderPlane 设）；牌上的圆筹码、张数角标反向压回去，保持正圆 */
#plane .stack:not(.wide), #market .card.full { scale: 1 var(--unsq, 1); }
#plane .stack:not(.wide) > .seal.token, #plane .stack:not(.wide) > .stack-count { scale: 1 calc(1 / var(--unsq, 1)); }
/* 张数角标：右上角一枚小圆牌 */
.stack-count { position: absolute; z-index: 6; top: -.55em; right: -.55em; min-width: 1.7em; height: 1.7em; padding: 0 .3em; box-sizing: border-box; border-radius: .85em;
  display: grid; place-items: center; font: 900 .85em/1 var(--serif); color: #2B1D10; background: radial-gradient(circle at 40% 35%, #FFF6DA, #E9D29A);
  box-shadow: inset 0 0 0 .08em color-mix(in srgb, var(--c) 75%, #000), 0 .08em .15em rgba(0,0,0,.5); pointer-events: none; }
.stack.wide > .stack-count { top: -.45em; right: -.45em; font-size: .7em; }
/* 拖牌：不再画椭圆光斑；悬停的落点那一侧保持亮，另一侧整片压暗（#drag-shade，hand-drag.js） */
.zone.drop-ok, .my-zone.drop-ok, .zone.drop-bad, .my-zone.drop-bad,
.zone.drop-ok.drop-hover, .my-zone.drop-ok.drop-hover, .zone.drop-bad.drop-hover, .my-zone.drop-bad.drop-hover { background: none !important; border: 0 !important; box-shadow: none !important; }
.drag-shade { position: fixed; inset: 0; z-index: 55; pointer-events: none; opacity: 0; transition: opacity .15s; }
.drag-shade.on { opacity: 1; }

/* ================= ?theme=cartoon：卡通风桌面、头像（布局同圆角长方形桌） ================= */
/* 桌面招牌上已经写了「老品牌股份」，顶栏标题不再重复 */
.stage[data-theme="cartoon"] .hud-title { visibility: hidden; }
/* 空牌堆：浅色台面上不要那团投影 */
.deck.empty::after { display: none; }
/* 卡通主题的牌背（assets/table/cartoon/card-back.webp，四角透明） */
.stage[data-theme="cartoon"] .card.back, .stage[data-theme="cartoon"] .deck-hit::before, .stage[data-theme="cartoon"] .deck-hit::after { background-image: url(../assets/table/cartoon/card-back.webp?v=ffaba36e14); background-color: transparent; }
.stage[data-theme="cartoon"] .hb { background-image: url(../assets/table/cartoon/card-back.webp?v=ffaba36e14); }
/* 牌堆（2026-11-06 重做）：和市场牌一样竖向拉回 3:4；厚度按真实比例（满堆约牌高的 6%），只在下方露出；
   侧边一律是米白纸边（真牌背面再深，侧边也是纸），加一圈深色细边和落地影，浅色、深色桌面上都分得开；不再画两张歪着的牌 */
#plane #deck { scale: 1 var(--unsq, 1); }
#plane #deck > :is(.deck-left, .deck-cost) { scale: 1 calc(1 / var(--unsq, 1)); }
.deck-hit::before, .deck-hit::after { display: none; }
.deck::before { left: 0; right: 0; top: auto; height: calc(2em + var(--th, .5em)); bottom: calc(-1 * var(--th, .5em)); border-radius: 0 0 .5em .5em / 0 0 .4em .4em;
  background: linear-gradient(180deg, #F6EEDA, #E6D7B2 85%, #D2BF94);
  box-shadow: 0 0 0 .04em rgba(40,25,10,.55), 0 .15em .3em rgba(0,0,0,.35); }
.deck .card.back, .deck-hit .card { box-shadow: 0 0 0 .04em rgba(20,15,10,.5); }
.stage[data-theme="cartoon"] .deck::before { box-shadow: 0 0 0 .04em rgba(60,35,10,.6), 0 .2em .35em rgba(90,50,10,.3); }
/* 两侧对手的气泡跟在铭牌外侧（左边座位在铭牌右边，右边座位在铭牌左边），不再顶到窗户和顶栏 */
.stage:not([data-preset="phone"]) .seat[data-bubble="before"] .bubble { top: 50%; translate: 0 -50%; left: auto; right: calc(100% - 16px + 138px + 10px); }
.stage:not([data-preset="phone"]) .seat[data-bubble="in-r"] .bubble { top: 50%; translate: 0 -50%; left: calc(100% + 8px); }
.stage:not([data-preset="phone"]) .seat[data-bubble="in-l"] .bubble { top: 50%; translate: 0 -50%; left: auto; right: calc(100% + 8px); }

/* ================= ?theme=cartoon：简约卡框 S（2026-11-06，assets/table/card-frame-s，scripts/prepare-card-frame-s.py） =================
   宽品牌色外框 + 顶部正中股数圆章 + 底部米色名条；牌铺满槽位（布局按卡框比例 1:1.223 给尺寸）。
   横向用 cqw（牌宽 100），竖向用 cqh（卡框高 122.3 = 100cqh）：桌上的牌在平面里矮一些、再竖向拉回，按高度百分比才对得上卡框 */
.stage[data-theme="cartoon"] :is(.card.full, .stack:not(.wide)) { width: 100cqw; height: 100cqh; border-radius: 7cqw; }
.stage[data-theme="cartoon"] :is(.card.full, .stack-top) .card-in, .stage[data-theme="cartoon"] .stack-top { border-radius: 7cqw; }
.stage[data-theme="cartoon"] .stack .edge, .stage[data-theme="cartoon"] .stack:not(.wide)::before { border-radius: 7cqw; }
.stage[data-theme="cartoon"] .card.full .card-in .card-art, .stage[data-theme="cartoon"] .stack-top .card-in .card-art {
  left: 8cqw; right: 8cqw; top: 19.1cqh; bottom: 23.8cqh;
  background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--c) 8%, #FFF8EA), color-mix(in srgb, var(--c) 22%, #F4E6CC) 85%); }
.stage[data-theme="cartoon"] :is(.card.full, .stack-top) .card-art.illus img { inset: 5% 6% 3%; width: 88%; height: 92%; }
.stage[data-theme="cartoon"] .card.full .card-plate, .stage[data-theme="cartoon"] .stack-top .card-plate {
  left: 10cqw !important; right: 10cqw !important; bottom: auto !important; top: 78.8cqh; height: 13cqh !important; border-radius: 0; background: none; box-shadow: none; }
/* 牌名：中等字重的黑体，小一号，不再厚重；5 个字以上按宽度缩 */
.stage[data-theme="cartoon"] .card.full .card-name, .stage[data-theme="cartoon"] .stack-top .card-name {
  font: 500 calc(12cqw * var(--nf, 1))/1 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", var(--sans) !important; letter-spacing: .06em; color: #3B2A17; }
.stage[data-theme="cartoon"] .card.full .card-corner, .stage[data-theme="cartoon"] .stack-top .card-corner {
  left: 36.3cqw; top: 2.5cqh; width: 27.4cqw; height: 21.8cqh; background: none; box-shadow: none; z-index: 3;
  font: 700 15cqw/1 "PingFang SC", "Hiragino Sans GB", var(--sans) !important; color: color-mix(in srgb, var(--c) 55%, #2A1A0A); text-shadow: none; }
/* 名条两头的小圆点（旧样式的 ::before/::after）不要 */
.stage[data-theme="cartoon"] .card-plate::before, .stage[data-theme="cartoon"] .card-plate::after { display: none; }
/* 市场牌上的硬币挪到左上角外侧（股数在正中，左上角只有叶子），不压名条 */
.stage[data-theme="cartoon"] .coins.on-card { left: -.7em; top: -.9em; bottom: auto; transform: none; }

/* ===== ?theme=cartoon：插画探出窗口（2026-11-06）=====
   插画层压到卡框上面，底部贴窗口下沿、往上伸出窗口上沿，更饱满、有立体感；
   卡框顶部正中的圆章会挡住瓶盖，已从卡框图里抹掉（prepare-card-frame-s.py）；股数改成右上角一枚小圆章，压在插画上面 */
.stage[data-theme="cartoon"] :is(.card.full, .stack-top) .card-in .card-art.illus { overflow: visible; z-index: 2; background: none; }
.stage[data-theme="cartoon"] :is(.card.full, .stack-top) .card-art.illus img { top: auto; bottom: 1%; left: -3%; width: 106%; height: 116%; }
.stage[data-theme="cartoon"] :is(.card.full, .stack-top) .card-in::before { content: ""; position: absolute; z-index: 0; left: 8cqw; right: 8cqw; top: 19.1cqh; bottom: 23.8cqh;
  background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--c) 8%, #FFF8EA), color-mix(in srgb, var(--c) 22%, #F4E6CC) 85%); }
.stage[data-theme="cartoon"] .card.full .card-corner, .stage[data-theme="cartoon"] .stack-top .card-corner {
  left: 74.5cqw; top: 2.6cqh; width: 21cqw; height: 17.2cqh; border-radius: 50%; z-index: 4; font-size: 13cqw !important;
  background: radial-gradient(circle at 40% 35%, #FFFBF0, #F3E6CA 80%);
  box-shadow: 0 0 0 1.2cqw color-mix(in srgb, var(--c) 60%, #3B2A17), 0 .6cqw 1.2cqw rgba(0,0,0,.25); }
/* 牌摞张数 ×N 让出右上角给股数，挪到左上角外侧（牌摞上没有硬币） */
.stage[data-theme="cartoon"] .stack > .stack-count { right: auto; left: -.55em; }
/* 市场牌上的硬币：只画一枚，数字写在币面正中（多枚叠着容易看成牌摞） */
.stage[data-theme="cartoon"] .coins.on-card i:not(:first-child) { display: none; }
.stage[data-theme="cartoon"] .coins.on-card b { left: 0; right: auto; }

/* ===== ?theme=cartoon：浅色 HUD + 每位玩家的粉彩底板（2026-11-07，照选中的卡通效果图）=====
   深棕面板换成米白纸面 + 木色描边、深棕字；每位玩家的投资区、市场垫一块淡色圆角底板（座位随人数变，由程序画） */
.stage[data-theme="cartoon"] {
  --cp-paper: #FFF7E6; --cp-paper2: #F6E7C8; --cp-edge: #B98A4E; --cp-ink: #4A2E14; --cp-sub: #8A6A45; }
.stage[data-theme="cartoon"] :is(.plate, .status, .legend, .actions, .prompt) {
  background: linear-gradient(var(--cp-paper), var(--cp-paper2)) !important; color: var(--cp-ink) !important;
  box-shadow: inset 0 0 0 2px var(--cp-edge), 0 3px 8px rgba(90,50,15,.28) !important; text-shadow: none !important; }
.stage[data-theme="cartoon"] .actions .prompt { box-shadow: none !important; background: none !important; }
.stage[data-theme="cartoon"] :is(.plate, .status, .legend, .actions) :is(b, small, span, em, strong, p, label) { color: inherit; text-shadow: none; }
.stage[data-theme="cartoon"] .plate small, .stage[data-theme="cartoon"] .legend small { color: var(--cp-sub) !important; }
.stage[data-theme="cartoon"] .status b { color: #C2410C !important; }
.stage[data-theme="cartoon"] .hud-tools :is(button.ghost, a.ghost, select), .stage[data-theme="cartoon"] .hud-tools .speed {
  background: linear-gradient(var(--cp-paper), var(--cp-paper2)) !important; color: var(--cp-ink) !important;
  box-shadow: inset 0 0 0 1.5px var(--cp-edge), 0 2px 5px rgba(90,50,15,.25) !important; border: 0 !important; text-shadow: none !important; }
.stage[data-theme="cartoon"] .hud-tools .speed { padding: 3px 4px 3px 10px; border-radius: var(--r-sm, 8px); }
.stage[data-theme="cartoon"] .hud-tools .speed select { box-shadow: none !important; background: none !important; }
.stage[data-theme="cartoon"] .hud-tools button.ghost:disabled { color: rgba(74,46,20,.4) !important; }

/* 文字：铭牌名字、硬币数、未进行的步骤、品牌速览标签都换成深棕 */
.stage[data-theme="cartoon"] .seat .plate b, .stage[data-theme="cartoon"] .plate .coins b { color: var(--cp-ink) !important; }
.stage[data-theme="cartoon"] .prompt li:not(.now) { color: var(--cp-sub) !important; }
.stage[data-theme="cartoon"] #brands > :is(span, b, small, h3, header, summary) { color: var(--cp-sub) !important; }

/* 粉彩底板：对手投资区（seat-zone）、我的投资区、市场。颜色很淡、几乎没有边框，只是把各家的牌拢成一块 */
.stage[data-theme="cartoon"] :is(.seat-zone, .my-zone) { --zc: #F4D9DE;
  background: color-mix(in srgb, var(--zc) 38%, transparent) !important; border: 0 !important;
  border-radius: 20px; box-shadow: none !important; }
.stage[data-theme="cartoon"] .seat-zone[data-zone="1"] { --zc: #E4DCF3; }
.stage[data-theme="cartoon"] .seat-zone[data-zone="2"] { --zc: #F6D8D6; }
.stage[data-theme="cartoon"] .seat-zone[data-zone="3"] { --zc: #DCEBD6; }
.stage[data-theme="cartoon"] .seat-zone[data-zone="4"] { --zc: #F8E3C8; }
.stage[data-theme="cartoon"] .seat-zone[data-zone="5"] { --zc: #D9E7F2; }
.stage[data-theme="cartoon"] .seat-zone[data-zone="6"] { --zc: #F3E8BE; }
.stage[data-theme="cartoon"] .my-zone { --zc: #F7DCC6; }
.stage[data-theme="cartoon"] .seat-zone.empty { background: color-mix(in srgb, var(--zc) 22%, transparent) !important; }
.stage[data-theme="cartoon"] .zone { z-index: 1; pointer-events: none; /* 只是底板，不能挡住下面没硬币的市场牌 */ background: none !important; border: 0 !important; border-radius: 20px; }
/* 市场只留一块「市场」小铭牌（和名牌同一套纸色），空着时不写说明 */
.stage[data-theme="cartoon"] .zone > span { display: block !important; background: linear-gradient(#FFF7E6, #F6E7C8); color: #6B4416; box-shadow: inset 0 0 0 1.5px #C9A25A, 0 2px 4px rgba(90,50,15,.18); border-radius: 999px; padding: 0 14px; font: 800 14px/24px var(--serif); letter-spacing: .3em; text-indent: .3em; top: -12px; }
.stage[data-theme="cartoon"][data-preset="phone"] .zone > span { font-size: 10px; line-height: 17px; padding: 0 8px; top: -8px; }
.stage[data-theme="cartoon"] #me-seat .plate > b { color: #FFF3DC !important; }
.stage[data-theme="cartoon"] #brands .legend-head, .stage[data-theme="cartoon"] #brands .legend-head * { color: var(--cp-sub) !important; }
.stage[data-theme="cartoon"] #brands .lchip { color: #FFF8EA !important; text-shadow: 0 1px 1px rgba(40,20,5,.45) !important; }
.stage[data-theme="cartoon"][data-preset="phone"] .zone > span { font-size: 8px; line-height: 13px; padding: 0 6px; top: -7px; }
/* 超出常见数量（每人 5 种以上）时整组缩小：不写牌名，插画占满（table-layout.js miniOverflow） */
.stage[data-theme="cartoon"] .stack-slot.mini .card-plate { display: none; }

/* ===== ?theme=cartoon：无桌沿纸面背景（2026-11-07 第三轮）=====
   舞台外的留边用背景上下沿的颜色接上；手机舞台更扁，背景贴下沿（上沿招牌裁掉，免得和提示条叠在一起） */
.viewport:has(.stage[data-theme="cartoon"]) { background: linear-gradient(#EFE3DA, #FDE7CA); }
.stage[data-theme="cartoon"] .table-art { filter: none; }
.stage[data-theme="cartoon"][data-preset="phone"] .table-art { background-position: center bottom; }
.stage[data-theme="cartoon"] .my-zone.tight { background: none !important; }
.stage[data-theme="cartoon"] .my-zone.tight > span { visibility: hidden; }
.stage[data-theme="cartoon"] .seat-zone.mine-bg { --zc: #F7DCC6; }
.stage[data-theme="cartoon"] .seat-zone.empty:not(.mine-bg) { display: none; }

/* 点了不能拿的市场牌：左右晃一下；你那摞上的反垄断标记跳一下（app.js nope） */
.mcard.blocked { cursor: not-allowed; }
.mcard.nope { animation: nope-shake .42s ease; }
@keyframes nope-shake { 0%, 100% { translate: 0 0; } 20% { translate: -.35em 0; } 40% { translate: .3em 0; } 60% { translate: -.2em 0; } 80% { translate: .1em 0; } }
.mcard.nope .why-tag { animation: nope-tag .42s ease; }
@keyframes nope-tag { 30% { scale: 1.18; } }
.seal.nope-seal { animation: nope-seal .6s ease; }
@keyframes nope-seal { 0%, 100% { scale: 1; } 30% { scale: 1.45; filter: drop-shadow(0 0 .4em #FFD54A); } 60% { scale: .95; } }

/* ===== ?theme=cartoon：顶上状态条去掉（屏幕阅读器照读）；轮到谁用青绿色高亮（奶白底上和黄色区分开） ===== */
.stage[data-theme="cartoon"] .status:not(.has-round) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); box-shadow: none; }
.stage[data-theme="cartoon"] { --turn: #0E9F8C; --turn-glow: rgba(14,159,140,.55); }
.stage[data-theme="cartoon"] .seat.active .avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--turn), 0 0 22px 4px var(--turn-glow) !important; animation: turn-pulse 1.6s ease-in-out infinite; }
.stage[data-theme="cartoon"] .seat.active .plate { box-shadow: inset 0 0 0 2.5px var(--turn), 0 0 14px var(--turn-glow) !important; }
@keyframes turn-pulse { 50% { filter: brightness(1.08); scale: 1.06; } }
@media (prefers-reduced-motion: reduce) { .stage[data-theme="cartoon"] .seat.active .avatar { animation: none; } }
/* 教学提示学会以后收起来（app.js app.taught），有特殊情况时再出现 */
.actions.quiet { display: none; }
.actions.quiet .steps { display: none; }
/* 卡通主题：手牌悬停 / 选中抬起放慢一点（原来 .16s 太急） */
.stage[data-theme="cartoon"] #hand .hcard { transition: transform .38s cubic-bezier(.22, .8, .3, 1), filter .3s ease-out; }
/* 状态条收起后顶栏按钮仍靠右（原来靠状态条 margin auto 撑开） */
.stage[data-theme="cartoon"] .hud-tools { margin-left: auto; }

/* ===== ?theme=cartoon：市场牌上的硬币压在牌中间、几枚散放（1–3 枚照画，超过 3 枚画 3 枚 + ×N）=====
   硬币先用 CSS 画（金色、深棕描边、中间 ¥）；ChatGPT 的 coin.png 到了再换 */
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card { left: 50%; top: 46%; right: auto; bottom: auto; transform: none; width: 0; height: 0; display: block; z-index: 5; font-size: 1em; }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card i { position: absolute; display: block !important; margin: 0; left: -1.1em; top: -1.1em; width: 2.2em; height: 2.2em;
  border-radius: 50%; box-sizing: border-box; border: .12em solid #6B4413; filter: none;
  background: radial-gradient(circle at 34% 28%, rgba(255,250,215,.95) 0 9%, transparent 10%), radial-gradient(circle, #FAD25A 0 50%, #D99A26 51% 57%, #F6C743 58% 100%);
  box-shadow: inset 0 -.15em 0 rgba(150,90,20,.55), 0 .1em .15em rgba(80,45,10,.35); }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card i::after { content: "¥"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 900 1em/1 Georgia, serif; color: #A86A12; text-shadow: 0 .05em 0 rgba(255,240,190,.9); }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card i:nth-child(2) { transform: translate(.75em, -.45em); }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card i:nth-child(3) { transform: translate(-.45em, -.95em); }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card i:nth-child(n+4) { display: none !important; }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card b { display: none; }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card.many b { display: grid; position: absolute; left: .9em; top: .3em; right: auto; transform: none; width: auto; height: 1.1em; padding: 0 .35em;
  border-radius: .55em; place-items: center; background: #4A2E14; color: #FFE9A8; font: 800 .7em/1 var(--sans); text-shadow: none; box-shadow: 0 0 0 .1em #FFF3DC; }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card.many b::before { content: "×"; }
.stage[data-theme="cartoon"] #market .mcard .why-tag { z-index: 6; }

/* ===== ?theme=cartoon：ChatGPT 画的硬币、皇冠标记（assets/table/cartoon/coin.webp、crown.webp，scripts/prepare-tokens-cartoon.py）=====
   皇冠图只有皇冠，底座用品牌色画（每个品牌的标记颜色不同）；标记压在那摞牌的正中间 */
.stage[data-theme="cartoon"] .coins i { background: url(../assets/table/cartoon/coin.webp?v=4af8875116) center / contain no-repeat; }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card i { border: 0; box-shadow: none; background: url(../assets/table/cartoon/coin.webp?v=4af8875116) center / contain no-repeat;
  filter: drop-shadow(0 .08em .1em rgba(80,45,10,.4)); }
.stage[data-theme="cartoon"] :is(#market, .tu-mkt) .coins.on-card i::after { content: none; }
.stage[data-theme="cartoon"] .seal.token, .stage[data-theme="cartoon"] .fx-fly > .seal.token {
  background: var(--tc) !important; box-sizing: border-box; border: .1em solid #4A2E14;
  box-shadow: inset 0 0 0 .12em rgba(255,255,255,.28), 0 .1em .18em rgba(60,35,10,.4) !important; }
.stage[data-theme="cartoon"] .seal.token > i, .stage[data-theme="cartoon"] .lchip .seal.token > i { inset: -.1em; clip-path: none; filter: none; border-radius: 0;
  background: url(../assets/table/cartoon/crown.webp?v=fb8c0ac797) center / contain no-repeat; }
.stage[data-theme="cartoon"] .seal.token.mini, .stage[data-theme="cartoon"] .lchip .seal.token { border-width: 1px; }
.stage[data-theme="cartoon"] .stack .seal.token, .stage[data-theme="cartoon"] .stack.wide .seal.token {
  left: 50%; top: 46%; right: auto; bottom: auto; translate: -50% -50%; width: 44cqw; height: 44cqw; font-size: 1em; z-index: 5; }

/* ---------- 终局：亮手牌、逐个品牌结算 ---------- */
.score-banner {
  position: fixed; left: 50%; top: 41%; transform: translate(-50%, -50%); z-index: 60;
  display: flex; align-items: center; gap: .5em; max-width: calc(100vw - 32px);
  padding: .55em 1.2em; border-radius: 999px; pointer-events: none;
  background: rgba(255, 250, 240, .96); color: #3b2a1a; border: 2px solid #4A2E14;
  box-shadow: 0 6px 18px rgba(60, 35, 10, .28); font: 600 clamp(13px, 1.5vw, 20px)/1.3 inherit;
  animation: sb-in .25s ease-out;
}
.score-banner[hidden] { display: none; }
.score-banner b { font-weight: 800; }
.score-banner .sb-brand {
  display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 800; text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
@keyframes sb-in { from { opacity: 0; transform: translate(-50%, -40%); } }
.stack-slot.scoring { filter: drop-shadow(0 0 .5em rgba(14, 159, 140, .9)); z-index: 4; }
.stack-slot.scoring.boss { filter: drop-shadow(0 0 .7em rgba(240, 180, 30, 1)); animation: sb-boss .8s ease-in-out infinite alternate; }
@keyframes sb-boss { to { transform: translateY(-4%); } }

/* 正面 1 元、反面 3 元的硬币（cartoon/coin-3.webp；字只留给读屏） */
.coin3 { display: inline-block; width: 1em; height: 1em; background: url(../assets/table/cartoon/coin-3.webp?v=0259e7fd5d) center / contain no-repeat; }
.coin3 b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.flipcoin { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; animation: coin-flip var(--d, 900ms) ease-in-out forwards; }
.flipcoin > i { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipcoin .f1 { background: url(../assets/table/cartoon/coin.webp?v=4af8875116) center / contain no-repeat; }
.flipcoin .f3 { transform: rotateY(180deg); font-size: inherit; }
@keyframes coin-flip { 0%, 62% { transform: rotateY(0); } 100% { transform: rotateY(180deg); } }
.c3.flip3 { font-size: 15px; color: #6B3E10; font-weight: 800; gap: 3px; }
.c3.flip3::before { display: none; }
.c3.flip3 em { font-style: normal; font-size: 13px; }
/* 结算中：只亮正在结算的那个品牌，其他牌摞和市场（不计分）压暗 */
#stacks .stack-slot { transition: opacity .3s, filter .3s; }
#stacks.scoring-on .stack-slot:not(.scoring) { opacity: .35; filter: grayscale(.5); }
.stage.ending #market { opacity: .35; filter: grayscale(.4); transition: opacity .4s; }
/* 控股者牌摞上压着的 3 元硬币（右下，避开中间的皇冠） */
.stack-slot .paid3 { position: absolute; left: 70%; top: 72%; width: 0; height: 0; z-index: 6; font-size: 34cqw; pointer-events: none; }
.paid3 .coin3 { position: absolute; left: -.5em; top: -.5em; filter: drop-shadow(0 .06em .08em rgba(60, 30, 5, .45)); }
.paid3 .coin3[style*="--i:1"] { translate: -.42em -.3em; }
.paid3 .coin3[style*="--i:2"] { translate: .1em -.62em; }
.paid3 em { position: absolute; left: .2em; top: .05em; font: 800 .42em/1 system-ui, sans-serif; font-style: normal; color: #fff;
  background: #8A2E0C; border: .08em solid #FFE08A; border-radius: 999px; padding: .12em .35em; white-space: nowrap; }
/* 算总分：名牌里的计分 */
.stage .plate .tally { display: inline-block; margin-left: .35em; padding: .05em .5em; border-radius: 999px; background: #0E9F8C; color: #fff !important;
  font: 900 1.05em/1.15 Georgia, 'Times New Roman', serif; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.stage[data-preset="phone"] .c3.flip3 { font-size: 9px; gap: 1px; }
.stage[data-preset="phone"] .c3.flip3 em { font-size: 8px; }
.stage[data-preset="phone"] .plate .tally { font-size: 9px; margin-left: .2em; padding: 0 .35em; }

/* 摸牌/拿牌待确认：牌抬起 + 头顶气泡（再点一下执行） */
.mcard.armed { transform: translateY(-.45em); z-index: 8; }
.deck-hit.armed { z-index: 8; }
/* 市场牌气泡放下方：上方常是对手的牌，会盖住气泡 */
.mcard .arm-bub { bottom: auto; top: calc(100% + .7em); }
.mcard .arm-bub::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--turn, #1D9E75); }
/* 牌堆气泡放左侧：上方会被对手刚打出的牌（.fx 层）挡住，右侧是市场 */
.deck-hit .arm-bub { left: auto; right: calc(100% + .7em); bottom: auto; top: 50%; transform: translateY(-50%); animation-name: arm-pop-side; }
.deck-hit .arm-bub::after { left: 100%; top: 50%; transform: translateY(-50%); border-top-color: transparent; border-left-color: var(--turn, #1D9E75); }
@keyframes arm-pop-side { from { opacity: 0; transform: translate(.4em, -50%) scale(.9); } }
.arm-bub { position: absolute; left: 50%; bottom: calc(100% + .7em); transform: translateX(-50%); display: flex; align-items: center; gap: .45em;
  padding: .35em .45em .35em .8em; border-radius: 999px; background: #FFFBF0; border: .14em solid var(--turn, #1D9E75); color: #3B2A12;
  font-size: max(13px, .95em); font-weight: 700; white-space: nowrap; box-shadow: 0 .25em .6em rgba(60,40,10,.3); z-index: 9; animation: arm-pop .16s ease-out; }
.arm-bub::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: .45em solid transparent; border-top-color: var(--turn, #1D9E75); }
.arm-bub b { color: #B4560B; font-size: 1.15em; }
.arm-ok { font-style: normal; background: var(--turn, #1D9E75); color: #fff; border-radius: 999px; padding: .2em .7em; }
@keyframes arm-pop { from { opacity: 0; transform: translate(-50%, .4em) scale(.9); } }
.stage[data-preset="phone"] .arm-bub { font-size: 10px; border-width: 1.5px; bottom: calc(100% + 6px); }
.stage[data-preset="phone"] .mcard .arm-bub { bottom: auto; top: calc(100% + 6px); }
.stage[data-preset="phone"] .deck-hit .arm-bub { bottom: auto; right: calc(100% + 6px); }

/* ================= 结算页（.res）：电脑版 = 总值表 + 本局收获 + 可展开的品牌明细；手机横屏 .res-phone = 名次列表 + 一行收获标签 ================= */
.modal-box.res { display: flex; flex-direction: column; overflow: visible; position: relative; }
.res .res-body { overflow: auto; min-height: 0; flex: 1 1 auto; }
.res .res-crown { display: inline-block; width: 1.2em; height: 1.2em; margin-right: .3em; vertical-align: -.22em; background: url(../assets/table/cartoon/crown.webp?v=fb8c0ac797) center / contain no-repeat; }
.res .res-label { margin: 6px 0 4px; }
.res .res-detail { margin-top: 10px; font-size: 13px; }
.res .res-detail summary { cursor: pointer; color: #7A5A30; font-weight: 700; }
.res .modal-actions { justify-content: center; flex: none; }
.res .modal-actions small { display: block; font-size: .62em; font-weight: 600; opacity: .8; line-height: 1.1; }

/* 卡通主题：红边金角外框（九宫格）、红绶带标题压在上边框、金按钮 */
.modal-box.res-cartoon { border: 30px solid transparent; border-image: url(../assets/table/cartoon/result-frame.webp?v=ac45af0fd7) 100 fill / 64px; background: none;
  padding: 34px 26px 14px; filter: drop-shadow(0 18px 30px rgba(40,20,5,.55)); color: #3A2410; }
.res-cartoon .res-ribbon { position: absolute; left: 50%; top: -66px; transform: translateX(-50%); width: min(500px, 74%); aspect-ratio: 1171 / 171;
  background: url(../assets/table/cartoon/result-ribbon.webp?v=5506856b21) center / 100% 100% no-repeat; display: grid; place-items: center; z-index: 2; }
.res-cartoon .res-ribbon h2 { margin: 0 0 .25em; font: 800 26px var(--serif); color: #FFE7B0; letter-spacing: .08em; text-shadow: 0 2px 0 #6E1A0E, 0 0 6px rgba(80,10,0,.5); white-space: nowrap; }
.res-cartoon .res-label { font: 800 17px var(--serif); color: #6B4416; letter-spacing: .1em; }
.res-cartoon table.result { border-collapse: separate; border-spacing: 0; background: #FFF8EA; border: 1.5px solid #E2C99A; border-radius: 12px; overflow: hidden; font-size: 16px; }
.res-cartoon table.result thead th { background: #F3E3C2; color: #5A3A14; font: 800 15px var(--serif); padding: 8px 6px; border-bottom: 1.5px solid #E2C99A; }
.res-cartoon table.result td, .res-cartoon table.result tbody th { padding: 7px 6px; border-bottom: 1px dashed #E6D4AE; font-variant-numeric: tabular-nums; }
.res-cartoon table.result tbody tr:last-child > * { border-bottom: 0; }
.res-cartoon table.res-total tbody th { text-align: center; font-weight: 700; }
.res-cartoon table.res-total td b { font-size: 1.15em; color: #A2361A; }
.res-cartoon table.result tr.me { background: #FBE6D6; }
.res-cartoon table.result tr.win { background: linear-gradient(90deg, #FBDD8F, #FDEBB8 50%, #FBDD8F); font-weight: 800; }
.res-cartoon .final { font: 700 15px var(--serif); color: #6B4416; text-align: center; margin: 8px 0 0; }
.res-cartoon .archive-harvest { background: #FFF8EA; border: 1.5px solid #E2C99A; border-radius: 12px; margin-top: 30px; padding: 26px 18px 10px; position: relative; }
.res-cartoon .archive-harvest .ah-head { display: block; }
.res-cartoon .archive-harvest h3 { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); width: 280px; height: 44px; display: grid; place-items: center; padding-bottom: 4px; box-sizing: border-box;
  background: url(../assets/table/cartoon/result-ribbon.webp?v=5506856b21) center / 100% 100% no-repeat; color: #FFE7B0; font: 800 18px var(--serif); letter-spacing: .15em; text-shadow: 0 1px 0 #6E1A0E; }
.res-cartoon .archive-harvest .ah-open { position: absolute; right: 16px; top: 8px; }
.res-cartoon .modal-actions { gap: 22px; margin-top: 14px; }
.res-cartoon .modal-actions button { border: 0; border-image: none; filter: drop-shadow(0 4px 3px rgba(60,30,5,.35)); font: 800 18px var(--serif); color: #5A3A14;
  height: 52px; padding: 0 28px; border-radius: 999px; background: #FBF1DC; box-shadow: inset 0 0 0 2px #C9A25A, inset 0 -3px 0 rgba(150,110,50,.25); }
.res-cartoon .modal-actions button.primary { width: 250px; height: 64px; padding: 0 56px; border-radius: 0; box-shadow: none; color: #5A3306; font-size: 23px; letter-spacing: .12em;
  background: url(../assets/table/cartoon/result-button.webp?v=c22bf810cd) center / 100% 100% no-repeat; text-shadow: 0 1px 0 rgba(255,240,190,.8); }
.res-cartoon .modal-actions button:not(:disabled):hover { filter: drop-shadow(0 6px 4px rgba(60,30,5,.4)) brightness(1.05); }

/* 手机横屏简化版 */
.res-phone .res-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 15px; }
.res-phone .res-rank li { display: grid; grid-template-columns: 30px 1fr auto 60px; align-items: center; padding: 5px 12px; border-radius: 8px; }
.res-phone .res-rank li b { text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; }
.res-phone .res-rank .pt { font-size: 11px; color: #7A5A30; }
.res-phone .res-rank li.me { background: #FBE6D6; }
.res-phone .res-rank li.win { background: linear-gradient(90deg, #FBDD8F, #FDEBB8 50%, #FBDD8F); font-weight: 800; }
.res-phone .res-rank li.me b { color: #A2361A; }
.res-phone .final { font-size: 12px; margin: 4px 0 0; }
.res-phone #btn-close, .res-phone .ah-go, .res-phone .ah-open, .res-phone .ah-bar, .res-phone .ah-pct, .res-phone .ah-sum, .res-phone .ah-idle, .res-phone .ah-note, .res-phone .ah-empty { display: none !important; }
.res-phone .archive-harvest:not(:has(.ah-row)) { display: none; }
.res-phone .archive-harvest { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 8px 0 0; padding: 7px 0 0; border: 0; border-top: 1px dashed #BA8A3E; border-radius: 0; background: none; font-size: 12px; }
.res-phone .archive-harvest .ah-head, .res-phone .archive-harvest .ah-list { display: contents; }
.res-phone .archive-harvest h3 { position: static; transform: none; width: auto; height: auto; background: none; padding: 0; margin: 0 2px 0 0; font: 700 12px var(--sans); color: #8A5A1E; letter-spacing: 0; text-shadow: none; }
.res-phone .archive-harvest .ah-row { display: inline-flex; gap: 4px; align-items: center; padding: 2px 9px; border: 0; border-radius: 999px; background: #fff; }
.res-phone .archive-harvest .ah-gain { font-size: 12px; }
.res-phone .archive-harvest .ah-gain { font-weight: 700; }
.res-phone .archive-harvest .ah-new { display: inline; }
.res-phone .archive-harvest .ah-new a { font-size: 0; padding: 0; background: none; border: 0; text-decoration: none; }
.res-phone .archive-harvest .ah-new a::before { content: "新章"; font-size: 11px; font-weight: 700; color: #A2361A; }
.res-phone .archive-harvest .ah-new a + a { display: none; }
.modal-box.res-phone.res-cartoon { border-width: 16px; border-image-width: 34px; padding: 20px 14px 8px; }
.res-phone.res-cartoon .res-ribbon { width: 250px; top: -34px; }
.res-phone.res-cartoon .res-ribbon h2 { font-size: 15px; }
.res-phone .modal-actions { gap: 12px; margin-top: 8px; }
.res-phone.res-cartoon .modal-actions button { height: 38px; font-size: 14px; padding: 0 18px; }
.res-phone.res-cartoon .modal-actions button.primary { width: 168px; height: 44px; padding: 0 36px; font-size: 16px; }
.res-cartoon .modal-actions button:focus { outline: none; }
.res-cartoon .modal-actions button:focus-visible { filter: drop-shadow(0 0 6px #FFD36A) drop-shadow(0 4px 3px rgba(60,30,5,.35)) brightness(1.06); }
.res-cartoon .archive-harvest .ah-row { padding-top: 5px; padding-bottom: 5px; }
.res-cartoon .archive-harvest h3 { width: auto; min-width: 280px; padding: 0 96px 4px; white-space: nowrap; }

/* 卡通商品插画降到 80% 饱和度：卡框、股数、品牌名、皇冠、硬币都是别的元素，不受影响。
   插画和装饰物在同一张 PNG 里，所以统一用 0.8（不单独压装饰物） */
.card-art.illus img[src*="card-art/cartoon/"] { filter: saturate(.8) drop-shadow(.04em .06em .08em rgba(0,0,0,.28)); }
.tile-art > img[src*="card-art/cartoon/"] { filter: saturate(.8) drop-shadow(0 .04em .05em rgba(0,0,0,.3)); }

/* 轮到你拿牌：牌堆呼吸发光，提示可以摸牌（悬停 / 待确认 / 拖动时停下） */
.deck.can .deck-hit:not(:hover):not(.armed):not(.dragging-source) .card { animation: deck-glow 1.6s ease-in-out infinite; }
@keyframes deck-glow {
  0%, 100% { box-shadow: 0 0 0 .12em #F5B740, 0 0 .6em rgba(240,160,30,.5), 0 .1em .12em rgba(0,0,0,.45); }
  50% { box-shadow: 0 0 0 .2em #FFC548, 0 0 1.8em .45em rgba(240,155,20,.85), 0 .1em .12em rgba(0,0,0,.45); }
}
@media (prefers-reduced-motion: reduce) { .deck.can .deck-hit .card { animation: none !important; } }

/* ---------- 胜者画面：算完分后从大缩回正常大小，点「看结算」才进结算页 ---------- */
.winner { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(30,18,6,.35), rgba(20,12,4,.72) 75%);
  -webkit-backdrop-filter: blur(6px) saturate(.8); backdrop-filter: blur(6px) saturate(.8); animation: win-fade .3s ease-out both; }
.winner.out { animation: win-fade .22s ease-in reverse both; }
@keyframes win-fade { from { opacity: 0; } }
.win-glow { position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,220,140,.5), rgba(255,220,140,0) 60%); }
.winner:not(.me) .win-glow { opacity: .35; }
.win-conf i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; opacity: .9; animation: win-fall linear infinite; }
@keyframes win-fall { to { transform: translateY(110vh) rotate(720deg); } }
.win-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 16px;
  animation: win-zoom .6s cubic-bezier(.2,1.25,.4,1) both; }
@keyframes win-zoom { from { transform: scale(1.8); opacity: 0; } }
.win-tag { padding: .25em 1.1em; border: 1px solid rgba(255,230,180,.6); border-radius: 999px; color: #FFE7B8;
  font: 600 .95em/1.4 var(--sans); letter-spacing: .3em; text-indent: .3em; }
.win-av { position: relative; width: 9.4em; height: 9.4em; margin-top: 2.5em; }
.win-face { width: 100%; height: 100%; border-radius: 50%; background: #FFF6E6; object-fit: cover;
  box-shadow: 0 0 0 .25em rgba(255,255,255,.9), 0 0 0 .44em #E5B65A, 0 0 3.8em .6em rgba(255,205,110,.45); }
.winner:not(.me) .win-face { box-shadow: 0 0 0 .25em rgba(255,255,255,.75), 0 0 0 .44em #CDB892, 0 0 2.4em .3em rgba(255,235,200,.25); }
.win-crown { position: absolute; left: 50%; top: -2.1em; width: 3.9em; transform: translateX(-50%) rotate(-10deg); filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); z-index: 1; }
.win-card h2 { margin: .3em 0 0; white-space: nowrap; padding-left: .08em; color: #FFF6E2; font: 800 3.5em/1.15 "Songti SC", "STSong", var(--serif, serif);
  letter-spacing: .08em; text-shadow: 0 4px 18px rgba(0,0,0,.35); }
.win-card h2 .ex { margin-right: -.72em; }
.winner:not(.me) .win-card h2 { font-size: 2.9em; }
.win-sc { margin-top: .6em; color: #FFEACC; font: 600 1.06em var(--sans); }
.win-sc b { color: #FFD36B; font: 800 1.76em var(--sans); margin: 0 .3em; vertical-align: -.12em; }
.win-sub { margin-top: .25em; color: rgba(255,236,206,.78); font: 500 .88em var(--sans); }
.win-go { margin-top: 1em; border: 0; cursor: pointer; background: url(../assets/table/cartoon/result-button.webp?v=c22bf810cd) center/100% 100% no-repeat;
  color: #5A2A08; font: 900 1.38em "Songti SC", "STSong", var(--serif, serif); letter-spacing: .15em; text-indent: .15em; width: 10.4em; height: 2.6em; }
.win-go:focus { outline: none; }
.win-go:focus-visible { filter: drop-shadow(0 0 .4em rgba(255,220,140,.9)); }
.win-go:hover { filter: brightness(1.06); }
.winner.phone .win-card { font-size: 10px; }
.winner.phone .win-conf i { width: 6px; height: 10px; }
@media (prefers-reduced-motion: reduce) { .win-card { animation: none; } .win-conf { display: none; } }
/* 强制横屏时 #app 转了 90°，backdrop-filter 只糊到一部分：改成不透明一点的纯色压暗 */
html.force-land .winner { -webkit-backdrop-filter: none; backdrop-filter: none; background: radial-gradient(circle at 50% 50%, rgba(40,26,10,.72), rgba(20,12,4,.9) 75%); }

/* 「结束这局」确认框：牌桌压暗，中间小框；金色大按钮是继续玩 */
.quit-dlg { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle, rgba(40,24,8,.45), rgba(20,12,4,.72) 75%); animation: win-fade .18s ease-out both; }
.qd-box { position: relative; width: min(400px, 100%); box-sizing: border-box; padding: 22px 22px 18px; text-align: center; border-radius: 12px;
  background: var(--paper-2); color: var(--ink); box-shadow: 0 0 0 6px #4A2A16, 0 0 0 8px var(--brass), 0 30px 60px rgba(0,0,0,.6); }
.qd-rib h2 { margin: 0 0 10px; font: 800 22px var(--serif); }
.qd-box p { margin: 0; font: 700 18px var(--serif); }
.qd-box small { display: block; margin-top: 6px; font: 500 13px var(--sans); opacity: .75; }
.qd-act { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 20px; }
.qd-act button { cursor: pointer; font: 800 17px var(--serif); letter-spacing: .08em; }
.qd-act button:hover { filter: brightness(1.05); }
.quit-dlg.cartoon .qd-box { width: 440px; max-width: none; border: 30px solid transparent; border-image: url(../assets/table/cartoon/result-frame.webp?v=ac45af0fd7) 100 fill / 64px;
  background: none; box-shadow: none; border-radius: 0; padding: 40px 18px 8px; color: #3A2410; filter: drop-shadow(0 18px 30px rgba(40,20,5,.55)); }
.quit-dlg.cartoon .qd-rib { position: absolute; left: 50%; top: -56px; transform: translateX(-50%); width: 300px; aspect-ratio: 1171 / 171;
  background: url(../assets/table/cartoon/result-ribbon.webp?v=5506856b21) center / 100% 100% no-repeat; display: grid; place-items: center; }
.quit-dlg.cartoon .qd-rib h2 { margin: 0 0 .25em; font-size: 22px; color: #FFE7B0; letter-spacing: .1em; text-indent: .1em; text-shadow: 0 2px 0 #6E1A0E; white-space: nowrap; }
.quit-dlg.cartoon .qd-box p { color: #5A3A14; }
.quit-dlg.cartoon .qd-box small { color: #8A6A40; opacity: 1; }
.quit-dlg.cartoon .qd-act button { border: 0; color: #5A3A14; }
.quit-dlg.cartoon .qd-no { height: 46px; padding: 0 24px; border-radius: 999px; background: #FBF1DC;
  box-shadow: inset 0 0 0 2px #C9A25A, inset 0 -3px 0 rgba(150,110,50,.25); filter: drop-shadow(0 3px 2px rgba(60,30,5,.3)); }
.quit-dlg.cartoon .qd-yes { width: 180px; height: 58px; font-size: 20px; color: #5A3306; background: url(../assets/table/cartoon/result-button.webp?v=c22bf810cd) center / 100% 100% no-repeat;
  text-shadow: 0 1px 0 rgba(255,240,190,.8); filter: drop-shadow(0 4px 3px rgba(60,30,5,.35)); }
.quit-dlg.cartoon.phone .qd-box { zoom: .78; }
.quit-dlg:not(.cartoon) .qd-yes { background: var(--amber); color: var(--ink); padding: 0 26px; }
.quit-dlg.cartoon .qd-act button:focus-visible { outline: none; }
.quit-dlg.cartoon .qd-yes:focus-visible { filter: drop-shadow(0 0 .35em rgba(255,200,80,.95)) drop-shadow(0 4px 3px rgba(60,30,5,.35)); }
.quit-dlg.cartoon .qd-no:focus-visible { box-shadow: inset 0 0 0 2px #C9A25A, 0 0 0 3px rgba(255,200,80,.9); }

/* ================= 新手教程（js/tutorial.js）：6 页图文，左图右文 ================= */
.tu { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 12px;
  background: radial-gradient(circle, rgba(40,24,8,.5), rgba(20,12,4,.8) 75%); animation: win-fade .18s ease-out both; }
.tu-box { position: relative; width: 860px; box-sizing: border-box; padding: 22px 26px 18px; color: var(--ink); border-radius: 12px;
  background: var(--paper-2); box-shadow: 0 0 0 6px #4A2A16, 0 0 0 8px var(--brass), 0 30px 60px rgba(0,0,0,.6); }
.tu-rib h2 { margin: 0 0 12px; font: 800 24px var(--serif); text-align: center; }
.tu-skip { position: absolute; right: 14px; top: 12px; border: 0; background: none; padding: 4px 6px; color: #8A6A40; font: 600 14px var(--sans); cursor: pointer; }
.tu-skip:hover { color: #5A3A14; }
.tu-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: center; min-height: 320px; }
/* 图：套 .stage[data-theme] 让牌面样式生效，这里把 .stage 的牌桌定位全部还原 */
.tu-pic.stage { position: relative; inset: auto; transform: none; overflow: visible; color: #4A3420; height: 300px; border-radius: 14px;
  background: #FFF8EA; box-shadow: inset 0 0 0 1.5px #E2C99A; display: flex; align-items: center; justify-content: center; gap: 34px; font-size: 16px; }
.tu-slot { position: relative; width: 6.6em; height: 7.9em; font-size: 18px; flex: none; container-type: size; }
.tu-pay { position: absolute; right: -1.4em; top: -.7em; display: flex; align-items: center; gap: 3px; padding: 4px 10px 4px 5px; border-radius: 999px;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); font: 800 15px var(--sans); color: #7A2414; white-space: nowrap; }
.tu-txt { min-width: 0; }
.tu-tag { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #A2361A; color: #FFE7B0; font: 700 13px var(--sans); letter-spacing: .1em; }
.tu-txt h3 { margin: 10px 0 12px; font: 800 26px var(--serif); color: #7A2414; }
.tu-txt ul { margin: 0; padding: 0; list-style: none; font: 500 16px/1.65 var(--sans); color: #4A3420; }
.tu-txt li { position: relative; padding-left: 1.3em; margin-bottom: 8px; }
.tu-txt li::before { content: ""; position: absolute; left: .2em; top: .62em; width: .5em; height: .5em; border-radius: 50%; background: #D9A441; }
.tu-txt b { color: #A2361A; }
.tu-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.tu-dots { display: flex; gap: 4px; }
.tu-dot { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.tu-dot::before { content: ""; width: 9px; height: 9px; border-radius: 5px; background: #E2C99A; transition: width .15s; }
.tu-dot.on::before { width: 22px; background: #A2361A; }
.tu-foot button:not(.tu-dot) { cursor: pointer; font: 800 17px var(--serif); letter-spacing: .08em; color: #5A3A14; }
.tu-prev { height: 44px; padding: 0 22px; border-radius: 999px; border: 0; background: #FBF1DC; box-shadow: inset 0 0 0 2px #C9A25A; }
.tu-prev:disabled { opacity: .4; cursor: default !important; }
.tu-next { height: 46px; padding: 0 30px; border: 0; border-radius: 999px; background: var(--amber); }
.tu-foot button:not(:disabled):hover { filter: brightness(1.05); }
/* 卡通主题：结算页同款红框、缎带、金按钮 */
.tu.cartoon .tu-box { border: 30px solid transparent; border-image: url(../assets/table/cartoon/result-frame.webp?v=ac45af0fd7) 100 fill / 64px; background: none; box-shadow: none;
  border-radius: 0; padding: 44px 26px 10px; color: #3A2410; filter: drop-shadow(0 18px 30px rgba(40,20,5,.55)); }
.tu.cartoon .tu-rib { position: absolute; left: 50%; top: -62px; transform: translateX(-50%); width: 420px; aspect-ratio: 1171 / 171;
  background: url(../assets/table/cartoon/result-ribbon.webp?v=5506856b21) center / 100% 100% no-repeat; display: grid; place-items: center; }
.tu.cartoon .tu-rib h2 { margin: 0 0 .25em; color: #FFE7B0; letter-spacing: .1em; text-indent: .1em; text-shadow: 0 2px 0 #6E1A0E; white-space: nowrap; }
.tu.cartoon .tu-skip { right: -6px; top: -14px; }
.tu.cartoon .tu-next { width: 170px; height: 54px; padding: 0; border-radius: 0; background: url(../assets/table/cartoon/result-button.webp?v=c22bf810cd) center / 100% 100% no-repeat;
  font-size: 19px; color: #5A3306; text-shadow: 0 1px 0 rgba(255,240,190,.8); filter: drop-shadow(0 4px 3px rgba(60,30,5,.35)); }
.tu.cartoon .tu-next:focus-visible { outline: none; filter: drop-shadow(0 0 .35em rgba(255,200,80,.95)) drop-shadow(0 4px 3px rgba(60,30,5,.35)); }
/* 矮屏（手机横屏）：图变矮、字略小，再整体缩放 */
.tu.short .tu-pic.stage { height: 230px; gap: 26px; }
.tu.short .tu-body { min-height: 316px; }
.tu.short .tu-txt h3 { margin: 6px 0 8px; }
.tu.short .tu-foot { margin-top: 12px; }
/* 窄屏（竖着拿手机）：上图下文，可滚动 */
.tu.narrow .tu-box { width: 100%; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; padding: 18px 16px 14px; }
.tu.narrow.cartoon .tu-box { border-width: 22px; border-image-width: 48px; padding: 30px 8px 6px; overflow: visible; max-height: none; }
.tu.narrow.cartoon .tu-rib { width: 260px; top: -44px; }
.tu.narrow.cartoon .tu-rib h2 { font-size: 19px; }
.tu.narrow .tu-body { grid-template-columns: 1fr; gap: 14px; min-height: 0; align-items: start; }
.tu.narrow .tu-txt { min-height: 250px; }
.tu.narrow .tu-foot button { white-space: nowrap; }
.tu.narrow .tu-pic.stage { height: 190px; gap: 12px; }
.tu.narrow .tu-txt h3 { font-size: 22px; margin: 6px 0 8px; }
.tu.narrow .tu-txt ul { font-size: 14.5px; line-height: 1.55; }
.tu.narrow .tu-next { width: 108px; height: 42px; font-size: 15px; letter-spacing: .02em; }
.tu.narrow .tu-prev { height: 36px; padding: 0 10px; font-size: 14px; letter-spacing: 0; }
.tu.narrow .tu-foot { gap: 6px; }
.tu.narrow .tu-dots { gap: 0; }
.tu.narrow .tu-dot { width: 13px; }
.tu.narrow .tu-dot::before { width: 7px; height: 7px; }
.tu.narrow .tu-dot.on::before { width: 13px; }
.tu-ask { z-index: 95; }
/* 教程里的桌面局部：540×330 的小牌桌 */
.tu-box { width: 960px; }
.tu-body.wide { grid-template-columns: 560px 1fr; gap: 22px; }
.tu-pic-scene.stage { height: 356px; padding: 0; display: block; background: none; box-shadow: none; }
.tu-scene { position: relative; width: 540px; height: 340px; margin: 8px auto; border-radius: 16px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, rgba(255,250,235,.0), rgba(120,80,30,.18) 100%), url(../assets/table/table-board.webp?v=0ed9ec225c) center / 240% auto;
  box-shadow: inset 0 0 0 2px rgba(120,80,30,.35), inset 0 0 30px rgba(80,50,15,.25); }
.tu-pic-scene[data-theme="cartoon"] .tu-scene { background: radial-gradient(ellipse at 50% 45%, rgba(255,250,235,0), rgba(150,100,40,.16) 100%), #F5EAD2 url(../assets/table/cartoon/table.webp?v=1139498c49) 50% 55% / 230% auto; }
.tu-at { position: absolute; z-index: 1; }
.tu-sm { font-size: 13px; }
.tu-sm.tu-stk { margin: 0; }
.tu-mkt.tu-no .card { filter: grayscale(.6) brightness(.85); }
.tu-mkt.tu-no .why-tag { font-size: 13px; }
.tu-mkt.tu-hot .card { box-shadow: 0 0 0 .2em #FFC548, 0 0 1.4em .35em rgba(240,155,20,.75); border-radius: 4.5cqw; }
.tu-sm.tu-deck > .card { box-shadow: 0 0 0 .14em #FFC548, 0 0 1em .25em rgba(240,155,20,.55); border-radius: .45em; }
.tu-sm .tu-pay { font-size: 13px; right: -2.6em; top: -.9em; }
.tu-pay img { width: 22px; height: 22px; }
.tu-ghost { opacity: .92; transform: rotate(-4deg); }
.tu-plate { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 999px; background: linear-gradient(#FFF7E6, #F6E7C8);
  box-shadow: inset 0 0 0 2px #B98A4E, 0 3px 6px rgba(90,50,15,.25); font: 800 15px var(--serif); color: #4A2E14; white-space: nowrap; }
.tu-plate > img { width: 40px; height: 40px; border-radius: 50%; background: #FFF6E6; box-shadow: 0 0 0 2px #D9A441; }
.tu-plate span { display: flex; align-items: center; gap: 3px; font: 800 14px var(--sans); color: #7A2414; }
.tu-plate span img { width: 18px; height: 18px; }
.tu-zone { display: inline-block; font: 700 12px var(--sans); color: #8A6A40; letter-spacing: .15em; white-space: nowrap; }
.tu-call { display: inline-block; padding: 3px 9px; border-radius: 8px; background: #fff; color: #A2361A; font: 800 13px var(--sans); white-space: nowrap;
  box-shadow: 0 0 0 1.5px #E8B9A6, 0 2px 5px rgba(90,40,15,.2); }
.tu-call.tu-plus { background: #A2361A; color: #FFE7B0; box-shadow: 0 2px 5px rgba(90,40,15,.3); }
.tu-call.tu-ban { background: #7A2414; color: #fff; }
.tu-call.tu-note-call { white-space: normal; width: 74px; font-size: 12px; line-height: 1.35; }
.tu-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.tu-lines path { fill: none; stroke: #C2381C; stroke-width: 2.6; stroke-dasharray: 6 5; stroke-linecap: round; }
.tu.short .tu-pic-scene.stage { height: 356px; }
.tu.narrow .tu-body.wide { grid-template-columns: 1fr; }
.tu.narrow .tu-pic-scene.stage { height: auto; }
.tu.narrow .tu-scene { zoom: .56; margin: 0 auto; }
.tu-sm.tu-xs, .tu-shand.tu-xs .tu-sm { font-size: 10px; }
.tu-shand { position: relative; display: flex; }
.tu-shand .tu-slot { margin-right: -1.6em; transform: rotate(calc(var(--k) * 7deg)) translateY(calc(var(--k) * var(--k) * .2em)); transform-origin: 50% 120%; }
.tu-removed { position: relative; width: 9em; height: 7.9em; font-size: 10px; }
.tu-removed .tu-slot { position: absolute; left: calc(var(--i) * .5em); top: calc(var(--i) * -.18em); filter: grayscale(.7) brightness(.75); opacity: .9; }
.tu-empty { border: 2px dashed rgba(162,54,26,.6); border-radius: .5em; background: rgba(255,255,255,.35); display: grid; place-items: center; box-sizing: border-box; }
.tu-empty span { font: 800 13px var(--sans); color: #A2361A; }
.tu-hot-s .card { box-shadow: 0 0 0 .2em #FFC548, 0 0 1.4em .35em rgba(240,155,20,.75); border-radius: 4.5cqw; }
.tu-call.tu-wide-note { width: 110px; }
.tu-call b { color: inherit; text-decoration: underline; }

/* 4 轮制：每轮开局的「第 N 轮」缎带 */
.round-title { position: fixed; inset: 0; z-index: 65; display: grid; place-content: center; justify-items: center; gap: 10px; pointer-events: none;
  background: radial-gradient(circle, rgba(40,24,8,.32), rgba(20,12,4,0) 70%); animation: win-fade .2s ease-out both; }
.round-title.out { animation: win-fade .26s ease-in reverse both; }
.rt-rib { width: 520px; aspect-ratio: 1171 / 171; display: grid; place-items: center; background: url(../assets/table/cartoon/result-ribbon.webp?v=5506856b21) center / 100% 100% no-repeat;
  filter: drop-shadow(0 10px 18px rgba(40,20,5,.45)); animation: rt-drop .5s cubic-bezier(.2,1.3,.4,1) both; }
.rt-rib b { margin-bottom: .2em; font: 900 40px var(--serif); color: #FFE7B0; letter-spacing: .2em; text-indent: .2em; text-shadow: 0 3px 0 #6E1A0E; }
.round-title small { padding: 4px 16px; border-radius: 999px; background: rgba(255,247,230,.95); color: #6B4416; font: 700 16px var(--sans); box-shadow: 0 3px 8px rgba(60,30,5,.3); }
.round-title.phone .rt-rib { width: 340px; }
.round-title.phone .rt-rib b { font-size: 27px; }
.round-title.phone small { font-size: 13px; }
@keyframes rt-drop { from { transform: scale(1.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* 4 轮制：名牌上的累计积分 */
.stage .plate .pts { display: inline-block; margin-left: .35em; padding: .05em .5em; border-radius: 999px; background: #A2361A; color: #FFE7B0 !important; font: 800 .78em/1.3 var(--sans); white-space: nowrap; vertical-align: middle; }
.stage[data-preset="phone"] .plate .pts { margin-left: 1px; padding: 0 .3em; font-size: 8.5px; line-height: 1.35; }
/* 不是你的回合：不显示提示框（轮到谁看头像的高亮和「思考中…」） */
.stage[data-theme="cartoon"] .actions:not(.mine) { display: none; }

/* 市场：标题铭牌两侧各一条细线（端头小菱形），牌堆和市场之间一条竖线，空牌位画成浅色牌框 */
.stage[data-theme="cartoon"] .zone > span { color: #9E2B1C; box-shadow: inset 0 0 0 1.5px #C9A25A, inset 0 0 0 3.5px #FFF7E6, inset 0 0 0 4.5px rgba(201,162,90,.6), 0 2px 4px rgba(90,50,15,.18); padding: 0 18px; }
.stage[data-theme="cartoon"] .zone > span::before, .stage[data-theme="cartoon"] .zone > span::after { content: ""; position: absolute; top: 50%; width: 110px; height: 7px; transform: translateY(-50%);
  background: linear-gradient(rgba(166,110,50,.55), rgba(166,110,50,.55)) center / calc(100% - 9px) 1.5px no-repeat; }
.stage[data-theme="cartoon"] .zone > span::before { right: calc(100% + 6px); background-position: right center; }
.stage[data-theme="cartoon"] .zone > span::after { left: calc(100% + 6px); background-position: left center; }
.stage[data-theme="cartoon"] .zone::after { content: ""; position: absolute; left: -4px; top: 14%; bottom: 14%; width: 1.5px; background: linear-gradient(transparent, rgba(166,110,50,.45) 20%, rgba(166,110,50,.45) 80%, transparent); }
.stage[data-theme="cartoon"][data-preset="phone"] .zone > span::before, .stage[data-theme="cartoon"][data-preset="phone"] .zone > span::after { width: 46px; }
.stage[data-theme="cartoon"][data-preset="phone"] .zone > span { box-shadow: inset 0 0 0 1px #C9A25A, 0 1px 2px rgba(90,50,15,.18); }
.mslot { position: absolute; border-radius: .5em; background: rgba(255,248,232,.55); box-shadow: inset 0 0 0 .1em rgba(201,162,90,.55), inset 0 0 0 .32em rgba(255,248,232,.5), inset 0 0 0 .4em rgba(201,162,90,.35), 0 .06em .2em rgba(120,80,30,.12); pointer-events: none; }
/* 市场超过 3 张：简版横条（和两侧对手的牌摞同款），硬币放在横条右端 */
.mcard.wide { container-type: normal; border-radius: .4em; }
.mcard.wide::before { border-radius: .4em; }
.stage[data-theme="cartoon"] #market .mcard.wide .coins.on-card { left: auto; right: 1.3em; top: 50%; font-size: .78em; }
.mcard.wide.can .tile-top { box-shadow: 0 0 0 .14em var(--amber), 0 .14em .14em rgba(0,0,0,.5); }
.mcard.wide.blocked .tile-top { filter: grayscale(.6) brightness(.8); }
.mcard.wide .why-tag { font-size: .8em; }
/* 市场空牌位、市场铭牌：用素材（market-slot / market-plaque） */
.mslot { background: url(../assets/table/cartoon/market-slot.webp?v=d09f604003) center / 100% 100% no-repeat; box-shadow: none; opacity: .8; }
.stage[data-theme="cartoon"] .zone > span { width: 3.4em; height: 1.5em; box-sizing: content-box; padding: 0 .85em; display: grid !important; place-items: center; border-radius: 0;
  background: url(../assets/table/cartoon/market-plaque.webp?v=a95b383c2a) center / 100% 100% no-repeat; box-shadow: none; font: 800 20px/1 var(--serif); letter-spacing: .4em; text-indent: .4em; top: -24px; }
.stage[data-theme="cartoon"][data-preset="phone"] .zone > span { font-size: 11px; box-shadow: none; top: -15px; }
/* 牌堆做成一张平放的牌（不画厚度），剩余张数放在右上角的圆章里 */
.stage[data-theme="cartoon"] .deck::before { display: none; }
.stage[data-theme="cartoon"] .deck { --th: 0em; }
.stage[data-theme="cartoon"] .deck .card.back { box-shadow: 0 0 0 .04em rgba(90,40,15,.45), 0 .12em .3em rgba(90,50,10,.35); }
.stage[data-theme="cartoon"] .deck-left { left: auto; right: -.35em; top: -.35em; bottom: auto; min-width: 0; width: 1.5em; height: 1.5em; padding: 0; border-radius: 50%;
  display: grid; place-items: center; font: 800 .62em/1 var(--serif); color: #FFE7B0; background: #7A2414; box-shadow: 0 0 0 .1em #E6C068, 0 .12em .25em rgba(0,0,0,.4); }
.stage[data-theme="cartoon"] .deck-cost { bottom: -.4em; }
.stage[data-theme="cartoon"] .deck::after { display: none; }
.stage[data-theme="cartoon"][data-preset="phone"] .deck-left { font-size: .95em; }

/* 「跳过教程」：明确的次级按钮（和「上一页」同款浅底描边胶囊），放在内容区右上，离开金色花边 */
.tu-skip, .tu.cartoon .tu-skip { position: absolute; right: 10px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 8px 0 16px; border: 0; border-radius: 999px; background: #FBF1DC; box-shadow: inset 0 0 0 2px #C9A25A, 0 2px 4px rgba(60,30,0,.18);
  color: #4A2E10; font: 800 15px var(--serif); letter-spacing: .06em; cursor: pointer; }
.tu-skip::before { content: ""; position: absolute; inset: -3px -2px; }  /* 触控区 ≥ 44px */
.tu-skip i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #8E1B16; color: #FBE6B0; font: 700 13px/1 var(--sans); font-style: normal; }
.tu-skip:hover { background: #FFF6E4; color: #2E1A06; }
.tu-skip:focus-visible { outline: 3px solid #8E1B16; outline-offset: 3px; }
.tu.cartoon .tu-skip { right: 6px; top: 4px; }
.tu.narrow .tu-skip, .tu.narrow.cartoon .tu-skip { min-height: 36px; right: 4px; top: 2px; font-size: 13px; padding: 0 6px 0 12px; }
.tu.narrow .tu-skip::before { inset: -4px -2px; }
.tu.narrow .tu-skip i { width: 24px; height: 24px; }

/* 教程：英文更长，收紧字距、字号，拓宽图里的窄注释 */
html[data-lang="en"] .tu-zone { letter-spacing: .02em; }
html[data-lang="en"] .tu-tag { letter-spacing: .04em; }
html[data-lang="en"] .tu-txt h3 { font-size: 23px; line-height: 1.2; }
html[data-lang="en"] .tu-txt ul { font-size: 15px; line-height: 1.5; }
html[data-lang="en"] .tu-call.tu-note-call { width: 88px; }
html[data-lang="en"] .tu-call.tu-note-call.tu-wide-note { width: 112px; }
html[data-lang="en"] .tu-empty span { font-size: 12px; text-align: center; }
html[data-lang="en"] .tu.narrow .tu-txt h3 { font-size: 20px; }
html[data-lang="en"] .tu.narrow .tu-txt ul { font-size: 13.5px; line-height: 1.5; }
html[data-lang="en"] .tu.narrow .tu-txt { min-height: 270px; }
html[data-lang="en"] .tu.narrow .tu-foot button:not(.tu-dot) { letter-spacing: 0; }

/* 英文界面：中文用的宽字距会把英文单词拆开 */
html[data-lang="en"] .stage .zone > span { letter-spacing: .06em !important; text-indent: 0 !important; }
html[data-lang="en"] .win-tag { letter-spacing: .08em; text-indent: 0; }

/* ===== 手机横屏整改（2026-11-15）：统一 8px 外边距、顶栏按钮触控 ≥ 44、气泡改顶部一行、行动面板贴右下 ===== */
:root { --sai-l: env(safe-area-inset-left, 0px); --sai-r: env(safe-area-inset-right, 0px); --sai-t: env(safe-area-inset-top, 0px); --sai-b: env(safe-area-inset-bottom, 0px); }
.stage[data-preset="phone"] .hud-tools { right: 8px; top: 6px; gap: 6px; }
/* 按钮画 30px 高，命中框用 ::after 向上下各扩 7px（= 44），左右各扩 3px（相邻按钮间距 6px，不重叠） */
.stage[data-preset="phone"] .hud-tools button { position: relative; min-height: 30px; min-width: 38px; padding: 0 9px; font-size: 12px; --hit-y: 7; --hit-x: 3; }
.stage[data-preset="phone"] .hud-tools button::after { content: ""; position: absolute; inset: -7px -3px; }
.ticker { position: absolute; z-index: 6; left: 186px; top: 8px; max-width: 396px; padding: 3px 12px; border-radius: 999px;
  background: rgba(255,250,238,.95); color: #3A2412; box-shadow: 0 2px 6px rgba(80,40,10,.22), inset 0 0 0 1px #D9BF8E;
  font: 600 11px/16px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.ticker[hidden] { display: none; }
.ticker.tip { white-space: normal; border-radius: 10px; padding: 4px 12px; }
.plate small.style-tag { cursor: help; }
.pay-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 70; pointer-events: none; white-space: nowrap;
  padding: 7px 26px; border-radius: 999px; background: rgba(255,248,232,.78); box-shadow: 0 2px 10px rgba(90,50,10,.18);
  font: 700 19px/1.3 "Songti SC", "STSong", var(--serif); color: #5A2A12; letter-spacing: .04em; animation: pay-hint-in .18s ease-out; }
.pay-hint[hidden] { display: none; }
.pay-hint b { color: #A2361A; margin-left: .2em; }
.pay-hint .pay-coin { display: inline-flex; vertical-align: -.2em; margin-left: .2em; font-size: .9em; }
.pay-hint .pay-coin i { margin: 0; }
.stage[data-preset="phone"] .pay-hint { font-size: 14px; padding: 4px 16px; }
@keyframes pay-hint-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pay-hint { animation: none; } }
.res-tie { margin: 8px 0 12px; padding: 8px 14px 8px 38px; position: relative; border-radius: 10px; background: #FDEBB8; border: 1.5px solid #D9A83E; color: #4A2A10; font: 700 15px/1.5 var(--sans); }
.res-tie::before { content: "⚖"; position: absolute; left: 12px; top: 7px; font-size: 18px; }
.res-phone .res-tie { margin: 6px 0 4px; font-size: 13px; padding: 6px 10px 6px 32px; }
.res-phone .res-tie::before { left: 9px; top: 5px; font-size: 15px; }
.win-tie { margin: .6em auto 0; max-width: 26em; padding: .45em .9em; border-radius: .6em; background: rgba(251,221,143,.18); border: 1px solid rgba(251,221,143,.7); color: #FFE9B0; font: 700 .86em/1.45 var(--sans); }
.stage:not([data-preset="phone"]) .ticker { display: none; }
.stage[data-preset="phone"] .actions.mine { padding: 6px 8px 8px; }
.stage[data-preset="phone"] .prompt span:empty { display: none; }
.stage[data-preset="phone"] .prompt { font-size: 11px; }
.stage[data-preset="phone"] .place-actions .big { min-height: 44px; }
/* 触屏：教程、结算、退出弹窗的按钮 ≥ 44 */
@media (pointer: coarse) {
  .tu-skip { min-height: 44px; }
  .tu-dot { position: relative; --hit-y: 9; --hit-x: 0; }
  .tu-dot::after { content: ""; position: absolute; inset: -9px 0; }
  .tu-foot button:not(.tu-dot) { min-height: 44px; }
  .modal-actions button, .res-cartoon .modal-actions button { min-height: 44px; }
  .qd-act button { min-height: 44px; }
}
@media (pointer: coarse) {
  /* 教程框整体缩放（手机上约 0.6）：命中框按设计坐标扩 */
  .tu-skip { min-height: 0; position: relative; --hit-y: 16; --hit-x: 0; }
  .tu-skip::after { content: ""; position: absolute; inset: -16px 0; }
  .tu-foot button:not(.tu-dot) { min-height: 0; position: relative; --hit-y: 8; }
  .tu-foot button:not(.tu-dot)::after { content: ""; position: absolute; inset: -8px 0; }
  .quit-dlg .qd-act button { min-height: 0; position: relative; --hit-y: 6; }
  .quit-dlg .qd-act button::after { content: ""; position: absolute; inset: -6px 0; }
}
/* 手机舞台最小缩放约 0.79（667×375）：命中扩展按设计坐标留足，44 屏幕像素 ≈ 56 设计像素 */
.stage[data-preset="phone"] .hud-tools { gap: 12px; }
.stage[data-preset="phone"] .hud-tools button { min-width: 44px; --hit-y: 13; --hit-x: 6; }
.stage[data-preset="phone"] .hud-tools button::after { inset: -13px -6px; }
.stage[data-preset="phone"] .deck-hit { --hit-x: 4; --hit-y: 4; }
.stage[data-preset="phone"] .deck-hit::after { display: block !important; content: ""; inset: -4px; rotate: none; translate: none; filter: none; background: none !important; pointer-events: auto; }
.stage[data-preset="phone"] .mcard.wide { --hit-y: 7; }
/* 市场牌（手机）：命中框左右各扩 4，短屏缩放后、5–6 张缩小后也够 44 宽 */
.stage[data-preset="phone"] .mcard:not(.wide) { --hit-x: 4; }
.stage[data-preset="phone"] .mcard:not(.wide)::after { content: ""; position: absolute; inset: 0 -4px; }

.stage[data-preset="phone"] .mcard.wide::after { content: ""; position: absolute; inset: -7px 0; }
.stage[data-preset="phone"] .place-actions .big { min-height: 56px; }
@media (pointer: coarse) {
  .tu-skip { --hit-y: 20; }
  .tu-skip::after { inset: -20px 0; }
  .tu-foot button:not(.tu-dot) { --hit-y: 12; }
  .tu-foot button:not(.tu-dot)::after { inset: -12px 0; }
}


/* ===== 我的回合面板（精简版，2026-11-21）：浅色半透明小卡片、细字；放牌只剩步骤标记 + 两个按钮，和中央的付钱提示同一风格 ===== */
.stage[data-theme="cartoon"] .actions.mine { background: rgba(255,248,232,.82) !important; box-shadow: 0 2px 10px rgba(90,50,10,.18) !important;
  border-radius: 14px; padding: 8px 10px 10px; gap: 6px; backdrop-filter: blur(2px); }
.stage[data-theme="cartoon"] .actions.mine .prompt { font: 500 13px/1.45 var(--sans); }
.stage[data-theme="cartoon"] .actions.mine .prompt span:empty { display: none; }
.stage[data-theme="cartoon"] .actions.mine .steps li { font-size: 11px; padding: 1px 8px 1px 3px; }
.stage[data-theme="cartoon"] .actions.mine .steps li::before { width: 15px; height: 15px; font-size: 10px; }
.stage[data-theme="cartoon"] .place-actions .big { border: 0; border-image: none; min-height: 40px; padding: 6px 14px; border-radius: 999px; filter: none;
  font: 700 15px/1.2 "Songti SC", "STSong", var(--serif); letter-spacing: .06em; }
.stage[data-theme="cartoon"] .place-actions .big.gold { background: linear-gradient(#F9DE8A, #E7B84A); color: #3A2508; box-shadow: 0 0 0 1.5px #B88A2A, 0 2px 4px rgba(90,50,10,.25); }
.stage[data-theme="cartoon"] .place-actions .big.ivory { background: #FFFDF6; color: #4A2E14; box-shadow: 0 0 0 1.5px #C9A877, 0 2px 4px rgba(90,50,10,.18); }
.stage[data-theme="cartoon"] .place-actions .big:not(:disabled):hover { filter: brightness(1.05); }
.stage[data-theme="cartoon"] .place-actions .big:disabled { opacity: .45; }
.stage[data-theme="cartoon"][data-preset="phone"] .actions.mine { padding: 5px 6px 6px; border-radius: 10px; }
.stage[data-theme="cartoon"][data-preset="phone"] .actions.mine .prompt { font-size: 10px; }
.stage[data-theme="cartoon"][data-preset="phone"] .place-actions .big { min-height: 44px; font-size: 12px; padding: 4px 8px; }
.stage[data-theme="cartoon"] .actions.mine .steps { flex-wrap: nowrap; }
.stage[data-theme="cartoon"] .actions.mine .steps li { white-space: nowrap; }
.stage[data-theme="cartoon"][data-preset="phone"] .actions.mine .steps li { font-size: 9px; }
/* 第二版：按钮更小、字更粗（桌面 34 高；手机可视 32 高、命中框上下扩到 44） */
.stage[data-theme="cartoon"] .place-actions { gap: 6px; }
.stage[data-theme="cartoon"] .place-actions .big { min-height: 34px; height: 34px; padding: 0 12px; font: 800 14px/1 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", var(--sans); letter-spacing: .04em; }
.stage[data-theme="cartoon"] .place-actions .big.gold { color: #3A2006; }
.stage[data-theme="cartoon"] .place-actions .big.ivory { color: #3E2410; }
.stage[data-theme="cartoon"] .actions.mine .steps li { font-weight: 700; }
.stage[data-theme="cartoon"] .actions.mine { padding: 7px 9px 9px; }
.stage[data-theme="cartoon"][data-preset="phone"] .place-actions .big { position: relative; min-height: 0; height: 32px; font-size: 12px; padding: 0 8px; --hit-y: 6; }
.stage[data-theme="cartoon"][data-preset="phone"] .place-actions .big::after { content: ""; position: absolute; inset: -6px -2px; }
.stage[data-theme="cartoon"] .place-actions .big { white-space: nowrap; }
.stage[data-theme="cartoon"][data-preset="phone"] .place-actions .big { font-size: 11px; padding: 0 6px; letter-spacing: 0; }
.stage[data-theme="cartoon"][data-preset="phone"] .place-actions .big { --hit-y: 12; }
.stage[data-theme="cartoon"][data-preset="phone"] .place-actions .big::after { inset: -12px -2px; }
/* 第三版：选了手牌时只剩两个按钮，没有面板框和步骤标记，竖排贴在手牌右边 */
.stage[data-theme="cartoon"] .actions.mine.beside { background: none !important; box-shadow: none !important; backdrop-filter: none; padding: 0; }
.stage[data-theme="cartoon"] .actions.mine.beside .prompt { display: none; }
.stage[data-theme="cartoon"] .actions.beside .place-actions { grid-template-columns: auto; gap: 10px; }
.stage[data-theme="cartoon"] .actions.beside .place-actions .big { min-width: 104px; box-shadow: 0 0 0 1.5px #B88A2A, 0 3px 8px rgba(60,30,5,.3); }
.stage[data-theme="cartoon"] .actions.beside .place-actions .big.ivory { box-shadow: 0 0 0 1.5px #C9A877, 0 3px 8px rgba(60,30,5,.22); }
.stage[data-theme="cartoon"][data-preset="phone"] .actions.beside .place-actions { gap: 14px; }
.stage[data-theme="cartoon"][data-preset="phone"] .actions.beside .place-actions .big { min-width: 68px; }
.stage[data-theme="cartoon"] .actions.beside .place-actions .why { max-width: 140px; }
/* 出牌待确认：确定按钮里的小秒数 */
.hold-left { display: inline-grid; place-items: center; min-width: 1.35em; height: 1.35em; margin-left: .35em; border-radius: 50%;
  font: 800 .78em/1 var(--sans); color: #3A2006; box-shadow: inset 0 0 0 1.5px rgba(58,32,6,.55); }
.stage[data-theme="cartoon"] .place-actions #btn-confirm { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; }
/* 倒计时画在「确定」按钮外面右侧：橙红实心小圆 + 白色粗数字，醒目、不占按钮 */
.stage[data-theme="cartoon"] .place-actions #btn-confirm { position: relative; overflow: visible; }
.stage[data-theme="cartoon"] .place-actions #btn-confirm .hold-left { position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); margin: 0;
  width: 1.75em; height: 1.75em; min-width: 0; font: 900 13px/1 var(--sans); color: #fff; background: #E2552B; box-shadow: 0 0 0 2px #FFF4E0, 0 2px 6px rgba(150,40,10,.45);
  animation: hold-pulse 1s ease-in-out infinite; pointer-events: none; }
.stage[data-theme="cartoon"][data-preset="phone"] .place-actions #btn-confirm .hold-left { font-size: 11px; left: calc(100% + 6px); }
@keyframes hold-pulse { 50% { transform: translateY(-50%) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .stage[data-theme="cartoon"] .place-actions #btn-confirm .hold-left { animation: none; } }
