/* ═══════════════════════════════════════════════════════════════
   麒麟抽签 ($QLOT) — pixel / 90s arcade cabinet theme
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0f0a;
  --bg2: #0d1a0d;
  --panel: #0f1c12;
  --panel2: #142619;
  --line: #22402c;
  --gold: #f5c542;
  --gold-l: #ffe58a;
  --gold-d: #a8740f;
  --gold-dd: #5c3d05;
  --jade: #2fd18a;
  --jade-l: #8ff0c0;
  --jade-d: #12603f;
  --red: #e0412f;
  --red-l: #ff8a6b;
  --red-d: #7a1a10;
  --text: #f3ead2;
  --muted: #9db3a2;
  --ink: #1d1404;

  --f-px: "Press Start 2P", "ZCOOL QingKe HuangYou", monospace;
  --f-body: "VT323", "ZCOOL QingKe HuangYou", monospace;
  --zh: 1; /* bumps CJK label sizes; set on html[lang] */
  --stage-w: 1240px;
  --dock-h: 0px;

  /* 9-slice pixel frames (6×6 svg, slice 2, drawn at 3× = 6px) */
  --frame-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' shape-rendering='crispEdges'%3E%3Cpath fill='%23f5c542' d='M1 0h4v1H1zM0 1h1v4H0zM5 1h1v4H5zM1 5h4v1H1z'/%3E%3Cpath fill='%23ffe58a' d='M1 1h3v1H1zM1 2h1v2H1z'/%3E%3Cpath fill='%23a8740f' d='M4 1h1v4H4zM1 4h3v1H1z'/%3E%3C/svg%3E");
  --frame-jade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' shape-rendering='crispEdges'%3E%3Cpath fill='%232fd18a' d='M1 0h4v1H1zM0 1h1v4H0zM5 1h1v4H5zM1 5h4v1H1z'/%3E%3Cpath fill='%238ff0c0' d='M1 1h3v1H1zM1 2h1v2H1z'/%3E%3Cpath fill='%2312603f' d='M4 1h1v4H4zM1 4h3v1H1z'/%3E%3C/svg%3E");
  --frame-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' shape-rendering='crispEdges'%3E%3Cpath fill='%23e0412f' d='M1 0h4v1H1zM0 1h1v4H0zM5 1h1v4H5zM1 5h4v1H1z'/%3E%3Cpath fill='%23ff8a6b' d='M1 1h3v1H1zM1 2h1v2H1z'/%3E%3Cpath fill='%237a1a10' d='M4 1h1v4H4zM1 4h3v1H1z'/%3E%3C/svg%3E");
}
html[lang="zh-CN"] { --zh: 1.7; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(245, 197, 66, .10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(47, 209, 138, .08), transparent 70%),
    linear-gradient(rgba(47, 209, 138, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 209, 138, .04) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px, 24px 24px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 20px;
  line-height: 1.3;
  -webkit-font-smoothing: none;
  padding-bottom: var(--dock-h);
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-l); }
button { font: inherit; color: inherit; }
code { font-family: var(--f-body); font-size: 18px; }
[hidden] { display: none !important; }
::selection { background: var(--jade); color: var(--ink); }

.num { font-family: "Press Start 2P", monospace; letter-spacing: 0; }
.gold { color: var(--gold); }
.jade { color: var(--jade); }
.red { color: var(--red-l); }
.muted { color: var(--muted); }
.small { font-size: 17px; }
.mt { margin-top: 22px; }
.glow-gold { color: var(--gold); text-shadow: 3px 3px 0 var(--gold-dd), 0 0 18px rgba(245, 197, 66, .35); }
.glow-jade { color: var(--jade); text-shadow: 3px 3px 0 var(--jade-d), 0 0 18px rgba(47, 209, 138, .35); }
.ico { width: 18px; height: 18px; flex: none; fill: currentColor; }

/* ─── animations ─── */
@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1.1s steps(1, end) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes coin-spin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes flicker { 0%, 100% { opacity: .9; } 50% { opacity: 1; } }
@keyframes halo { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.06); } }
@keyframes stripes { to { background-position: 24px 0; } }
@keyframes bulbs { 50% { background-position: 18px 0; } }
@keyframes walk { from { transform: translateX(-10%); } to { transform: translateX(10%); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* ─── CRT overlay ─── */
.crt {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .22) 3px, rgba(0, 0, 0, 0) 4px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .45) 100%);
  animation: flicker 4s steps(2, end) infinite;
}

/* ─── boot screen ─── */
.boot {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--bg);
  transition: opacity .35s steps(4, end), visibility 0s .35s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-logo { width: 128px; height: 128px; animation: bob 1s steps(4, end) infinite; filter: drop-shadow(0 0 22px rgba(245, 197, 66, .5)); }
.boot-title { font-family: "ZCOOL QingKe HuangYou", var(--f-px); font-size: 56px; color: var(--gold); text-shadow: 4px 4px 0 var(--gold-d), 8px 8px 0 var(--gold-dd); }
.boot-bar { width: 220px; height: 18px; padding: 3px; border: 6px solid transparent; border-image: var(--frame-gold) 2 / 6px / 0 stretch; }
.boot-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gold) 0 9px, transparent 9px 12px); transition: width .2s steps(5, end); }
.boot-press { font-family: var(--f-px); font-size: calc(10px * var(--zh)); color: var(--text); margin-top: 8px; }

/* ─── pixel frames ─── */
.px-frame, .px-frame-jade, .px-frame-red {
  border: 6px solid transparent;
  border-image: var(--frame-gold) 2 / 6px / 0 stretch;
  background-clip: padding-box;
}
.px-frame-jade { border-image-source: var(--frame-jade); }
.px-frame-red { border-image-source: var(--frame-red); }

/* ─── HUD header ─── */
.hud {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, #0c1a0f, #070c07);
  border-bottom: 6px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--gold) 0 18px, var(--gold-d) 18px 24px, var(--jade) 24px 42px, var(--jade-d) 42px 48px) 6;
}
.hud-top {
  max-width: var(--stage-w); margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { width: 44px; height: 44px; filter: drop-shadow(0 0 10px rgba(245, 197, 66, .45)); animation: bob 2.4s steps(4, end) infinite; }
.brand-cn {
  font-family: "ZCOOL QingKe HuangYou", var(--f-px); font-size: 32px; line-height: 1;
  color: var(--gold); text-shadow: 3px 3px 0 var(--gold-d), 5px 5px 0 var(--gold-dd);
}

.tabs { display: flex; gap: 4px; flex: 1; justify-content: center; }
.tab {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 9px;
  font-family: var(--f-px); font-size: calc(9px * var(--zh));
  color: var(--muted);
  background: #070c07;
  border: 3px solid var(--line);
  border-bottom-width: 6px;
  white-space: nowrap;
  transition: transform .05s steps(1, end);
}
.tab:hover { color: var(--text); border-color: var(--jade-d); }
.tab.active {
  color: var(--ink); background: var(--gold);
  border-color: var(--gold-l) var(--gold-d) var(--gold-dd) var(--gold-l);
  transform: translateY(3px); border-bottom-width: 3px;
}
.tab.active .ico { fill: var(--ink); }
.tab kbd {
  font-family: "Press Start 2P", monospace; font-size: 7px;
  padding: 2px 3px; border: 2px solid currentColor; opacity: .55;
}
.tab-dot { position: absolute; top: -5px; right: -5px; width: 10px; height: 10px; background: var(--red); box-shadow: 0 0 0 2px #000; animation: blink 1s steps(1, end) infinite; }

.hud-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px;
  background: #050805; border: 3px solid var(--line);
  font-family: var(--f-px); font-size: 9px; color: var(--muted);
  white-space: nowrap;
}
.chip b { color: var(--gold); font-weight: normal; }
.chip img { width: 14px; height: 14px; }
.refresh-pips { display: inline-flex; gap: 2px; }
.refresh-pips i { width: 4px; height: 10px; background: var(--jade); }
.refresh-pips i.off { background: var(--line); }
.chip-refresh.loading .refresh-pips i { animation: blink .4s steps(1, end) infinite; }
.sq-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: #050805; border: 3px solid var(--line); color: var(--muted); cursor: pointer;
}
.sq-btn:hover { color: var(--gold); border-color: var(--gold-d); }
.sq-btn.on { color: var(--jade); border-color: var(--jade-d); }
.lang-btn { width: auto; padding: 0 8px; font-family: var(--f-px); font-size: 9px; }
.lang-btn span { font-size: inherit; }
html[lang="en"] .lang-btn { font-size: 14px; font-family: "ZCOOL QingKe HuangYou", var(--f-px); }

.wallet-wrap { position: relative; }
.wallet-btn { margin: 3px 3px 9px; }
.wallet-btn-ico { width: 16px; height: 16px; object-fit: contain; }
.wallet-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 120;
  width: 250px; padding: 12px; background-color: var(--panel);
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .6);
}
.wm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 18px; }
.wm-row b { font-size: 10px; color: var(--gold-l); font-weight: normal; }
.wm-addr { justify-content: flex-start; }
.wm-addr .icon-btn { margin-left: auto; }
.wallet-addr { background: none; border: 0; padding: 0; cursor: pointer; font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--text); }
.wallet-addr:hover { color: var(--gold); }
.dot-live { width: 8px; height: 8px; background: var(--jade); box-shadow: 0 0 8px var(--jade); flex: none; animation: blink 1.6s steps(1, end) infinite; }

.hud-strip {
  max-width: var(--stage-w); margin: 0 auto; padding: 6px 20px 8px;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  font-family: "Press Start 2P", monospace; font-size: 9px;
}
.hs { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.hs em { font-style: normal; color: var(--red-l); font-family: var(--f-px); font-size: calc(9px * var(--zh)); }
.hs b { color: var(--text); font-weight: normal; }
.hs-hi b { color: var(--gold); }
.hs-jp b { color: var(--jade); }
.hs-credit { margin-left: auto; }
.credit-coins { display: inline-flex; gap: 5px; }

/* ─── stage ─── */
.stage { max-width: var(--stage-w); margin: 0 auto; padding: 22px 20px 40px; min-width: 0; }

/* ─── buttons ─── */
.btn {
  --b: var(--gold); --bl: var(--gold-l); --bd: var(--gold-d); --bt: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin: 3px 3px 9px;
  padding: 12px 18px;
  background: var(--b); color: var(--bt);
  border: 0; cursor: pointer; user-select: none;
  font-family: var(--f-px); font-size: calc(11px * var(--zh)); line-height: 1.2;
  text-transform: uppercase; text-align: center;
  box-shadow:
    inset -3px -3px 0 0 var(--bd),
    inset 3px 3px 0 0 var(--bl),
    0 -3px 0 0 #000, 0 3px 0 0 #000, -3px 0 0 0 #000, 3px 0 0 0 #000,
    0 9px 0 0 #000;
  transition: transform .05s steps(1, end);
}
.btn:hover { color: var(--bt); filter: brightness(1.08); }
.btn:active:not(:disabled), .btn.pressed {
  transform: translateY(6px);
  box-shadow:
    inset 3px 3px 0 0 var(--bd),
    0 -3px 0 0 #000, 0 3px 0 0 #000, -3px 0 0 0 #000, 3px 0 0 0 #000;
}
.btn:focus-visible { outline: 3px dashed var(--jade-l); outline-offset: 6px; }
.btn:disabled { --b: #3a3a2c; --bl: #50503e; --bd: #24241a; --bt: #8a8a70; cursor: not-allowed; filter: none; }
.btn-jade { --b: var(--jade); --bl: var(--jade-l); --bd: var(--jade-d); --bt: #04150c; }
.btn-red { --b: var(--red); --bl: var(--red-l); --bd: var(--red-d); --bt: #fff; }
.btn-ghost { --b: var(--panel2); --bl: #24402c; --bd: #07100a; --bt: var(--text); }
.btn-sm { padding: 8px 12px; font-size: calc(9px * var(--zh)); white-space: nowrap; }
.btn-lg { padding: 16px 26px; font-size: calc(13px * var(--zh)); }
.btn-block { display: flex; width: calc(100% - 6px); }
.btn.busy { pointer-events: none; }
.btn.busy::after { content: ""; width: 10px; height: 10px; background: currentColor; animation: blink .5s steps(1, end) infinite; }
.btn.is-off { opacity: .55; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row-center { justify-content: center; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 5px;
  background: var(--panel2); border: 3px solid var(--line); color: var(--muted);
  cursor: pointer; font-size: 16px; line-height: 1;
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold-d); }

.pill { white-space: nowrap;
  padding: 7px 10px; cursor: pointer;
  font-family: var(--f-px); font-size: calc(8px * var(--zh));
  background: #050805; color: var(--muted); border: 3px solid var(--line);
}
.pill:hover { color: var(--text); }
.pill.on { background: var(--jade); color: var(--ink); border-color: var(--jade-l); }

/* ─── mini coin + coin spin ─── */
.mini-coin {
  display: inline-block; width: 12px; height: 12px; flex: none;
  background: var(--gold);
  box-shadow: inset -2px -2px 0 var(--gold-d), inset 2px 2px 0 var(--gold-l);
  clip-path: polygon(25% 0, 75% 0, 75% 12%, 88% 12%, 88% 25%, 100% 25%, 100% 75%, 88% 75%, 88% 88%, 75% 88%, 75% 100%, 25% 100%, 25% 88%, 12% 88%, 12% 75%, 0 75%, 0 25%, 12% 25%, 12% 12%, 25% 12%);
  animation: coin-spin 1.6s steps(8, end) infinite;
}
.credit-coins .mini-coin:nth-child(2) { animation-delay: -.5s; }
.credit-coins .mini-coin:nth-child(3) { animation-delay: -1s; }
.btn .mini-coin { animation-duration: 1.2s; }

.coin-stage { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; perspective: 600px; }
.coin { position: relative; width: 112px; height: 112px; transform-style: preserve-3d; animation: coin-spin 2.4s steps(16, end) infinite; }
.coin-face {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden;
  background: radial-gradient(circle at 35% 30%, var(--gold-l), var(--gold) 45%, var(--gold-d));
  clip-path: polygon(33% 0, 67% 0, 67% 8%, 83% 8%, 83% 17%, 92% 17%, 92% 33%, 100% 33%, 100% 67%, 92% 67%, 92% 83%, 83% 83%, 83% 92%, 67% 92%, 67% 100%, 33% 100%, 33% 92%, 17% 92%, 17% 83%, 8% 83%, 8% 67%, 0 67%, 0 33%, 8% 33%, 8% 17%, 17% 17%, 17% 8%, 33% 8%);
}
.coin-face img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(2px 2px 0 rgba(92, 61, 5, .6)); }
.coin-back { transform: rotateY(180deg); font-family: "ZCOOL QingKe HuangYou", var(--f-px); font-size: 60px; color: var(--gold-dd); text-shadow: 2px 2px 0 var(--gold-l); }
.coin-shadow { width: 76px; height: 8px; margin-top: 10px; background: rgba(0, 0, 0, .6); animation: halo 2.4s steps(8, end) infinite; }

/* ─── sections / grid / cards ─── */
.section { display: none; flex-direction: column; gap: 20px; }
.section.active { display: flex; animation: pop .25s steps(4, end); }
.section-head { display: flex; flex-direction: column; gap: 8px; }
.section-title { margin: 0; font-family: var(--f-px); font-size: calc(18px * var(--zh)); color: var(--gold); text-shadow: 3px 3px 0 var(--gold-dd); line-height: 1.3; display: flex; align-items: center; gap: 12px; }
.section-num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: var(--jade); color: var(--ink); font-size: 13px; text-shadow: none; box-shadow: inset -3px -3px 0 var(--jade-d); }
.section-sub { margin: 0; color: var(--muted); max-width: 760px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-lobby { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.grid-buy { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.card, .stack > .px-frame-jade, .card.px-frame-jade { background-color: var(--panel); padding: 18px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.px-frame-jade.card, .stack > .px-frame-jade { background-color: #0c1a12; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-title { margin: 0; font-family: var(--f-px); font-size: calc(11px * var(--zh)); color: var(--gold-l); letter-spacing: .5px; line-height: 1.4; font-weight: normal; }
.card p { margin: 0; }

.stat-card { gap: 10px; }
.stat-label { font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--muted); }
.stat-value { font-size: 17px; line-height: 1.3; word-break: break-all; }
.stat-sub { font-size: 9px; color: var(--muted); min-height: 12px; }
.stat-sub:not(.num) { font-family: var(--f-body); font-size: 17px; }

.badge {
  display: inline-block; padding: 4px 7px;
  font-family: "Press Start 2P", monospace; font-size: 8px;
  background: var(--gold); color: var(--ink);
  box-shadow: inset -2px -2px 0 var(--gold-d);
  vertical-align: middle; white-space: nowrap;
}
.badge-jade { background: var(--jade); box-shadow: inset -2px -2px 0 var(--jade-d); }
.badge-red { background: var(--red); color: #fff; box-shadow: inset -2px -2px 0 var(--red-d); }
.badge-ghost { background: var(--panel2); color: var(--muted); box-shadow: inset -2px -2px 0 #07100a; }
.badge-zh { font-family: var(--f-px); font-size: calc(8px * var(--zh)); }

.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 2px dashed var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-size: 10px; text-align: right; align-self: center; }
.kv dd:not(.num) { font-family: var(--f-body); font-size: 19px; }
.kv-tight > div { padding: 6px 0; }
.kv-tight dt { font-size: 17px; }
.kv-tight dd { font-size: 9px; }

/* fill bar */
.fill-bar { height: 26px; padding: 4px; background: #050805; border: 3px solid var(--line); }
.fill-bar-sm { height: 20px; }
.fill-bar-in {
  height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--gold) 0 10px, var(--gold-d) 10px 12px, transparent 12px 14px);
  transition: width .4s steps(10, end);
}
.fill-bar-in.grand { background: repeating-linear-gradient(90deg, var(--red-l) 0 10px, var(--red) 10px 12px, transparent 12px 14px); }
.fill-meta { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-top: 6px; }
.fill-meta span:not(.num) { font-family: var(--f-body); font-size: 18px; }

/* jackpot lamps */
.lamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lamps i { height: 30px; background: #07100a; border: 3px solid var(--line); }
.lamps i.on { background: var(--jade); border-color: var(--jade-l); box-shadow: 0 0 14px rgba(47, 209, 138, .55), inset -4px -4px 0 var(--jade-d); }
.lamps i.next { border-color: var(--gold); animation: blink .8s steps(1, end) infinite; background: var(--gold-dd); }
.lamps.grand i { background: var(--red); border-color: var(--red-l); box-shadow: 0 0 14px rgba(224, 65, 47, .5), inset -4px -4px 0 var(--red-d); animation: blink .8s steps(1, end) infinite; }

/* ─── cabinet (lobby hero) ─── */
.cabinet {
  position: relative;
  padding: 0 0 6px;
  background: linear-gradient(180deg, #1a1206, #0a0f0a 30%);
  border: 6px solid #000;
  box-shadow: 0 0 0 3px var(--gold-d), 0 0 0 6px #000, 0 18px 0 -6px rgba(0, 0, 0, .5);
}
.bulbs {
  height: 18px; margin-bottom: 14px;
  background:
    radial-gradient(circle at 9px 9px, var(--gold-l) 0 4px, transparent 5px) 0 0 / 36px 18px,
    radial-gradient(circle at 27px 9px, var(--red-l) 0 4px, transparent 5px) 0 0 / 36px 18px,
    #120c03;
  border-bottom: 3px solid var(--gold-d);
  animation: bulbs 1s steps(1, end) infinite;
}
.cab-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; padding: 0 16px 10px; align-items: stretch; }
.cab-side { background-color: #08110a; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.px-frame-red.cab-side { background-color: #140b08; }
.side-title { display: flex; align-items: center; gap: 8px; font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--gold-l); }
.side-tag { font-family: "Press Start 2P", monospace; font-size: 8px; padding: 4px 5px; background: var(--jade); color: var(--ink); }
.side-tag-red { background: var(--red); color: #fff; }
.p1-status { font-size: 19px; color: var(--text); min-height: 50px; }
.p1-status b { font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--jade); font-weight: normal; }
.side-hint { margin: 0; color: var(--muted); font-size: 18px; }
.cab-side > .badge { align-self: flex-start; }
.coin-slot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 8px; background: #050805; border: 3px solid var(--line); perspective: 400px; }
.slot-coin { width: 26px; height: 26px; animation: coin-spin 1.4s steps(8, end) infinite, bob 1.4s steps(4, end) infinite; }
.slot-plate { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 18px; background: linear-gradient(180deg, #3a2a08, #1c1404); border: 3px solid var(--gold-d); box-shadow: inset 0 0 0 3px #000; }
.slot-hole { width: 8px; height: 34px; background: #000; box-shadow: 0 0 0 3px var(--gold), 0 0 12px rgba(245, 197, 66, .6); }
.slot-txt { font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--red-l); }
.slot-sub { font-size: 16px; color: var(--muted); text-align: center; }
.last-jp { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: #050805; border: 3px solid var(--line); }
.last-jp b { font-size: 14px; font-weight: normal; text-shadow: 0 0 10px rgba(47, 209, 138, .5); }
.cab-side .btn { margin-top: auto; }
.cab-side .kv { margin-top: auto; }

.cab-screen {
  position: relative; overflow: hidden;
  background-color: #050a06;
  padding: 18px 18px 14px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
}
.cab-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 50% 35%, rgba(245, 197, 66, .18), transparent 70%),
    repeating-linear-gradient(0deg, rgba(47, 209, 138, .04) 0 3px, transparent 3px 6px);
}
.screen-kicker { position: relative; font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--jade); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.screen-kicker b { color: var(--gold); font-weight: normal; }
.screen-art { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 170px; }
.hero-halo {
  position: absolute; width: 230px; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(245, 197, 66, .32) 0, rgba(47, 209, 138, .12) 45%, transparent 68%);
  animation: halo 3s steps(6, end) infinite;
}
.hero-logo { position: relative; width: 180px; height: auto; animation: bob 3s steps(6, end) infinite; filter: drop-shadow(0 0 24px rgba(245, 197, 66, .35)); }
.sprite-wrap { position: absolute; right: 2%; bottom: 0; animation: walk 4s steps(8, end) infinite alternate; }
.qilin-sprite { display: block; width: 96px; height: 72px; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .6)); animation: bob .5s steps(2, end) infinite; }
.hero-stars i { position: absolute; width: 6px; height: 6px; background: var(--gold-l); animation: twinkle 2.2s steps(4, end) infinite; }
.hero-stars i::before, .hero-stars i::after { content: ""; position: absolute; background: var(--gold); }
.hero-stars i::before { left: -6px; right: -6px; top: 0; height: 6px; transform: scaleY(.5); }
.hero-stars i::after { top: -6px; bottom: -6px; left: 0; width: 6px; transform: scaleX(.5); }
.hero-stars i:nth-child(2n) { animation-delay: -.7s; }
.hero-stars i:nth-child(3n) { animation-delay: -1.4s; background: var(--jade-l); }
.hero-title {
  position: relative; margin: 0;
  font-family: "ZCOOL QingKe HuangYou", var(--f-px); font-weight: normal;
  font-size: clamp(48px, 6vw, 76px); line-height: 1; letter-spacing: 6px;
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--gold-d), 8px 8px 0 var(--gold-dd), 0 0 30px rgba(245, 197, 66, .3);
}
.led-box {
  position: relative;
  display: grid; grid-template-columns: auto auto; justify-content: center; align-items: end; gap: 4px 10px;
  padding: 10px 16px; background: #020402; border: 3px solid #1b2a1f;
  box-shadow: inset 0 0 18px rgba(47, 209, 138, .12);
}
.led-label { grid-column: 1 / -1; font-family: var(--f-px); font-size: calc(8px * var(--zh)); color: var(--red-l); }
.led { position: relative; font-family: "Press Start 2P", monospace; font-size: clamp(22px, 3vw, 32px); line-height: 1; }
.led-ghost { color: rgba(47, 209, 138, .09); }
.led-val { position: absolute; right: 0; top: 0; color: var(--jade); text-shadow: 0 0 10px rgba(47, 209, 138, .8), 3px 3px 0 var(--jade-d); }
.led-unit { font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--jade-l); padding-bottom: 2px; }
.led-usd { grid-column: 1 / -1; font-size: 8px; color: var(--muted); }
.led-box.bump .led-val { animation: shake .15s steps(2, end) 3; }
.screen-fill { position: relative; width: min(380px, 100%); }
.hero-cta { position: relative; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.insert-coin { position: relative; font-family: var(--f-px); font-size: calc(8px * var(--zh)); color: var(--gold-l); }

/* win banner */
.win-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background-color: #1a1406; background-image: repeating-linear-gradient(45deg, rgba(245, 197, 66, .08) 0 8px, transparent 8px 16px); animation: stripes 1.2s linear infinite; }
.win-star { font-size: 30px; color: var(--gold); animation: blink .6s steps(1, end) infinite; }
.win-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.win-text strong { font-family: var(--f-px); font-weight: normal; font-size: calc(11px * var(--zh)); color: var(--gold); }
.win-text span { color: var(--gold-l); }

/* marquee */
.marquee { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background-color: #07130b; overflow: hidden; }
.marquee-tag { flex: none; font-family: var(--f-px); font-size: calc(9px * var(--zh)); padding: 5px 7px; background: var(--red); color: #fff; }
.marquee-track { overflow: hidden; flex: 1; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.marquee-inner { display: inline-flex; gap: 40px; white-space: nowrap; font-size: 19px; color: var(--gold-l); }
.marquee-inner.run { animation: marquee 40s linear infinite; }
.marquee-inner b { font-family: "Press Start 2P", monospace; font-size: 9px; font-weight: normal; color: var(--jade); }

/* seats */
.seats { display: grid; grid-template-columns: repeat(25, 1fr); gap: 4px; }
.seats.grand { grid-template-columns: repeat(40, 1fr); gap: 3px; }
.seat { display: inline-block; aspect-ratio: 1; min-width: 8px; background: #07100a; border: 2px solid var(--line); }
.legend .seat { width: 14px; height: 14px; vertical-align: middle; margin-right: 4px; }
.seat-taken { background: var(--gold); border-color: var(--gold-l); box-shadow: inset -2px -2px 0 var(--gold-d); }
.seat-you { background: var(--jade); border-color: var(--jade-l); box-shadow: 0 0 8px var(--jade); animation: blink 1s steps(1, end) infinite; }
.seat-new { animation: twinkle .6s steps(3, end) 2; }
.legend { display: flex; gap: 14px; font-size: 17px; color: var(--muted); flex-wrap: wrap; }
.recent-head { margin-top: 4px; }
.recent-players { display: flex; flex-wrap: wrap; gap: 6px; }
.recent-players a { font-family: "Press Start 2P", monospace; font-size: 8px; padding: 5px 6px; background: var(--panel2); border: 2px solid var(--line); color: var(--muted); }
.recent-players a:hover { color: var(--gold); border-color: var(--gold-d); }
.recent-players .you { color: var(--jade); border-color: var(--jade-d); }

/* ─── buy ─── */
.machine { gap: 14px; }
.machine-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.machine-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.buy-round { font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.buy-round b { color: var(--gold); font-weight: normal; }
.buy-price { font-size: 24px; }
.buy-price-usd { font-size: 9px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field-label { font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--gold-l); }
.field-hint { font-size: 17px; color: var(--muted); min-height: 20px; }
.field-hint.ok { color: var(--jade); }
.field-hint.bad { color: var(--red-l); }
.input {
  width: 100%; padding: 10px 12px;
  background: #050805; color: var(--text);
  border: 3px solid var(--line); border-radius: 0; outline: none;
  font-family: var(--f-body); font-size: 20px;
  box-shadow: inset 3px 3px 0 #000;
}
.input:focus { border-color: var(--jade); }
.input.bad { border-color: var(--red); animation: shake .15s steps(2, end) 2; }
.copy-row { display: flex; gap: 6px; align-items: flex-start; }
.copy-row .input { flex: 1; min-width: 0; font-size: 17px; }
.copy-row .btn { margin-top: 3px; }
.buy-state { padding: 10px; border: 3px dashed var(--gold-d); color: var(--gold-l); font-size: 19px; }
.buy-state.ok { border-color: var(--jade); color: var(--jade-l); }
.buy-state.bad { border-color: var(--red); color: var(--red-l); }
.last-ticket { padding: 8px 10px; background: rgba(224, 65, 47, .12); border: 3px solid var(--red-d); color: var(--red-l); font-size: 18px; }
.press-start { margin: 0; text-align: center; font-family: var(--f-px); font-size: calc(8px * var(--zh)); color: var(--muted); }

/* ticket stub */
.stub { display: grid; grid-template-columns: minmax(0, 1fr) 70px; background: var(--gold); color: var(--ink); box-shadow: 0 0 0 3px #000, 6px 6px 0 3px rgba(0, 0, 0, .5); animation: pop .35s steps(5, end); }
.stub-main { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: repeating-linear-gradient(0deg, transparent 0 6px, rgba(92, 61, 5, .08) 6px 7px), var(--gold-l); }
.stub-head { display: flex; align-items: center; gap: 8px; font-family: "ZCOOL QingKe HuangYou", var(--f-px); font-size: 24px; color: var(--gold-dd); }
.stub-head .badge { margin-left: auto; }
.stub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.stub-grid div { display: flex; flex-direction: column; gap: 4px; }
.stub-grid em { font-style: normal; font-family: var(--f-px); font-size: calc(7px * var(--zh)); color: var(--gold-d); }
.stub-grid b { font-size: 10px; font-weight: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stub-tear { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 6px; border-left: 4px dashed var(--gold-dd); background: var(--gold); }
.stub-code { flex: 1; width: 40px; background: repeating-linear-gradient(0deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 13px); }
.stub-no { font-size: 7px; writing-mode: vertical-rl; transform: rotate(180deg); }

.split-list { display: flex; flex-direction: column; gap: 8px; }
.split-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 18px; }
.split-item .pct { font-family: "Press Start 2P", monospace; font-size: 10px; }
.split-item .bar { height: 12px; background: #050805; border: 2px solid var(--line); }
.split-item .bar span { display: block; height: 100%; }
.split-item .amt { font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--muted); white-space: nowrap; }
.split-label { grid-column: 2 / 4; margin-top: -6px; color: var(--muted); font-size: 17px; }

/* ─── tables ─── */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 19px; }
.tbl th { text-align: left; padding: 8px 10px; font-family: var(--f-px); font-weight: normal; font-size: calc(8px * var(--zh)); color: var(--muted); border-bottom: 3px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 2px dashed var(--line); vertical-align: middle; }
.tbl td.num { font-size: 10px; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .btn { margin: 3px 4px 9px 3px; }
.tbl .acts { display: flex; flex-wrap: wrap; gap: 4px; }
.split-bar { display: flex; height: 22px; border: 3px solid #000; }
.split-bar span { display: block; height: 100%; }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: middle; border: 2px solid #000; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; font-size: 19px; }
.empty:empty { display: none; }
.empty .big { display: block; font-family: var(--f-px); font-size: calc(10px * var(--zh)); color: var(--gold-d); margin-bottom: 8px; }

/* ─── stake-lock ─── */
.locks, .lockable { display: flex; flex-direction: column; gap: 10px; }
.lock {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  padding: 12px; background: #07100a; border: 3px solid var(--line);
}
.lock.ready { border-color: var(--jade); box-shadow: 0 0 14px rgba(47, 209, 138, .2); }
.lock.claimed { opacity: .5; }
.lock-amt { font-family: "Press Start 2P", monospace; font-size: 11px; color: var(--gold); line-height: 1.5; }
.lock-meta { font-size: 17px; color: var(--muted); }
.lock-timer { font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--jade-l); }
.lock-bar { grid-column: 1 / -1; height: 10px; background: #050805; border: 2px solid var(--line); }
.lock-bar span { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--jade) 0 6px, var(--jade-d) 6px 8px); }
.lock .btn { margin: 3px 3px 9px; }
.lock-calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.lock-calc > div { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #050805; border: 3px solid var(--line); font-size: 16px; color: var(--muted); }
.lock-calc b { font-size: 10px; font-weight: normal; }

/* ─── history ─── */
.history-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.history { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.round { background-color: var(--panel); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.round.mine { background-color: #0c1d14; }
.round-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.round-id { font-family: "Press Start 2P", monospace; font-size: 13px; color: var(--gold); }
.round-head .badge:last-child { margin-left: auto; }
.round-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.round-stats > div { padding: 8px; background: #07100a; border: 2px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--muted); min-width: 0; }
.round-stats b { font-family: "Press Start 2P", monospace; font-size: 9px; font-weight: normal; color: var(--text); }
.winners { display: flex; flex-direction: column; gap: 6px; }
.winner { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 18px; text-align: left; }
.winner a { font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner a:hover { color: var(--gold); }
.winner .num { font-size: 9px; color: var(--gold-l); }
.winner.you a { color: var(--jade); }
.medal { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--ink); clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); }
.medal-1 { background: var(--gold); }
.medal-2 { background: #cfd8dc; }
.medal-3 { background: #d08b4a; }
.jp-banner { padding: 8px 10px; background: repeating-linear-gradient(45deg, rgba(47, 209, 138, .18) 0 8px, rgba(47, 209, 138, .06) 8px 16px); border: 3px solid var(--jade); color: var(--jade-l); font-family: var(--f-px); font-size: calc(9px * var(--zh)); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; animation: stripes 1s linear infinite; background-size: 24px 24px; }
.jp-banner .num { color: var(--gold); }
.round-open { color: var(--muted); font-size: 18px; }

/* ─── rules ─── */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; background: #07100a; border: 3px solid var(--line); font-size: 16px; color: var(--muted); text-align: center; }
.pod b { font-size: 12px; font-weight: normal; color: var(--text); }
.pod-1 { min-height: 150px; border-color: var(--gold); background: linear-gradient(180deg, rgba(245, 197, 66, .18), #07100a); }
.pod-1 b { color: var(--gold); font-size: 16px; }
.pod-2 { min-height: 120px; }
.pod-3 { min-height: 100px; }
.pod-medal { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-family: "Press Start 2P", monospace; font-size: 11px; background: var(--gold); color: var(--ink); clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); }
.pod-2 .pod-medal { background: #cfd8dc; }
.pod-3 .pod-medal { background: #d08b4a; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.step { background-color: var(--panel); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.step-n { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-family: "Press Start 2P", monospace; font-size: 13px; background: var(--jade); color: var(--ink); box-shadow: inset -3px -3px 0 var(--jade-d); }
.step h4 { margin: 0; font-family: var(--f-px); font-size: calc(10px * var(--zh)); color: var(--gold-l); font-weight: normal; }
.step p { margin: 0; color: var(--muted); font-size: 18px; }

.calc-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.seg { display: flex; gap: 6px; }
.calc-price { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-px); font-size: calc(8px * var(--zh)); color: var(--muted); width: 200px; }
.calc-out { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.calc-out > div { padding: 10px; background: #050805; border: 3px solid var(--line); display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 16px; min-width: 0; }
.calc-out b { font-family: "Press Start 2P", monospace; font-size: 10px; font-weight: normal; color: var(--text); word-break: break-all; }
.calc-out .c1 b { color: var(--gold); }
.calc-out .c4 b { color: var(--jade); }

.px-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.px-list li { position: relative; padding-left: 20px; color: #cfd9cc; font-size: 19px; }
.px-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; background: var(--jade); box-shadow: 2px 2px 0 var(--jade-d); }

.addr-list { display: flex; flex-direction: column; gap: 8px; }
.addr-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px; background: #07100a; border: 2px solid var(--line); font-size: 17px; color: var(--muted); }
.addr-row code { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faq { border: 3px solid var(--line); background: #07100a; padding: 10px 12px; }
.faq + .faq { margin-top: 8px; }
.faq summary { cursor: pointer; color: var(--gold-l); font-size: 19px; list-style: none; }
.faq summary::before { content: "▶ "; font-size: 12px; color: var(--jade); }
.faq[open] summary::before { content: "▼ "; }
.faq p { margin: 8px 0 0; color: var(--muted); font-size: 18px; }

/* notices */
.notice { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 20px; background-color: #0c1a12; font-size: 19px; }
.notice strong { display: block; font-family: var(--f-px); font-weight: normal; font-size: calc(10px * var(--zh)); color: var(--gold); margin-bottom: 6px; }
.notice span { color: var(--muted); }
.notice-ico { width: 40px; height: 40px; flex: none; animation: bob 1.6s steps(4, end) infinite; }
.notice-ico-txt { font-family: var(--f-px); font-size: 20px; color: var(--red); }
.notice-red { background-color: #1a0c0a; }
.notice-red strong { color: var(--red-l); }

/* footer */
.footer { margin-top: 36px; padding-top: 18px; border-top: 3px dashed var(--line); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 18px; }
.footer img { width: 36px; height: 36px; }
.footer-name { font-family: "ZCOOL QingKe HuangYou", var(--f-px); font-size: 26px; color: var(--gold); text-shadow: 2px 2px 0 var(--gold-dd); }
.footer-legal { margin-left: auto; }
.social-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 18px; }
.social-link svg { width: 14px; height: 14px; }
.social-link:hover { color: var(--gold); }

/* ─── mobile dock ─── */
.dock {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: #070c07;
  border-top: 6px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--gold) 0 18px, var(--gold-d) 18px 24px, var(--jade) 24px 42px, var(--jade-d) 42px 48px) 6;
  grid-template-columns: repeat(6, 1fr); gap: 4px;
}
.dock-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 7px 2px 6px;
  font-family: var(--f-px); font-size: calc(7px * var(--zh)); color: var(--muted);
  border: 3px solid transparent;
}
.dock-btn .ico { width: 20px; height: 20px; }
.dock-btn.active { color: var(--ink); background: var(--gold); border-color: var(--gold-l) var(--gold-d) var(--gold-d) var(--gold-l); }
.dock-btn .tab-dot { top: 2px; right: 10%; }

/* ─── modal ─── */
.modal { position: fixed; inset: 0; z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .78); }
.modal-card { position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background-color: var(--panel); padding: 16px; display: flex; flex-direction: column; gap: 14px; animation: pop .25s steps(4, end); }
.modal-head { display: flex; align-items: center; gap: 10px; }
.modal-head h3 { flex: 1; margin: 0; font-family: var(--f-px); font-weight: normal; font-size: calc(11px * var(--zh)); color: var(--gold); }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-extra { display: flex; flex-direction: column; gap: 8px; }
.wallet-extra:not(:empty)::before { content: attr(data-label); font-family: var(--f-px); font-size: calc(8px * var(--zh)); color: var(--muted); margin-top: 6px; }
.wallet-opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; cursor: pointer; text-align: left;
  background: #07100a; border: 3px solid var(--line);
}
.wallet-opt:hover { border-color: var(--gold); background: rgba(245, 197, 66, .06); }
.wallet-opt:hover .wallet-name::before { content: "▶ "; color: var(--gold); }
.wallet-ico { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex: none; background: #fff; padding: 4px; box-shadow: 0 0 0 3px #000; }
.wallet-ico img { width: 100%; height: 100%; object-fit: contain; }
.wallet-name { flex: 1; font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--text); }
.wallet-tag { font-family: "Press Start 2P", monospace; font-size: 7px; color: var(--muted); }
.wallet-tag.detected { color: var(--jade); }
.wc-view, .connecting-view { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.connecting-view { padding: 16px 0; }
.connecting-ico { width: 64px; height: 64px; object-fit: contain; background: #fff; padding: 8px; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--gold); animation: bob .8s steps(2, end) infinite; }
.connecting-view p { font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--gold-l); margin: 0; }
.qr-box { width: 240px; height: 240px; padding: 10px; background: #fff8e1; display: flex; align-items: center; justify-content: center; border: 6px solid var(--gold); }
.qr-box svg { width: 100%; height: 100%; }
.qr-loading { font-family: var(--f-px); font-size: 10px; color: var(--ink); }

/* draw overlay */
.draw-card { align-items: center; text-align: center; background-color: #0b160d; width: min(460px, 100%); }
.draw-logo { width: 96px; height: 96px; animation: bob .6s steps(2, end) infinite; filter: drop-shadow(0 0 20px rgba(245, 197, 66, .6)); }
.draw-title { margin: 0; font-family: "ZCOOL QingKe HuangYou", var(--f-px); font-weight: normal; font-size: 44px; color: var(--gold); text-shadow: 3px 3px 0 var(--gold-d), 6px 6px 0 var(--gold-dd); }
.draw-sub { font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--jade); }
.draw-card .winners { width: 100%; }
.draw-card .jp-banner { width: 100%; }
.draw-you { width: 100%; padding: 10px; background: var(--jade); color: var(--ink); font-family: var(--f-px); font-size: calc(9px * var(--zh)); line-height: 1.6; animation: blink .8s steps(1, end) 4; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 8px; animation: fall linear forwards; }

/* ─── toasts ─── */
.toasts { position: fixed; right: 16px; bottom: calc(16px + var(--dock-h)); z-index: 8500; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast { background-color: var(--panel); padding: 12px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; box-shadow: 6px 6px 0 rgba(0, 0, 0, .6); }
.toast-ico { font-family: "Press Start 2P", monospace; font-size: 12px; line-height: 1.4; }
.toast-title { font-family: var(--f-px); font-size: calc(9px * var(--zh)); color: var(--gold-l); line-height: 1.5; }
.toast-msg { font-size: 17px; color: var(--muted); word-break: break-word; margin-top: 4px; }
.toast-msg a { color: var(--jade); }
.toast-close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0; }
.toast.success .toast-ico { color: var(--jade); }
.toast.error .toast-ico { color: var(--red); }
.toast.pending .toast-ico { color: var(--gold); animation: blink .6s steps(1, end) infinite; }

/* ─── responsive ─── */
@media (max-width: 1360px) {
  .tab kbd { display: none; }
  .hud-top { gap: 12px; }
  .chip-refresh { display: none; }
}
@media (max-width: 1200px) {
  .tab { padding: 10px 9px 9px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-out { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  :root { --dock-h: 74px; }
  .tabs { display: none; }
  .dock { display: grid; }
  .hud-actions { margin-left: auto; }
  .cab-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cab-screen { grid-column: 1 / -1; order: -1; }
  .grid-lobby, .grid-buy, .grid-2, .history { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 19px; }
  .hud-top { padding: 8px 12px; gap: 8px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-cn { font-size: 24px; }
  .chip-price, .chip-refresh { display: none; }
  .hud-strip { padding: 4px 12px 6px; gap: 14px; font-size: 8px; }
  .hs-credit { display: none; }
  .stage { padding: 14px 12px 28px; }
  .grid, .stack, .section { gap: 14px; }
  .cab-body { grid-template-columns: minmax(0, 1fr); padding: 0 10px 8px; gap: 12px; }
  .cabinet { box-shadow: 0 0 0 3px var(--gold-d), 0 0 0 6px #000; }
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-3 > :last-child { grid-column: auto; }
  .grid-4.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 .stat-value { font-size: 12px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .seats { grid-template-columns: repeat(10, 1fr); }
  .seats.grand { grid-template-columns: repeat(20, 1fr); gap: 2px; }
  .card { padding: 14px; }
  .round-stats b { font-size: 8px; }
  .lock-calc { grid-template-columns: minmax(0, 1fr); }
  .machine-top { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .machine-info { width: 100%; align-items: center; }
  .machine-info .fill-bar { width: 100%; }
  .machine-info .fill-meta { width: 100%; }
  .addr-row { grid-template-columns: 70px minmax(0, 1fr) auto; }
  .tbl .acts { flex-direction: column; align-items: stretch; }
  .split-item { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .calc-out { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-legal { margin-left: 0; }
  .win-banner { flex-wrap: wrap; }
  .wallet-btn { padding: 8px 10px; }
}
@media (max-width: 400px) {
  .brand-cn { font-size: 20px; }
  .hud-strip .hs-hi { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .crt { animation: none; }
}
