/* ============ 解密专家 · 手机解锁弹幕玩法 ============
   设计稿固定 1181 x 2100（标准竖屏 9:16），整体 transform 缩放适配屏幕，保证丝滑 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: #07080c; color: #fff; overflow: hidden;
  user-select: none;
}

/* ---------- 舞台与缩放 ----------
   背景/暗角都属于 9:16 画布本身：窗口比例怎么变，画面构图恒定不变 */
#stage { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; background: #07080c; }
#screen {
  position: absolute; left: 0; top: 0; width: 1181px; height: 2100px;
  transform-origin: 0 0; will-change: transform; z-index: 1;
  overflow: hidden;
  background: #20242c url("assets/stage-bg.png") center/cover no-repeat;
}
#screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.35) 100%);
}

/* ---------- 通用头像 ---------- */
.avatar {
  --hue: 200;
  border-radius: 50%; display: grid; place-items: center; flex: none;
  background:
    radial-gradient(circle at 32% 28%, hsl(var(--hue) 90% 78%), hsl(var(--hue) 75% 55%) 60%, hsl(calc(var(--hue) + 40) 70% 45%));
  box-shadow: 0 0 0 4px hsl(var(--hue) 85% 62%), 0 4px 10px rgba(0,0,0,.35);
  font-size: 34px; line-height: 1; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 左侧 互动玩法榜 ---------- */
.rank-panel { position: absolute; left: 144px; top: 140px; width: 152px; z-index: 20; }
.rank-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; }
.rank-cell { display: grid; place-items: center; position: relative; }
.rank-cell .avatar { width: 68px; height: 68px; font-size: 30px; }
.rank-cell .score {
  position: absolute; bottom: -5px; right: -2px; min-width: 30px; padding: 1px 5px; border-radius: 9px;
  background: rgba(0,0,0,.55); font-size: 18px; font-weight: 700; color: #ffd76a; text-align: center;
}
.rank-cell.top1 .avatar { box-shadow: 0 0 0 5px #ffd24a, 0 0 22px rgba(255,210,74,.7); }
.rank-cell.top2 .avatar { box-shadow: 0 0 0 5px #d9e2ef, 0 0 18px rgba(217,226,239,.6); }
.rank-cell.top3 .avatar { box-shadow: 0 0 0 5px #e0a06a, 0 0 18px rgba(224,160,106,.6); }
.rank-cell { animation: cellIn .35s ease both; }
@keyframes cellIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- 右侧面板 ---------- */
.right-panel { position: absolute; right: 96px; top: 200px; width: 200px; z-index: 20; display: grid; gap: 120px; justify-items: stretch; }
.expert-badge {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 20px;
  width: 200px; max-width: 200px; overflow: hidden;
  background: linear-gradient(135deg, rgba(64,120,255,.9), rgba(120,80,255,.9));
  box-shadow: 0 8px 22px rgba(80,100,255,.4);
}
.expert-ico { font-size: 34px; flex: none; }
.expert-title { font-size: 26px; font-weight: 800; }
.expert-badge .expert-text { min-width: 0; }
.expert-sub { font-size: 18px; opacity: .9; }
.remain-box {
  width: 200px; max-width: 200px; padding: 18px 20px; border-radius: 22px; text-align: center;
  background: rgba(20,22,30,.55); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
}
.remain-label { font-size: 22px; color: rgba(255,255,255,.8); }
.remain-value { font-size: 34px; font-weight: 800; color: #ffd76a; letter-spacing: 1px; white-space: nowrap; }
.remain-value span:last-child { color: rgba(255,255,255,.55); font-size: 24px; font-weight: 600; }
.remain-bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.15); margin-top: 12px; overflow: hidden; }
.remain-bar i { display: block; height: 100%; width: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #ffd76a, #ff8a3d); transition: width .5s cubic-bezier(.22,1,.36,1); }

/* ---------- 中央手机锁屏 ---------- */
.phone {
  position: absolute; left: 50%; top: 140px; transform: translateX(-50%);
  width: 540px; height: 1120px; border-radius: 64px; overflow: hidden; z-index: 10;
  background: #101216;
  box-shadow: 0 0 0 10px #0a0b0e, 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(0,0,0,.4);
}
.phone-wall {
  position: absolute; inset: 0;
  background: url("assets/bg.png") center 22%/cover no-repeat;
  filter: blur(12px) saturate(1.08) brightness(.92); transform: scale(1.06);
  transition: filter .8s ease, transform .8s ease;
}
.phone.unlocked .phone-wall { filter: blur(0) saturate(1.05) brightness(1.02); transform: scale(1); }
.phone-glass { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.02) 30%, rgba(0,0,0,.20)); transition: opacity .6s; }
.phone.unlocked .phone-glass { opacity: .25; }
.phone-status {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  padding: 26px 40px 0; font-size: 26px; font-weight: 600; color: #fff; z-index: 2;
}
.st-left { display: flex; align-items: center; gap: 18px; }
.st-notch { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: #000; }
.st-icons { display: flex; align-items: center; gap: 10px; }
.ic-wifi { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.ic-wifi circle { fill: #fff; stroke: none; }
.ic-sig { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.sig-5g { font-size: 14px; font-weight: 800; line-height: 1; }
.sig-bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.sig-bars i { width: 5px; border-radius: 2px; background: #fff; }
.sig-bars i:nth-child(1) { height: 8px; }
.sig-bars i:nth-child(2) { height: 13px; }
.sig-bars i:nth-child(3) { height: 18px; }
.sig-bars i:nth-child(4) { height: 22px; }
.ic-batt { position: relative; width: 46px; height: 24px; border: 2.5px solid rgba(255,255,255,.95); border-radius: 7px; }
.ic-batt::after {
  content: ""; position: absolute; right: -7px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 10px; border-radius: 2px; background: rgba(255,255,255,.95);
}
.ic-batt i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: 50%; background: #fff; border-radius: 4px; }
.batt-pct { font-size: 24px; font-weight: 700; }

.lock-body { position: relative; z-index: 2; padding-top: 56px; display: flex; flex-direction: column; align-items: center; transition: opacity .5s ease, transform .5s ease; }
.phone.unlocked .lock-body { opacity: 0; transform: scale(.94); }
.lock-icon { font-size: 64px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); transition: transform .3s; }
.lock-msg { margin-top: 28px; font-size: 40px; font-weight: 700; letter-spacing: 6px; color: #ff4d4f; min-height: 52px;
  text-shadow: 0 2px 10px rgba(0,0,0,.5); transition: color .25s; }
.lock-msg.ok { color: #52e08a; }
.lock-msg.idle { color: rgba(255,255,255,.92); }
.dots { display: flex; gap: 44px; margin-top: 26px; }
.dots i {
  width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.85);
  transition: background .15s, transform .15s; position: relative;
}
.dots i.fill { background: #fff; transform: scale(1.08); }
.dots i.hint { border-color: #ffd76a; box-shadow: 0 0 14px rgba(255,215,106,.8); }
.dots i.hint::after { content: attr(data-d); position: absolute; inset: 0; display: grid; place-items: center;
  color: #ffd76a; font-size: 22px; font-weight: 800; }
.dots.shake { animation: shake .45s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-16px); } 40% { transform: translateX(14px); }
  60% { transform: translateX(-10px); } 80% { transform: translateX(8px); }
}

.keypad { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 140px); gap: 26px 36px; justify-content: center; }
.key {
  position: relative; height: 104px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.10); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  backdrop-filter: blur(4px); transition: transform .12s, background .12s;
}
.key .n { font-size: 56px; font-weight: 500; line-height: 1; }
.key .l { font-size: 22px; letter-spacing: 2px; color: rgba(255,255,255,.85); }
.key.fn { background: transparent; }
.key.fn .t { font-size: 30px; font-weight: 600; }
.key.press { background: rgba(255,255,255,.42); transform: scale(.92); }
.key:active { transform: scale(.94); }
.home-ring { margin: 34px auto 0; width: 100px; height: 100px; border-radius: 50%; border: 4px solid rgba(255,255,255,.9); }

/* 指纹解锁动画 */
.fp-overlay {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center;
  background: rgba(0,0,0,.38); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.fp-overlay.show { opacity: 1; }
.fp-box { position: relative; display: grid; place-items: center; }
.fp-rings { position: absolute; top: 50%; left: 50%; width: 320px; height: 320px; margin: -160px 0 0 -160px; }
.fp-rings i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(82,224,138,.75); animation: fpRing 1.6s ease-out infinite; }
.fp-rings i:nth-child(2) { animation-delay: .5s; }
.fp-rings i:nth-child(3) { animation-delay: 1s; }
@keyframes fpRing { 0% { transform: scale(.35); opacity: .95; } 100% { transform: scale(1.15); opacity: 0; } }
.fp-finger { font-size: 130px; animation: fpPress 1.8s ease-in-out infinite; filter: drop-shadow(0 0 26px rgba(82,224,138,.85)); }
@keyframes fpPress { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(16px) scale(.9); } }
.fp-text { margin-top: 26px; font-size: 34px; font-weight: 700; color: #52e08a; letter-spacing: 4px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.fp-user { margin-top: 10px; font-size: 28px; color: rgba(255,255,255,.92); text-shadow: 0 2px 8px rgba(0,0,0,.6); }

/* 解锁成功：高清壁纸 + 烟花 + 横幅 */
.fw-canvas { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.unlock-overlay {
  position: absolute; inset: 0; z-index: 7; display: grid; justify-items: center; align-items: start;
  padding-top: 220px; background: transparent;
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.unlock-overlay.show { opacity: 1; }
.unlock-card { text-align: center; transform: scale(.7) translateY(-30px); transition: transform .45s cubic-bezier(.2,1.4,.4,1); }
.unlock-overlay.show .unlock-card { transform: scale(1) translateY(0); }
.unlock-user {
  padding: 14px 26px; border-radius: 40px; white-space: nowrap;
  max-width: 470px; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(135deg, rgba(255,190,80,.96), rgba(255,110,60,.96));
  box-shadow: 0 10px 34px rgba(255,150,50,.55); font-size: 34px; font-weight: 800; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.unlock-code { margin-top: 16px; font-size: 72px; font-weight: 800; letter-spacing: 12px; color: #ffd76a; text-shadow: 0 0 26px rgba(255,215,106,.85); }

/* ---------- 底部猜测流 ---------- */
.feed-zone {
  position: absolute; left: 50%; transform: translateX(-50%); top: 700px;
  width: 640px; height: 1200px; z-index: 5;
}
/* ---------- 手机右下 参与玩法说明 ---------- */
.join-panel {
  position: absolute; right: 96px; bottom: 840px; width: 200px; max-width: 200px; z-index: 20;
  padding: 14px 14px; border-radius: 18px; display: grid; gap: 10px;
  background: rgba(15,17,24,.58); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14); box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.join-title { font-size: 24px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.join-row { display: flex; align-items: flex-start; gap: 8px; font-size: 20px; color: rgba(255,255,255,.92); line-height: 1.35; }
.join-row .ji { font-size: 24px; flex: none; }
.join-row i { font-style: normal; color: #ffd76a; }
.feed {
  position: absolute; left: 0; right: 0; top: 160px; bottom: 0; overflow: hidden;
  transform: perspective(760px) rotateX(24deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 100%);
}
.feed-track { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 10px; will-change: transform; }
.feed-row {
  height: 84px; display: flex; align-items: center; justify-content: center; gap: 20px;
  background: linear-gradient(90deg, rgba(214,178,140,.10), rgba(236,206,176,.30), rgba(214,178,140,.10));
  border: 1px solid rgba(255,236,214,.22);
  border-radius: 14px; backdrop-filter: blur(3px);
}
.feed-row .gift-ico { font-size: 40px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.feed-row .avatar { width: 62px; height: 62px; font-size: 26px; }
.feed-row .code { font-size: 56px; font-weight: 800; letter-spacing: 6px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.feed-row.hit { background: linear-gradient(90deg, rgba(82,224,138,.25), rgba(82,224,138,.5), rgba(82,224,138,.25)); }
.feed-row.hit .code { color: #b6ffd2; }

/* ---------- 礼物特效层 ---------- */
.fx-layer { position: absolute; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.fx {
  position: absolute; display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-radius: 40px;
  background: linear-gradient(135deg, rgba(255,120,180,.92), rgba(255,80,120,.92));
  box-shadow: 0 10px 30px rgba(255,80,140,.45); font-size: 34px; font-weight: 800;
  animation: fxFloat 2.6s cubic-bezier(.2,.7,.3,1) forwards; will-change: transform, opacity;
}
.fx .who { font-size: 26px; font-weight: 600; opacity: .95; }
.fx.blue { background: linear-gradient(135deg, rgba(80,140,255,.92), rgba(120,90,255,.92)); box-shadow: 0 10px 30px rgba(100,120,255,.45); }
.fx.gold { background: linear-gradient(135deg, rgba(255,190,80,.95), rgba(255,140,40,.95)); box-shadow: 0 10px 30px rgba(255,160,60,.5); }
@keyframes fxFloat {
  0% { transform: translate(-50%, 40px) scale(.6); opacity: 0; }
  15% { transform: translate(-50%, 0) scale(1.08); opacity: 1; }
  25% { transform: translate(-50%, -6px) scale(1); }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -160px) scale(1); opacity: 0; }
}

