/* 星辉宇宙 · 渡劫试炼 —— 竖屏铺满，无标题栏 */
:root {
  --orange: #FF8A3D;
  --orange-deep: #E45E1D;
  --gold: #FFC777;
  --gold-soft: #FFE1A8;
  --cyan: #7FE6F2;
  --ink: #12081F;
  --ink-2: #1B0F2C;
  --card: rgba(38, 20, 60, 0.82);
  --card-line: rgba(255, 195, 120, 0.22);
  --txt: #FFF6EA;
  --txt-2: #D9C7E8;
  --txt-3: #A48FB8;
  --safe: #6FE0D2;
  --danger: #FF5F78;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 10px 26px rgba(6, 2, 14, 0.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #0A0514; color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
}
body { overflow: hidden; }

.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  background: radial-gradient(120% 80% at 50% 0%, #2A1043 0%, #12081F 55%, #0A0514 100%);
}

/* ---------- 背景 ---------- */
.scene-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  z-index: 0; pointer-events: none;
}
.scene-tint {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(70% 40% at 50% 8%, rgba(255, 138, 61, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(10, 5, 20, 0.55) 0%, rgba(10, 5, 20, 0) 26%, rgba(10, 5, 20, 0) 62%, rgba(10, 5, 20, 0.72) 100%);
}
.starfield { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.starfield i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #FFF3D6; opacity: 0.7;
  animation: twinkle 3.6s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.7); } 50% { opacity: 0.9; transform: scale(1.15); } }

/* ---------- 顶部 HUD ---------- */
.hud {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 16px 4px;
  flex: 0 0 auto;
}
.hud-player {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(48, 26, 74, 0.9), rgba(26, 14, 42, 0.9));
  border: 1px solid var(--card-line);
  box-shadow: 0 6px 16px rgba(6, 2, 14, 0.45), inset 0 1px 0 rgba(255, 226, 180, 0.16);
  min-width: 0;
}
.avatar {
  position: relative; width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #FFB35C, #E45E1D);
  border: 1.5px solid rgba(255, 226, 180, 0.75);
  box-shadow: 0 0 12px rgba(255, 138, 61, 0.45);
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-char { font-size: 15px; font-weight: 800; color: #3A1A08; }
.hud-player-txt { display: flex; flex-direction: column; min-width: 0; }
.hud-player-txt b {
  font-size: 13px; font-weight: 700; letter-spacing: 0.2px;
  max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hud-player-txt small { font-size: 10px; color: var(--txt-3); margin-top: 1px; }

.hud-right { display: flex; align-items: center; gap: 8px; }
.hud-shop {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gold-soft); font-size: 20px;
  background: linear-gradient(180deg, rgba(48, 26, 74, 0.92), rgba(26, 14, 42, 0.92));
  border: 1px solid var(--card-line);
  box-shadow: 0 6px 16px rgba(6, 2, 14, 0.45);
  transition: transform 0.12s ease;
}
.hud-shop:active { transform: scale(0.92); }
.points-pill {
  display: flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 12px 0 10px;
  border-radius: 999px;
  color: #3A1A08;
  background: linear-gradient(180deg, #FFD98E, #FFA94F 60%, #F0842C);
  border: 1px solid rgba(255, 240, 200, 0.85);
  box-shadow: 0 6px 18px rgba(255, 138, 61, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 13px; font-weight: 800;
  transition: transform 0.12s ease;
}
.points-pill:active { transform: scale(0.94); }
.points-pill i { font-size: 17px; }
.points-pill b { font-size: 15px; font-variant-numeric: tabular-nums; }
.points-pill span { font-size: 10px; font-weight: 700; opacity: 0.72; }
.points-pill .plus {
  font-style: normal; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
  background: rgba(58, 26, 8, 0.18); margin-left: 1px;
}

/* ---------- 舞台 ---------- */
.stage {
  position: relative; z-index: 4;
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding: 2px 16px 0;
}
.arena-ring {
  position: relative; width: 118px; height: 118px; flex: 0 0 auto;
  margin-top: 2px;
  display: grid; place-items: center;
}
.ring-progress { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 226, 180, 0.14); stroke-width: 4; }
.ring-fill {
  fill: none; stroke: url(#none); stroke: var(--orange); stroke-width: 4;
  stroke-linecap: round; stroke-dasharray: 333; stroke-dashoffset: 333;
  transition: stroke-dashoffset 0.12s linear, stroke 0.3s ease;
  filter: drop-shadow(0 0 6px rgba(255, 138, 61, 0.8));
}
.ring-dash {
  position: absolute; inset: 6px; border-radius: 50%;
  border: 1px dashed rgba(255, 195, 120, 0.28);
  animation: spin 22s linear infinite;
}
.ring-dash-b { inset: 14px; border-style: dotted; border-color: rgba(127, 230, 242, 0.22); animation-direction: reverse; animation-duration: 16s; }
@keyframes spin { to { transform: rotate(360deg); } }
.ring-core {
  position: relative; width: 84px; height: 84px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(255, 176, 92, 0.34), rgba(26, 14, 42, 0.94) 68%);
  border: 1px solid rgba(255, 195, 120, 0.4);
  box-shadow: inset 0 0 18px rgba(255, 138, 61, 0.35), 0 8px 22px rgba(6, 2, 14, 0.5);
}
.ring-label { font-size: 10px; color: var(--txt-3); letter-spacing: 2px; }
.ring-num { font-size: 26px; line-height: 1; font-weight: 800; color: var(--gold-soft); text-shadow: 0 0 12px rgba(255, 138, 61, 0.7); }
.ring-sub { font-size: 10px; color: var(--orange); letter-spacing: 1px; margin-top: 1px; }

/* 星台 */
.pads {
  position: relative; width: 100%; flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 8px 6px; align-content: center; justify-items: center;
  padding: 6px 0 4px;
}
.pad {
  position: relative; width: 100%; max-width: 108px; aspect-ratio: 160 / 110;
  border: 0; padding: 0; background: transparent;
  display: grid; place-items: center;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}
.pad:nth-child(4) { grid-column: 1 / 2; grid-row: 2; }
.pad:nth-child(5) { grid-column: 3 / 4; grid-row: 2; }
.pad img { width: 100%; height: 100%; display: block; }
.pad .pad-name {
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 1px; color: var(--txt-3);
  white-space: nowrap;
}
.pad .pad-mark {
  position: absolute; top: 6%; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 16px;
  opacity: 0; transition: opacity 0.2s ease;
}
.pad:active { transform: scale(0.95); }
.pad.is-me { transform: translateY(-4px) scale(1.04); filter: drop-shadow(0 0 14px rgba(255, 195, 120, 0.75)); }
.pad.is-me .pad-name { color: var(--gold-soft); font-weight: 700; }
.pad.is-danger { animation: padShake 0.4s ease-in-out infinite; }
.pad.is-danger .pad-mark { opacity: 1; color: var(--danger); text-shadow: 0 0 10px rgba(255, 95, 120, 0.9); }
.pad.is-danger img { filter: drop-shadow(0 0 12px rgba(255, 95, 120, 0.85)) saturate(1.4) hue-rotate(-18deg); }
.pad.is-safe .pad-mark { opacity: 1; color: var(--safe); }
.pad.is-hit { animation: padHit 0.5s ease-out; }
@keyframes padShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes padHit { 0% { filter: brightness(2.4); transform: scale(1.1); } 100% { filter: none; transform: scale(1); } }

/* 修士 */
.hero {
  position: absolute; left: 50%; bottom: 2px;
  width: 74px; height: 98px; transform: translateX(-50%);
  z-index: 3; pointer-events: none;
  transition: left 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), bottom 0.22s ease;
}
.hero-rune {
  position: absolute; left: 50%; bottom: -4px; width: 62px; height: 16px;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 176, 92, 0.55), transparent 70%);
  filter: blur(3px);
}
.hero-img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(6, 2, 14, 0.6)); }
.hero.is-jump .hero-img { animation: heroJump 0.34s ease-out; }
.hero.is-shock .hero-img { animation: heroShock 0.5s ease-out; }
@keyframes heroJump { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(-16px) scale(1.06); } 100% { transform: translateY(0) scale(1); } }
@keyframes heroShock { 0%, 100% { transform: translateX(0); filter: drop-shadow(0 0 0 transparent); } 20% { transform: translateX(-5px) rotate(-6deg); filter: brightness(2.2); } 60% { transform: translateX(5px) rotate(6deg); filter: brightness(1.6); } }

/* 雷 */
.bolt-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.bolt-glow { fill: none; stroke: rgba(255, 176, 92, 0.55); stroke-width: 9; filter: url(#boltGlowFilter); stroke-dasharray: 100; stroke-dashoffset: 100; }
.bolt-main { fill: none; stroke: #FFF6D8; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.bolt-branch { fill: none; stroke: rgba(255, 226, 180, 0.8); stroke-width: 1.6; stroke-dasharray: 100; stroke-dashoffset: 100; }
.bolt-layer.strike .bolt-glow { animation: boltDraw 0.42s ease-out forwards; }
.bolt-layer.strike .bolt-main { animation: boltDraw 0.3s ease-out forwards; }
.bolt-layer.strike .bolt-branch { animation: boltDraw 0.36s 0.04s ease-out forwards; }
@keyframes boltDraw { 0% { stroke-dashoffset: 100; opacity: 0; } 22% { opacity: 1; } 55% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }

.flash { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 40%, rgba(255, 246, 216, 0.85), rgba(255, 138, 61, 0.25) 45%, transparent 72%); }
.flash.on { animation: flashOut 0.42s ease-out; }
@keyframes flashOut { 0% { opacity: 0.95; } 100% { opacity: 0; } }

.combo {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%, 0) scale(0.8);
  z-index: 7; pointer-events: none; opacity: 0;
  font-size: 22px; font-weight: 900; letter-spacing: 1px;
  color: var(--gold-soft); text-shadow: 0 0 16px rgba(255, 138, 61, 0.9), 0 2px 0 rgba(58, 26, 8, 0.6);
  white-space: nowrap;
}
.combo.show { animation: comboPop 0.9s ease-out; }
@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.7); }
  25% { opacity: 1; transform: translate(-50%, -6px) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -26px) scale(0.96); }
}
.pulse-ring { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; opacity: 0; border: 2px solid rgba(255, 226, 180, 0.8); }
.pulse-ring.on { animation: pulseOut 0.7s ease-out; }
@keyframes pulseOut { 0% { opacity: 0.9; width: 10px; height: 10px; } 100% { opacity: 0; width: 320px; height: 320px; } }

/* ---------- 底部面板 ---------- */
.dock {
  position: relative; z-index: 8; flex: 0 0 auto;
  margin: 0 10px 10px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(44, 24, 68, 0.94), rgba(20, 11, 34, 0.97));
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 226, 180, 0.16);
  padding: 10px 14px 14px;
  backdrop-filter: blur(10px);
}
.dock-grip { width: 38px; height: 4px; border-radius: 2px; background: rgba(255, 226, 180, 0.28); margin: 0 auto 8px; }
.dock-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; letter-spacing: 1.4px; color: var(--orange);
  text-transform: uppercase;
}
.eyebrow i { font-size: 13px; }
.dock-head h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: 1px; color: var(--txt); }
.dock-head p { margin: 3px 0 0; font-size: 11px; color: var(--txt-3); letter-spacing: 0.4px; }
.how-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--gold-soft);
  background: rgba(255, 195, 120, 0.12);
  border: 1px solid rgba(255, 195, 120, 0.32);
  transition: transform 0.12s ease;
}
.how-btn:active { transform: scale(0.94); }
.how-btn i { font-size: 15px; }

.rule-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.rule-list li {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-md);
  background: rgba(255, 246, 234, 0.05);
  border: 1px solid rgba(255, 226, 180, 0.1);
}
.rule-ico {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px;
  display: grid; place-items: center; font-size: 17px;
}
.rule-ico.orange { color: #FFB35C; background: rgba(255, 138, 61, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 138, 61, 0.3); }
.rule-ico.cyan { color: var(--cyan); background: rgba(127, 230, 242, 0.13); box-shadow: inset 0 0 0 1px rgba(127, 230, 242, 0.28); }
.rule-ico.gold { color: var(--gold); background: rgba(255, 199, 119, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 199, 119, 0.3); }
.rule-copy { flex: 1 1 auto; min-width: 0; }
.rule-copy b { display: block; font-size: 12.5px; font-weight: 700; }
.rule-copy p { margin: 2px 0 0; font-size: 10.5px; color: var(--txt-3); line-height: 1.35; }
.rule-tag {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; color: var(--gold-soft);
  padding: 3px 7px; border-radius: 8px; background: rgba(255, 195, 120, 0.14);
}
.arena-stack { display: flex; flex: 0 0 auto; }
.arena-stack span {
  width: 20px; height: 20px; border-radius: 50%; margin-left: -6px;
  display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #3A1A08;
  background: linear-gradient(160deg, #FFD98E, #F0842C);
  border: 1.5px solid rgba(20, 11, 34, 0.9);
}
.arena-stack span:first-child { margin-left: 0; }

.need-bar {
  display: flex; align-items: center; gap: 9px;
  margin-top: 9px; padding: 9px 11px; border-radius: var(--r-md);
  background: linear-gradient(100deg, rgba(255, 138, 61, 0.18), rgba(255, 95, 120, 0.1));
  border: 1px solid rgba(255, 195, 120, 0.26);
}
.need-ico { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; color: var(--gold-soft); background: rgba(255, 226, 180, 0.14); }
.need-main { flex: 1 1 auto; min-width: 0; }
.need-main b { display: block; font-size: 12px; }
.need-main small { font-size: 10px; color: var(--txt-3); }
.need-price { text-align: right; flex: 0 0 auto; }
.need-price strong { font-size: 17px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.need-price em { font-style: normal; font-size: 10px; color: var(--txt-3); margin-left: 2px; }
.need-price small { display: block; font-size: 9.5px; color: var(--txt-3); }

.dock-cta { display: flex; gap: 9px; margin-top: 11px; }
.btn-main {
  flex: 1 1 auto; height: 50px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 16px; font-weight: 800; letter-spacing: 1px; color: #3A1A08;
  background: linear-gradient(180deg, #FFD98E, #FFA94F 55%, #F0842C);
  border: 1px solid rgba(255, 240, 200, 0.9);
  box-shadow: 0 8px 20px rgba(255, 138, 61, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-main:active { transform: translateY(2px) scale(0.985); box-shadow: 0 3px 10px rgba(255, 138, 61, 0.4); }
.btn-main i { font-size: 20px; }
.btn-sub {
  flex: 0 0 92px; height: 50px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: var(--gold-soft);
  background: rgba(255, 195, 120, 0.12);
  border: 1px solid rgba(255, 195, 120, 0.34);
  transition: transform 0.12s ease;
}
.btn-sub:active { transform: scale(0.96); }
.btn-sub i { font-size: 17px; }

/* 游戏中面板 */
.dock-play { display: none; }
.dock-play.on { display: block; }
.play-grid { display: flex; align-items: center; gap: 8px; }
.play-round { flex: 1 1 auto; min-width: 0; }
.play-round span { font-size: 10px; color: var(--txt-3); letter-spacing: 1px; }
.play-round b { display: block; font-size: 15px; color: var(--gold-soft); }
.play-stat { text-align: center; flex: 0 0 auto; padding: 0 8px; border-left: 1px solid rgba(255, 226, 180, 0.14); }
.play-stat span { display: block; font-size: 9.5px; color: var(--txt-3); }
.play-stat b { font-size: 15px; font-variant-numeric: tabular-nums; }
.quit-btn {
  flex: 0 0 auto; height: 32px; padding: 0 12px; border-radius: 10px;
  font-size: 12px; font-weight: 700; color: var(--txt-2);
  background: rgba(255, 246, 234, 0.08);
  border: 1px solid rgba(255, 226, 180, 0.18);
}
.quit-btn:active { transform: scale(0.95); }
.timer-track { height: 6px; border-radius: 3px; background: rgba(255, 246, 234, 0.1); margin: 9px 0 8px; overflow: hidden; }
.timer-track i { display: block; height: 100%; width: 100%; border-radius: 3px; background: linear-gradient(90deg, #7FE6F2, #FFC777 55%, #FF5F78); transition: width 0.1s linear; }
.play-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.play-hint { margin: 0; font-size: 11.5px; color: var(--txt-2); }
.play-items { display: flex; gap: 5px; }
.play-items span {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; color: var(--gold-soft);
  padding: 3px 7px; border-radius: 8px; background: rgba(255, 195, 120, 0.14);
}
.play-items span i { font-size: 12px; }

/* ---------- 弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 20; background: rgba(6, 2, 14, 0.66);
  opacity: 0; pointer-events: none; transition: opacity 0.24s ease;
  backdrop-filter: blur(2px);
}
.sheet-mask.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-height: 86vh; display: flex; flex-direction: column;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #2C1844, #150B22 70%);
  border-top: 1px solid rgba(255, 195, 120, 0.3);
  box-shadow: 0 -12px 40px rgba(6, 2, 14, 0.7);
  transform: translateY(102%); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.on { transform: translateY(0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 226, 180, 0.3); margin: 9px auto 4px; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 4px 18px 8px; flex: 0 0 auto; }
.sheet-head h3 { margin: 3px 0 0; font-size: 19px; letter-spacing: 0.6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; color: var(--txt-2);
  background: rgba(255, 246, 234, 0.08);
  border: 1px solid rgba(255, 226, 180, 0.16);
}
.icon-btn:active { transform: scale(0.92); }
.sheet-scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 18px 14px; }
.sheet-cta {
  flex: 0 0 auto; margin: 0 18px 14px; height: 48px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 15px; font-weight: 800; color: #3A1A08;
  background: linear-gradient(180deg, #FFD98E, #FFA94F 55%, #F0842C);
  border: 1px solid rgba(255, 240, 200, 0.9);
  box-shadow: 0 8px 20px rgba(255, 138, 61, 0.4);
}
.sheet-cta:active { transform: translateY(2px); }
.sheet-cta.ghost { color: var(--gold-soft); background: rgba(255, 195, 120, 0.12); border-color: rgba(255, 195, 120, 0.34); box-shadow: none; }
.sheet-cta i { font-size: 19px; }

.rule-hero {
  border-radius: var(--r-md); padding: 13px;
  background: linear-gradient(150deg, rgba(255, 138, 61, 0.2), rgba(255, 95, 120, 0.08));
  border: 1px solid rgba(255, 195, 120, 0.26);
}
.rule-hero-top { display: flex; gap: 6px; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; color: #3A1A08;
  padding: 3px 9px; border-radius: 999px;
  background: linear-gradient(180deg, #FFD98E, #FFA94F);
}
.hero-chip.ghost { color: var(--gold-soft); background: rgba(255, 195, 120, 0.14); border: 1px solid rgba(255, 195, 120, 0.3); }
.hero-chip i { font-size: 13px; }
.rule-hero h4 { margin: 9px 0 5px; font-size: 15px; }
.rule-hero p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--txt-2); }
.diagram { display: flex; gap: 6px; margin: 11px 0 7px; }
.d-pad {
  flex: 1 1 0; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px;
  background: rgba(127, 230, 242, 0.12);
  border: 1px solid rgba(127, 230, 242, 0.3);
  color: var(--safe);
}
.d-pad:first-child { background: rgba(255, 95, 120, 0.16); border-color: rgba(255, 95, 120, 0.5); color: var(--danger); }
.diagram-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--txt-3); }
.diagram-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.danger { background: var(--danger); box-shadow: 0 0 8px rgba(255, 95, 120, 0.8); }
.dot.safe { background: var(--safe); box-shadow: 0 0 8px rgba(111, 224, 210, 0.7); }

.sheet-section { margin-top: 14px; }
.sheet-section h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; font-size: 14px; }
.s-ico { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; color: var(--gold-soft); background: rgba(255, 195, 120, 0.14); }
.sheet-section p { margin: 0; font-size: 12px; line-height: 1.65; color: var(--txt-2); }
.share-btn {
  margin-top: 9px; height: 38px; padding: 0 14px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--gold-soft);
  background: rgba(255, 195, 120, 0.12); border: 1px solid rgba(255, 195, 120, 0.32);
}
.share-btn:active { transform: scale(0.96); }
.share-btn i { font-size: 16px; }
.cost-table { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cost-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 11px;
  background: rgba(255, 246, 234, 0.05);
  border: 1px solid rgba(255, 226, 180, 0.1);
  font-size: 12px;
}
.cost-row span { flex: 0 0 74px; color: var(--txt-2); }
.cost-row b { flex: 0 0 auto; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.cost-row em { flex: 1 1 auto; text-align: right; font-style: normal; font-size: 10.5px; color: var(--txt-3); }
.cost-row.total { background: rgba(255, 138, 61, 0.16); border-color: rgba(255, 195, 120, 0.3); }
.cost-tip { display: flex; align-items: center; gap: 5px; margin-top: 8px !important; font-size: 10.5px !important; color: var(--txt-3) !important; }
.cost-tip i { font-size: 13px; }

/* 星辉阁 */
.wallet {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(255, 138, 61, 0.22), rgba(255, 95, 120, 0.1));
  border: 1px solid rgba(255, 195, 120, 0.28);
}
.wallet-main { flex: 1 1 auto; }
.wallet-main span { font-size: 10.5px; color: var(--txt-3); }
.wallet-main b { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 24px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.wallet-main b i { font-size: 19px; }
.wallet-main b em { font-style: normal; }
.ad-btn {
  flex: 0 0 auto; height: 40px; padding: 0 13px; border-radius: 13px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 800; color: #3A1A08;
  background: linear-gradient(180deg, #FFD98E, #FFA94F 55%, #F0842C);
  border: 1px solid rgba(255, 240, 200, 0.9);
  box-shadow: 0 6px 16px rgba(255, 138, 61, 0.4);
}
.ad-btn:active { transform: scale(0.95); }
.ad-btn i { font-size: 17px; }
.shop-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.shop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--r-md);
  background: rgba(255, 246, 234, 0.05);
  border: 1px solid rgba(255, 226, 180, 0.12);
}
.shop-item .s-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; font-size: 20px; }
.shop-item .s-copy { flex: 1 1 auto; min-width: 0; }
.shop-item .s-copy b { display: block; font-size: 13px; }
.shop-item .s-copy p { margin: 2px 0 0; font-size: 10.5px; color: var(--txt-3); }
.shop-item .s-buy {
  flex: 0 0 auto; height: 34px; padding: 0 12px; border-radius: 11px;
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 800; color: #3A1A08;
  background: linear-gradient(180deg, #FFD98E, #FFA94F);
  border: 1px solid rgba(255, 240, 200, 0.85);
}
.shop-item .s-buy:active { transform: scale(0.95); }
.shop-item .s-buy.owned { color: var(--safe); background: rgba(111, 224, 210, 0.14); border-color: rgba(111, 224, 210, 0.4); }
.shop-item .s-buy i { font-size: 13px; }
.shop-note { display: flex; gap: 5px; margin: 11px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--txt-3); }
.shop-note i { font-size: 13px; flex: 0 0 auto; }

/* 结算 */
.modal-mask {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: rgba(6, 2, 14, 0.72); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.24s ease;
  padding: 24px;
}
.modal-mask.on { opacity: 1; pointer-events: auto; }
.result-card {
  position: fixed; left: 50%; top: 50%; z-index: 31;
  width: calc(100% - 48px); max-width: 340px;
  transform: translate(-50%, -46%) scale(0.94); opacity: 0; pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
  border-radius: 24px; padding: 20px 18px 16px;
  background: linear-gradient(180deg, #33194F, #170D26 72%);
  border: 1px solid rgba(255, 195, 120, 0.34);
  box-shadow: 0 20px 50px rgba(6, 2, 14, 0.8), inset 0 1px 0 rgba(255, 226, 180, 0.2);
  text-align: center;
}
.result-card.on { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.result-card .r-badge {
  width: 62px; height: 62px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 176, 92, 0.5), rgba(26, 14, 42, 0.9) 70%);
  border: 1px solid rgba(255, 195, 120, 0.5);
  box-shadow: 0 0 22px rgba(255, 138, 61, 0.5);
  color: var(--gold-soft);
}
.result-card h3 { margin: 0; font-size: 19px; letter-spacing: 1px; }
.result-card .r-sub { margin: 5px 0 0; font-size: 11.5px; color: var(--txt-3); }
.result-card .r-stats { display: flex; gap: 8px; margin: 14px 0 0; }
.result-card .r-stats div {
  flex: 1 1 0; padding: 9px 6px; border-radius: 13px;
  background: rgba(255, 246, 234, 0.06);
  border: 1px solid rgba(255, 226, 180, 0.12);
}
.result-card .r-stats span { display: block; font-size: 9.5px; color: var(--txt-3); }
.result-card .r-stats b { font-size: 17px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.result-card .r-actions { display: flex; gap: 8px; margin-top: 14px; }
.result-card .r-actions button { flex: 1 1 0; height: 44px; border-radius: 14px; font-size: 14px; font-weight: 800; }
.result-card .r-again {
  color: #3A1A08;
  background: linear-gradient(180deg, #FFD98E, #FFA94F 55%, #F0842C);
  border: 1px solid rgba(255, 240, 200, 0.9);
  box-shadow: 0 8px 18px rgba(255, 138, 61, 0.4);
}
.result-card .r-again:active { transform: translateY(2px); }
.result-card .r-ad {
  color: var(--gold-soft); background: rgba(255, 195, 120, 0.12);
  border: 1px solid rgba(255, 195, 120, 0.34);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.result-card .r-ad:active { transform: scale(0.96); }
.result-card .r-ad i { font-size: 16px; }

/* 广告 */
.ad-mask { z-index: 40; }
.ad-card {
  width: calc(100% - 56px); max-width: 300px; padding: 22px 18px 18px;
  border-radius: 22px; text-align: center;
  background: linear-gradient(180deg, #33194F, #170D26 72%);
  border: 1px solid rgba(255, 195, 120, 0.34);
  box-shadow: 0 20px 50px rgba(6, 2, 14, 0.8);
}
.ad-orbit { width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 176, 92, 0.5), rgba(26, 14, 42, 0.9) 70%);
  border: 1px solid rgba(255, 195, 120, 0.5); animation: spin 6s linear infinite; }
.ad-star { font-size: 28px; color: var(--gold-soft); animation: spin 6s linear infinite reverse; }
.ad-card h3 { margin: 0; font-size: 16px; }
.ad-card p { margin: 6px 0 0; font-size: 11.5px; color: var(--txt-2); }
.ad-track { height: 6px; border-radius: 3px; background: rgba(255, 246, 234, 0.12); margin: 12px 0 8px; overflow: hidden; }
.ad-track i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #FFC777, #FF8A3D); transition: width 0.2s linear; }
.ad-card small { font-size: 10px; color: var(--txt-3); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 50;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  max-width: 78vw; padding: 9px 16px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--txt);
  background: rgba(20, 11, 34, 0.94);
  border: 1px solid rgba(255, 195, 120, 0.3);
  box-shadow: 0 10px 24px rgba(6, 2, 14, 0.6);
  transition: opacity 0.22s ease, transform 0.22s ease;
  text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 680px) {
  .arena-ring { width: 96px; height: 96px; }
  .ring-core { width: 70px; height: 70px; }
  .ring-num { font-size: 22px; }
  .hero { width: 62px; height: 82px; }
  .rule-list li { padding: 6px 9px; }
  .dock-head h2 { font-size: 18px; }
}
