/* 皇室战争 H5 样式：手机竖屏为主，适配电脑 */

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

/* 关键：hidden 属性必须生效（防止 display 覆盖） */
[hidden] { display: none !important; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0d1b2a;
  color: #eef;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  position: relative;
}

/* ============ 主页（参考《魔修模拟器》样式体系：切角面板；配色替换为深蓝+金） ============ */
:root {
  --bg: #0d1b2a;
  --bg-deep: #081525;
  --panel: #16263a;
  --panel-2: #1d3050;
  --line: #2a4462;
  --line-soft: #1e3450;
  --gold: #ffd93b;
  --gold-dim: #a8791a;
  --gold-bright: #ffe680;
  --text: #eef;
  --text-dim: #8aa;
  --text-mute: #5a7089;
  --mono: ui-monospace, "SF Mono", Consolas, "DejaVu Sans Mono", monospace;
}
#home-page {
  width: 100%;
  max-width: 480px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  padding: 22px 16px calc(28px + env(safe-area-inset-bottom));
  gap: 12px;
  text-align: center;
}
.home-hero { text-align: center; }
.home-emoji { font-size: 38px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(255,200,60,.5)); }
/* 全站统计框 */
.home-count {
  width: 100%;
  margin-top: 8px;
  background: rgba(255,217,59,.07);
  border: 1px solid rgba(255,217,59,.22);
  border-radius: 3px;
  padding: 8px 12px;
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.home-count b { color: var(--gold-bright); font-size: 13px; }
.home-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 3px;
  white-space: nowrap;
  background: linear-gradient(90deg, #ffd93b, #ffb03b, #ffe680, #ffb03b, #ffd93b);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: rainbowShift 3s linear infinite;
  filter: drop-shadow(0 0 14px rgba(255,200,60,.45));
}
@keyframes rainbowShift { 0% { background-position: 0% 50%; } 100% { background-position: 400% 50%; } }
.home-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; letter-spacing: 1px; }

/* 杯数 / 段位 / 进度条 整合框 */
.home-lv {
  width: 100%;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  padding: 12px 16px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  text-align: left;
}
.lv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lv-name { color: var(--text-dim); font-size: 13px; }
.lv-lv { color: var(--gold-bright); font-size: 18px; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* 段位靠左、奖杯靠右 */
.lv-bonus { color: var(--gold); font-size: 15px; white-space: nowrap; font-weight: 700; }
.lv-trophy { color: var(--gold-bright); font-size: 15px; white-space: nowrap; }
.lv-exp-line { margin-top: 7px; color: var(--text-dim); font-size: 12px; text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lv-bar { height: 8px; background: var(--bg-deep); border: 1px solid var(--line-soft); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.lv-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold) 55%, #ffb03b); box-shadow: 0 0 10px rgba(255,217,59,.55); width: 0%; transition: width .3s; }

/* 按钮体系（切角面板；金色主按钮） */
.btn {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  border-radius: 4px;
  padding: 11px 20px;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.btn:active { transform: scale(.97); filter: brightness(1.25); }
.btn-primary {
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #8a6a10, #ffb03b);
  color: #2a1c00;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(255,200,60,.30), inset 0 0 14px rgba(255,200,60,.14);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.btn-big { width: 100%; padding: 14px 20px; font-size: 16px; border-radius: 6px; }
.btn.disabled { opacity: .45; filter: grayscale(.5); pointer-events: none; }

.home-link-btns { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-link-btns3 { grid-template-columns: 1fr 1fr 1fr; }
.home-link-btns3 .btn-big { padding: 12px 4px; font-size: 14px; }

/* 引导三连（首页按钮 + 点击弹窗） */
.btn-follow {
  border-color: var(--gold-dim);
  color: var(--gold);
  font-size: 14px;
  padding: 12px 16px;
}
.follow-rows { display: flex; flex-direction: column; gap: 8px; }
.follow-action { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 11px 14px; font-size: 14px; }
.fb-state { font-size: 13px; white-space: nowrap; margin-left: 8px; }
.fb-state.done { color: var(--gold); }
.fb-state.todo { color: var(--text-mute); }
.fb-total { font-size: 13px; color: var(--gold); font-weight: 700; text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* 底部二维码 */
.qr-area { width: 100%; text-align: center; margin-top: 4px; }
.qr-text { color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.qr-img { width: 132px; height: 132px; border-radius: 4px; background: #fff; padding: 5px; }

.difficulty { display: flex; gap: 12px; margin-top: 8px; }
.dif-btn {
  padding: 10px 26px;
  border-radius: 20px;
  border: 2px solid #3a5570;
  background: rgba(255,255,255,.06);
  color: #cde;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s;
}
.dif-btn.active { border-color: #ffd93b; background: rgba(255,217,59,.18); color: #ffd93b; font-weight: 700; }
.dif-btn:active { transform: scale(.95); }

.start-btn {
  margin-top: 12px;
  padding: 16px 60px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 4px;
  border: none;
  border-radius: 30px;
  color: #312000;
  background: linear-gradient(135deg, #ffd93b, #ffb02b);
  box-shadow: 0 8px 24px rgba(255,190,50,.4);
  cursor: pointer;
  transition: transform .15s;
}
.start-btn:active { transform: scale(.95); }

.home-desc { font-size: 11px; color: #7a94ad; line-height: 1.6; }
/* 卡组预览外圈包围 */
.home-deck-wrap {
  width: 100%;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(22,38,58,.55);
  box-shadow: inset 0 0 12px rgba(0,0,0,.35);
  display: flex;
  justify-content: center;
}
.home-deck { display: flex; gap: 5px; }
.home-deck { flex-wrap: wrap; justify-content: center; }
.home-deck .mini-card {
  width: 52px;
  min-height: 46px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,.35);
  padding: 3px 2px;
}
.home-deck .mc-icon { font-size: 15px; line-height: 1; }
.home-deck .mc-name { font-size: 9px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); white-space: nowrap; }

/* ============ 对局页 ============ */
#game-page {
  width: 100%;
  max-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0d1b2a;
  position: relative;
}

/* 顶部条：左剩余时间 · 中皇冠 · 右暂停/退出 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.bar-crown {
  font-size: 13px;
  font-weight: 800;
  color: #ffd93b;
  background: rgba(255,217,59,.1);
  padding: 3px 10px;
  border-radius: 12px;
}
.bar-crown span { font-size: 16px; }
.timer {
  font-size: 14px;
  font-weight: 800;
  color: #ffd93b;
  letter-spacing: 1px;
  min-width: 52px;
}
.timer-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ai-diff {
  font-size: 10px;
  color: #9ab;
  background: rgba(255,255,255,.1);
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 700;
}
/* B站引导关注按钮 */
.follow-btn {
  margin-top: 8px;
  padding: 10px 26px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #ff5f6d, #ff2d55);
  box-shadow: 0 4px 14px rgba(255,45,85,.35);
  animation: followPulse 1.6s infinite;
}
.follow-btn[hidden] { display: none; }
@keyframes followPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.crown-score {
  font-size: 18px;
  font-weight: 800;
  color: #ffd93b;
  letter-spacing: 3px;
  background: rgba(255,217,59,.1);
  padding: 2px 14px;
  border-radius: 12px;
}
.crown-score span { color: #fff; }
.top-actions { display: flex; gap: 8px; }
.act-btn {
  border: none;
  background: rgba(255,255,255,.12);
  color: #ffd93b;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.act-btn.quit { color: #ff6b6b; }
.elixir-track {
  width: 140px;
  height: 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  position: relative;
}
.elixir-fill {
  height: 100%;
  width: 50%;
  border-radius: 6px;
  transition: width .3s;
}
.elixir-fill.red { background: linear-gradient(90deg, #e74c3c, #ff6b5e); }
.elixir-fill.blue { background: linear-gradient(90deg, #3498db, #6fd0ff); }
.tower-hps { display: flex; gap: 8px; font-size: 11px; color: #bcd; }
.thp { display: flex; align-items: center; gap: 3px; }

/* 场地 */
.arena-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#arena {
  height: 100%;
  max-height: 100%;
  aspect-ratio: 18 / 32;
  border-radius: 6px;
  touch-action: none;
  box-shadow: 0 0 24px rgba(0,0,0,.5);
  background: #7ac74f;
}

/* 阶段徽章（双倍/三倍圣水、突然死亡） */
.stage-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,30,45,.85);
  color: #ffd93b;
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1px;
  z-index: 20;
  border: 1px solid rgba(255,217,59,.4);
  pointer-events: none;
  white-space: nowrap;
}
.stage-badge.sudden {
  color: #ff6b6b;
  border-color: rgba(255,80,80,.6);
  animation: stagePulse 1s infinite;
}
@keyframes stagePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* 结束覆盖层 */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(5,10,20,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.overlay[hidden] { display: none; }
.overlay-box {
  position: relative;
  background: linear-gradient(180deg, #16283f, #10203a);
  border: 2px solid rgba(255,217,59,.35);
  border-radius: 18px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
/* 弹层右上角关闭按钮 */
.ov-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #cde;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.ov-close:active { transform: scale(.9); }
/* 弹层滚动条美化 */
.overlay-box::-webkit-scrollbar { width: 5px; }
.overlay-box::-webkit-scrollbar-thumb { background: rgba(255,217,59,.35); border-radius: 3px; }
.overlay-box::-webkit-scrollbar-track { background: transparent; }
.overlay-box::-webkit-scrollbar-thumb:hover { background: rgba(255,217,59,.55); }
.overlay-title { font-size: 30px; font-weight: 800; color: #ffd93b; margin-bottom: 8px; }
.overlay-msg { color: #aebdcc; font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.overlay-btns { display: flex; gap: 12px; justify-content: center; }
.ov-btn {
  padding: 12px 22px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,.1);
  color: #eef;
}
.ov-btn.primary { background: linear-gradient(135deg, #ffd93b, #ffb02b); color: #312000; }
.ov-btn:active { transform: scale(.96); }

/* 底部条 */
.bottom-bar {
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.hand {
  flex: 1;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.card {
  flex: 1;
  aspect-ratio: 4 / 5.2;
  max-width: 78px;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  user-select: none;
  touch-action: none; /* 手机端长按拖动：阻止触摸滚动/长按菜单干扰 pointermove */
  border: 2px solid rgba(255,255,255,.25);
  background: rgba(30,50,75,.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform .12s, border-color .12s;
}
.card .cost {
  position: absolute;
  top: -7px;
  left: -5px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #9b59b6;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.card .icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 800;
  margin-bottom: 4px;
}
.card .cname { font-size: 10px; color: #cde; font-weight: 700; }
.card.selected {
  transform: translateY(-8px);
  box-shadow: 0 0 0 2px #ffd93b, 0 6px 16px rgba(255,217,59,.35);
}
.card.disabled { filter: grayscale(.7); opacity: .5; }
/* 预选（圣水不足已点选）：灰色 + 提起，无法释放；配 disabled 的灰化 */
.card.pending {
  transform: translateY(-8px);
  box-shadow: 0 0 0 2px rgba(255,255,255,.22);
}

.next-card-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.next-label { font-size: 9px; color: #8aa; }
.next-card {
  width: 36px; height: 46px;
  border-radius: 8px;
  border: 2px dashed rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05);
}
.next-card .icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; font-weight: 800; }

.my-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.elixir-num { font-size: 15px; font-weight: 800; color: #6fd0ff; }

/* 电脑端加宽 */
@media (min-width: 700px) {
  #home-page, #game-page, #deck-page, #settings-page { max-width: 560px; }
}

/* ============ 主页菜单 ============ */
/* 主页奖杯/段位 */
.home-trophy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.trophy-icon { font-size: 24px; }
.trophy-num {
  font-size: 24px;
  font-weight: 800;
  color: #ffd93b;
  letter-spacing: 1px;
}
.home-rank {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3a5570, #2a4560);
  padding: 2px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.rank-bar {
  width: 100%;
  max-width: 260px;
  height: 8px;
  border-radius: 5px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  margin-top: 4px;
}
.rank-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #ffd93b, #ff9a3b);
  transition: width .5s;
}
.rank-progress {
  font-size: 11px;
  color: #8aa;
  margin-top: 2px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 260px;
  margin-top: 4px;
}
.menu-btn {
  padding: 10px 0;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  background: rgba(255,255,255,.08);
  color: #dce8f5;
  transition: transform .12s, background .2s;
}
.menu-btn.primary {
  background: linear-gradient(135deg, #ffd93b, #ffb02b);
  color: #312000;
  box-shadow: 0 8px 24px rgba(255,190,50,.35);
}
.menu-btn:active { transform: scale(.96); }
.menu-btn.disabled { opacity: .45; pointer-events: none; }

/* ============ 通用页面 ============ */
#deck-page, #settings-page, #rank-page {
  width: 100%;
  max-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0d1b2a; /* 纯色：滚动时不上下分层 */
  padding: 10px 12px;
}
#deck-page { overflow-y: auto; }
/* 滚动条美化（金） */
#home-page::-webkit-scrollbar, #deck-page::-webkit-scrollbar, #settings-page::-webkit-scrollbar,
#rank-page::-webkit-scrollbar, .lb-body::-webkit-scrollbar, .deck-pool::-webkit-scrollbar { width: 5px; }
#home-page::-webkit-scrollbar-thumb, #deck-page::-webkit-scrollbar-thumb, #settings-page::-webkit-scrollbar-thumb,
#rank-page::-webkit-scrollbar-thumb, .lb-body::-webkit-scrollbar-thumb, .deck-pool::-webkit-scrollbar-thumb {
  background: rgba(255,217,59,.35); border-radius: 3px;
}
#home-page::-webkit-scrollbar-thumb:hover, #deck-page::-webkit-scrollbar-thumb:hover, #settings-page::-webkit-scrollbar-thumb:hover,
#rank-page::-webkit-scrollbar-thumb:hover, .lb-body::-webkit-scrollbar-thumb:hover, .deck-pool::-webkit-scrollbar-thumb:hover {
  background: rgba(255,217,59,.55);
}
#home-page::-webkit-scrollbar-track, #deck-page::-webkit-scrollbar-track, #settings-page::-webkit-scrollbar-track,
#rank-page::-webkit-scrollbar-track, .lb-body::-webkit-scrollbar-track, .deck-pool::-webkit-scrollbar-track { background: transparent; }
.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.back-btn, .save-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,.1);
  color: #eef;
}
.save-btn { background: linear-gradient(135deg, #ffd93b, #ffb02b); color: #312000; }
.page-title { flex: 1; text-align: center; font-size: 17px; font-weight: 800; color: #ffd93b; }
/* 右上角关闭 × （功能同返回） */
.page-x {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid #2a4462;
  background: linear-gradient(180deg, #1d3050, #16263a);
  color: #8aa;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.page-x:active { transform: scale(.92); color: #ffd93b; border-color: #ffd93b; }

/* ============ 排行榜（参考《魔修模拟器》.tabs/.tab/.lb-*，配色替换为金） ============ */
.tabs { display: flex; gap: 8px; padding: 10px 0 4px; width: 100%; }
.tabs-small { padding-top: 4px; }
.tabs-small .tab { font-size: 12px; padding: 6px 0; }
.tab {
  flex: 1;
  border: 1px solid #1e3450;
  border-radius: 3px;
  padding: 8px 0;
  background: #1d3050;
  color: #5a7089;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.tab.active {
  background: linear-gradient(180deg, #ffd93b, #a8791a);
  border-color: #ffd93b;
  color: #2a1c00;
  box-shadow: 0 0 12px rgba(255,200,60,.35);
}
.tab:active { transform: scale(.97); }
.lb-note { padding: 6px 0 0; font-size: 12px; color: #ffd93b; width: 100%; letter-spacing: 1px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lb-body { flex: 1; min-height: 0; padding: 8px 0 30px; width: 100%; overflow-y: auto; }
.lb-tip { text-align: center; color: #5a7089; padding: 30px 0; font-size: 14px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #16263a;
  border: 1px solid #1e3450;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.lb-rank {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 3px;
  background: #1d3050;
  color: #5a7089;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 26px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.lb-rank.top { background: #5a4a10; color: #ffe680; }
.lb-rank.top.r1 { background: #ffd93b; color: #2a1c00; }
.lb-rank.top.r2 { background: #d4b12f; color: #2a1c00; }
.lb-rank.top.r3 { background: #a8791a; color: #ffe680; }
.lb-user { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lb-avatar { width: 28px; height: 28px; border-radius: 3px; flex: none; }
.lb-name { font-size: 14px; color: #cde; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 14px; font-weight: 700; color: #ffe680; flex: none; white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.lb-score .lb-sub { font-size: 11px; color: #ffd93b; font-weight: 400; }
.deck-tabs { flex: 1; display: flex; gap: 6px; justify-content: center; }
.deck-tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,.07);
  color: #bcd;
}
.deck-tab.active { background: rgba(255,217,59,.2); color: #ffd93b; }

.deck-current-title, .deck-pool-title {
  font-size: 13px;
  color: #8aa;
  margin: 12px 0 6px;
  font-weight: 700;
}
.deck-avg {
  font-size: 11px;
  color: #8ecbff;
  margin-left: 8px;
  font-weight: 700;
}
/* 稀有度边框：普通白 / 稀有橙 / 史诗紫 / 传奇彩色 */
.rarity-common { border-color: #c8c8c8 !important; }
.rarity-rare { border-color: #ff9800 !important; }
.rarity-epic { border-color: #9c27b0 !important; }
.rarity-legendary {
  border: 2px solid transparent !important;
  border-image: linear-gradient(135deg, #ff5f6d, #ffc93b, #6fd0ff, #9c27b0) 1 !important;
}

/* 卡组 8 张分两排（4+4）展示 */
.deck-current {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.deck-slot {
  width: 100%;
  aspect-ratio: 4 / 5.2;
  border-radius: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(30,50,75,.6);
  border: 2px solid rgba(255,255,255,.2);
  cursor: pointer;
}
.deck-slot.empty { background: rgba(255,255,255,.04); border-style: dashed; }
.deck-slot .plus { font-size: 24px; color: #6a8; }
/* 右上角 × 移除 */
.slot-x {
  position: absolute;
  top: -7px; right: -7px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(255,70,70,.92);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.slot-x:active { transform: scale(.9); }
.deck-info { font-size: 11.5px; color: #789; margin: 8px 0 2px; }
.detail-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #bcd;
  cursor: pointer;
  margin: 8px 0 2px;
  user-select: none;
}
.detail-toggle input {
  width: 16px; height: 16px;
  accent-color: #ffd93b;
  cursor: pointer;
}

.deck-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 7px;
  padding-bottom: 12px;
}
.pool-card {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(30,50,75,.5);
  border: 2px solid rgba(255,255,255,.15);
  cursor: pointer;
  transition: transform .1s;
}
.pool-card:active { transform: scale(.94); }
.pool-card.used { opacity: .35; border-color: rgba(100,255,150,.5); }
.pool-card .cname { font-size: 9px; color: #bcd; font-weight: 700; }
.deck-slot .cname { font-size: 9px; color: #cde; font-weight: 700; }

/* 设置页 */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.setting-label { font-size: 15px; font-weight: 700; color: #dce8f5; }
.deck-picker { display: flex; gap: 8px; }
.deck-pick {
  padding: 8px 14px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,.08);
  color: #bcd;
}
.deck-pick.active { background: rgba(255,217,59,.2); color: #ffd93b; }
.sound-toggle { display: flex; gap: 8px; }
.setting-note { font-size: 12px; color: #6a8; margin-top: 16px; line-height: 1.6; }

/* 排行榜 */
.rank-tabs { flex: 1; display: flex; gap: 6px; justify-content: center; }
.rank-tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,.07);
  color: #bcd;
}
.rank-tab.active { background: rgba(255,217,59,.2); color: #ffd93b; }
.rank-my {
  flex-shrink: 0;
  margin: 10px 0 8px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,217,59,.1);
  border: 1px solid rgba(255,217,59,.3);
  font-size: 14px;
  color: #ffd93b;
  text-align: center;
  font-weight: 700;
}
.rank-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-bottom: 12px;
}
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
}
.rank-row .rk-num { width: 36px; text-align: center; font-weight: 800; color: #ffd93b; font-size: 16px; }
.rank-row .rk-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
  overflow: hidden;
}
.rank-row .rk-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank-row .rk-name { flex: 1; font-size: 15px; color: #dce8f5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank-row .rk-score { font-weight: 800; color: #ffd93b; font-size: 15px; }
.rank-loading { text-align: center; color: #8aa; padding: 60px 0; font-size: 14px; }

/* 主页问号提示 */
.info-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #9ab;
  cursor: help;
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
}
.info-q svg { display: block; }
.info-q .info-tip {
  display: none;
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-60%);
  width: 250px;
  max-width: 76vw;
  background: rgba(15,25,40,.97);
  border: 1px solid rgba(255,217,59,.4);
  color: #cde;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 60;
  text-align: left;
  white-space: normal;
}
.info-q:hover .info-tip,
.info-q:focus .info-tip { display: block; }

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,30,45,.95);
  color: #ffd93b;
  padding: 10px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
