/* 西游·八十一难 —— 明快国风：宣纸暖底 + 朱砂/藤黄/石绿 */
:root {
  --paper: #f6ead2;
  --paper-deep: #efe0bd;
  --ink: #3b2b20;
  --ink-soft: #7a6248;
  --sand: #d9c592;
  --red: #c8381f;
  --red-deep: #a02714;
  --gold: #e8a93c;
  --green: #3f8f5f;
  --indigo: #46557a;
  --brown: #9c6b4f;
  --font-display: "Yuanti SC", "YouYuan", "Kaiti SC", "STKaiti", "PingFang SC", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  background: var(--paper);
  background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,.5), transparent 42%),
                    radial-gradient(circle at 85% 85%, rgba(216,186,124,.18), transparent 50%);
  color: var(--ink);
  font-family: var(--font-body);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 100%; padding: 13px 18px; border-radius: 999px;
  background: #fffaf0; color: var(--ink);
  box-shadow: 0 1px 3px rgba(59,43,32,.14), 0 4px 12px rgba(59,43,32,.08);
  transition: transform .12s ease, box-shadow .12s ease;
  font-size: 16px;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .42; }
.btn-primary { background: var(--red); color: #fff9ee; }
.btn-danger { color: var(--red-deep); }
.btn-big { font-size: 18px; padding: 16px 18px; }
.btn-label { font-weight: 700; font-family: var(--font-display); letter-spacing: .06em; }
.btn-detail { font-size: 12px; opacity: .82; font-weight: 400; line-height: 1.45; }

/* ---------- 首页 ---------- */
.screen { min-height: 100dvh; }
#home { display: flex; flex-direction: column; align-items: center; padding: max(24px, env(safe-area-inset-top)) 20px 32px; gap: 22px; }
.home-hero { text-align: center; margin-top: 26px; }
.hero-seal {
  display: inline-block; background: var(--red); color: #fff7e8;
  font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: .2em;
  padding: 10px 14px 10px 17px; border-radius: 12px; transform: rotate(-4deg);
  box-shadow: 0 3px 10px rgba(160,39,20,.35);
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(40px, 12vw, 58px); font-weight: 900; white-space: nowrap;
  letter-spacing: .12em; margin-top: 14px; color: var(--ink);
}
.hero-sub { color: var(--ink-soft); font-size: 15px; letter-spacing: .18em; margin-top: 6px; }
.hero-byline { color: #b39b6b; font-size: 12px; letter-spacing: .22em; margin-top: 8px; }
.home-foot { color: #b39b6b; font-size: 12px; letter-spacing: .1em; margin-top: auto; }

.resume-box {
  width: min(480px, 100%); background: #fffaf0; border-radius: 18px; padding: 16px;
  box-shadow: 0 2px 10px rgba(59,43,32,.1);
}
.resume-box p { font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.resume-btns { display: flex; gap: 10px; }

.setup { width: min(480px, 100%); display: flex; flex-direction: column; gap: 14px; }
.setup-title { font-family: var(--font-display); font-size: 20px; letter-spacing: .08em; }
.setup-title small { font-size: 13px; color: var(--ink-soft); font-weight: 400; margin-left: 8px; }
.slot { background: #fffaf0; border-radius: 16px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(59,43,32,.09); margin-bottom: 10px; }
.slot-off { opacity: .62; }
.slot-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.slot-no { font-family: var(--font-display); font-weight: 800; color: var(--ink-soft); }
.seg-group { display: flex; background: var(--paper-deep); border-radius: 999px; padding: 3px; }
.seg { padding: 6px 16px; border-radius: 999px; font-size: 14px; color: var(--ink-soft); transition: all .15s; }
.seg.on { background: var(--ink); color: #fff7e8; font-weight: 700; }
.char-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.char-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px; border-radius: 12px; font-size: 12px; color: var(--ink-soft);
  background: var(--paper); transition: all .15s;
}
.char-pick .char-face {
  width: 34px; height: 34px; border-radius: 50%; background: var(--c);
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center; opacity: .45; transition: opacity .15s;
}
.char-pick.on { background: #fff; box-shadow: 0 0 0 2px var(--c), 0 2px 8px rgba(59,43,32,.12); color: var(--ink); font-weight: 700; }
.char-pick.on .char-face { opacity: 1; }
.char-pick.taken { opacity: .3; }
.char-pick:active { transform: scale(.95); }

/* ---------- 对局框架 ---------- */
#game { display: flex; flex-direction: column; height: 100dvh; }
#game-top {
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 12px 8px;
  background: rgba(246,234,210,.92); backdrop-filter: blur(6px);
  position: relative; z-index: 5;
  box-shadow: 0 1px 0 rgba(59,43,32,.08);
}
#btn-menu { font-size: 20px; padding: 6px 10px; border-radius: 10px; color: var(--ink-soft); }
#btn-menu:active { transform: scale(.9); }
#turn-indicator { font-family: var(--font-display); font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
#players-strip { display: flex; gap: 6px; margin-left: auto; min-width: 0; overflow-x: auto; padding: 2px 1px; }
.chip {
  display: flex; align-items: flex-start; gap: 6px; min-width: 142px; padding: 5px 8px 5px 5px;
  background: #fffaf0; border-radius: 13px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(59,43,32,.1);
  transition: box-shadow .2s;
}
.chip.active { box-shadow: 0 0 0 2px var(--c), 0 2px 6px rgba(59,43,32,.16); }
.chip-avatar {
  width: 27px; height: 27px; border-radius: 50%; background: var(--c);
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.chip-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.chip-line { display: flex; align-items: baseline; gap: 5px; }
.chip-name { font-family: var(--font-display); font-size: 11.5px; color: var(--ink); }
.chip-info { font-size: 10px; color: var(--ink-soft); }
.chip-effects { display: flex; flex-wrap: wrap; gap: 3px; min-height: 16px; }
.chip-effect {
  display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 999px;
  background: #eee1c8; color: #695637; font-size: 9.5px; font-weight: 800; line-height: 1;
}
.chip-effect.auto { background: #f8e3a3; color: #8a5b00; }
.chip-effect.buff { background: #dfead5; color: #3f6c43; }
.chip-effect.warning { background: #f6ded5; color: #a33e27; }
.chip-effect.cooldown { background: #dde4ef; color: #465a80; }
.chip-effects.empty { color: #b8a37e; font-size: 9.5px; align-items: center; }

#board-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
#board { display: block; width: 100%; height: auto; }

/* ---------- 棋盘 SVG：水墨长卷 ---------- */
.road-edge { fill: none; stroke: #41504a; stroke-width: 46; stroke-linejoin: round; stroke-linecap: round; opacity: .28; }
.road-outer { fill: none; stroke: #c9ad7f; stroke-width: 40; stroke-linejoin: round; stroke-linecap: round; }
.road-inner { fill: none; stroke: #efe2c0; stroke-width: 30; stroke-linejoin: round; stroke-linecap: round; }
.road-dash { fill: none; stroke: #93a099; stroke-width: 2.6; stroke-dasharray: 2 15; stroke-linecap: round; opacity: .75; }
.region-label { font-family: var(--font-display); font-size: 21px; font-weight: 700; fill: #93a099; letter-spacing: 7px; opacity: .85; }
.cell-glyph { font-family: var(--font-display); font-size: 19px; font-weight: 800; }
.cell-num-plain { font-family: var(--font-display); font-size: 13px; font-weight: 700; fill: #99917b; }
.cell-num-badge { font-family: var(--font-display); font-size: 10.5px; font-weight: 800; fill: #41504a; }
.cell-idx-cp { font-family: var(--font-display); font-size: 14px; font-weight: 800; fill: var(--red); }
.seal-caption { font-family: var(--font-display); font-size: 14px; font-weight: 700; fill: #7a6248; }
.cloud-drift-a, .cloud-drift-b, .bg-ink, .buddha-rays { pointer-events: none; }
.cloud-drift-a { animation: cloudDriftA 90s ease-in-out infinite alternate; }
.cloud-drift-b { animation: cloudDriftB 140s ease-in-out infinite alternate; }
@keyframes cloudDriftA { to { transform: translateX(46px); } }
@keyframes cloudDriftB { from { transform: translateX(30px); } to { transform: translateX(-38px); } }
@media (prefers-reduced-motion: reduce) {
  .cloud-drift-a, .cloud-drift-b, .halo { animation: none; }
}
.seal { stroke-width: 0; }
.seal-red { fill: var(--red); filter: drop-shadow(0 2px 3px rgba(160,39,20,.4)); }
.seal-gold { fill: var(--gold); filter: drop-shadow(0 2px 4px rgba(184,124,20,.5)); }
.seal-green { fill: var(--green); filter: drop-shadow(0 2px 3px rgba(38,94,60,.35)); }
.seal-char { font-family: var(--font-display); font-size: 26px; font-weight: 900; fill: #fff7e8; }
.seal-name { font-family: var(--font-display); font-size: 16px; font-weight: 800; fill: #fff7e8; }
.halo { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 6 10; opacity: .8; animation: haloSpin 14s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes haloSpin { to { transform: rotate(360deg); } }
.deco-cloud { pointer-events: none; }

.token { transition: transform .17s ease; }
.token-body { stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 2px 3px rgba(59,43,32,.35)); }
.token-glyph { font-family: var(--font-display); font-size: 15px; font-weight: 900; fill: #fff; text-anchor: middle; }
.token.active .token-body { animation: tokenPulse 1.6s ease-in-out infinite; }
@keyframes tokenPulse { 0%,100% { stroke-width: 2.5; } 50% { stroke-width: 5.5; } }
.token.hopping .token-body { animation: hop .17s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes hop { 0%,100% { transform: scale(1,1); } 40% { transform: scale(.92,1.12) translateY(-4px); } 70% { transform: scale(1.08,.9); } }
.token.leaping { transition: transform .42s cubic-bezier(.3,-.4,.4,1.4); }

/* ---------- 日志行 & 底部面板 ---------- */
#log-line {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  font-size: 12.5px; color: var(--ink-soft); background: rgba(255,250,240,.86);
  white-space: nowrap; overflow: hidden; cursor: pointer;
  box-shadow: 0 -1px 0 rgba(59,43,32,.07);
}
#log-line-text { overflow: hidden; text-overflow: ellipsis; }
.log-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.log-list { max-height: 55dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.log-item { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); padding-bottom: 8px; border-bottom: 1px dashed rgba(178,148,96,.3); }

#panel {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fffaf0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 3px solid var(--panel-color, var(--red));
  box-shadow: 0 -5px 18px rgba(59,43,32,.13); position: relative; z-index: 5;
}
#panel-avatar {
  width: 50px; height: 50px; border-radius: 50%; flex: none;
  color: #fff; font-family: var(--font-display); font-weight: 900; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px #fffaf0, 0 2px 8px rgba(59,43,32,.28);
}
.panel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.panel-row1 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.panel-row1 b { font-family: var(--font-display); font-size: 16px; }
#panel-skill { font-size: 11.5px; color: var(--ink-soft); line-height: 1.35; }
.panel-row2 { display: flex; align-items: center; gap: 14px; }
.mana { width: 13px; height: 13px; border-radius: 50%; display: inline-block; background: var(--paper-deep); margin-right: 3px; }
.mana.on { background: var(--red); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.gongde-box { font-size: 13px; color: var(--ink-soft); }
.gongde-box b { color: var(--gold); font-size: 16px; text-shadow: 0 1px 0 rgba(138,91,0,.3); }
#panel-effects {
  display: flex; align-items: center; gap: 6px; min-height: 29px; overflow-x: auto;
  padding: 5px 0 3px; border-top: 1px solid rgba(178,148,96,.26); border-bottom: 1px solid rgba(178,148,96,.2);
  scrollbar-width: none;
}
#panel-effects::-webkit-scrollbar { display: none; }
.effects-label { flex: none; color: var(--panel-color, var(--red)); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.effect-empty { color: #b8a37e; font-size: 11.5px; }
.effect-pill {
  display: inline-flex; align-items: center; gap: 4px; flex: none; border-radius: 999px; padding: 3px 7px 3px 4px;
  background: #f1e7d2; color: #695637; font-size: 11px; font-weight: 800; line-height: 1.25; white-space: nowrap;
}
.effect-pill i {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: currentColor; color: #fffaf0; font-style: normal; font-family: var(--font-display); font-size: 10px;
}
.effect-auto { background: #f8e3a3; color: #8a5b00; }
.effect-buff { background: #dfead5; color: #3f6c43; }
.effect-warning { background: #f6ded5; color: #a33e27; }
.effect-cooldown { background: #dde4ef; color: #465a80; }
#panel-hand { display: flex; gap: 8px; overflow-x: auto; padding-top: 2px; }
.hand-card {
  display: flex; flex-direction: column; align-items: center; gap: 1px; flex: none;
  width: 52px; padding: 5px 2px; border-radius: 10px;
  background: var(--paper); font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--red);
  box-shadow: 0 1px 3px rgba(59,43,32,.12);
}
.hand-card em { font-style: normal; font-size: 9.5px; color: var(--ink-soft); font-weight: 400; white-space: nowrap; }
.hand-card:active { transform: scale(.93); }
.hand-empty { font-size: 12px; color: #c2ab84; }

/* ---------- 弹层 ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(59,43,32,0); transition: background .22s;
}
.modal-wrap.show { background: rgba(59,43,32,.42); }
.sheet {
  width: min(520px, 100%); max-height: 88dvh; overflow-y: auto;
  background: var(--paper); border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(40px); opacity: 0; transition: transform .22s ease, opacity .22s ease;
}
.modal-wrap.show .sheet { transform: translateY(0); opacity: 1; }
.sheet-kicker {
  display: inline-block; font-size: 12px; letter-spacing: .25em; color: #fff7e8;
  background: var(--ink); border-radius: 6px; padding: 3px 9px 3px 11px; margin-bottom: 10px;
  font-family: var(--font-display);
}
.sheet-title { font-family: var(--font-display); font-size: 21px; font-weight: 900; letter-spacing: .04em; margin-bottom: 8px; }
.sheet-body { font-size: 14px; line-height: 1.65; color: var(--ink-soft); }
.sheet-btns { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.enc-hint { background: rgba(70,85,122,.1); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.cp-intro { font-size: 15px; line-height: 1.8; }
.sheet-checkpoint .sheet-kicker { background: var(--red); }
.rules h4 { font-family: var(--font-display); margin: 14px 0 4px; color: var(--ink); }
.rules p { margin-bottom: 4px; }

/* 卡牌 */
.sheet-card { display: flex; flex-direction: column; align-items: center; }
.game-card {
  width: min(300px, 82vw); border-radius: 18px; padding: 22px 20px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 6px 22px rgba(59,43,32,.25);
  animation: cardIn .3s cubic-bezier(.2,1.4,.5,1);
}
@keyframes cardIn { from { transform: scale(.7) rotate(-3deg); opacity: 0; } }
.card-glyph {
  width: 62px; height: 62px; border-radius: 50%; font-family: var(--font-display);
  font-size: 32px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.25);
}
.card-name { font-family: var(--font-display); font-size: 23px; font-weight: 900; letter-spacing: .1em; }
.card-power { font-size: 13px; font-weight: 700; opacity: .95; }
.card-text { font-size: 13.5px; line-height: 1.65; opacity: .92; }
.card-source { font-size: 11px; opacity: .65; margin-top: 4px; }
.card-treasure { background: #fdf3dd; color: var(--ink); box-shadow: 0 0 0 4px var(--gold) inset, 0 6px 22px rgba(59,43,32,.25); }
.card-treasure .card-glyph { background: var(--gold); color: #fff7e8; }
.card-fortune { background: var(--gold); color: #4a3405; }
.card-fortune .card-glyph { background: rgba(255,255,255,.4); color: #7a5410; }
.card-mishap { background: var(--brown); color: #fdf0e2; }
.card-demon { background: var(--indigo); color: #f2ecdd; }
.card-demon .card-glyph { background: #2f3c59; color: #fff; }

/* 斗法 */
.sheet-battle { text-align: center; }
.battle-line { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0; }
.battle-math { font-size: 20px; color: var(--ink); }
.battle-math b { font-size: 28px; }
.battle-math em { font-style: normal; color: var(--ink-soft); font-size: 15px; }
.battle-vs { font-family: var(--font-display); color: var(--ink-soft); }
.battle-stamp {
  display: inline-block; font-family: var(--font-display); font-size: 34px; font-weight: 900;
  width: 64px; height: 64px; line-height: 64px; border-radius: 14px; margin: 4px auto;
  transform: rotate(-6deg); animation: stampIn .25s cubic-bezier(.2,1.6,.5,1);
}
@keyframes stampIn { from { transform: scale(2.2) rotate(-6deg); opacity: 0; } }
.battle-win { background: var(--red); color: #fff7e8; box-shadow: 0 3px 10px rgba(160,39,20,.4); }
.battle-lose { background: #6b6257; color: #f2ecdd; }

/* 骰子 */
#dice-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; pointer-events: none;
}
#dice-overlay[hidden] { display: none; }
.die {
  width: 92px; height: 92px; background: #fffaf0; border-radius: 20px;
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px; gap: 4px;
  box-shadow: 0 8px 24px rgba(59,43,32,.35), 0 0 0 3px rgba(200,56,31,.15);
}
#dice-overlay.settle .die { animation: diePop .3s cubic-bezier(.2,1.6,.4,1); }
@keyframes diePop { 40% { transform: scale(1.18) rotate(4deg); } }
.die i { border-radius: 50%; }
.die .pip { background: var(--red); box-shadow: inset 0 -2px 2px rgba(0,0,0,.2); }
#dice-label {
  font-family: var(--font-display); font-weight: 800; letter-spacing: .1em;
  background: var(--ink); color: #fff7e8; border-radius: 999px; padding: 6px 18px; font-size: 15px;
}

/* 胜利榜 */
.rank-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.rank-row { display: flex; align-items: center; gap: 10px; background: #fffaf0; border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.rank-row .rank-detail { margin-left: auto; font-size: 12.5px; color: var(--ink-soft); }

/* 提示条 */
.toast {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; z-index: 70;
  transform: translate(-50%, -16px); opacity: 0;
  background: var(--ink); color: #fff7e8; font-size: 13.5px;
  border-radius: 999px; padding: 8px 18px; pointer-events: none;
  transition: all .25s ease; max-width: 86vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* 桌面端 */
@media (min-width: 720px) {
  #game { max-width: 720px; margin: 0 auto; box-shadow: 0 0 40px rgba(59,43,32,.12); }
  .modal-wrap { align-items: center; }
  .sheet { border-radius: 22px; }
}

/* ---------- 路线选择 ---------- */
#routes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.route {
  background: #fffaf0; border-radius: 14px; padding: 10px 12px;
  border: 2px solid transparent; text-align: left;
  box-shadow: 0 1px 4px rgba(59,43,32,.09);
  display: flex; flex-direction: column; gap: 2px;
  transition: border-color .12s, transform .12s;
}
.route:active { transform: scale(.97); }
.route b { font-family: var(--font-display); font-size: 15px; }
.route small { font-size: 12px; color: var(--ink-soft); }
.route.on { border-color: var(--red); }
.route.on b { color: var(--red-deep); }

/* ---------- 抽卡翻牌 ---------- */
.flip-box { perspective: 900px; }
.flip-inner { position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.35,1.2,.4,1); }
.flip-inner.flipped { transform: rotateY(180deg); }
.flip-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-front { transform: rotateY(180deg); }
.flip-back {
  position: absolute; inset: 0; border-radius: 18px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 6px 22px rgba(59,43,32,.3);
  background-image: repeating-radial-gradient(circle at 50% 42%, rgba(255,255,255,.1) 0 14px, transparent 14px 30px);
}
.flip-back-glyph {
  width: 84px; height: 84px; border-radius: 50%; background: rgba(255,250,240,.92);
  font-family: var(--font-display); font-size: 44px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.flip-back-hint {
  font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: .12em;
  color: rgba(255,250,240,.95); animation: hintPulse 1.1s ease-in-out infinite;
}
.flip-back-treasure { background-color: var(--red); }
.flip-back-treasure .flip-back-glyph { color: var(--red-deep); }
.flip-back-fortune { background-color: var(--gold); }
.flip-back-fortune .flip-back-glyph { color: #7a5410; }
.flip-back-fortune .flip-back-hint { color: #4a3405; }
.flip-back-mishap { background-color: var(--brown); }
.flip-back-mishap .flip-back-glyph { color: var(--brown); }
.flip-back-demon { background-color: var(--indigo); }
.flip-back-demon .flip-back-glyph { color: var(--indigo); }
@keyframes hintPulse { 50% { transform: scale(1.08); opacity: .8; } }

/* ---------- 骰子等待点击 ---------- */
#dice-overlay.waiting { pointer-events: auto; cursor: pointer; background: rgba(59,43,32,.28); }
#dice-overlay.waiting .die { animation: dieWobble 1.1s ease-in-out infinite; }
@keyframes dieWobble {
  0%, 100% { transform: rotate(-7deg) translateY(0); }
  25% { transform: rotate(6deg) translateY(-7px); }
  50% { transform: rotate(-5deg) translateY(-2px); }
  75% { transform: rotate(7deg) translateY(-5px); }
}
#dice-overlay.waiting #dice-label { animation: hintPulse 1.1s ease-in-out infinite; }

/* ---------- 选角基础数据展示 ---------- */
.char-pick .char-power { font-size: 10px; color: var(--ink-soft); letter-spacing: .02em; }
.char-pick.on .char-power { color: var(--red-deep); font-weight: 800; }
.char-pick .char-specialty { font-size: 10px; color: var(--c); font-weight: 800; letter-spacing: .05em; }
.char-info {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--paper);
  font-size: 12px; line-height: 1.6; color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 2px;
}
.char-info b {
  display: inline-block; background: var(--paper-deep); color: var(--ink);
  border-radius: 6px; padding: 0 6px; margin-right: 6px; font-size: 11px;
}
