:root {
  --bg: #0a0e1c;
  --bg-2: #0f1526;
  --card: #141a2e;
  --card-2: #1a2138;
  --border: #2a3350;
  --border-soft: #232c46;
  --text: #e8ebf5;
  --text-dim: #8b93a8;
  --text-faint: #5c647c;

  --gold: #f6c453;
  --gold-2: #d4a017;
  --gold-grad: linear-gradient(135deg, #ffe08a 0%, #f6c453 45%, #d4a017 100%);
  --silver-grad: linear-gradient(135deg, #ffffff 0%, #c9d1e0 45%, #8a93a6 100%);
  --bronze-grad: linear-gradient(135deg, #f0b990 0%, #cd7f32 45%, #a05a2c 100%);

  --green: #2fd37f;
  --red: #ff5c6c;
  --accent: #5b7cff;
  --violet: #8b5cf6;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.018) 75%),
    linear-gradient(-45deg, rgba(255,255,255,0.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.018) 75%);
  background-size: 44px 44px;
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 86px;
}

/* ---------- 顶部 ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 10px;
}
.brand-top {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-faint);
  font-weight: 700;
}
.brand-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.brand-title span { -webkit-text-fill-color: #cfe0ff; }
.season-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid rgba(246, 196, 83, 0.4);
  background: rgba(246, 196, 83, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 1px;
}

/* ---------- 横幅 ---------- */
.banner {
  position: relative;
  margin: 4px 16px 18px;
  padding: 18px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(246, 196, 83, 0.45);
  background: url("banner-god.webp") center / cover no-repeat, linear-gradient(120deg, rgba(30, 26, 16, 0.9), rgba(20, 18, 32, 0.95));
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(246, 196, 83, 0.08);
  min-height: 200px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.banner::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.05) 0%, rgba(10, 14, 28, 0) 40%, rgba(10, 14, 28, 0.65) 78%, rgba(10, 14, 28, 0.88) 100%);
  pointer-events: none;
  z-index: 1;
}
.banner-text { position: relative; z-index: 2; }
.banner-season {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.banner-slogan {
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}
.banner-champion {
  position: absolute;
  left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.banner-champion .avatar {
  width: 125px; height: 125px; font-size: 51px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.35), 0 0 26px rgba(246, 196, 83, 0.55), 0 4px 16px rgba(0, 0, 0, 0.6);
}
.mini-card {
  width: 34px; height: 48px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.9);
}
.mini-card.red { background: #e8e6ea; color: #d33; margin-right: -12px; }
.mini-card.dark { background: #1a1c22; color: #e33; }

/* ---------- 面板 ---------- */
.tabs-content { padding: 0 14px; }
.tab-panel { display: none; animation: fadeUp 0.25s ease; }
.tab-panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 17px; font-weight: 800;
  margin: 6px 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: "";
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--gold-grad);
}

.list { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: #0a0e1c;
  background: var(--gold-grad);
  transition: transform 0.05s ease, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, #6f8dff, #4f6dff); color: #fff; }
.btn-gold { background: var(--gold-grad); color: #1a1200; }
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-danger { background: linear-gradient(135deg, #ff6b7a, #e83b52); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---------- 总积分榜 ---------- */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 6px;
}
.podium-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 0;
  border-radius: 14px 14px 0 0;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-bottom: none;
}
.podium-col.rank-1 { padding-top: 22px; background: linear-gradient(180deg, #2a2210, var(--card)); border-color: rgba(246,196,83,0.45); box-shadow: 0 0 34px rgba(246,196,83,0.4), 0 0 90px rgba(246,196,83,0.16); }
.podium-col.rank-2 { background: linear-gradient(180deg, #1f2230, var(--card)); border-color: rgba(201,209,224,0.3); box-shadow: 0 0 28px rgba(201,209,224,0.3), 0 0 76px rgba(201,209,224,0.12); }
.podium-col.rank-3 { background: linear-gradient(180deg, #2a1d13, var(--card)); border-color: rgba(205,127,50,0.4); box-shadow: 0 0 26px rgba(205,127,50,0.32), 0 0 68px rgba(205,127,50,0.12); }

/* 前三名背景装饰元素 */
.podium-col::after {
  content: "";
  position: absolute;
  top: 64%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 130px;
  line-height: 1;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
}
.podium-col.rank-1::after { content: "🏆"; }
.podium-col.rank-2::after { content: "🎉"; }
.podium-col.rank-3::after { content: "💐"; }

.crown { width: 38px; height: 26px; filter: drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
.podium-col.rank-1 .crown { width: 82px; height: auto; }
.podium-col.rank-2 .crown { width: 56px; height: 40px; }
.podium-col.rank-3 .crown { width: 48px; height: 34px; }
.podium-col.rank-1 .crown { animation: crown-gold 2.4s ease-in-out infinite; }
.podium-col.rank-2 .crown { animation: crown-silver 2.4s ease-in-out infinite; }
.podium-col.rank-3 .crown { animation: crown-bronze 2.4s ease-in-out infinite; }
.podium-col .avatar-wrap { position: relative; }
.podium-col.rank-1 .avatar-wrap::before,
.podium-col.rank-2 .avatar-wrap::before,
.podium-col.rank-3 .avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
  animation: halo-spin 3.5s linear infinite;
}
.podium-col.rank-1 .avatar-wrap::before {
  background: conic-gradient(from 0deg, transparent, #fff6c8, var(--gold), rgba(255,246,200,0.4), transparent);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}
.podium-col.rank-2 .avatar-wrap::before {
  background: conic-gradient(from 0deg, transparent, #ffffff, #c9d1e0, rgba(255,255,255,0.4), transparent);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}
.podium-col.rank-3 .avatar-wrap::before {
  background: conic-gradient(from 0deg, transparent, #fdcaa0, #cd7f32, rgba(240,185,144,0.4), transparent);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}
@keyframes halo-spin { to { transform: rotate(360deg); } }
@keyframes crown-gold {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(246,196,83,0.55)) drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
  50% { filter: drop-shadow(0 0 18px rgba(246,196,83,0.95)) drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
}
@keyframes crown-silver {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(201,209,224,0.5)) drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
  50% { filter: drop-shadow(0 0 16px rgba(201,209,224,0.9)) drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
}
@keyframes crown-bronze {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(205,127,50,0.5)) drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
  50% { filter: drop-shadow(0 0 16px rgba(205,127,50,0.9)) drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
}

.avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card-2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--text-dim);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.podium-col .avatar { width: 66px; height: 66px; font-size: 26px; }
.podium-col.rank-1 .avatar { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,196,83,0.25); }

.nick { font-weight: 800; font-size: 15px; }
.podium-col .nick { font-size: 17px; }
.motto {
  font-size: 13px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.3px;
  max-width: 120px; text-align: center;
  line-height: 1.35; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.score { font-size: 20px; font-weight: 800; }
.score.pos { color: var(--green); }
.score.neg { color: var(--red); }
.score-label { font-size: 10px; color: var(--text-faint); }

.podium-base {
  height: 60px;
  margin: 0 -8px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1f2438, #171c2c);
  border: 1px solid var(--border-soft);
}
.podium-col.rank-1 .podium-base { height: 80px; background: linear-gradient(180deg, #3a2f14, #1f1a0e); }
.podium-col.rank-2 .podium-base { height: 46px; }
.podium-col.rank-3 .podium-base { height: 34px; background: linear-gradient(180deg, #33261b, #1c1510); }

/* 领先后（CONTENDERS 区） */
.contenders-title {
  font-size: 11px; letter-spacing: 3px; color: var(--text-faint);
  font-weight: 700; margin: 20px 0 10px; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.contenders-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- 榜单区块标题 ---------- */
.flag {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 2px 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
}
.flag-line { flex: 1; height: 2px; border-radius: 2px; }
.flag-leading span {
  background: linear-gradient(135deg, #ffe08a 0%, #f6c453 45%, #d4a017 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(246, 196, 83, 0.55));
}
.flag-leading .flag-line {
  background: linear-gradient(90deg, rgba(246, 196, 83, 0.8), transparent);
  box-shadow: 0 0 12px rgba(246, 196, 83, 0.5);
}
.flag-frog span {
  color: #5ee79a;
  text-shadow: 0 0 14px rgba(94, 231, 154, 0.65);
}
.flag-frog .flag-line {
  background: linear-gradient(90deg, rgba(94, 231, 154, 0.7), transparent);
}
.flag-gift span {
  background: linear-gradient(135deg, #ffc9a3 0%, #ff5c6c 50%, #e63946 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 92, 108, 0.5));
}
.flag-gift .flag-line {
  background: linear-gradient(90deg, rgba(255, 92, 108, 0.7), transparent);
}
.contenders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px;
  padding: 4px 2px 10px;
}
.contenders::-webkit-scrollbar { display: none; }
.contender {
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  position: relative;
}
.contender .rank-no {
  position: absolute; top: 6px; left: 8px;
  font-size: 15px; font-weight: 800; color: var(--text-dim);
}
.contender .avatar { width: 46px; height: 46px; font-size: 18px; }
.contender .nick { font-size: 13px; }
.contender .c-score { font-size: 15px; font-weight: 800; }
.contender .c-score.pos { color: var(--green); }
.contender .c-score.neg { color: var(--red); }

.avatar-wrap { position: relative; display: inline-flex; line-height: 0; }

/* 小丑（倒数第一）标记 */
.avatar-wrap.jester .avatar {
  animation: jester-halo 1.6s ease-in-out infinite;
}
.jester-hat {
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-bottom: 20px solid #ff5c9d;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  z-index: 4;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.jester-hat::after {
  content: "";
  position: absolute;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  width: 11px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c8, var(--gold));
  box-shadow: 0 0 8px rgba(246, 196, 83, 0.8);
}
.jester-nose {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9dab, #e63946);
  z-index: 4;
  box-shadow: 0 1px 5px rgba(230, 57, 70, 0.65);
}
.jester-badge {
  position: absolute;
  right: -8px; bottom: -8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a1a5e, #1a0e22);
  border: 1px solid var(--violet);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  z-index: 4;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.55);
  animation: jester-bounce 2s ease-in-out infinite;
}
@keyframes jester-halo {
  0%, 100% { box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.5), 0 0 12px rgba(139, 92, 246, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.85), 0 0 22px rgba(139, 92, 246, 0.9); }
}
@keyframes jester-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* 末位小丑卡片 */
.jester-spot {
  position: relative;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: url("jester-bg.webp") center / contain no-repeat, linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(26, 14, 34, 0.9));
  border: 1px solid rgba(139, 92, 246, 0.45);
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* 垫底小丑是「朴」时：换成朴的小丑立绘（透明底），放在右半边，只露出上半身 */
.jester-spot.jester-spot-piao {
  background:
    url("jester-piao.webp") right 4% top 12% / auto 158% no-repeat,
    radial-gradient(ellipse 46% 90% at 74% 38%, rgba(214, 40, 64, 0.30), transparent 70%),
    linear-gradient(135deg, rgba(139, 92, 246, 0.20), rgba(26, 14, 34, 0.92));
}
.jester-spot-piao .jester-spot-score { position: relative; z-index: 1; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9); }
/* 左边压暗，名字和「末位 · 第 N 名」不会压在立绘上看不清 */
.jester-spot.jester-spot-piao::before {
  background:
    linear-gradient(90deg, rgba(20, 12, 34, 0.9) 0%, rgba(20, 12, 34, 0.6) 30%, rgba(20, 12, 34, 0) 56%),
    linear-gradient(180deg, rgba(20, 12, 34, 0) 0%, rgba(20, 12, 34, 0) 55%, rgba(20, 12, 34, 0.7) 100%);
}
@media (max-width: 719px) {
  .jester-spot.jester-spot-piao {
    background:
      url("jester-piao.webp") right -34px top 14% / auto 150% no-repeat,
      radial-gradient(ellipse 56% 90% at 76% 38%, rgba(214, 40, 64, 0.30), transparent 70%),
      linear-gradient(135deg, rgba(139, 92, 246, 0.20), rgba(26, 14, 34, 0.92));
  }
}
.jester-spot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 12, 34, 0) 0%, rgba(20, 12, 34, 0) 46%, rgba(20, 12, 34, 0.86) 100%);
  pointer-events: none;
}
.jester-spot-tag {
  position: absolute;
  top: 14px; left: 16px;
  font-size: 22px;
  letter-spacing: 2px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 18px rgba(139, 92, 246, 0.5);
  z-index: 2;
}
.jester-spot-body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.jester-spot-body .avatar { width: 62px; height: 62px; font-size: 24px; }
.jester-spot-info { flex: 1; min-width: 0; }
.jester-spot-name { font-size: 18px; font-weight: 800; }
.jester-spot-rank { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.jester-spot-score { font-size: 22px; font-weight: 900; }
.jester-spot-score.pos { color: var(--green); }
.jester-spot-score.neg { color: var(--red); }

/* ---------- 近期牌局 ---------- */
.recent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
}
.stat-card .stat-label { font-size: 11px; color: var(--text-faint); font-weight: 700; letter-spacing: 1px; }
.stat-card .stat-name { font-size: 17px; font-weight: 800; margin-top: 6px; }
.stat-card .stat-value { font-size: 20px; font-weight: 800; margin-top: 2px; }
.stat-card .stat-value.pos { color: var(--green); }
.stat-card .stat-value.neg { color: var(--red); }
.stat-card.gold { border-color: rgba(246,196,83,0.35); background: linear-gradient(150deg, #251f10, var(--card)); }

.best-hand-card {
  background: radial-gradient(circle at 30% 20%, rgba(246,196,83,0.18), transparent 60%), var(--card);
  border: 1px solid rgba(246,196,83,0.35);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.best-hand-card .bh-label { font-size: 11px; letter-spacing: 2px; color: var(--gold); font-weight: 700; }
.best-hand-card .bh-hand { margin: 10px 0 4px; }
.best-hand-card .bh-type { font-size: 20px; font-weight: 900; color: var(--gold); margin: 6px 0 2px; }
.best-hand-card .bh-player { font-size: 14px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.best-hand-card .bh-player .avatar { width: 30px; height: 30px; font-size: 13px; }
.best-hand-card .bh-date { color: var(--text-faint); }
.best-hand-card .bh-empty { color: var(--text-faint); font-size: 14px; }
.best-hand-card .mini-pcard { width: 40px; height: 54px; }
.best-hand-card .mini-pcard .mp-rank { font-size: 16px; }
.best-hand-card .mini-pcard .mp-suit { font-size: 16px; }

/* 高光时刻 */
.highlight-list { display: flex; flex-direction: column; gap: 10px; }
.highlight-item {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--violet);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "left type"
    "left date"
    "desc desc";
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  padding-right: 34px;
}
.highlight-item .hl-left {
  grid-area: left;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.highlight-item .hl-avatar { flex-shrink: 0; }
.highlight-item .hl-avatar .avatar { width: 40px; height: 40px; font-size: 16px; }
.highlight-item .hl-name {
  font-size: 12px; font-weight: 700; color: var(--text-dim);
  text-align: center; max-width: 72px; word-break: break-all; line-height: 1.2;
}
.highlight-item .hl-type {
  grid-area: type;
  font-size: 17px; font-weight: 800; color: #b79bff;
  letter-spacing: 0.5px; line-height: 1.2;
}
.highlight-item .hl-desc {
  grid-area: desc;
  font-size: 14px; color: var(--text); line-height: 1.6;
  margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.highlight-item .hl-date {
  grid-area: date;
  font-size: 12px; color: var(--text-faint);
}
.highlight-del {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 16px;
}

/* ---------- 玩家档案卡片 ---------- */
.profiles-grid { display: flex; flex-direction: column; gap: 14px; }
.profile-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-head .avatar { width: 54px; height: 54px; font-size: 20px; }
.profile-head .p-info { flex: 1; min-width: 0; }
.profile-head .p-name { font-size: 17px; font-weight: 800; }
.profile-head .p-profit { font-size: 12.5px; font-weight: 800; margin-left: 8px; }
.profile-head .p-profit.pos { color: var(--green); }
.profile-head .p-profit.neg { color: var(--red); }
.profile-head .p-motto { font-size: 12px; color: var(--text-dim); font-style: italic; font-weight: 700; }
.profile-card > .p-note { font-size: 13px; line-height: 1.7; color: var(--gold-2); font-weight: 700; margin-top: 10px; overflow-wrap: anywhere; white-space: pre-wrap;
  padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(246, 196, 83, 0.06); border: 1px solid rgba(246, 196, 83, 0.14); }
.profile-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-shrink: 0; align-self: flex-start; }
.icon-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

/* 冷热倾向标尺 */
.tendency-row { margin-top: 14px; }
.tendency-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); font-weight: 700; }
.tendency-meter {
  margin-top: 6px;
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  gap: 2px;
}
.tendency-meter .seg { flex: 1; opacity: 0.35; transition: opacity 0.2s; }
.tendency-meter .seg.on { opacity: 1; box-shadow: 0 0 8px rgba(255,255,255,0.15); }
.tendency-current {
  margin-top: 6px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.tendency-current .t-name { color: var(--text); }

/* 危险程度 */
.danger-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.danger-row .danger-label { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.danger-badge {
  font-size: 12px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px;
  letter-spacing: 1px;
}
.danger-low { color: #46d28a; background: rgba(70,210,138,0.12); border: 1px solid rgba(70,210,138,0.35); }
.danger-medium { color: #f6c453; background: rgba(246,196,83,0.12); border: 1px solid rgba(246,196,83,0.35); }
.danger-high { color: #ff9f43; background: rgba(255,159,67,0.12); border: 1px solid rgba(255,159,67,0.4); }
.danger-extreme { color: #ff5c6c; background: rgba(255,92,108,0.12); border: 1px solid rgba(255,92,108,0.45); }

/* 频率条 */
.freq-row { margin-top: 12px; }
.freq-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 4px; }
.freq-bar { height: 8px; border-radius: 99px; background: #0e1424; overflow: hidden; }
.freq-bar .fill { height: 100%; border-radius: 99px; background: var(--gold-grad); }

/* 最佳手牌 */
.best-hand-row { margin-top: 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.best-hand-row > span:first-child { flex-shrink: 0; }
.best-hand-row .bh-val { color: var(--gold); font-weight: 800; }
.bh-cards { display: flex; gap: 5px; flex-wrap: wrap; }
.mini-pcard {
  width: 32px; height: 44px;
  border-radius: 5px;
  background: #f4f1ec;
  border: 1px solid #d8d2c6;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #1a1a1a;
}
.mini-pcard .mp-rank { font-size: 13px; font-weight: 900; line-height: 1; }
.mini-pcard .mp-suit { font-size: 13px; line-height: 1; }
.mini-pcard.red { color: #d33; }

/* 手牌选择器（弹窗内） */
.hand-picker {
  background: linear-gradient(125deg, #2a1a4a, #17112e);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.hand-picker-label { font-size: 12px; font-weight: 700; color: var(--violet); margin-bottom: 10px; }
.hand-cards { display: flex; gap: 6px; justify-content: space-between; }
.hand-card { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.hc-preview {
  width: 46px; height: 62px;
  border-radius: 6px;
  background: #0d1322;
  border: 1px dashed var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  color: var(--text-faint);
}
.hc-preview.filled {
  background: #f4f1ec;
  border: 1px solid #e0dcd3;
  color: #1a1a1a;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}
.hc-rank { font-size: 16px; font-weight: 900; line-height: 1; }
.hc-suit { font-size: 16px; line-height: 1; }
.hc-suit.red { color: #d33; }
.hand-card select {
  width: 46px;
  background: #0d1322;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 0;
  text-align: center;
}

/* ---------- 牌局记录列表 ---------- */
.game-item {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
}
.game-item .g-head { display: flex; justify-content: space-between; align-items: center; }
.game-item .g-date { font-weight: 800; font-size: 15px; }
.game-item .g-note { font-size: 12px; color: var(--text-faint); }
.game-results { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.game-result { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.game-result .gr-name { color: var(--text-dim); }
.game-result .gr-amount { font-weight: 700; }
.game-result .gr-amount.pos { color: var(--green); }
.game-result .gr-amount.neg { color: var(--red); }
.game-besthand {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.game-besthand .gbh-label { color: var(--text-faint); font-size: 12px; }
.game-besthand .gbh-type { color: var(--gold); font-weight: 800; font-size: 12px; }
.game-besthand .gbh-player { color: var(--text-dim); font-size: 12px; }
.game-besthand .mini-pcard { width: 26px; height: 36px; }
.game-besthand .mini-pcard .mp-rank { font-size: 11px; }
.game-besthand .mini-pcard .mp-suit { font-size: 11px; }
.game-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ---------- 上传卡片 ---------- */
.upload-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.upload-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.upload-card-title { font-size: 13px; font-weight: 700; }
.upload-card .btn { width: 100%; font-size: 12px; padding: 8px 6px; }
.highlight-section { display: flex; flex-direction: column; gap: 10px; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  color: var(--text-faint);
  padding: 40px 20px;
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 100%; max-width: 560px;
  display: flex;
  background: rgba(13, 17, 30, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.nav-item {
  flex: 1;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-faint);
  font-size: 10.5px; font-weight: 600;
  padding: 6px 0;
  border-radius: 10px;
  transition: color 0.15s;
}
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-item svg path { fill: none; }
.nav-item.active { color: var(--gold); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(246,196,83,0.5)); }
.nav-item:nth-child(1) svg path { fill: currentColor; stroke: none; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 6, 14, 0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #171d31, #101523);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--border);
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  animation: slideUp 0.22s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-size: 19px; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 24px; cursor: pointer; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: #0d1322;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold-2); }
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.avatar-picker { display: flex; align-items: center; gap: 14px; }
.avatar-picker .avatar { width: 64px; height: 64px; font-size: 24px; flex-shrink: 0; }
.avatar-picker input[type="file"] { display: none; }
.avatar-picker .pick-btn {
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: rgba(91,124,255,0.1); border: 1px solid rgba(91,124,255,0.35);
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 100px 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.result-row .del-row {
  background: none; border: 1px solid var(--border); color: var(--text-faint);
  width: 32px; height: 38px; border-radius: 8px; cursor: pointer; font-size: 16px;
}

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; padding: 13px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%; bottom: 96px;
  transform: translateX(-50%) translateY(10px);
  background: #1c2337;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: 80vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 手机高光：整场浏览，卡片展开，底部选择日期 */
.hl-browser { margin-top: 26px; scroll-margin-top: 16px; min-height: calc(100vh - 86px); min-height: calc(100dvh - 86px); }
.hl-browser-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.hl-browser-heading h2 { font-size: 17px; font-weight: 800; }
.hl-browser-heading > span { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.hl-date-picker {
  width: 100%;
  min-height: 74px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: var(--radius-sm);
  background: linear-gradient(110deg, rgba(139, 92, 246, 0.15), var(--card));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.hl-date-current { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.hl-date-label { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.hl-date-meta { font-size: 12px; color: var(--text-dim); }
.hl-date-action { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 13px; color: #c6b4ff; }
.hl-date-action > span { font-size: 21px; line-height: 1; }
.hl-story-list { display: flex; flex-direction: column; gap: 12px; }
.hl-story-card {
  min-width: 0;
  padding: 16px 16px 8px;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--violet);
  border-radius: var(--radius-sm);
  background: var(--card);
  scroll-margin-top: 16px;
}
.hl-story-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.hl-story-head .avatar { width: 44px; height: 44px; font-size: 18px; }
.hl-story-head .avatar-wrap { flex-shrink: 0; }
.hl-story-info { min-width: 0; }
.hl-story-name { font-size: 12px; color: var(--text-dim); margin-bottom: 3px; }
.hl-story-title { font-size: 18px; font-weight: 800; line-height: 1.4; color: #c6b4ff; overflow-wrap: anywhere; }
.hl-story-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 8px;
}
.hl-story-text.is-expanded { display: block; -webkit-line-clamp: unset; }
.hl-readmore {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-top: 1px solid var(--border-soft);
  background: transparent;
  color: #c6b4ff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.hl-readmore[hidden] { display: none; }
.hl-readmore-arrow { width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.hl-readmore[aria-expanded="true"] .hl-readmore-arrow { transform: rotate(225deg); }
body.hl-dates-open { overflow: hidden; }
.hl-date-sheet { max-height: 82vh; max-height: 82dvh; overscroll-behavior: contain; }
.hl-date-sheet .modal-close { min-width: 44px; min-height: 44px; margin: -8px -8px -8px 0; }
.hl-date-hint { font-size: 13px; color: var(--text-dim); margin: -5px 0 16px; }
.hl-date-options { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; max-height: 55dvh; overflow-y: auto; overscroll-behavior: contain; padding: 3px; }
.hl-date-option {
  width: 100%;
  min-height: 76px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.hl-date-option.is-selected { border-color: var(--violet); background: rgba(139, 92, 246, 0.15); }
.hl-option-date { display: block; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.hl-option-meta { display: block; font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.hl-option-check { flex-shrink: 0; min-width: 20px; color: #c6b4ff; font-size: 20px; text-align: right; }
.hl-date-picker:focus-visible, .hl-readmore:focus-visible, .hl-date-option:focus-visible { outline: 2px solid #c6b4ff; outline-offset: 2px; }

@media (max-width: 719px) {
  .app { overflow-x: clip; }
}

/* ---------- 响应式（桌面） ---------- */
@media (min-width: 720px) {
  .app { max-width: 720px; }
  .podium-col.rank-1 { padding-top: 30px; }
  .profiles-grid { grid-template-columns: 1fr 1fr; }
  .upload-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 牌魂（游戏页签） ---------- */
body[data-tab="game"] .banner { display: none; }
body[data-tab="game"] .app { padding-bottom: 78px; }
.game-head { align-items: flex-end; gap: 12px; }
.game-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-head > div:first-child { min-width: 0; }
@media (max-width: 719px) { .game-sub-more { display: none; } }
.game-tools { display: flex; gap: 8px; flex-shrink: 0; }
.game-tools .btn { text-decoration: none; display: inline-flex; align-items: center; }
.game-stage {
  position: relative;
  height: calc(100vh - 236px - env(safe-area-inset-bottom)); height: calc(100dvh - 236px - env(safe-area-inset-bottom));
  min-height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(246, 196, 83, 0.35);
  background: radial-gradient(ellipse at 50% 40%, #16203a, #05070b 70%);
  box-shadow: var(--shadow), 0 0 0 4px rgba(5, 6, 10, 0.6);
}
.game-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #05070b; }
.game-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text-dim); font-size: 14px; letter-spacing: 1px; }
.game-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(246, 196, 83, 0.18); border-top-color: var(--gold); animation: gameSpin 0.9s linear infinite; }
@keyframes gameSpin { to { transform: rotate(360deg); } }
.game-stage.ready .game-loading { display: none; }
.game-stage:fullscreen { height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.game-stage:-webkit-full-screen { width: 100%; height: 100%; border: 0; border-radius: 0; }
@media (min-width: 720px) {
  /* 桌面上游戏不受 720px 的窄栏限制，按 16:10 铺开 */
  #panel-game .game-stage {
    width: min(1320px, calc(100vw - 48px));
    left: 50%; transform: translateX(-50%);
    height: min(calc(100vh - 238px), calc(min(1320px, 100vw - 48px) * 0.625));
  }
  #panel-game .panel-head { width: min(1320px, calc(100vw - 48px)); position: relative; left: 50%; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) { .game-spin { animation: none; } }
