/* ============================================================
   刮点大的 · 街机刮刮乐  v2
   深色街机机台 + 霓虹发光 + 像素字体 + CRT 扫描线
   （上一版保存在 ../Cursor-v1-backup）
   ============================================================ */

@font-face {
  font-family: "Press Start 2P";
  src: url("./fonts/PressStart2P.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-body: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;

  --bg: #17100d;
  --surface: #1f1612;
  --surface-2: #2b1f19;
  --surface-3: #382a21;
  --line: rgba(255, 255, 255, 0.12);

  --pink: #e0795e;
  --cyan: #e0b070;
  --yellow: #f0c566;
  --green: #9ccc8a;
  --purple: #c79ab0;
  --orange: #e8925c;
  --red: #d9625a;

  --text: #f5e9da;
  --text-dim: #cbb8a3;
  --text-mute: #967f6d;

  --glow-pink: 0 0 10px rgba(224, 121, 94, 0.28);
  --glow-cyan: 0 0 10px rgba(224, 176, 112, 0.25);
  --glow-gold: 0 0 12px rgba(240, 197, 102, 0.28);
}

* { box-sizing: border-box; }

html { scrollbar-color: #6b4a32 var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(224, 121, 94, 0.13), transparent 55%),
    radial-gradient(ellipse at 95% 35%, rgba(224, 176, 112, 0.06), transparent 50%),
    radial-gradient(ellipse at 0% 70%, rgba(199, 154, 176, 0.07), transparent 50%),
    var(--bg);
  padding: 18px 14px 60px;
  overflow-x: hidden;
}

/* 底部霓虹透视网格 */
body::before {
  content: "";
  position: fixed;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 55vh;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(224, 121, 94, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 176, 112, 0.13) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 85%);
  mask-image: linear-gradient(to top, #000 5%, transparent 85%);
}

@keyframes gridRun {
  to { background-position: 0 64px, 64px 0; }
}

/* CRT 扫描线 + 暗角 */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 65%, rgba(0, 0, 0, 0.28) 100%);
}

.hidden { display: none !important; }

button { font-family: inherit; }

/* ========== 机台外壳 ========== */
.cabinet {
  position: relative;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 26px 20px 20px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(58, 42, 32, 0.55), transparent 220px),
    var(--surface);
  border: 2px solid rgba(224, 121, 94, 0.7);
  box-shadow:
    0 0 0 4px #140e0b,
    0 0 0 5px rgba(224, 176, 112, 0.35),
    0 16px 50px rgba(0, 0, 0, 0.5);
}

/* 机台顶部跑马灯泡 */
.cabinet::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 24px;
  right: 24px;
  height: 8px;
  background: radial-gradient(circle, var(--yellow) 0 2.5px, transparent 3.5px) 0 0 / 20px 8px repeat-x;
  opacity: 0.35;
}

@keyframes bulbs {
  0% { opacity: 1; background-position: 0 0; }
  50% { opacity: 0.55; background-position: 10px 0; }
  100% { opacity: 1; background-position: 0 0; }
}

/* ========== 顶部招牌 ========== */
.marquee {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.title-block { display: grid; gap: 6px; }

.arcade-tag {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #f8e6bd 0%, var(--yellow) 42%, #e39a6c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 2px 0 #3a1f17);
}

.subtitle {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 600;
}

.header-right { display: grid; gap: 10px; justify-items: end; }

.tool-row { display: flex; gap: 8px; }

.icon-btn {
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.icon-btn:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(224, 176, 112, 0.08); }

/* 钱包：像素 LCD */
.coin-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #0e0907;
  border: 2px solid rgba(240, 197, 102, 0.75);
  box-shadow: inset 0 0 14px rgba(240, 197, 102, 0.08);
}

.coin-panel::before { content: "🪙"; font-size: 1.4rem; }

.coin-panel span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 0.08em;
}

#coin-balance {
  font-family: var(--font-pixel);
  font-size: 1.6rem;
  min-width: 4.2ch;
  text-align: right;
  color: #f3e3a6;
}

#coin-balance.bounce { animation: coinBounce 0.5s ease; }

@keyframes coinBounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.18); }
  60% { transform: scale(0.96); }
}

/* ========== 爆奖播报 ========== */
.ticker-section {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0e0907;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  overflow: hidden;
}

.ticker-title {
  flex: none;
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: #120c0a;
  background: var(--pink);
  padding: 5px 8px;
  border-radius: 4px;
}

.ticker-line { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.82rem; color: var(--text-dim); }

.ticker-line span { display: inline; }

@keyframes marquee { to { transform: translateX(-100%); } }

/* ========== 主布局 ========== */
.play-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.stage { grid-column: 1 / -1; order: -1; min-width: 0; }

@media (min-width: 1240px) {
  .play-grid { grid-template-columns: 230px minmax(0, 1fr) 250px; }
  .stage { grid-column: auto; order: 0; }
}

@media (max-width: 760px) {
  .play-grid { grid-template-columns: minmax(0, 1fr); }
  .cabinet { padding: 22px 12px 14px; border-radius: 16px; }
}

.rail { display: grid; gap: 14px; min-width: 0; align-content: start; }

/* 通用面板 */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(58, 42, 32, 0.7), rgba(34, 24, 19, 0.85));
  border: 2px solid rgba(199, 154, 176, 0.28);
  border-radius: 12px;
  padding: 12px 14px 14px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.panel-title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border-bottom: 1px dashed rgba(224, 176, 112, 0.3);
}

/* 通用进度条 */
.bar {
  height: 10px;
  border-radius: 999px;
  background: #0e0907;
  border: 1px solid var(--line);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  transition: width 0.35s ease;
}

.bar-cards i { background: linear-gradient(90deg, var(--cyan), var(--purple)); }

/* 目标 */
/* 通关目标：顶部醒目横条 */
.goal-strip {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border: 2px solid rgba(240, 197, 102, 0.6);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(240, 197, 102, 0.12), rgba(58, 42, 32, 0.6));
}

.goal-head { display: flex; align-items: center; gap: 12px; min-width: 0; }

.goal-badge {
  flex: none;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 6px 8px;
  border-radius: 4px;
  color: #1f1612;
  background: var(--yellow);
}

.goal-title { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--text); font-weight: 800; }

.goal-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.goal-meter { display: grid; gap: 6px; }
.goal-meter-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.86rem; font-weight: 700; color: var(--text-dim); }
.goal-meter-row b { font-family: var(--font-pixel); font-size: 0.85rem; color: var(--text); }
.goal-strip .bar { height: 14px; }

.victory-goal.all-done { border-color: var(--green); background: linear-gradient(90deg, rgba(156, 204, 138, 0.16), rgba(58, 42, 32, 0.6)); }
.victory-goal.all-done .goal-title { color: var(--green); }


/* 最近开奖 */
#history-list { margin: 0; padding: 0; list-style: none; max-height: 300px; overflow: auto; font-size: 0.78rem; line-height: 1.4; }
#history-list:empty::before { content: "还没有动态"; color: var(--text-mute); }

#history-list li {
  padding: 6px 4px 6px 16px;
  position: relative;
  color: var(--text-dim);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

#history-list li::before { content: "▸"; position: absolute; left: 2px; color: var(--text-mute); }
#history-list li.win-big { color: var(--yellow); font-weight: 700; }
#history-list li.win-big::before { content: "★"; color: var(--yellow); }
#history-list li.loss { color: #e89a8a; }
#history-list li.item { color: var(--cyan); }
#history-list li.item::before { content: "◆"; color: var(--cyan); }
#history-list li.card { color: var(--purple); font-weight: 700; }
#history-list li.card::before { content: "◆"; color: var(--purple); }
#history-list li.achv { color: var(--green); font-weight: 700; }
#history-list li.achv::before { content: "★"; color: var(--green); }
#history-list li.buy { color: var(--text-mute); }

/* ========== 控制区 ========== */
.controls { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* 操作栏：左 状态，右 开刮按钮（与票根同宽对齐） */
.dock {
  width: min(640px, 100%);
  margin: 16px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.dock-info { display: grid; gap: 8px; justify-items: center; min-width: 0; }
.dock .active-effects { justify-content: center; }

/* 街机大按钮 */
.buy-btn {
  position: relative;
  border: 3px solid #3a1a10;
  border-radius: 14px;
  padding: 15px 38px;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(80, 30, 15, 0.6);
  background: linear-gradient(180deg, #f0a083 0%, var(--pink) 50%, #c25a3f 100%);
  box-shadow:
    0 6px 0 #7a3322,
    0 10px 18px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
}


@keyframes btnPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}

.buy-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 #7a3322, 0 12px 20px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35); }

.buy-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 #7a3322, inset 0 2px 4px rgba(0, 0, 0, 0.2); }

.buy-btn:disabled { font-size: 0.9rem;
  cursor: not-allowed;
  color: #8a7566;
  text-shadow: none;
  background: linear-gradient(180deg, #4a362b, #3a2a22);
  border-color: #2a1c14;
  box-shadow: 0 5px 0 #24180f;
}

.status-text {
  margin: 0;
  max-width: 640px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(14, 9, 7, 0.7);
  border: 1px dashed rgba(199, 154, 176, 0.4);
}

.status-text[danger] { color: #e89a8a; border-color: rgba(217, 98, 90, 0.5); }
.status-text[success] { color: var(--green); border-color: rgba(156, 204, 138, 0.45); }

.active-effects { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.active-effects:empty { display: none; }

.effect-pill {
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--purple);
  background: rgba(199, 154, 176, 0.16);
  color: #f0dcc4;
}

.coinflip-panel { display: grid; gap: 6px; justify-items: center; font-size: 0.82rem; color: var(--text-dim); }
.coinflip-panel p { margin: 0; }

/* ========== 奖券区域 ========== */
.ticket-area {
  position: relative;
  margin-top: 6px;
  display: flex;
  justify-content: center;
  min-height: 380px;
}

/* 奖券：左 主票面 + 右 票根（用点线分开，上下各有一个撕口） */
.ticket {
  position: relative;
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 0%, rgba(224, 121, 94, 0.10), transparent 45%),
    linear-gradient(160deg, #3b2a21, #2a1e18 60%, #33251d);
  border: 3px solid var(--yellow);
  box-shadow:
    0 0 0 2px #140e0b,
    0 18px 30px rgba(0, 0, 0, 0.45);
  animation: ticketEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ticket.hidden { display: none !important; }

/* 全息彩虹边光 */
.ticket::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 17px;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.04) 50%, transparent 60%);
}

@keyframes holo {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0 0; }
}

@keyframes ticketEnter {
  0% { opacity: 0; transform: translateY(-40px) scale(0.85) rotate(-3deg); }
  55% { transform: translateY(6px) scale(1.02) rotate(1deg); }
  100% { opacity: 1; transform: none; }
}

.ticket-main { padding: 14px 16px 12px; display: grid; gap: 9px; min-width: 0; align-content: start; position: relative; z-index: 1; }

.ticket-head { display: flex; align-items: center; gap: 8px; }

.ticket-brand { display: grid; margin-right: auto; line-height: 1.2; }

.brand-top {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  color: var(--yellow);
  text-shadow: 2px 2px 0 #6a2e1f;
}

.brand-sub { font-family: var(--font-pixel); font-size: 0.45rem; letter-spacing: 0.12em; color: var(--cyan); margin-top: 4px; }

.ticket-face,
.ticket-pool {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--text-dim);
  background: rgba(14, 9, 7, 0.6);
  border: 1px solid var(--line);
}

.ticket-face b, .ticket-pool b { font-family: var(--font-pixel); font-size: 0.7rem; margin-left: 3px; }
.ticket-face b { color: var(--cyan); }
.ticket-pool b { color: var(--yellow); }

.ticket-hint { margin: 0; text-align: center; font-size: 0.78rem; color: var(--text-dim); letter-spacing: 0.04em; }
.ticket-hint b { color: var(--yellow); }

/* ========== 刮刮区 ========== */
.scratch-container {
  position: relative;
  width: 100%;
  max-width: 282px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid #0e0907;
  box-shadow: 0 0 0 2px rgba(224, 176, 112, 0.4), inset 0 0 12px rgba(0, 0, 0, 0.6);
}

.result-card {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 6px, transparent 6px 12px),
    #1a110d;
}

.pattern-grid {
  position: absolute;
  inset: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
}

.symbol-cell {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 2px solid color-mix(in srgb, var(--c, #888) 45%, transparent);
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--c, #888) 30%, #2a1d16), #1d130f 78%);
  box-shadow: inset 0 0 10px color-mix(in srgb, var(--c, #888) 14%, transparent);
  transition: opacity 0.3s, filter 0.3s;
}

.symbol-icon { width: 64%; aspect-ratio: 1; display: grid; place-items: center; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--c, #fff) 45%, transparent)); }
.line-icon { width: 100%; height: 100%; display: block; }

/* 开奖后：中奖格高亮，其余变暗 */
.pattern-grid.has-win .symbol-cell,
.pattern-grid.no-win .symbol-cell { animation: cellIn 0.4s ease backwards; }

.pattern-grid.has-win .symbol-cell:not(.winner) { opacity: 0.3; filter: grayscale(0.75) brightness(0.7); }

.symbol-cell.winner {
  z-index: 1;
  border-color: var(--c);
  box-shadow: 0 0 0 2px var(--c), 0 0 12px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 14px color-mix(in srgb, var(--c) 28%, transparent);
  animation: cellIn 0.4s ease backwards;
}

.symbol-cell.winner::after {
  content: "✓";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: #120c0a;
  background: var(--c);
}

@keyframes cellIn {
  0% { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  70% { transform: scale(1.12) rotate(2deg); }
  100% { transform: none; }
}

@keyframes winnerGlow {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.35); }
}

/* 刮膜层 */
#scratch-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23e3bf55' stroke='%236b4f12' stroke-width='1.8'/%3E%3Ccircle cx='12' cy='12' r='6.2' fill='none' stroke='%236b4f12' stroke-width='1.3' stroke-dasharray='2 1.6'/%3E%3Cpath d='M6.5 8.5a6.5 6.5 0 0 1 5-3' stroke='%23fff3bf' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") 12 12, crosshair;
}

/* 刮下来的银屑 */
.flake {
  position: absolute;
  z-index: 3;
  width: 5px;
  height: 5px;
  background: linear-gradient(135deg, #fff, #9aa3b8);
  pointer-events: none;
  animation: flake 0.55s ease-out forwards;
}

@keyframes flake {
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* ========== 实时汇总 ========== */
.tally-wrap { display: grid; gap: 5px; justify-items: center; }

.tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 30px; }

.tally-chip,
.rb-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px 2px 4px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--c, #888) 60%, transparent);
  background: color-mix(in srgb, var(--c, #888) 14%, #1a110d);
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--text);
}

.chip-icon { width: 22px; height: 22px; display: inline-block; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c, #fff) 70%, transparent)); }

.tally-chip.hot { border-color: var(--c); animation: chipPop 0.35s ease; }
.tally-chip.rest { padding: 4px 10px; font-family: var(--font-body); font-size: 0.7rem; color: var(--text-mute); border-style: dashed; background: transparent; }

@keyframes chipPop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

.tally-hint { margin: 0; min-height: 1.3em; font-size: 0.8rem; font-weight: 700; color: var(--yellow); text-align: center; }

.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .bar { flex: 1; height: 8px; }
.bar-scratch i { background: linear-gradient(90deg, #9aa1b4, #e3e6ee); transition: width 0.1s linear; }

.scratch-progress { flex: none; font-size: 0.72rem; font-weight: 700; color: var(--text-dim); }

/* ========== 开奖盖章 ========== */
.result-banner {
  --tc: var(--text-mute);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 3px solid var(--tc);
  background: color-mix(in srgb, var(--tc) 16%, #120c0a);
  box-shadow: 0 0 12px color-mix(in srgb, var(--tc) 35%, transparent);
  animation: stampIn 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.result-banner.tier-hidden { --tc: #ffffff; border-image: linear-gradient(90deg, var(--pink), var(--yellow), var(--green), var(--cyan), var(--purple)) 1; background: linear-gradient(90deg, rgba(224, 121, 94, 0.25), rgba(240, 197, 102, 0.25), rgba(224, 176, 112, 0.25)); }
.result-banner.tier-grand { --tc: var(--pink); }
.result-banner.tier-first { --tc: var(--yellow); }
.result-banner.tier-second { --tc: var(--cyan); }
.result-banner.tier-third { --tc: var(--green); }
.result-banner.tier-fourth { --tc: #c9b08a; }
.result-banner.tier-lose { --tc: #8a7566; box-shadow: none; }

@keyframes stampIn {
  0% { opacity: 0; transform: scale(2.6) rotate(-9deg); }
  100% { opacity: 1; transform: none; }
}

.rb-main { display: grid; gap: 3px; }
.rb-tier { font-size: 1.3rem; font-weight: 900; letter-spacing: 0.06em; color: var(--tc); }
.tier-hidden .rb-tier { background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tier-lose .rb-tier { color: var(--text-dim); text-shadow: none; }
.rb-rule { font-size: 0.74rem; color: var(--text-dim); }
.rb-icons { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }

.rb-reward { display: grid; justify-items: end; line-height: 1.1; }
.rb-reward small { font-size: 0.62rem; color: var(--text-mute); }
.rb-reward b { font-family: var(--font-pixel); font-size: 1.15rem; color: var(--yellow); }
.tier-lose .rb-reward b { color: var(--text-mute); text-shadow: none; }

.reward-detail { margin: 0; text-align: center; font-size: 0.78rem; color: var(--text-dim); }

.ticket-detail summary { cursor: pointer; font-size: 0.72rem; color: var(--text-mute); user-select: none; }
.ticket-stats { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: rgba(14, 9, 7, 0.6); border: 1px dashed var(--line); }
.ticket-stats p { margin: 3px 0; font-size: 0.74rem; color: var(--text-dim); }

.ticket-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.ticket-counter { margin: 0; font-size: 0.68rem; color: var(--text-mute); }

.ticket-serial { margin: 0; font-family: var(--font-pixel); font-size: 0.45rem; letter-spacing: 0.1em; color: var(--text-mute); }

/* ========== 票根：奖级对照表 ========== */
.ticket-stub {
  position: relative;
  z-index: 1;
  padding: 14px 10px 14px;
  border-left: 2px dashed rgba(255, 255, 255, 0.32);
  display: grid;
  gap: 8px;
  align-content: start;
}

/* 街机按钮位：紧贴奖级表下方 */
.buy-slot { display: grid; padding-top: 8px; }
.buy-slot .buy-btn { width: 100%; padding: 16px 8px; font-size: 1.05rem; }
.ticket-placeholder .buy-slot { width: min(260px, 100%); }

/* 撕口：上下各一个半圆，颜色与机台底色一致 */
.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  left: -13px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--yellow);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

.ticket-stub::before { top: -15px; }
.ticket-stub::after { bottom: -15px; }

.stub-title { margin: 0; text-align: center; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.1em; color: var(--yellow); }

.stub-note { margin: 0; text-align: center; font-size: 0.64rem; color: var(--text-mute); }

.paytable { display: grid; gap: 5px; }

.pay-row {
  --tc: #c9b08a;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 8px;
  border-left: 4px solid var(--tc);
  background: rgba(14, 9, 7, 0.55);
  transition: opacity 0.3s, background 0.3s, box-shadow 0.3s;
}

.pay-row.tier-hidden { --tc: #ffffff; border-image: linear-gradient(180deg, var(--pink), var(--yellow), var(--cyan)) 1; }
.pay-row.tier-grand { --tc: var(--pink); }
.pay-row.tier-first { --tc: var(--yellow); }
.pay-row.tier-second { --tc: var(--cyan); }
.pay-row.tier-third { --tc: var(--green); }
.pay-row.tier-fourth { --tc: #c9b08a; }

.pay-name { font-size: 0.72rem; font-weight: 800; color: var(--tc); line-height: 1.2; }

.pay-pattern { display: grid; gap: 2px; min-width: 0; }
.pay-icons { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.pay-group { display: inline-flex; gap: 1px; }
.pay-plus { font-size: 0.6rem; color: var(--text-mute); margin: 0 2px; }
.mini-icon { width: 17px; height: 17px; display: inline-block; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--c, #fff) 60%, transparent)); }
.pay-desc { font-size: 0.6rem; color: var(--text-mute); }

.pay-reward { font-family: var(--font-pixel); font-size: 0.7rem; color: var(--yellow); text-align: right; min-width: 3ch; }

.pay-row.hit {
  background: color-mix(in srgb, var(--tc) 28%, #120c0a);
  box-shadow: inset 0 0 0 1.5px var(--tc);
}

.pay-row.hit .pay-name::after { content: " ◀ 中!"; font-size: 0.6rem; }
.pay-row.dim { opacity: 0.32; }

@keyframes rowBlink { 50% { filter: brightness(1.4); } }

/* ========== 占位：未开票时的说明 ========== */
.ticket-placeholder {
  width: min(640px, 100%);
  padding: 22px 20px 18px;
  border-radius: 20px;
  border: 3px dashed rgba(224, 121, 94, 0.45);
  background: rgba(58, 42, 32, 0.35);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.ph-insert {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  color: var(--pink);
  text-shadow: 3px 3px 0 #3a1f17;
}

@keyframes blink { 50% { opacity: 0.25; } }

.ph-sub { margin: 0; font-size: 0.85rem; color: var(--text-dim); }

.ph-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; font-size: 0.8rem; color: var(--text-dim); }
.ph-steps b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; margin-right: 5px; font-family: var(--font-pixel); font-size: 0.55rem; color: #120c0a; background: var(--cyan); }
.ph-steps em { color: var(--yellow); font-style: normal; font-weight: 800; }

.ticket-placeholder .paytable { width: min(420px, 100%); }

/* ========== 动效：大奖 / 差一点 / 彩纸 ========== */
.ticket.jackpot { animation: jackpotFlash 0.7s ease; }

@keyframes jackpotFlash {
  0%, 100% { filter: none; }
  40% { filter: brightness(1.2); transform: scale(1.015); }
}

.ticket.near-miss { animation: nearMissShake 0.32s ease; }

@keyframes nearMissShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

body.hidden-hit .cabinet { animation: hiddenHitFlash 0.9s ease; }

@keyframes hiddenHitFlash {
  50% { box-shadow: 0 0 0 4px #140e0b, 0 0 60px rgba(255, 255, 255, 0.45); }
}

.confetti {
  position: absolute;
  top: 45%;
  width: 8px;
  height: 8px;
  z-index: 20;
  pointer-events: none;
  animation: confetti var(--d, 1.2s) cubic-bezier(0.1, 0.7, 0.4, 1) forwards;
}

@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) * -0.2 + 340px)) rotate(var(--r)); opacity: 0; }
}

.coin-fly { position: fixed; z-index: 1300; font-size: 1.1rem; pointer-events: none; animation: coinFly 0.8s ease forwards; }

@keyframes coinFly { to { left: var(--target-x); top: var(--target-y); opacity: 0; transform: scale(0.7); } }

/* ========== 迷你按钮 / 补给站 ========== */
.mini-btn {
  border: 2px solid #3a1a10;
  background: linear-gradient(180deg, #f0c27a, #d09048);
  color: #3a2208;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #7a4f1c;
  transition: transform 0.06s, box-shadow 0.06s, filter 0.15s;
}

.mini-btn:hover:not(:disabled) { filter: brightness(1.12); }
.mini-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 #7a4f1c; }
.mini-btn:disabled { cursor: not-allowed; color: #8a7566; background: #3a2a22; box-shadow: 0 3px 0 #24180f; }

.shop-item { padding: 8px 0 10px; border-bottom: 1px dashed rgba(255, 255, 255, 0.1); }
.shop-item:last-child { border-bottom: 0; padding-bottom: 0; }
.shop-item .mini-btn { width: 100%; }

.shop-title { margin: 0; display: flex; justify-content: space-between; align-items: center; font-size: 0.84rem; font-weight: 800; color: var(--text); }
.shop-title span { font-family: var(--font-pixel); font-size: 0.6rem; color: var(--yellow); }
.shop-title span::before { content: "🪙 "; font-family: var(--font-body); }

.shop-desc { margin: 3px 0 7px; font-size: 0.72rem; line-height: 1.45; color: var(--text-mute); }

.jump-showcase-btn { width: 100%; background: linear-gradient(180deg, #dcb0c0, #b87c96); color: #3a1626; box-shadow: 0 3px 0 #6e3f55; }
.jump-showcase-btn.pulse { animation: hintPulse 1.6s ease-in-out 3; }

@keyframes hintPulse { 50% { filter: brightness(1.35); transform: translateY(-1px); } }

.coin-supply-widget {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 3px solid var(--yellow);
  background: linear-gradient(180deg, rgba(240, 197, 102, 0.18), rgba(232, 146, 92, 0.1));
  animation: supplyIn 0.2s ease;
}

.coin-supply-widget.supply-alert { box-shadow: var(--glow-gold); }

.supply-title { margin: 0; font-size: 0.8rem; font-weight: 900; letter-spacing: 0.1em; color: var(--yellow); }
.supply-text { margin: 0; font-size: 0.74rem; color: var(--text-dim); text-align: center; }
.supply-coin { width: 34px; height: 34px; display: grid; place-items: center; }
.supply-coin::before { content: "🪙"; font-size: 1.7rem; }
.supply-coin.play { animation: supplyCoinPop 0.62s ease; }

@keyframes supplyCoinPop {
  0% { transform: translateY(0) rotateY(0); }
  35% { transform: translateY(-26px) rotateY(540deg); }
  100% { transform: translateY(0) rotateY(1080deg); }
}

@keyframes supplyIn { from { opacity: 0; transform: translateY(-6px); } }
@keyframes supplyPulse { 50% { filter: brightness(1.2); } }

.coinflip-anim.flip { animation: supplyCoinPop 0.6s ease; }

/* ========== 折叠：规则 / 成就 ========== */
.achv-fold { padding: 0; }

.rules-fold summary, .achv-fold summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 14px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--cyan);
  user-select: none;
}

.rules-fold summary::-webkit-details-marker, .achv-fold summary::-webkit-details-marker { display: none; }
.rules-fold summary::after, .achv-fold summary::after { content: "▸"; float: right; color: var(--text-mute); transition: transform 0.2s; }
.rules-fold[open] summary::after, .achv-fold[open] summary::after { transform: rotate(90deg); }
.achv-fold[open] summary { border-bottom: 1px dashed rgba(224, 176, 112, 0.3); }
.rules-brief #rule-list-key { margin-bottom: 8px; }
.rules-fold { border-top: 1px dashed rgba(224, 176, 112, 0.3); padding-top: 4px; }
.rules-fold summary { padding: 6px 0; font-size: 0.8rem; }
.rules-fold ul { padding: 4px 0 0 !important; }
.achv-fold { margin-top: 14px; }
.achv-fold #achievement-list { padding: 12px; }

.showcase { margin-top: 18px; }
.showcase .panel-title small { margin-left: 8px; font-size: 0.72rem; font-weight: 600; color: var(--text-mute); letter-spacing: 0; }

#rule-list-key, #rule-list { margin: 0; padding: 0; list-style: none; font-size: 0.78rem; line-height: 1.55; }
#rule-list-key { margin-bottom: 10px; }
#rule-list-key li { padding: 3px 0 3px 16px; position: relative; font-weight: 700; color: var(--yellow); }
#rule-list-key li::before { content: "★"; position: absolute; left: 0; }
#rule-list li { padding: 5px 0 5px 16px; position: relative; color: var(--text-dim); border-bottom: 1px dashed rgba(255, 255, 255, 0.08); }
#rule-list li::before { content: "▸"; position: absolute; left: 2px; color: var(--cyan); }

#achievement-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }

#achievement-list li {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--text-mute);
  background: rgba(14, 9, 7, 0.55);
  color: var(--text-mute);
  opacity: 0.7;
}

#achievement-list li strong { font-size: 0.83rem; }
#achievement-list li span { font-size: 0.72rem; }
#achievement-list li.done { opacity: 1; color: var(--text); border-left-color: var(--green); background: linear-gradient(90deg, rgba(156, 204, 138, 0.14), rgba(14, 9, 7, 0.55)); }
#achievement-list li.new-unlock { animation: chipPop 0.6s ease; border-left-color: var(--yellow); }

/* ========== 展示柜 ========== */
.showcase-head { display: grid; gap: 4px; }
.showcase-head p { margin: 0; font-size: 0.76rem; color: var(--text-mute); }
.showcase-head .showcase-tip { color: var(--yellow); font-weight: 700; }

.cabinet-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }

.cabinet-slot {
  --rc: var(--cyan);
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--rc) 60%, transparent);
  background: linear-gradient(180deg, rgba(58, 42, 32, 0.8), rgba(26, 17, 13, 0.9));
}

.cabinet-slot.rarity-2 { --rc: var(--purple); }
.cabinet-slot.rarity-3 { --rc: var(--yellow); }

.cabinet-slot.locked { filter: grayscale(1); opacity: 0.6; box-shadow: none; }

.cabinet-card-face { border-radius: 8px; padding: 4px; background: rgba(14, 9, 7, 0.7); border: 1px solid var(--line); }
.cabinet-frame { position: relative; border-radius: 6px; padding: 5px; background: linear-gradient(180deg, #2a1d16, #1a110d); }

.card-title-cn { margin: 0; text-align: center; font-size: 0.8rem; font-weight: 900; color: var(--text); }
.card-title-en { margin: 1px 0 0; text-align: center; font-family: var(--font-pixel); font-size: 0.4rem; letter-spacing: 0.06em; color: var(--rc); text-transform: uppercase; }

.card-illustration { margin: 6px 0 4px; height: 130px; border-radius: 6px; overflow: hidden; position: relative; background: #0e0907; border: 1px solid var(--line); }
.cabinet-card-image { width: 100%; height: 100%; object-fit: contain; display: block; image-rendering: pixelated; }
.card-rarity { margin: 0; text-align: center; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--yellow); }

.cabinet-slot.locked .cabinet-frame::after {
  content: "???";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: #fff;
  background: rgba(14, 9, 7, 0.55);
  border-radius: 6px;
}

.cabinet-card-name { margin: 0; font-size: 0.88rem; font-weight: 800; color: var(--text); }
.cabinet-card-meta { margin: 0; font-size: 0.72rem; color: var(--text-dim); }
.cabinet-card-buff { margin: 0; min-height: 1.2em; font-size: 0.7rem; line-height: 1.45; color: var(--text-mute); }
.cabinet-card-stock { margin: 0; font-size: 0.68rem; color: var(--text-mute); }
.cabinet-actions { display: grid; gap: 5px; }
.cabinet-actions .mini-btn { padding: 6px 8px; }

/* ========== 提示 Toast ========== */
.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 1000;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 800;
  color: #120c0a;
  background: linear-gradient(180deg, #f6d68a, var(--yellow));
  border: 3px solid #3a1a10;
  box-shadow: 0 5px 0 #6b5410;
  animation: toastEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.fade-out { animation: toastExit 0.3s ease forwards; }

@keyframes toastEnter { from { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(0.8); } }
@keyframes toastExit { to { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.9); } }

.achv-toast { display: grid; gap: 2px; }
.achv-toast strong { font-size: 0.95rem; }
.achv-toast span { font-size: 0.8rem; opacity: 0.85; }
.achv-toast em { font-size: 0.76rem; font-style: normal; opacity: 0.75; }

/* ========== 结算浮层 ========== */
.settle-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: start center;
  padding-top: 18vh;
  pointer-events: none;
}

.settle-card {
  min-width: 190px;
  text-align: center;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(20, 13, 10, 0.9);
  border: 3px solid var(--text-mute);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  animation: settlePop 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.settle-tier { margin: 0 0 6px; font-size: 0.8rem; font-weight: 800; color: var(--text-dim); }
.settle-line { display: none; }
.settle-net { margin: 0; font-family: var(--font-pixel); font-size: 1.8rem; }
.settle-extra { margin: 6px 0 0; min-height: 1em; font-size: 0.72rem; color: var(--text-dim); max-width: 320px; }

.settle-overlay.win .settle-card { border-color: var(--green); }
.settle-overlay.win .settle-net { color: var(--green); }
.settle-overlay.lose .settle-net { color: #e89a8a; }
.settle-overlay.big-win .settle-card { border-color: var(--yellow); box-shadow: var(--glow-gold); }
.settle-overlay.big-win .settle-net { color: var(--yellow); }
.settle-overlay.fade-out .settle-card { animation: settleOut 0.35s ease forwards; }

@keyframes settlePop { from { transform: scale(0.6); opacity: 0; } }
@keyframes settleOut { to { transform: translateY(-14px) scale(0.95); opacity: 0; } }

/* ========== 游戏结束 / 通关 ========== */
.game-over-overlay,
.victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: 10px;
  background: radial-gradient(circle at 50% 35%, rgba(224, 121, 94, 0.25), rgba(14, 9, 7, 0.9));
  backdrop-filter: blur(4px);
}

.victory-overlay { z-index: 1700; background: radial-gradient(circle at 50% 30%, rgba(240, 197, 102, 0.28), rgba(14, 9, 7, 0.92)); }

.game-over-card,
.victory-card {
  border-radius: 18px;
  background: linear-gradient(180deg, #3b2a21, #1f1612);
  animation: gameOverIn 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.game-over-card {
  width: min(520px, 100%);
  padding: 26px 22px 22px;
  text-align: center;
  border: 3px solid var(--pink);
  box-shadow: 0 10px 0 #140e0b;
}

.game-over-tag { margin: 0 0 14px; font-family: var(--font-pixel); font-size: clamp(1.4rem, 7vw, 2.4rem); line-height: 1.2; color: var(--pink); text-shadow: 4px 4px 0 #3a1f17; }
#game-over-title { margin: 0; font-size: 1.4rem; }
.game-over-line, .game-over-tip { margin: 10px 0 0; color: var(--text-dim); font-weight: 600; }
.game-over-tip { font-size: 0.9rem; color: var(--text-mute); }
.restart-btn { margin-top: 16px; }

@keyframes gameOverIn { from { transform: scale(0.8) translateY(14px); opacity: 0; } }

.victory-card {
  width: min(780px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 20px 18px;
  border: 3px solid var(--yellow);
  box-shadow: 0 10px 0 #140e0b;
}

.victory-tag { margin: 0; text-align: center; font-family: var(--font-pixel); font-size: clamp(1.1rem, 5vw, 2rem); color: var(--yellow); text-shadow: 3px 3px 0 #6a2e1f; }
#victory-title { margin: 8px 0 0; text-align: center; font-size: 1.5rem; }
.victory-banner { margin: 6px 0 0; text-align: center; font-size: 0.86rem; font-weight: 700; color: var(--cyan); }

.victory-hero { margin-top: 14px; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; }

.victory-grade { display: grid; place-items: center; align-content: center; gap: 4px; padding: 12px; border-radius: 14px; text-align: center; border: 2px solid var(--yellow); background: rgba(240, 197, 102, 0.1); box-shadow: inset 0 0 22px rgba(240, 197, 102, 0.2); }

.rank-badge { margin: 0; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-family: var(--font-pixel); font-size: 0.9rem; color: #120c0a; background: var(--yellow); box-shadow: var(--glow-gold); }
.grade-main { margin: 6px 0 0; font-size: 1.3rem; font-weight: 900; color: var(--yellow); }
.grade-sub { margin: 0; font-size: 0.72rem; color: var(--text-dim); }

.victory-hero-copy { padding: 12px 14px; border-radius: 12px; background: rgba(14, 9, 7, 0.55); border: 1px solid var(--line); }
.victory-line { margin: 0; font-weight: 800; }
.victory-tip { margin: 6px 0 0; color: var(--text-dim); font-weight: 600; }
.victory-summary { margin: 8px 0 0; font-size: 0.9rem; color: var(--green); font-weight: 700; }

.victory-core { margin-top: 12px; display: grid; grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr)); gap: 8px; }
.core-metric { padding: 10px 8px; border-radius: 10px; text-align: center; background: rgba(14, 9, 7, 0.55); border: 1px solid var(--line); }
.metric-profit { border: 2px solid var(--yellow); box-shadow: 0 0 16px rgba(240, 197, 102, 0.3); }
.metric-label { margin: 0; font-size: 0.7rem; color: var(--text-mute); font-weight: 700; }
.metric-value { margin: 5px 0 0; font-family: var(--font-pixel); font-size: 0.95rem; color: var(--text); }
.metric-profit .metric-value { font-size: 1.4rem; }
.metric-value.good { color: var(--green); text-shadow: 0 0 10px rgba(156, 204, 138, 0.6); }
.metric-sub { margin: 6px 0 0; font-size: 0.68rem; color: var(--text-mute); }
.metric-badge { margin: 6px auto 0; width: fit-content; padding: 2px 8px; border-radius: 999px; font-size: 0.64rem; font-weight: 800; color: #120c0a; background: var(--yellow); }

.victory-groups { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.group-card, .victory-rare { padding: 10px 12px; border-radius: 10px; background: rgba(14, 9, 7, 0.55); border: 1px solid var(--line); }
.group-card h3, .victory-rare h3 { margin: 0 0 6px; font-size: 0.84rem; color: var(--cyan); }
.group-card ul, #victory-rare-list { margin: 0; padding-left: 16px; font-size: 0.78rem; line-height: 1.5; color: var(--text-dim); }
.group-card li.hot, #victory-rare-list li.rare-hit { color: var(--yellow); font-weight: 800; }
.group-card li.legend { color: var(--pink); font-weight: 900; }
.victory-details { margin-top: 12px; }
.victory-details summary { cursor: pointer; font-weight: 800; font-size: 0.84rem; color: var(--text-dim); padding: 6px 0; }
.victory-details .group-card + .group-card { margin-top: 8px; }
.victory-rare { margin-top: 12px; }
.victory-actions { margin-top: 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.victory-actions .restart-btn { margin-top: 0; }

/* ========== 响应式 ========== */
@media (max-width: 760px) {
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .ticket-stub { border-left: 0; border-top: 2px dashed rgba(255, 255, 255, 0.32); padding-top: 18px; }
  .ticket-stub::before, .ticket-stub::after { top: -13px; bottom: auto; }
  .ticket-stub::before { left: -15px; }
  .ticket-stub::after { left: auto; right: -15px; }
  .header-right { justify-items: start; }
  .goal-strip { grid-template-columns: 1fr; gap: 12px; }
  .victory-hero, .victory-groups { grid-template-columns: 1fr; }
  .victory-core { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-banner { grid-template-columns: 1fr auto; }
  .rb-icons { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 480px) {
  .goal-meters { grid-template-columns: 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ticker-line span { animation: none; padding-left: 0; }
}


/* ========== 彩蛋 ========== */
.symbol-cell.bonus {
  --c: var(--yellow);
  gap: 1px;
  align-content: center;
  border: 2px dashed var(--yellow);
  background: radial-gradient(circle at 50% 35%, rgba(240, 197, 102, 0.28), rgba(26, 17, 13, 0.95) 80%);
}

.pattern-grid.has-win .symbol-cell.bonus { opacity: 1; filter: none; }
.symbol-cell.bonus .bonus-icon { font-size: 1.7rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.symbol-cell.bonus .bonus-tag { font-size: 0.55rem; font-weight: 800; color: var(--yellow); letter-spacing: 0.02em; }
.symbol-cell.bonus::before { content: "✦"; position: absolute; top: 3px; left: 5px; font-size: 0.65rem; color: var(--yellow); }
.pattern-grid.has-win .symbol-cell.bonus, .pattern-grid.no-win .symbol-cell.bonus { animation: cellIn 0.4s ease backwards; }

.tally-chip.bonus { border-style: dashed; border-color: var(--yellow); color: var(--yellow); font-family: var(--font-body); font-weight: 800; font-size: 0.72rem; padding: 3px 10px; }

.egg-note { color: var(--yellow); opacity: 0.85; }

.ghost-note { margin: 0; text-align: center; font-size: 0.78rem; font-style: italic; color: var(--yellow); opacity: 0.9; }

.jam-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background: repeating-linear-gradient(45deg, rgba(20, 12, 8, 0.92) 0 12px, rgba(60, 38, 14, 0.92) 12px 24px);
  color: var(--yellow);
}

.jam-overlay b { font-size: 1.2rem; }
.jam-overlay span { font-size: 0.82rem; color: var(--text); }
.jam-overlay:active { filter: brightness(1.3); }

#history-list li.egg { color: var(--yellow); }
#history-list li.egg::before { content: "✦"; color: var(--yellow); }
#history-list li.boss { color: var(--text-dim); font-style: italic; }


/* ========== 补给站锁定 / 成就奖励 ========== */
.shop-lock { margin: 0; padding: 14px 10px; text-align: center; font-size: 0.82rem; line-height: 1.6; color: var(--text-dim); border: 1px dashed rgba(240, 197, 102, 0.4); border-radius: 8px; }
.shop-lock b { color: var(--yellow); font-family: var(--font-pixel); font-size: 0.7rem; }
#achievement-list li .achv-reward { font-style: normal; font-size: 0.7rem; color: var(--yellow); }
.achv-toast .achv-reward { font-style: normal; font-weight: 800; }

/* 道具逐个解锁 */
.shop-item.locked .shop-desc { display: none; }
.shop-item.locked .shop-title { opacity: 0.55; }
.shop-item.locked .mini-btn { background: transparent; border: 1px dashed rgba(240, 197, 102, 0.4); color: var(--text-dim); box-shadow: none; font-weight: 600; }
.shop-item.just-unlocked { animation: chipPop 0.6s ease; }


/* ============================================================
   手机端适配（宽度 ≤ 760px）
   ============================================================ */
.mobile-dock { display: none; }

.ticket, .scratch-container { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, .tab, summary { -webkit-tap-highlight-color: transparent; }

@media (max-width: 760px) {
  body { padding: 10px 8px calc(118px + env(safe-area-inset-bottom)); }
  .crt-overlay, body::before { display: none; }
  .cabinet { padding: 18px 10px 12px; border-radius: 14px; }
  .cabinet::before { top: 6px; }

  /* 顶部：压缩成两行 */
  .marquee { gap: 8px; align-items: flex-start; }
  .title-block { gap: 2px; }
  .arcade-tag { font-size: 0.5rem; }
  h1 { font-size: 1.9rem; }
  .subtitle { font-size: 0.8rem; }
  .header-right { width: 100%; display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 8px; }
  .tool-row { flex-direction: column; gap: 6px; }
  .icon-btn { padding: 6px 10px; font-size: 0.78rem; }
  .coin-panel { flex: 1; padding: 8px 12px; }
  #coin-balance { font-size: 1.35rem; }
  .ticker-section { display: none; }

  /* 通关目标：紧凑 */
  .goal-strip { margin-top: 12px; padding: 10px 12px; gap: 10px; }
  .goal-badge { display: none; }
  .goal-title { font-size: 0.82rem; }
  .goal-meter-row { font-size: 0.76rem; }
  .goal-meter-row b { font-size: 0.68rem; }
  .goal-strip .bar { height: 10px; }
  .goal-meters { grid-template-columns: 1fr 1fr; gap: 12px; }

  .play-grid { margin-top: 12px; gap: 12px; }

  /* 奖券 */
  .ticket-area { margin-top: 0; min-height: 0; }
  .ticket-main { padding: 12px 10px 10px; gap: 8px; }
  .ticket-hint { font-size: 0.74rem; }
  .scratch-container { max-width: 320px; }
  .tally-chip { font-size: 0.56rem; }
  .ticket-placeholder { padding: 16px 12px 14px; }
  .ph-insert { font-size: 1.15rem; }
  .ph-steps { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ticket-placeholder .buy-slot { display: none; }

  /* 对照表在手机上单独成区，按钮由底部操作栏承担 */
  .ticket-stub .buy-slot { display: none; }

  /* 操作区状态文字挪到底栏，原位置隐藏 */
  .dock { display: none; }

  .rail { gap: 12px; }
  #history-list { max-height: 220px; }

  /* 展示柜：两列紧凑卡 */
  .cabinet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cabinet-slot { padding: 8px; }
  .card-illustration { height: 96px; }
  .card-title-cn { font-size: 0.72rem; }
  .cabinet-card-name { font-size: 0.8rem; }
  .cabinet-card-buff, .cabinet-card-stock { font-size: 0.64rem; }
  .cabinet-actions .mini-btn { font-size: 0.68rem; padding: 7px 4px; }

  #achievement-list { grid-template-columns: 1fr; }
  .toast { top: 10px; max-width: calc(100vw - 16px); padding: 10px 14px; }

  /* 底部固定操作栏 */
  .mobile-dock {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 800;
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(23, 16, 13, 0.92), #17100d 30%);
    border-top: 2px solid rgba(240, 197, 102, 0.45);
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.45);
  }

  .dock-status { margin: 0 0 6px; font-size: 0.76rem; line-height: 1.35; color: var(--text-dim); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dock-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
  .dock-coins { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: #0e0907; border: 2px solid rgba(240, 197, 102, 0.6); font-size: 1.1rem; }
  .dock-coins b { font-family: var(--font-pixel); font-size: 0.95rem; color: #f3e3a6; min-width: 3.4ch; text-align: right; }
  .buy-slot-mobile { display: grid; }
  .buy-slot-mobile .buy-btn { width: 100%; padding: 14px 8px; font-size: 1.05rem; }
}

@media (max-width: 360px) {
  h1 { font-size: 1.6rem; }
  .pay-row { grid-template-columns: 38px 1fr auto; }
}

@media (max-width: 760px) {
  .dock-effects { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 6px; }
  .dock-effects:not(:has(.effect-pill:not(.hidden))) { display: none; }
  .dock-effects .effect-pill { font-size: 0.7rem; padding: 2px 8px; }
}

.paytable { text-align: left; }
