/* ============================================
   999 · 游戏点卡  —— 暗夜赛博 / 电竞霓虹风
   ============================================ */
:root {
  --bg: #05060a;
  --bg-card: #0d1018;
  --bg-card2: #131826;
  --cyan: #00f0ff;
  --purple: #a855f7;
  --pink: #ff2e88;
  --green: #00ffa3;
  --amber: #ffb020;
  --text: #e6edf6;
  --text-dim: #7d8aa0;
  --line: rgba(0, 240, 255, .14);
  --radius: 14px;
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

body {
  font-family: "HarmonyOS Sans", "PingFang SC", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 赛博网格背景 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  background:
    linear-gradient(rgba(0,240,255,.045) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(0,240,255,.045) 1px, transparent 1px) 0 0 / 44px 100%,
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(168,85,247,.2), transparent 70%),
    radial-gradient(ellipse 50% 30% at 90% 100%, rgba(255,46,136,.13), transparent 70%);
  pointer-events: none;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
  opacity: .5;
}

.wrap { position: relative; z-index: 1; max-width: 470px; margin: 0 auto; padding: 0 18px 60px; }

/* ---------- 头部 ---------- */
.hero { padding: 34px 0 24px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; letter-spacing: .2em; color: var(--cyan);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 15px; margin-bottom: 18px;
  background: rgba(0,240,255,.06);
  text-transform: uppercase;
}
.hero-badge i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 9px var(--green); animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.24; } }

.logo {
  font-size: 38px; font-weight: 900; letter-spacing: -.02em; line-height: 1.08;
  background: linear-gradient(102deg, var(--cyan) 8%, var(--purple) 48%, var(--pink) 92%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 22px rgba(168,85,247,.42));
}
.logo-sub {
  font-size: 11px; letter-spacing: .4em; color: var(--text-dim);
  margin-top: 12px; text-indent: .4em;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; margin-top: 28px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.hero-stats > div { background: var(--bg-card); padding: 15px 6px; }
.hero-stats b {
  display: block; font-size: 20px; font-weight: 800; color: var(--cyan);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.hero-stats span { display: block; font-size: 10.5px; color: var(--text-dim); margin-top: 5px; letter-spacing: .08em; }

/* ---------- 抽卡台 ---------- */
.stage { position: relative; margin: 30px 0 26px; }

.rig {
  position: relative; height: 250px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-card2), var(--bg-card));
  border: 1px solid var(--line); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 0 44px rgba(0,240,255,.07), inset 0 1px 0 rgba(255,255,255,.05);
}
.rig::before, .rig::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  border-color: var(--cyan); border-style: solid; opacity: .55;
}
.rig::before { top: 12px; left: 12px; border-width: 2px 0 0 2px; border-radius: 5px 0 0 0; }
.rig::after { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; border-radius: 0 0 5px 0; }

.scan {
  position: absolute; left: 0; right: 0; height: 60px;
  background: linear-gradient(180deg, transparent, rgba(0,240,255,.13), transparent);
  animation: scanDown 3.4s linear infinite; pointer-events: none;
}
@keyframes scanDown { 0% { top:-60px; } 100% { top: 250px; } }

.core {
  width: 122px; height: 122px; border-radius: 24px; cursor: pointer;
  background: linear-gradient(140deg, rgba(0,240,255,.16), rgba(168,85,247,.16));
  border: 1px solid rgba(0,240,255,.42);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; transition: all .45s cubic-bezier(.3,1.2,.4,1);
  box-shadow: 0 0 34px rgba(0,240,255,.2), inset 0 0 26px rgba(0,240,255,.09);
}
.core:hover { transform: scale(1.055); box-shadow: 0 0 52px rgba(168,85,247,.4), inset 0 0 32px rgba(168,85,247,.15); }
.core:active { transform: scale(.97); }
.core .glyph { font-size: 42px; line-height: 1; filter: drop-shadow(0 0 12px rgba(0,240,255,.6)); }
.core .lbl { font-size: 11px; letter-spacing: .22em; color: var(--cyan); margin-top: 11px; text-indent: .22em; }
.core.busy { animation: spinPulse .82s linear infinite; }
@keyframes spinPulse {
  0% { transform: rotate(0) scale(1); border-radius: 24px; }
  50% { transform: rotate(180deg) scale(1.09); border-radius: 50%; }
  100% { transform: rotate(360deg) scale(1); border-radius: 24px; }
}
.core.hit { animation: hitFlash .62s ease-out; }
@keyframes hitFlash {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255,46,136,0); }
  35% { transform: scale(1.3); box-shadow: 0 0 76px rgba(255,46,136,.75); }
  100% { transform: scale(1); box-shadow: 0 0 34px rgba(0,240,255,.2); }
}

.rig-hint {
  position: absolute; bottom: 13px; left: 0; right: 0; text-align: center;
  font-size: 11px; color: var(--text-dim); letter-spacing: .1em;
}

/* ---------- 能量按钮 ---------- */
.charge {
  width: 100%; padding: 17px 0; margin-bottom: 12px;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 800;
  letter-spacing: .1em; color: #04060a; position: relative; overflow: hidden;
  background: linear-gradient(102deg, var(--cyan), var(--purple) 55%, var(--pink));
  box-shadow: 0 10px 34px rgba(168,85,247,.36);
  transition: transform .18s, box-shadow .3s, filter .25s;
}
.charge:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 46px rgba(168,85,247,.5); }
.charge:active:not(:disabled) { transform: translateY(0) scale(.99); }
.charge:disabled { filter: grayscale(.72) brightness(.62); cursor: not-allowed; box-shadow: none; }
.charge::after {
  content:""; position:absolute; top:0; left:-100%; width:45%; height:100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  animation: glide 3.2s ease-in-out infinite;
}
@keyframes glide { 0%,70% { left:-100%;} 100% { left:190%;} }

.note { text-align:center; font-size:12px; color:var(--text-dim); margin-bottom:30px; }
.note b { color: var(--cyan); font-weight: 700; }

/* ---------- 区块标题 ---------- */
.sec-head {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 17px; font-size: 14.5px; font-weight: 700; letter-spacing: .06em;
}
.sec-head::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--purple));
}
.sec-head small { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--text-dim); }

/* ---------- 卡池 ---------- */
.pool { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 32px; }
.item {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 13px; position: relative;
  overflow: hidden; transition: all .28s;
}
.item::before {
  content:""; position:absolute; inset:0; opacity:0; transition: opacity .3s;
  background: radial-gradient(circle at 50% 0%, rgba(0,240,255,.13), transparent 66%);
}
.item:hover { transform: translateY(-3px); border-color: rgba(0,240,255,.42); box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.item:hover::before { opacity:1; }
.item .ic { font-size: 31px; display:block; margin-bottom: 10px; }
.item .nm { font-size: 12.8px; line-height:1.55; margin-bottom:8px; min-height:40px; }
.item.out { opacity:.32; filter:grayscale(1); }

.badge {
  display:inline-block; font-size:9.5px; font-weight:800; letter-spacing:.1em;
  padding: 3px 9px; border-radius: 4px; line-height:1.5; text-transform: uppercase;
}
.b-legendary { background: linear-gradient(135deg,#ff2e88,#ffb020); color:#0a0510; }
.b-epic { background: rgba(168,85,247,.2); color:#c98bff; border:1px solid rgba(168,85,247,.45); }
.b-rare { background: rgba(0,240,255,.13); color:var(--cyan); border:1px solid rgba(0,240,255,.38); }
.b-common { background: rgba(125,138,160,.14); color:var(--text-dim); border:1px solid rgba(125,138,160,.3); }

/* ---------- 实时动态 ---------- */
.feed { border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; margin-bottom: 30px; }
.feed li {
  list-style:none; display:flex; align-items:center; gap:10px;
  padding: 12px 14px; font-size: 12.3px;
  border-bottom: 1px solid rgba(0,240,255,.07);
  background: var(--bg-card);
}
.feed li:last-child { border-bottom: none; }
.feed .dot { width:5px; height:5px; border-radius:50%; background: var(--cyan); box-shadow: 0 0 7px var(--cyan); flex-shrink:0; }
.feed .nm2 { color: var(--text); flex:1; }
.feed .tm { color: var(--text-dim); font-size: 11px; flex-shrink:0; }

.empty { text-align:center; color:var(--text-dim); font-size:12.5px; padding:28px 0; }

/* ---------- 结果层 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(3,4,7,.93); backdrop-filter: blur(14px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.on { display: flex; animation: fadeIn .28s both; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.sheet {
  width: 100%; max-width: 358px; border-radius: 18px; overflow: hidden;
  background: var(--bg-card2); border: 1px solid var(--line);
  animation: popIn .5s cubic-bezier(.2,1.2,.3,1) both;
  box-shadow: 0 26px 70px rgba(0,0,0,.72), 0 0 60px rgba(168,85,247,.16);
}
@keyframes popIn { from{opacity:0; transform: translateY(26px) scale(.92)} to{opacity:1;transform:none} }

.sheet-top {
  padding: 28px 22px 24px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(168,85,247,.2), rgba(0,240,255,.07));
}
.sheet-top::after {
  content:""; position:absolute; inset:0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 8px, transparent 8px 16px);
}
.rarity {
  display:inline-block; font-size:11px; font-weight:800; letter-spacing:.22em;
  padding: 5px 15px; border-radius: 999px; margin-bottom: 18px; position:relative; z-index:1;
}
.sheet .glyph2 { font-size: 60px; display:block; margin-bottom: 16px; position:relative; z-index:1; animation: zoomIn .6s cubic-bezier(.2,1.5,.4,1) both .1s; }
@keyframes zoomIn { from{transform:scale(0) rotate(-40deg);opacity:0} to{transform:none;opacity:1} }
.sheet .pname { font-size: 21px; font-weight: 800; margin-bottom: 9px; position:relative; z-index:1; }
.sheet .pdesc { font-size: 12.8px; color: var(--text-dim); line-height:1.7; position:relative; z-index:1; }

.sheet-body { padding: 22px; }

/* 卡密展示 */
.codebox {
  background: rgba(0,0,0,.5); border: 1px dashed rgba(0,240,255,.42);
  border-radius: 10px; padding: 17px 14px; text-align: center; margin-bottom: 14px;
}
.codebox .code {
  font-family: "Consolas", "SF Mono", monospace; font-size: 15px; font-weight: 700;
  color: var(--green); letter-spacing: .07em; word-break: break-all;
  text-shadow: 0 0 14px rgba(0,255,163,.45); line-height: 1.6;
}
.codebox .tip { font-size: 10.5px; color: var(--text-dim); margin-top: 9px; }

.prize-no { font-size: 10px; color: var(--text-dim); letter-spacing: .05em; margin-bottom: 15px; word-break: break-all; font-family: Consolas, monospace; }

.cta {
  width:100%; padding: 14px 0; margin-bottom: 10px; border: none;
  border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 14.5px; font-weight: 700; letter-spacing: .08em;
  color: #04060a; background: linear-gradient(102deg, var(--cyan), var(--purple));
}
.ghost {
  width:100%; padding: 13px 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); font-family: inherit; font-size: 13.2px;
  letter-spacing: .08em; transition: all .25s;
}
.ghost:hover { color: var(--cyan); border-color: rgba(0,240,255,.45); background: rgba(0,240,255,.05); }

/* ---------- 表单 ---------- */
.form { display:none; margin-top: 18px; }
.form.on { display:block; animation: popIn .35s both; }
.field { margin-bottom: 13px; }
.field label { display:block; font-size: 11.5px; color: var(--cyan); margin-bottom: 7px; letter-spacing: .07em; }
.field input, .field textarea {
  width:100%; padding: 12px 13px; background: rgba(0,0,0,.42);
  border: 1px solid var(--line); border-radius: 9px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none; transition: all .25s;
}
.field textarea { resize: vertical; min-height: 72px; }
.field input:focus, .field textarea:focus { border-color: rgba(0,240,255,.5); box-shadow: 0 0 0 3px rgba(0,240,255,.08); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%) translateY(-110%);
  background: var(--bg-card2); border: 1px solid rgba(255,46,136,.5);
  color: #ff8fb8; padding: 12px 22px; border-radius: 10px;
  font-size: 13.2px; z-index: 120; opacity: 0;
  transition: all .32s cubic-bezier(.2,1.2,.3,1); max-width: 86%; text-align: center;
  box-shadow: 0 12px 34px rgba(0,0,0,.6);
}
.toast.on { transform: translateX(-50%) translateY(0); opacity: 1; }

.link-top {
  display:block; text-align:center; margin-top: 30px; padding-top: 20px;
  border-top: 1px solid var(--line); font-size: 12.2px;
  color: var(--text-dim); text-decoration: none; letter-spacing: .08em;
}
.link-top:hover { color: var(--cyan); }
.legal { text-align:center; font-size:10px; color:#4d5768; margin-top:14px; line-height:1.75; }