/* ============================================================
   大帅牌 · 复古街机机壳 × Y2K × CRT × 赛博赌场
   设计语言：深色底 + 双强调色(品红/青) + 金色货币；克制的辉光
   ============================================================ */
:root {
  --bg0: #0a0516;
  --bg1: #14092b;
  --surface: rgba(24, 15, 48, 0.92);
  --surface2: rgba(32, 20, 62, 0.94);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --magenta: #ff3ddb;
  --cyan: #23e6ff;
  --purple: #7b2bff;
  --gold: #ffcf4d;
  --red: #ff4d6d;
  --green: #51ff9a;
  --ink: #f0eaff;
  --dim: #a295c8;
  --font-arcade: 'Press Start 2P', 'Courier New', monospace;
  --font-cn: 'ZCOOL QingKe HuangYou', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-user-select: none; user-select: none; }
html, body { height: 100%; overflow: hidden; }
body {
  background:
    radial-gradient(90% 70% at 50% -10%, var(--bg1) 0%, var(--bg0) 68%),
    var(--bg0);
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 15px;
  touch-action: manipulation;
}
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.gold { color: var(--gold); }
.red { color: var(--red); }

#app { position: fixed; inset: 0; }

/* ============ CRT 层 ============ */
#scanlines, #vignette, #noise, #rollbar, #glass {
  position: fixed; inset: 0; pointer-events: none; z-index: 900;
}
#scanlines {
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  animation: crt-flicker 4s infinite;
}
@keyframes crt-flicker { 0%,100% {opacity:.9} 50% {opacity:.75} 52% {opacity:.96} 54% {opacity:.8} }
#vignette { background: radial-gradient(115% 115% at 50% 46%, transparent 56%, rgba(0,0,0,0.6) 100%); }
#noise {
  opacity: .045;
  background-image: repeating-conic-gradient(rgba(255,255,255,.7) 0% 25%, transparent 0% 50%);
  background-size: 3px 3px;
  animation: noise-jitter .35s steps(4) infinite;
}
@keyframes noise-jitter {
  0% { background-position: 0 0; } 25% { background-position: 1px 2px; }
  50% { background-position: 2px 1px; } 75% { background-position: 1px 1px; }
  100% { background-position: 0 0; }
}
#rollbar {
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.045) 42%, rgba(180,230,255,0.09) 50%, rgba(255,255,255,0.045) 58%, transparent 100%);
  height: 220px; inset: auto 0; top: -240px;
  animation: roll-down 9s linear infinite;
}
@keyframes roll-down { from { transform: translateY(0); } to { transform: translateY(calc(100vh + 480px)); } }
#glass {
  background:
    radial-gradient(120% 55% at 18% -12%, rgba(255,255,255,0.08), transparent 46%),
    radial-gradient(90% 38% at 85% 112%, rgba(160,120,255,0.06), transparent 55%);
}
body.no-crt #scanlines, body.no-crt #vignette, body.no-crt #noise,
body.no-crt #rollbar, body.no-crt #glass, body.no-crt #bezel { display: none; }

/* ============ 街机机壳 ============ */
#bezel {
  position: fixed; inset: 7px; pointer-events: none; z-index: 1000;
  border-radius: 24px;
  border: 9px solid #171221;
  box-shadow:
    inset 0 0 0 2px #271e37,
    inset 0 0 30px rgba(0,0,0,.8),
    0 0 0 2px #0a0710,
    0 0 34px rgba(123,43,255,.22),
    0 22px 60px rgba(0,0,0,.66);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 20%);
}
#bezel::before, #bezel::after {
  content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6d6480, #171221 70%);
}
#bezel::before { top: -6px; left: 20px; }
#bezel::after  { bottom: -6px; right: 20px; }
#bezel .bezel-label {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-arcade); font-size: 7px; letter-spacing: 4px;
  color: #544a6a; background: #171221; padding: 2px 12px; border-radius: 8px;
}
#bezel .bezel-led {
  position: absolute; top: -5px; right: 44px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b6ffef, var(--green) 60%, #0a4d34);
  box-shadow: 0 0 9px var(--green);
  animation: led-blink 2.6s infinite;
}
@keyframes led-blink { 0%,88%,100% { opacity: 1; } 92% { opacity: .35; } }

#fx { position: fixed; inset: 0; z-index: 950; pointer-events: none; }
#float-layer { position: fixed; inset: 0; z-index: 960; pointer-events: none; }
#flash {
  position: fixed; inset: 0; z-index: 955; pointer-events: none;
  background: radial-gradient(80% 80% at 50% 50%, rgba(255,255,255,.9), rgba(255,200,255,.5));
  opacity: 0;
}
#flash.on { animation: flash-pop .22s ease-out; }
@keyframes flash-pop { 0% { opacity: .5; } 100% { opacity: 0; } }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ---------- 震屏 ---------- */
@keyframes shake-h { 0%,100%{transform:translate(0,0)} 20%{transform:translate(-6px,3px)} 40%{transform:translate(5px,-4px)} 60%{transform:translate(-4px,-2px)} 80%{transform:translate(3px,4px)} }
.shake-1 { animation: shake-h 0.18s 2; }
.shake-2 { animation: shake-h 0.12s 3; }
.shake-3 { animation: shake-h 0.08s 5; }

/* ============ 按钮体系 ============ */
.btn {
  position: relative;
  font-family: var(--font-cn);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--ink);
  background: var(--surface2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 20px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0,0,0,.5);
  transition: transform .08s, box-shadow .15s, filter .15s, border-color .15s;
  overflow: hidden;
}
.btn:hover:not(:disabled) { filter: brightness(1.22); border-color: rgba(255,255,255,.32); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .35; cursor: not-allowed; filter: grayscale(.7); }
.btn-primary {
  background: linear-gradient(180deg, #ff5ce4, #e01ec2 52%, #a110a0);
  border-color: #ff9dea;
  box-shadow: 0 0 18px rgba(255,61,219,0.5), inset 0 2px 0 rgba(255,255,255,.3), inset 0 -8px 14px rgba(90,0,80,.5);
  text-shadow: 0 0 8px rgba(255,255,255,0.6), 0 2px 0 rgba(90,0,90,.5);
}
.btn-primary::after {
  content: ''; position: absolute; top: -40%; bottom: -40%; left: -30%; width: 30%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.3), transparent);
  transform: skewX(-18deg);
  animation: btn-sheen 3.6s ease-in-out infinite;
}
@keyframes btn-sheen { 0%, 68% { left: -34%; } 88%, 100% { left: 120%; } }
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 30px rgba(255,61,219,0.9), inset 0 2px 0 rgba(255,255,255,.35); }
.btn-ghost { background: rgba(255,255,255,.035); border-color: var(--line-strong); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { border-color: var(--cyan); color: #dffaff; }
.btn-danger { background: linear-gradient(180deg, #c21850, #7a0c30); border-color: var(--red); }
.btn-xl { font-size: 23px; padding: 15px 42px; border-radius: 13px; }
.btn-small { font-size: 13px; padding: 5px 11px; letter-spacing: 1px; border-radius: 8px; }
.btn-icon { width: 36px; height: 36px; padding: 0; font-size: 15px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.btn-play { font-size: 25px; padding: 13px 40px; letter-spacing: 5px; }
.btn-play:not(:disabled) { animation: play-pulse 1.5s ease-in-out infinite; }
@keyframes play-pulse { 0%,100% { box-shadow: 0 0 14px rgba(255,61,219,.5), inset 0 2px 0 rgba(255,255,255,.3); } 50% { box-shadow: 0 0 30px rgba(255,61,219,.95), inset 0 2px 0 rgba(255,255,255,.3); } }
.btn-discard { font-size: 18px; padding: 12px 24px; border-color: rgba(35,230,255,.5); }
.btn-discard:hover:not(:disabled) { border-color: var(--cyan); box-shadow: 0 0 14px rgba(35,230,255,.35); }
.btn-count {
  display: inline-block; margin-left: 9px; vertical-align: 2px;
  font-family: var(--font-arcade); font-size: 11px; letter-spacing: 0;
  background: rgba(0,0,0,.35); border-radius: 6px; padding: 3px 6px;
  text-shadow: none;
}

/* ---------- 弹幕 ---------- */
#danmaku { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 12; }
.danmaku-item {
  position: absolute; left: 100%;
  font-size: 15px; letter-spacing: 2px; white-space: nowrap;
  color: rgba(35,230,255,.5);
  text-shadow: 0 0 8px rgba(35,230,255,.35);
  animation: dm-fly linear forwards;
}
.danmaku-item:nth-child(3n) { color: rgba(255,61,219,.48); text-shadow: 0 0 8px rgba(255,61,219,.35); }
.danmaku-item:nth-child(4n) { color: rgba(255,207,77,.48); text-shadow: 0 0 8px rgba(255,207,77,.35); }
@keyframes dm-fly { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 340px)); } }

/* ============ 主菜单 ============ */
#screen-menu { align-items: center; justify-content: center; }
.menu-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(transparent 96%, rgba(123,43,255,.22) 96%) 0 0/100% 42px,
    linear-gradient(90deg, transparent 96%, rgba(123,43,255,.22) 96%) 0 0/42px 100%;
  transform: perspective(420px) rotateX(28deg) scale(1.6);
  transform-origin: 50% 100%;
  opacity: .32;
  mask-image: linear-gradient(transparent 30%, black 92%);
  animation: grid-scroll 3s linear infinite;
}
@keyframes grid-scroll { from { background-position: 0 0, 0 0; } to { background-position: 0 42px, 42px 0; } }
.menu-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; z-index: 2; }
.marquee {
  width: 100vw; overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 6px 0; color: var(--cyan); text-shadow: 0 0 8px var(--cyan); font-size: 13px; letter-spacing: 4px;
  position: fixed; top: 0; opacity: .8;
  background: rgba(8,3,18,.55);
}
.marquee-inner { display: inline-block; animation: marquee 22s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.px-crown { width: 76px; height: 54px; filter: drop-shadow(0 0 10px rgba(255,207,77,.75)); animation: crown-bob 2.4s ease-in-out infinite; }
@keyframes crown-bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }

.logo-wrap { position: relative; padding: 20px 44px 12px; }
.logo-wrap::before {
  content: ''; position: absolute; inset: 0;
  border: 2px solid rgba(255,61,219,.6);
  border-radius: 18px;
  box-shadow: 0 0 20px rgba(255,61,219,.35), inset 0 0 20px rgba(255,61,219,.14);
  animation: frame-buzz 3.2s infinite;
}
@keyframes frame-buzz { 0%,90%,100% { opacity: 1; } 92% { opacity: .55; } 94% { opacity: .9; } 96% { opacity: .6; } }
.logo-wrap::after {
  content: ''; position: absolute; left: 22px; right: 22px; bottom: -4px; height: 10px;
  background: radial-gradient(circle, var(--gold) 0 3px, transparent 4px) 0 0 / 22px 10px repeat-x;
  filter: drop-shadow(0 0 5px rgba(255,207,77,.85));
  animation: bulb-chase 1s steps(2) infinite;
}
@keyframes bulb-chase { 0% { opacity: 1; } 50% { opacity: .5; } 100% { opacity: 1; } }
.logo {
  font-family: var(--font-arcade);
  font-size: clamp(60px, 9.5vw, 110px);
  color: #fff;
  letter-spacing: 12px;
  text-shadow:
    3px 0 0 rgba(255,61,219,.85), -3px 0 0 rgba(35,230,255,.85),
    0 0 6px #fff, 0 0 24px var(--magenta), 0 0 60px var(--purple), 7px 7px 0 rgba(0,0,0,.55);
  animation: logo-bob 2.8s ease-in-out infinite;
}
@keyframes logo-bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }
.glitch { position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; overflow: hidden; }
.glitch::before { color: var(--cyan); z-index: -1; animation: glitch-a 2.8s infinite steps(1); }
.glitch::after { color: var(--magenta); z-index: -2; animation: glitch-b 3.4s infinite steps(1); }
@keyframes glitch-a { 0%,92%{transform:none;opacity:.8} 93%{transform:translate(-4px,2px)} 96%{transform:translate(3px,-2px)} 100%{transform:none} }
@keyframes glitch-b { 0%,90%{transform:none;opacity:.8} 91%{transform:translate(4px,-2px)} 95%{transform:translate(-3px,2px)} 100%{transform:none} }
.logo-sub { font-size: 17px; letter-spacing: 9px; color: var(--cyan); text-shadow: 2px 0 0 rgba(255,61,219,.55), 0 0 12px var(--cyan); }
.menu-mascot {
  position: absolute; right: -38px; bottom: -22px; width: 92px; height: 106px;
  cursor: pointer; pointer-events: auto; z-index: 3;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.6));
  animation: mascot-idle 2.4s ease-in-out infinite;
  transition: transform .12s;
}
.menu-mascot:hover { transform: scale(1.08) rotate(-3deg); }
.menu-mascot .tut-mascot { width: 100%; height: 100%; }
.menu-mascot.wiggle { animation: mascot-wiggle .5s ease-in-out; }
@keyframes mascot-idle { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes mascot-wiggle { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-8deg) scale(1.1) } 75% { transform: rotate(8deg) scale(1.1) } }
.menu-btns { display: flex; flex-direction: column; gap: 13px; margin-top: 10px; width: 340px; }
.menu-btns .btn-primary { width: 100%; }
.menu-sub-btns { display: flex; gap: 9px; }
.menu-sub-btns .btn { flex: 1; font-size: 14px; padding: 8px 6px; letter-spacing: 1px; }
.menu-foot { position: fixed; bottom: 20px; font-size: 12px; letter-spacing: 2px; }

/* ============ 对局 ============ */
#screen-game { padding: 10px 10px 12px; gap: 10px; }
#topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  z-index: 10;
}
.boss-chip {
  font-size: 14px; color: #ffd7f4; padding: 4px 12px; border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, rgba(255,61,219,.1) 0 10px, transparent 10px 20px),
    rgba(255,61,219,.07);
  border: 1px dashed rgba(255,61,219,.6);
  text-shadow: 0 0 8px rgba(255,61,219,.5);
}
#tb-seal { font-size: 13px; color: #ffb3b3; }
.tb-spacer { flex: 1; }
#tb-progress { display: flex; gap: 5px; align-items: center; }
#tb-progress i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255,255,255,.07); border: 1px solid var(--line); }
#tb-progress i.done { background: var(--purple); border-color: transparent; box-shadow: 0 0 6px var(--purple); }
#tb-progress i.cur { background: var(--magenta); border-color: transparent; box-shadow: 0 0 8px var(--magenta); animation: badge-pulse 1.4s infinite; }
@keyframes badge-pulse { 0%,100%{box-shadow:0 0 4px rgba(255,61,219,.4)} 50%{box-shadow:0 0 14px rgba(255,61,219,.9)} }
.kind-badge { font-size: 12px; padding: 3px 9px; border-radius: 6px; letter-spacing: 2px; }
.kind-badge.normal { background: rgba(35,230,255,.12); color: var(--cyan); border: 1px solid rgba(35,230,255,.55); }
.kind-badge.elite { background: rgba(255,207,77,.12); color: var(--gold); border: 1px solid rgba(255,207,77,.55); }
.kind-badge.boss { background: rgba(255,61,219,.16); color: var(--magenta); border: 1px solid rgba(255,61,219,.65); animation: badge-pulse 1.6s infinite; }
.tb-money { font-size: 18px; letter-spacing: 1px; }

#game-body { flex: 1; display: flex; gap: 10px; min-height: 0; }

/* ---- 左侧信息卡（单一面板分区） ---- */
#left-panel { width: 272px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; z-index: 5; }
.lp-card {
  flex: 1;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  overflow-y: auto;
}
.lp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lp-title { font-size: 17px; letter-spacing: 1px; color: #fff; }
.pb-label { font-size: 12px; color: var(--dim); letter-spacing: 3px; }
.lp-goals { display: flex; gap: 14px; }
.lp-goal { flex: 1; min-width: 0; }
.lp-goal .big-num { margin-top: 4px; }
.lp-counts { display: flex; flex-direction: column; gap: 2px; }
.big-num { font-family: var(--font-arcade); font-size: 27px; line-height: 1.3; word-break: break-all; }
.big-num.neon { color: #ecfeff; text-shadow: 2px 0 0 rgba(255,61,219,.5), -2px 0 0 rgba(35,230,255,.5), 0 0 12px rgba(35,230,255,.75); }
.big-num.gold { color: var(--gold); text-shadow: 0 0 12px rgba(255,207,77,.8), 2px 2px 0 rgba(0,0,0,.4); }
.big-num.rgb-split { animation: rgb-jitter .12s steps(2) infinite; }
@keyframes rgb-jitter {
  0% { text-shadow: 4px 0 0 rgba(255,61,219,.9), -4px 1px 0 rgba(35,230,255,.9), 0 0 18px #fff; transform: translateX(-1px); }
  50% { text-shadow: -5px -1px 0 rgba(255,61,219,.9), 5px 0 0 rgba(35,230,255,.9), 0 0 22px #fff; transform: translateX(1px); }
  100% { text-shadow: 3px 1px 0 rgba(255,61,219,.9), -3px 0 0 rgba(35,230,255,.9), 0 0 16px #fff; transform: translateX(0); }
}
.progress { height: 8px; background: rgba(0,0,0,.45); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
#progress-fill { height: 100%; width: 0%; background: repeating-linear-gradient(90deg, var(--purple) 0 8px, var(--magenta) 8px 16px); box-shadow: 0 0 10px var(--magenta); transition: width .5s; }
.lp-sep { height: 1px; background: var(--line); margin: 2px 0; }
.lp-preview {
  position: relative;
  background: linear-gradient(180deg, rgba(10,14,40,.8), rgba(7,8,26,.9));
  border: 1px solid rgba(90,80,220,.35);
  border-radius: 12px;
  padding: 12px;
  overflow: hidden;
}
.lp-preview::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(120,160,255,.05) 0 1px, transparent 1px 3px);
}
.hand-name { font-size: 21px; color: #fff; text-shadow: 0 0 10px var(--purple); margin: 5px 0 9px; min-height: 25px; }
.score-boxes { display: flex; align-items: stretch; gap: 6px; }
.score-box {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 9px; padding: 8px 4px; min-height: 58px;
  font-family: var(--font-arcade); font-size: 17px;
  transition: filter .2s;
}
.score-box.chips { background: linear-gradient(180deg, #1d1856, #110d3a); border: 1px solid rgba(122,110,255,.55); color: #cfe0ff; text-shadow: 0 0 8px rgba(122,110,255,.8); }
.score-box.mult { background: linear-gradient(180deg, #6c0f50, #400830); border: 1px solid rgba(255,61,219,.6); color: #ffd7f4; text-shadow: 0 0 8px var(--magenta), 0 0 20px rgba(255,61,219,.45); }
.sb-label { font-size: 9px; opacity: .7; margin-bottom: 5px; letter-spacing: 2px; }
.sb-x { align-self: center; font-size: 18px; color: var(--dim); }
@keyframes box-pop { 0%{transform:scale(1)} 40%{transform:scale(1.18)} 100%{transform:scale(1)} }
.score-box.pop { animation: box-pop .3s; }
@keyframes box-boom {
  0%{transform:scale(1) rotate(0)}
  22%{transform:scale(1.6) rotate(-4deg); box-shadow:0 0 56px var(--magenta), 0 0 110px rgba(255,61,219,.45)}
  50%{transform:scale(1.18) rotate(3deg)}
  100%{transform:scale(1) rotate(0)}
}
.score-box.boom { animation: box-boom .55s; }
.count-row { display: flex; align-items: center; gap: 8px; margin: 2px 0; font-size: 15px; }
.cr-label { color: var(--dim); width: 50px; letter-spacing: 2px; }
.cr-num { font-family: var(--font-arcade); font-size: 13px; color: #fff; }
.pips { color: var(--magenta); text-shadow: 0 0 7px var(--magenta); font-size: 12px; letter-spacing: 2px; }

/* ---- 主区域 ---- */
#main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
#main-area::before {
  content: '大帥牌'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(110px, 19vw, 230px); letter-spacing: 26px;
  color: transparent;
  -webkit-text-stroke: 2px rgba(123,43,255,.10);
  pointer-events: none;
  white-space: nowrap; overflow: hidden;
}
#play-area {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 18px; min-height: 0; z-index: 2;
}
#chain-tip {
  position: absolute; top: 14px; right: 20px; z-index: 6;
  font-family: var(--font-arcade); font-size: 15px; letter-spacing: 2px;
  color: var(--gold); text-shadow: 0 0 12px rgba(255,207,77,.9), 2px 2px 0 rgba(0,0,0,.7);
  opacity: 0; transform: scale(.5) rotate(-6deg);
  pointer-events: none;
}
#chain-tip.show { opacity: 1; transform: scale(1) rotate(-4deg); transition: transform .12s cubic-bezier(.2,2,.4,1); }
#chain-tip.hot { color: var(--magenta); text-shadow: 0 0 16px var(--magenta), 0 0 40px rgba(255,61,219,.7), 2px 2px 0 rgba(0,0,0,.7); }

#hand-zone {
  padding: 8px 10px 4px;
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(60,26,110,.38));
  border-radius: 14px;
  z-index: 3;
}
#hand {
  display: flex; justify-content: center; align-items: flex-end;
  min-height: 136px; padding: 0 10px;
}
#hand .pcard:not(:first-child) { margin-left: -24px; }
#hand .pcard { transform: rotate(var(--fan-rot, 0deg)) translateY(var(--fan-y, 0px)); }
#hand .pcard:hover { transform: rotate(var(--fan-rot, 0deg)) translateY(calc(var(--fan-y, 0px) - 10px)); z-index: 5; transition: transform .1s; }
#hand .pcard.selected { transform: rotate(var(--fan-rot, 0deg)) translateY(-26px); }
#actions { display: flex; align-items: center; justify-content: center; gap: 13px; padding-bottom: 6px; }
.sort-btns { display: flex; gap: 8px; margin-left: 8px; }

/* ============================================================
   扑克牌：赛博赌场霓虹牌
   ============================================================ */
.pcard {
  --suit-c: #b9a8ff;
  --suit-glow: rgba(160,140,255,.3);
  position: relative;
  width: 82px; height: 116px;
  border-radius: 10px;
  background: linear-gradient(165deg, #282062 0%, #1a1248 48%, #120b34 100%);
  border: 1px solid rgba(158,138,255,.5);
  box-shadow:
    0 0 10px var(--suit-glow),
    0 5px 18px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -10px 18px rgba(0,0,0,.38);
  cursor: grab;
  transition: transform .12s ease, box-shadow .12s ease;
  flex-shrink: 0;
  animation: deal-in .3s backwards;
  animation-delay: var(--deal-delay, 0ms);
  overflow: hidden;
  touch-action: none;
  -webkit-touch-callout: none;
}
.pcard.suit-H, .pcard.suit-D { --suit-c: #ff5f9e; --suit-glow: rgba(255,95,158,.36); }
.pcard.suit-S, .pcard.suit-C { --suit-c: #7ce7ff; --suit-glow: rgba(124,231,255,.32); }
.pcard::before {
  content: ''; position: absolute; inset: 3px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  pointer-events: none; z-index: 1;
}
.pcard::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.09) 46%, rgba(35,230,255,.06) 52%, transparent 66%);
  background-size: 260% 100%;
  animation: card-sheen 5s linear infinite;
}
@keyframes card-sheen { from { background-position: 135% 0; } to { background-position: -135% 0; } }
.pc-index {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 1px;
  line-height: 1; z-index: 3;
  font-family: var(--font-arcade);
  color: var(--suit-c);
  text-shadow: 0 0 7px var(--suit-c);
}
.pc-index.tl { top: 6px; left: 6px; }
.pc-index.br { bottom: 6px; right: 6px; transform: rotate(180deg); }
.pc-index b { font-size: 11px; font-weight: normal; }
.pc-index i { font-style: normal; font-size: 12px; }
.pc-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  z-index: 2; pointer-events: none;
}
.pc-wm {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -54%);
  font-size: 64px; line-height: 1;
  color: var(--suit-c); opacity: .13;
}
.pc-rank {
  position: relative;
  font-family: var(--font-arcade);
  font-size: 36px;
  color: #fff;
  text-shadow: 0 0 10px var(--suit-c), 0 0 28px var(--suit-c), 2px 2px 0 rgba(0,0,0,.45);
}
.pc-rank.ten { font-size: 24px; letter-spacing: -2px; }
.pc-enh {
  position: absolute; top: 4px; right: 4px; z-index: 6;
  font-size: 13px; line-height: 1;
  background: rgba(6,3,18,.78);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 5px; padding: 2px 4px;
  box-shadow: 0 0 8px rgba(0,0,0,.5);
}
.pcard.selected {
  transform: translateY(-26px);
  box-shadow:
    0 0 0 2px var(--cyan),
    0 0 28px var(--cyan),
    0 0 62px rgba(35,230,255,.4),
    0 12px 26px rgba(0,0,0,.7);
}
.pcard.dragging {
  position: fixed !important;
  z-index: 999; pointer-events: none;
  transform: scale(1.12) rotate(4deg) !important;
  box-shadow: 0 0 0 2px var(--gold), 0 0 32px rgba(255,207,77,.55), 0 16px 38px rgba(0,0,0,.78);
  margin: 0 !important;
  animation: none;
  cursor: grabbing;
}
.pcard.debuffed { filter: grayscale(.85) brightness(.5) contrast(.92); }
.pcard.debuffed::after {
  content: '✗'; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 46px; color: rgba(255,77,109,.5);
  text-shadow: 0 0 12px rgba(255,77,109,.4);
  background: none; animation: none;
  font-family: var(--font-arcade);
}
.pcard.score-pop { animation: score-pop .32s; }
@keyframes score-pop { 0%{transform:translateY(0) scale(1)} 45%{transform:translateY(-18px) scale(1.14)} 100%{transform:none} }
.pcard.fly-away { transition: transform .4s cubic-bezier(.5,0,.9,.4), opacity .4s; transform: translateY(150px) rotate(14deg) scale(.9); opacity: 0; }
#play-area .pcard { cursor: default; }

/* 强化牌 */
.enh-gold {
  border-color: rgba(255,207,77,.95);
  box-shadow: 0 0 16px rgba(255,207,77,.6), 0 5px 18px rgba(0,0,0,.6), inset 0 0 18px rgba(255,207,77,.16);
}
.enh-gold::before { border-color: rgba(255,207,77,.45); }
.enh-gold .pc-rank { text-shadow: 0 0 10px #ffcf4d, 0 0 30px rgba(255,207,77,.8), 2px 2px 0 rgba(0,0,0,.45); }
.enh-diamond {
  border-color: rgba(140,240,255,.95);
  box-shadow: 0 0 16px rgba(35,230,255,.6), 0 5px 18px rgba(0,0,0,.6), inset 0 0 18px rgba(35,230,255,.16);
}
.enh-diamond::before { border-color: rgba(140,240,255,.45); }
.enh-diamond .pc-rank { text-shadow: 0 0 10px #8ceaff, 0 0 30px rgba(35,230,255,.8), 2px 2px 0 rgba(0,0,0,.45); }
.enh-mirror {
  border: 1px solid transparent;
  background:
    linear-gradient(165deg, #282062 0%, #1a1248 48%, #120b34 100%) padding-box,
    linear-gradient(120deg, #ff3ddb, #ffcf4d, #23e6ff, #51ff9a, #ff5f9e, #ff3ddb) border-box;
  background-size: auto, 320% 100%;
  animation: deal-in .3s backwards, mirror-pan 3s linear infinite;
  animation-delay: var(--deal-delay, 0ms), 0s;
  box-shadow: 0 0 18px rgba(255,138,232,.5), 0 5px 18px rgba(0,0,0,.6);
}
@keyframes mirror-pan { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 320% 0; } }
.enh-cyber {
  border-color: rgba(35,230,255,.85);
  background:
    repeating-linear-gradient(0deg, rgba(35,230,255,.08) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(90deg, rgba(35,230,255,.08) 0 1px, transparent 1px 10px),
    linear-gradient(165deg, #0e1538, #0a0d2a);
  box-shadow: 0 0 15px rgba(35,230,255,.45), 0 5px 18px rgba(0,0,0,.65), inset 0 0 16px rgba(35,230,255,.1);
}
.enh-cyber .pc-rank { color: #b6f4ff; }
.enh-star {
  border-color: rgba(255,210,90,.95);
  box-shadow: 0 0 20px rgba(255,200,60,.8), 0 5px 18px rgba(0,0,0,.6), inset 0 0 20px rgba(255,220,120,.22);
}
.enh-star::before { border-color: rgba(255,220,120,.5); }
.enh-flash { border-color: rgba(255,138,232,.9); box-shadow: 0 0 18px rgba(255,138,232,.65), 0 5px 18px rgba(0,0,0,.6); }
.enh-flash::after {
  background: linear-gradient(115deg, transparent 24%, rgba(255,255,255,.55) 44%, rgba(255,138,232,.4) 52%, transparent 68%);
  background-size: 260% 100%;
  animation: card-sheen 1.1s linear infinite;
}
.enh-hotscreen {
  border-color: rgba(255,122,77,.95);
  box-shadow: 0 0 16px rgba(255,90,42,.7), 0 5px 18px rgba(0,0,0,.6), inset 0 0 18px rgba(255,120,60,.18);
}
.enh-hotscreen::before { border-color: rgba(255,150,100,.45); }
.enh-hotscreen .pc-rank { text-shadow: 0 0 10px #ff9a5a, 0 0 28px rgba(255,90,42,.8), 2px 2px 0 rgba(0,0,0,.45); }
.enh-alround {
  border-color: rgba(190,120,255,.95);
  box-shadow: 0 0 16px rgba(123,43,255,.7), 0 5px 18px rgba(0,0,0,.6), inset 0 0 18px rgba(160,80,255,.2);
}
.enh-alround::before { border-color: rgba(190,120,255,.5); }
.enh-fortune {
  border-color: rgba(90,255,170,.95);
  box-shadow: 0 0 16px rgba(81,255,154,.6), 0 5px 18px rgba(0,0,0,.6), inset 0 0 18px rgba(81,255,154,.16);
}
.enh-fortune::before { border-color: rgba(90,255,170,.45); }
.enh-break {
  border-color: rgba(255,77,109,.95);
  box-shadow: 0 0 18px rgba(255,77,109,.75), 0 5px 18px rgba(0,0,0,.6), inset 0 0 20px rgba(255,77,109,.2);
}
.enh-break::before { border-color: rgba(255,77,109,.5); }
.enh-break .pc-rank { text-shadow: 0 0 10px #ff5c8a, 0 0 30px rgba(255,77,109,.8), 2px 2px 0 rgba(0,0,0,.45); }

.pcard.mini { width: 44px; height: 62px; border-radius: 6px; }
.pcard.mini::before { inset: 2px; border-radius: 4px; }
.pcard.mini .pc-index b { font-size: 8px; }
.pcard.mini .pc-index i { font-size: 8px; }
.pcard.mini .pc-index.tl { top: 2px; left: 3px; gap: 0; }
.pcard.mini .pc-index.br { display: none; }
.pcard.mini .pc-rank { font-size: 19px; }
.pcard.mini .pc-rank.ten { font-size: 13px; letter-spacing: -1px; }
.pcard.mini .pc-wm { font-size: 34px; opacity: .18; }
.pcard.mini .pc-enh { font-size: 9px; top: 1px; right: 2px; padding: 1px 2px; }
.pcard.big { width: 128px; height: 180px; cursor: default; }
.pcard.big .pc-index b { font-size: 17px; }
.pcard.big .pc-index i { font-size: 17px; }
.pcard.big .pc-index.tl { top: 9px; left: 10px; }
.pcard.big .pc-index.br { bottom: 9px; right: 10px; }
.pcard.big .pc-rank { font-size: 54px; }
.pcard.big .pc-rank.ten { font-size: 34px; }
.pcard.big .pc-wm { font-size: 98px; }
.pcard.big .pc-enh { font-size: 19px; top: 6px; right: 6px; padding: 3px 5px; }

/* ---- 底部栏 ---- */
#bottom-bar {
  display: flex; gap: 24px; align-items: center;
  padding: 9px 16px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  z-index: 10; min-height: 64px;
}
.bb-group { display: flex; flex-direction: column; gap: 4px; }
.bb-label { font-size: 11px; color: var(--dim); letter-spacing: 2px; }
.ds-row { display: flex; gap: 8px; }
.ds-chip {
  display: flex; align-items: center; gap: 6px;
  min-width: 122px; height: 38px;
  padding: 4px 11px; border-radius: 10px;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--line-strong);
  font-size: 15px; cursor: pointer;
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.ds-chip:hover:not(.empty) { transform: translateY(-3px); border-color: rgba(255,255,255,.35); }
.ds-chip.empty { border-style: dashed; opacity: .35; cursor: default; }
.ds-chip .ds-name { letter-spacing: 1px; }
.ds-chip .ds-rar { font-size: 11px; opacity: .65; margin-left: auto; }
.ds-chip.r-common { border-color: rgba(35,230,255,.6); box-shadow: 0 0 10px rgba(35,230,255,.22); }
.ds-chip.r-rare { border-color: rgba(255,207,77,.7); box-shadow: 0 0 12px rgba(255,207,77,.35); }
.ds-chip.r-legend {
  border-color: rgba(255,61,219,.8);
  background: linear-gradient(120deg, rgba(255,61,219,.16), rgba(35,230,255,.12), rgba(255,207,77,.12));
  background-size: 220% 100%;
  animation: legend-flow 3s linear infinite;
  box-shadow: 0 0 14px rgba(255,61,219,.5);
}
@keyframes legend-flow { from { background-position: 0 0; } to { background-position: 220% 0; } }
.ds-chip.sealed { filter: grayscale(.95); position: relative; }
.seal-mark { margin-left: 4px; }
.consum-chip {
  display: flex; align-items: center; gap: 6px;
  min-width: 112px; height: 38px; padding: 4px 11px; border-radius: 10px;
  background: rgba(81,255,154,.06);
  border: 1px solid rgba(81,255,154,.55);
  box-shadow: 0 0 10px rgba(81,255,154,.18);
  font-size: 15px; cursor: pointer; transition: transform .1s, box-shadow .15s;
}
.consum-chip:hover { transform: translateY(-3px); box-shadow: 0 0 16px rgba(81,255,154,.4); }
.consum-chip.empty { border-style: dashed; opacity: .35; cursor: default; box-shadow: none; background: transparent; border-color: var(--line); }
.cb-icon { font-size: 17px; }

/* ---------- 飘字 ---------- */
.float-txt {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-arcade);
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 10px currentColor, 2px 2px 0 rgba(0,0,0,.65);
  animation: float-up 1.1s ease-out forwards;
  white-space: nowrap;
  z-index: 970;
}
@keyframes float-up { 0%{opacity:0; transform:translate(-50%,-30%) scale(.5)} 15%{opacity:1; transform:translate(-50%,-60%) scale(1.2)} 100%{opacity:0; transform:translate(-50%,-280%) scale(1)} }
.float-txt.chips { color: var(--cyan); }
.float-txt.mult { color: #ff8ae8; }
.float-txt.xmult { color: var(--magenta); font-size: 27px; }
.float-txt.gold { color: var(--gold); }
.float-txt.money { color: #ffe27a; }
.float-txt.miss { color: #8a8a9e; font-size: 13px; font-family: var(--font-cn); }
.float-txt.info { color: #ffd7f4; font-size: 14px; font-family: var(--font-cn); }
.float-txt.big { font-size: 32px; letter-spacing: 6px; }
.float-txt.slam { font-size: 40px; letter-spacing: 4px; color: #fff; text-shadow: 0 0 20px var(--magenta), 0 0 60px var(--purple), 4px 4px 0 rgba(0,0,0,.7); }

/* ---------- Toast ---------- */
#toast-root {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 980; pointer-events: none;
}
.toast {
  background: rgba(10,4,24,.94);
  border: 1px solid rgba(35,230,255,.6);
  border-left: 3px solid var(--magenta);
  color: #dffaff;
  padding: 9px 20px; border-radius: 10px;
  box-shadow: 0 0 18px rgba(35,230,255,.3);
  font-size: 15px; letter-spacing: 1px;
  animation: toast-in .25s ease-out;
  transition: opacity .4s, transform .4s;
  max-width: 70vw;
}
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; } }

/* ---------- 篮球侠彩蛋层 ---------- */
#cameo {
  position: fixed; left: 20px; bottom: 20px; z-index: 850;
  display: flex; align-items: flex-end; gap: 10px;
  pointer-events: none;
  animation: cameo-in .3s cubic-bezier(.2,1.6,.4,1);
}
@keyframes cameo-in { from { transform: translateY(20px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
#cameo .tut-mascot { width: 58px; height: 66px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.7)); }
.cameo-bubble {
  background: rgba(12,5,28,.95);
  border: 2px solid var(--gold);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  font-size: 15px; letter-spacing: 1px; color: #ffe9fb;
  max-width: 250px; line-height: 1.6;
  box-shadow: 0 0 20px rgba(255,207,77,.3), 0 10px 30px rgba(0,0,0,.5);
}

/* ---------- 覆盖层 ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(6,2,14,.86);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto;
}
.ovl { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 40px 30px; max-width: 940px; width: 100%; }
.ovl-back { position: absolute; top: 0; left: 0; z-index: 5; }
.ovl-tag { font-size: 14px; letter-spacing: 7px; color: var(--cyan); text-shadow: 2px 0 0 rgba(255,61,219,.5), 0 0 12px var(--cyan); }
.ovl-title {
  font-size: clamp(40px, 7vw, 74px); color: #fff; letter-spacing: 8px; text-align: center;
  text-shadow: 3px 0 0 rgba(255,61,219,.8), -3px 0 0 rgba(35,230,255,.8), 0 0 10px #fff, 0 0 34px var(--magenta), 0 0 80px var(--purple);
}
.ovl-title.small { font-size: 38px; }
.ovl-title.huge { font-size: clamp(44px, 8vw, 88px); }
.ovl-title.rainbow { animation: rainbow-hue 3s linear infinite; }
@keyframes rainbow-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
.title-slam { animation: title-slam .5s cubic-bezier(.2,1.8,.3,1) backwards; }
@keyframes title-slam { from { transform: scale(2.4); opacity: 0; filter: blur(8px); } to { transform: scale(1); opacity: 1; filter: blur(0); } }

/* 对手登场 */
.opp-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-width: 340px; padding: 24px 38px;
  background:
    repeating-linear-gradient(135deg, rgba(255,61,219,.05) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, rgba(48,12,92,.6), rgba(20,4,44,.75));
  border: 2px solid var(--magenta);
  border-radius: 16px;
  box-shadow: 0 0 36px rgba(255,61,219,.3), inset 0 0 36px rgba(255,61,219,.08);
  animation: opp-in .5s cubic-bezier(.2,1.7,.4,1) backwards;
}
@keyframes opp-in { from { transform: scale(.5) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.opp-card::before, .opp-card::after {
  content: ''; position: absolute; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(45deg, var(--gold) 0 12px, #111 12px 24px);
  opacity: .7;
}
.opp-card::before { top: 0; border-radius: 14px 14px 0 0; }
.opp-card::after { bottom: 0; border-radius: 0 0 14px 14px; }
.opp-emoji { font-size: 64px; filter: drop-shadow(0 0 16px var(--magenta)); animation: opp-idle 2s ease-in-out infinite; }
@keyframes opp-idle { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
.opp-name { font-size: 30px; letter-spacing: 7px; text-shadow: 0 0 14px var(--magenta), 0 0 40px rgba(255,61,219,.5); }
.opp-title { font-size: 13px; color: var(--gold); letter-spacing: 4px; }
.opp-taunt { font-size: 17px; color: #ffd7f4; margin-top: 4px; min-height: 24px; }
.opp-tip { font-size: 14px; color: var(--cyan); border-top: 1px dashed var(--line-strong); padding-top: 9px; margin-top: 4px; text-shadow: 0 0 8px rgba(35,230,255,.4); }
.intro-target { font-size: 21px; letter-spacing: 2px; }
.intro-target b { font-family: var(--font-arcade); font-size: 31px; color: var(--gold); text-shadow: 0 0 16px rgba(255,207,77,.9), 3px 3px 0 rgba(0,0,0,.55); }
.intro-chips { display: flex; gap: 12px; }
.intro-chips span { border: 1px solid var(--line-strong); border-radius: 20px; padding: 4px 15px; font-size: 13px; color: var(--dim); background: rgba(0,0,0,.3); }
.seal-warn { color: #ffb3b3; border: 1px dashed var(--red); border-radius: 10px; padding: 9px 20px; font-size: 15px; background: rgba(255,77,109,.08); animation: seal-shake .5s ease-in-out; }
@keyframes seal-shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) } }

/* 过关 */
.win-score { font-size: 20px; }
.win-score b { font-family: var(--font-arcade); color: var(--gold); text-shadow: 0 0 14px rgba(255,207,77,.8); }
.reward-list { display: flex; flex-direction: column; gap: 8px; min-width: 380px; }
.reward-line {
  display: flex; justify-content: space-between; gap: 40px;
  padding: 10px 18px;
  background: rgba(0,0,0,.38); border: 1px solid var(--line); border-radius: 10px;
  font-size: 17px;
  animation: reward-in .4s backwards;
}
.reward-line:nth-child(1){animation-delay:.15s} .reward-line:nth-child(2){animation-delay:.35s}
.reward-line:nth-child(3){animation-delay:.55s} .reward-line:nth-child(4){animation-delay:.75s}
@keyframes reward-in { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; } }
.reward-line b { font-family: var(--font-arcade); color: var(--green); text-shadow: 0 0 10px rgba(81,255,154,.7); }
.reward-line.total { border-color: rgba(255,207,77,.6); background: rgba(255,207,77,.08); }
.reward-line.total b { color: var(--gold); font-size: 21px; }

/* ---------- 商店 ---------- */
.ovl.shop { gap: 14px; padding-top: 26px; }
.shop-head { display: flex; align-items: baseline; gap: 30px; }
.shop-money { font-size: 21px; }
.shop-money .js-money { font-family: var(--font-arcade); font-size: 21px; }
.shop-rows { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.row-label { font-size: 12px; color: var(--dim); letter-spacing: 2px; margin-top: 4px; }
.shop-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; width: 100%; max-width: 980px; }
.shop-item {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 14px;
  min-height: 150px;
  transition: transform .12s, box-shadow .15s, border-color .15s;
  overflow: hidden;
}
.shop-item:hover:not(.sold) { transform: translateY(-5px); border-color: rgba(255,255,255,.35); }
.shop-item.r-common { border-color: rgba(35,230,255,.55); }
.shop-item.r-rare { border-color: rgba(255,207,77,.65); box-shadow: 0 0 16px rgba(255,207,77,.25); }
.shop-item.r-legend { border-color: rgba(255,61,219,.7); box-shadow: 0 0 20px rgba(255,61,219,.4); }
.shop-item.sold { opacity: .3; filter: grayscale(1); pointer-events: none; }
.shop-item.sold::after {
  content: '已售出'; position: absolute; top: 42%; left: 50%;
  transform: translate(-50%,-50%) rotate(-14deg);
  font-size: 29px; letter-spacing: 6px; color: var(--red);
  border: 3px solid var(--red); border-radius: 10px; padding: 4px 14px; opacity: .9;
  text-shadow: 0 0 12px rgba(255,77,109,.55);
}
.si-head { display: flex; align-items: center; gap: 8px; }
.si-icon { font-size: 21px; }
.si-name { font-size: 18px; letter-spacing: 1px; }
.si-rar { margin-left: auto; font-size: 12px; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 8px; }
.r-rare .si-rar { color: var(--gold); border-color: rgba(255,207,77,.6); }
.r-legend .si-rar { color: var(--magenta); border-color: rgba(255,61,219,.6); }
.si-desc { font-size: 14px; color: #e8ddff; line-height: 1.55; flex: 1; }
.si-flavor { font-size: 12px; color: var(--dim); }
.si-foot { display: flex; align-items: center; justify-content: space-between; }
.si-price { font-family: var(--font-arcade); font-size: 14px; color: var(--gold); text-shadow: 0 0 10px rgba(255,207,77,.65); }
.shop-foot { display: flex; gap: 14px; }

/* ---------- 结束画面 ---------- */
.over-detail { display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 18px; }
.over-detail b { font-family: var(--font-arcade); }
.over-mascot .tut-mascot { width: 72px; height: 82px; animation: tut-bounce 2s ease-in-out infinite; }
.victory-quote { font-size: 20px; color: var(--gold); text-shadow: 0 0 14px rgba(255,207,77,.6); }
.victory-sub { font-size: 19px; color: var(--gold); letter-spacing: 5px; text-shadow: 0 0 16px rgba(255,207,77,.7); }
.btn-row { display: flex; gap: 16px; margin-top: 8px; }
.stamp {
  font-size: 21px; letter-spacing: 4px; color: var(--gold);
  border: 3px solid var(--gold); border-radius: 10px; padding: 8px 22px;
  transform: rotate(-8deg);
  text-shadow: 0 0 14px rgba(255,207,77,.8);
  box-shadow: 0 0 20px rgba(255,207,77,.3), inset 0 0 14px rgba(255,207,77,.12);
  animation: stamp-in .45s cubic-bezier(.3,1.6,.4,1) .35s backwards;
}
@keyframes stamp-in { from { transform: rotate(-8deg) scale(2.6); opacity: 0; } 60% { transform: rotate(-8deg) scale(.92); opacity: 1; } to { transform: rotate(-8deg) scale(1); } }

/* ---------- 弹窗 ---------- */
#modal-root { position: fixed; inset: 0; z-index: 700; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(4,1,12,.78); backdrop-filter: blur(4px); }
.modal {
  position: relative;
  max-width: 92vw; max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, #1c0d3a, #100627);
  border: 1px solid rgba(160,120,255,.5);
  border-radius: 16px;
  box-shadow: 0 0 42px rgba(123,43,255,.4), 0 24px 70px rgba(0,0,0,.6);
  padding: 20px 24px;
  animation: modal-in .22s cubic-bezier(.2,1.4,.4,1);
}
@keyframes modal-in { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 20px; letter-spacing: 3px; color: #fff; text-shadow: 0 0 12px var(--purple); margin-bottom: 14px; }
.modal-body { font-size: 15px; line-height: 1.7; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 18px; }
.detail-card-row { display: flex; gap: 22px; align-items: center; }
.detail-info { display: flex; flex-direction: column; gap: 6px; }
.detail-info b { color: var(--gold); }
.ds-detail { display: flex; flex-direction: column; gap: 10px; }
.dsd-head { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.dsd-desc { font-size: 15px; color: #e8ddff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: rgba(0,0,0,.25); }
.dsd-flavor { color: var(--dim); font-size: 13px; }
.ds-detail.r-common .dsd-head b { color: var(--cyan); }
.ds-detail.r-rare .dsd-head b { color: var(--gold); }
.ds-detail.r-legend .dsd-head b { color: var(--magenta); }

/* 牌库查看 */
.deck-view { display: flex; flex-direction: column; gap: 12px; }
.dv-suit { display: flex; align-items: flex-start; gap: 10px; }
.dv-suit-name { writing-mode: vertical-lr; font-size: 14px; letter-spacing: 4px; padding-top: 4px; }
.dv-suit-name.red { color: #ff5f9e; }
.dv-suit-name.black { color: #7ce7ff; }
.dv-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.deck-view .pcard.mini { cursor: pointer; }
.deck-view .pcard.mini:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--cyan), 0 6px 16px rgba(0,0,0,.65); }

/* 选择按钮组 */
.btn-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.suit-btn { min-width: 92px; font-size: 19px; }
.suit-btn.red { border-color: rgba(255,95,158,.7); color: #ffd7ec; }
.hand-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 122px; }
.hand-btn .lv { font-size: 12px; color: var(--gold); }
.hand-btn .dim { font-size: 12px; font-family: var(--font-arcade); }

/* 设置 & 统计 */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0; }
.setting-row input[type="range"] { width: 180px; accent-color: var(--magenta); }
.setting-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--magenta); }
.small-note { margin-top: 8px; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats-grid div { display: flex; flex-direction: column; gap: 4px; background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stats-grid span { color: var(--dim); font-size: 12px; }
.stats-grid b { font-family: var(--font-arcade); font-size: 17px; color: var(--gold); }

/* ---------- 新手指引 ---------- */
#tutorial-root { position: fixed; inset: 0; z-index: 760; pointer-events: none; }
#tutorial-root.dimmed { background: rgba(4,1,12,.72); }
.tut-spot {
  position: fixed; z-index: 1;
  border: 2px solid var(--cyan);
  border-radius: 14px;
  box-shadow: 0 0 0 200vmax rgba(4,1,12,.8), 0 0 26px rgba(35,230,255,.45), inset 0 0 20px rgba(35,230,255,.1);
  animation: tut-spot-pulse 1.6s ease-in-out infinite;
  pointer-events: none;
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease;
}
@keyframes tut-spot-pulse { 0%, 100% { border-color: var(--cyan); } 50% { border-color: var(--gold); } }
.tut-bubble {
  position: fixed; z-index: 2;
  width: 372px; max-width: 92vw;
  pointer-events: auto;
  background: linear-gradient(180deg, #241040, #150829);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 14px 16px 12px;
  box-shadow: 0 0 28px rgba(255,207,77,.3), 0 18px 50px rgba(0,0,0,.6);
  animation: tut-pop .28s cubic-bezier(.2,1.6,.4,1);
}
@keyframes tut-pop { from { transform: scale(.82) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.tut-bubble.centered {
  left: 50% !important; top: 50% !important;
  transform: translate(-50%, -50%);
  animation: tut-pop-center .28s cubic-bezier(.2,1.6,.4,1);
}
@keyframes tut-pop-center { from { transform: translate(-50%, -46%) scale(.85); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.tut-bubble.tail-up::before {
  content: ''; position: absolute; top: -12px; left: var(--tail-x, 50%); transform: translateX(-50%);
  border: 11px solid transparent; border-bottom-color: var(--gold); border-top: 0;
}
.tut-bubble.tail-down::before {
  content: ''; position: absolute; bottom: -12px; left: var(--tail-x, 50%); transform: translateX(-50%);
  border: 11px solid transparent; border-top-color: var(--gold); border-bottom: 0;
}
.tut-head { display: flex; align-items: center; gap: 12px; }
.tut-mascot { width: 52px; height: 60px; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(255,138,60,.45)); animation: tut-bounce 2s ease-in-out infinite; }
@keyframes tut-bounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-4px) } }
.tut-who { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tut-who b { font-size: 18px; letter-spacing: 3px; color: var(--gold); text-shadow: 0 0 10px rgba(255,207,77,.65); }
.tut-who span { font-size: 12px; color: var(--dim); letter-spacing: 1px; }
.tut-skip { font-size: 12px; color: var(--dim); cursor: pointer; text-decoration: underline dotted; pointer-events: auto; }
.tut-skip:hover { color: var(--ink); }
.tut-text { font-size: 15.5px; line-height: 1.8; color: #ffe9fb; margin-top: 10px; min-height: 56px; }
.tut-text b { color: var(--cyan); text-shadow: 0 0 8px rgba(35,230,255,.5); }
.tut-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.tut-dots { display: flex; gap: 5px; }
.tut-dots i { width: 8px; height: 8px; border-radius: 2px; background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.tut-dots i.done { background: var(--purple); border-color: transparent; }
.tut-dots i.on { background: var(--gold); border-color: transparent; box-shadow: 0 0 8px var(--gold); }
.tut-btns { display: flex; align-items: center; gap: 10px; }
.tut-hint { font-size: 13px; color: var(--cyan); text-shadow: 0 0 8px rgba(35,230,255,.5); animation: hint-blink 1.2s ease-in-out infinite; }
@keyframes hint-blink { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* 篮球侠小抄 */
.cheat-list { display: flex; flex-direction: column; gap: 8px; }
.cheat-line { display: flex; gap: 10px; align-items: baseline; font-size: 15px; line-height: 1.6; }
.cheat-line .ci { flex-shrink: 0; }
.cheat-line b { color: var(--gold); }
.cheat-mascot-row { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.cheat-mascot-row .tut-mascot { width: 64px; height: 74px; }

/* ---------- 响应式：平板 ---------- */
@media (max-width: 1024px) {
  #left-panel { width: 238px; }
  .lp-card { padding: 13px; }
  .big-num { font-size: 23px; }
}

/* ---------- 响应式：手机竖屏 ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  #noise { display: none; }
  #bezel { inset: 4px; border-width: 5px; border-radius: 16px; }
  #bezel .bezel-label, #bezel .bezel-led { display: none; }

  #screen-game { padding: 6px; gap: 6px; }
  #topbar { flex-wrap: wrap; padding: 6px 10px; gap: 8px; border-radius: 10px; }
  .boss-chip { font-size: 12px; padding: 3px 9px; }
  .btn-icon { width: 32px; height: 32px; font-size: 13px; }
  .tb-money { font-size: 15px; }
  #tb-progress { gap: 4px; }
  #tb-progress i { width: 7px; height: 7px; }

  #game-body { flex-direction: column; gap: 6px; }
  #left-panel { width: 100%; flex: none; }
  .lp-card {
    flex-direction: row; flex-wrap: wrap; align-items: stretch;
    gap: 8px 14px; padding: 10px 12px; border-radius: 12px;
  }
  .lp-head { width: 100%; align-items: center; }
  .lp-title { font-size: 14px; }
  .lp-goals { flex: 1 1 170px; gap: 10px; }
  .lp-preview { flex: 1.5 1 190px; padding: 9px 10px; }
  #left-panel .progress { flex: 1 1 100%; }
  .lp-counts { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
  .count-row { margin: 0; font-size: 13px; }
  .lp-sep { display: none; }
  .big-num { font-size: 19px; }
  .hand-name { font-size: 16px; margin: 3px 0 6px; min-height: 20px; }
  .score-box { min-height: 44px; font-size: 12px; padding: 5px 3px; }
  .sb-label { font-size: 8px; margin-bottom: 3px; }
  .pb-label { font-size: 10px; letter-spacing: 2px; }
  #deck-counts, #upgrade-list { font-size: 11px; }

  #main-area { min-height: 0; }
  #main-area::before { font-size: 110px; }
  #play-area { min-height: 148px; padding: 8px; gap: 8px; }
  #chain-tip { font-size: 12px; right: 10px; top: 8px; }
  .pcard { width: 58px; height: 84px; border-radius: 7px; }
  .pcard::before { inset: 2px; border-radius: 5px; }
  .pc-index b { font-size: 8px; }
  .pc-index i { font-size: 9px; }
  .pc-index.tl { top: 4px; left: 4px; }
  .pc-index.br { bottom: 4px; right: 4px; }
  .pc-rank { font-size: 26px; }
  .pc-rank.ten { font-size: 17px; letter-spacing: -1px; }
  .pc-wm { font-size: 44px; }
  .pc-enh { font-size: 10px; padding: 1px 3px; }
  #hand { min-height: 98px; padding: 0 6px; }
  #hand .pcard:not(:first-child) { margin-left: -20px; }
  #hand .pcard.selected { transform: rotate(var(--fan-rot, 0deg)) translateY(-16px); }
  .pcard.selected { transform: translateY(-16px); }

  #hand-zone { padding: 6px 6px 2px; gap: 7px; }
  #actions { gap: 8px; flex-wrap: wrap; justify-content: center; padding-bottom: 4px; }
  .btn-play { font-size: 19px; padding: 10px 22px; letter-spacing: 3px; }
  .btn-discard { font-size: 15px; padding: 9px 14px; }
  .btn-count { font-size: 9px; padding: 2px 5px; margin-left: 6px; }
  .sort-btns { margin-left: 0; gap: 6px; }
  .sort-btns .btn { padding: 5px 9px; font-size: 12px; }

  #bottom-bar {
    overflow-x: auto; gap: 14px; padding: 8px 12px;
    min-height: 0; border-radius: 10px;
    scrollbar-width: none;
  }
  #bottom-bar::-webkit-scrollbar { display: none; }
  .bb-group { flex-shrink: 0; }
  .bb-label { font-size: 10px; }
  .ds-chip { min-width: 0; height: 34px; padding: 3px 9px; font-size: 13px; border-radius: 8px; }
  .consum-chip { min-width: 0; height: 34px; padding: 3px 9px; font-size: 13px; }
  .cb-icon { font-size: 14px; }

  .ovl { padding: 16px 12px; gap: 13px; }
  .ovl-back { top: -4px; left: -2px; }
  .ovl-title { letter-spacing: 4px; }
  .ovl-title.huge { font-size: clamp(30px, 9.5vw, 60px); }
  .opp-card { min-width: 0; width: 100%; max-width: 340px; padding: 16px 18px; }
  .opp-emoji { font-size: 46px; }
  .opp-name { font-size: 23px; letter-spacing: 4px; }
  .opp-taunt { font-size: 15px; }
  .opp-tip { font-size: 12px; }
  .intro-target { font-size: 16px; }
  .intro-target b { font-size: 23px; }
  .intro-chips { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .reward-list { width: 100%; min-width: 0; }
  .reward-line { font-size: 14px; padding: 8px 12px; }
  .btn-row { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .btn-xl { font-size: 19px; padding: 12px 26px; }
  .stamp { font-size: 15px; padding: 6px 14px; }

  .ovl.shop { padding-top: 16px; }
  .shop-items { grid-template-columns: 1fr 1fr; gap: 9px; }
  .shop-item { min-height: 0; padding: 10px; border-radius: 10px; }
  .si-name { font-size: 15px; }
  .si-desc { font-size: 12px; }
  .shop-foot { flex-wrap: wrap; justify-content: center; }
  .shop-foot .btn { padding: 8px 14px; font-size: 14px; }

  .modal { padding: 16px 14px; border-radius: 12px; }
  .modal-title { font-size: 17px; }
  .dv-cards { gap: 4px; }

  #menu-mascot { width: 62px; height: 72px; right: -6px; bottom: -14px; }
  .menu-btns { width: min(88vw, 340px); }
  .menu-foot { font-size: 10px; bottom: 10px; width: 100vw; text-align: center; padding: 0 12px; }
  .px-crown { width: 60px; height: 43px; }
  .logo { letter-spacing: 7px; font-size: clamp(44px, 13vw, 64px); }
  .logo-sub { font-size: 12px; letter-spacing: 3px; text-align: center; max-width: 92vw; }

  #cameo { left: 10px; bottom: 12px; }
  #cameo .tut-mascot { width: 44px; height: 50px; }
  .cameo-bubble { max-width: 60vw; font-size: 13px; padding: 8px 11px; }
  #toast-root { bottom: 128px; width: 92vw; }
  .toast { font-size: 13px; }
  .tut-bubble { width: min(92vw, 372px); }
  .float-txt.xmult { font-size: 20px; }
  .float-txt.slam { font-size: 27px; }
  .float-txt.big { font-size: 22px; }
  #chain-tip { font-size: 12px; }
}

/* ---------- 响应式：横屏矮屏（手机横过来） ---------- */
@media (max-height: 540px) and (orientation: landscape) {
  #screen-game { padding: 4px; gap: 4px; }
  #topbar { padding: 4px 10px; }
  .lp-card { padding: 8px 10px; gap: 5px; }
  .big-num { font-size: 17px; }
  .lp-preview { padding: 6px 8px; }
  .hand-name { font-size: 14px; margin: 2px 0 4px; }
  .score-box { min-height: 36px; font-size: 11px; padding: 3px 2px; }
  .count-row { font-size: 11px; }
  .pips { font-size: 9px; }
  #play-area { min-height: 84px; padding: 6px; }
  .pcard { width: 54px; height: 78px; }
  .pc-rank { font-size: 24px; }
  .pc-rank.ten { font-size: 16px; }
  #hand { min-height: 88px; }
  #hand .pcard:not(:first-child) { margin-left: -18px; }
  #actions { padding-bottom: 2px; }
  .btn-play { font-size: 16px; padding: 8px 18px; }
  .btn-discard { font-size: 13px; padding: 7px 12px; }
  .ds-chip, .consum-chip { height: 30px; font-size: 12px; }
  #bottom-bar { min-height: 0; padding: 5px 10px; }
  .bb-label { display: none; }
  .float-txt.xmult { font-size: 17px; }
  .float-txt.slam { font-size: 22px; }
}
