:root {
  --ink: #0b0906;
  --ink-2: #120e09;
  --card: #17130c;
  --card-2: #211b11;
  --bubble: #1f1a12;
  --line: rgba(233, 193, 90, 0.16);
  --line-strong: rgba(233, 193, 90, 0.42);
  --gold: #e9c15a;
  --gold-deep: #b8902f;
  --gold-soft: rgba(233, 193, 90, 0.12);
  --paper: #f3ead6;
  --mute: #9b8f79;
  --red: #c8352c;
  --red-deep: #8e231c;
  --win: #6fcf97;
  --loss: #e0736a;
  --num: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink); color: var(--paper); font-family: var(--body); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; }

/* ---------- 通用 ---------- */
.mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(160deg, var(--gold) 0%, var(--gold-deep) 100%); color: var(--ink); font-weight: 700; font-size: 18px;
}
.mark-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 34px; margin-bottom: 14px; }
.hint { color: var(--mute); font-size: 13px; margin: 0; }
.err { color: var(--loss); font-size: 13px; margin: 10px 0 0; }
.num { font-family: var(--num); font-weight: 800; letter-spacing: 0.01em; }
.gold { color: var(--gold); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 13px 18px; border-radius: 14px;
  font-weight: 600; width: 100%; transition: transform 0.08s ease, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-gold { background: linear-gradient(160deg, #f1cf6f, var(--gold-deep)); color: #1a1205; box-shadow: 0 6px 20px rgba(233, 193, 90, 0.18); }
.btn-ghost { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--line); }
.btn-red { background: linear-gradient(160deg, #d9433a, var(--red-deep)); color: #fff4e6; }
.btn-sm { width: auto; padding: 8px 16px; border-radius: 999px; font-size: 14px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: var(--mute);
  border: 1px solid rgba(255, 255, 255, 0.08); flex: none;
}
.link-btn { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.field { display: block; margin-bottom: 14px; text-align: left; }
.field span { display: block; color: var(--mute); font-size: 13px; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--paper); outline: none;
}
.field input:focus { border-color: var(--line-strong); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 12px; }
.section-title h2 { font-size: 19px; font-weight: 700; position: relative; padding-bottom: 8px; }
.section-title h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 40px; height: 3px; border-radius: 2px; background: var(--gold); }
.section-title small { color: var(--mute); font-size: 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-bottom: 12px; }
.panel-head { color: var(--gold); font-weight: 700; font-size: 14px; margin: -4px 0 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.row:last-child { border-bottom: 0; }
.row .ico { font-size: 22px; width: 30px; text-align: center; }
.row .body { flex: 1; min-width: 0; }
.row .body b { display: block; font-weight: 600; }
.row .body small { color: var(--mute); font-size: 12px; }
.row .end { text-align: right; color: var(--gold); font-weight: 700; font-family: var(--num); font-size: 20px; }
.row .end small { display: block; font-family: var(--body); font-weight: 400; color: var(--mute); font-size: 11px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--gold-soft); color: var(--gold); }
.empty { color: var(--mute); text-align: center; padding: 30px 0; }

/* ---------- 登录 ---------- */
.screen { min-height: 100vh; }
.login { display: grid; place-items: center; padding: 24px; text-align: center; background: radial-gradient(120% 80% at 50% 0%, #2a1f0e 0%, var(--ink) 60%); }
.login-card { width: 100%; max-width: 340px; }
.login-title { font-size: 30px; font-weight: 800; letter-spacing: 0.04em; margin-bottom: 4px; }
.login .hint { margin-bottom: 22px; }

/* ---------- 主页面 ---------- */
.page { padding: calc(14px + var(--safe-t)) 16px calc(90px + var(--safe-b)); min-height: 100vh; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; padding: 6px 8px calc(6px + var(--safe-b));
  background: rgba(11, 9, 6, 0.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.nav-btn { flex: 1; padding: 6px 4px; border-radius: 14px; color: var(--mute); font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nav-btn .ico { font-size: 22px; filter: grayscale(1) opacity(0.6); }
.nav-btn.is-active { color: var(--gold); }
.nav-btn.is-active .ico { filter: none; }

/* 大厅 */
.lobby-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #1a1205; background: linear-gradient(160deg, #f1cf6f, var(--gold-deep)); flex: none; }
.lobby-top .who { flex: 1; }
.lobby-top .who b { display: block; font-size: 17px; }
.lobby-top .bell { margin-left: auto; }
.balance-card { padding: 4px 0 18px; }
.balance-card .label { color: var(--mute); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.balance-card .amount { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 14px; }
.balance-card .amount .cur { color: var(--gold); font-size: 15px; font-weight: 700; }
.balance-card .amount .num { font-size: 52px; line-height: 1; color: var(--gold); }
.wallet-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wallet-actions button {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 6px; color: var(--paper);
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px;
}
.wallet-actions button .ico { font-size: 24px; }
.wallet-actions button.is-off { color: var(--mute); }
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 22px 18px 18px; margin: 18px 0 16px;
  background: radial-gradient(90% 70% at 85% 10%, #4a2410 0%, #1a1109 55%, var(--card) 100%); border: 1px solid var(--line);
  min-height: 210px;
}
.hero .tag { position: absolute; left: 14px; top: 14px; font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(233, 193, 90, 0.15); color: var(--gold); border: 1px solid var(--line); }
.hero .title { font-size: 34px; font-weight: 800; line-height: 1; margin-top: 30px; letter-spacing: 0.02em; }
.hero .title small { display: block; font-size: 15px; color: var(--gold); font-weight: 700; letter-spacing: 0.15em; margin-bottom: 6px; }
.hero .hero-sub { color: var(--mute); margin: 8px 0 18px; max-width: 66%; }
.hero.hero-sm { min-height: 0; padding-bottom: 22px; }
.hero.hero-sm .hero-sub { margin-bottom: 0; }
.hero .btn-row .btn { padding: 12px; font-size: 14px; }
.packet-stack { position: absolute; right: -4px; top: 18px; width: 120px; height: 140px; pointer-events: none; }
.packet-stack i {
  position: absolute; width: 58px; height: 84px; border-radius: 8px; background: linear-gradient(170deg, #d94a40, var(--red-deep));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 200, 120, 0.25);
}
.packet-stack i::after { content: '牛'; position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fbe4a0, var(--gold-deep) 70%); color: #6b1d16; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.packet-stack i:nth-child(1) { left: 10px; top: 30px; transform: rotate(-16deg); }
.packet-stack i:nth-child(2) { left: 36px; top: 16px; transform: rotate(-4deg); }
.packet-stack i:nth-child(3) { left: 62px; top: 26px; transform: rotate(10deg); }
.notice-list .row .body b { font-size: 14px; }

/* 活动 */
.checkin { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.checkin .track { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.checkin .track i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.progress-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); margin-top: 6px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--gold); }
.milestone { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.milestone:last-child { border-bottom: 0; }
.milestone .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold-deep); justify-self: center; }
.milestone.is-done .dot { background: var(--gold); border-color: var(--gold); }
.milestone .prize { color: var(--gold); font-family: var(--num); font-weight: 800; font-size: 20px; }
.milestone .btn { width: auto; padding: 6px 12px; font-size: 12px; border-radius: 999px; }
.medal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #1a1205; background: #6b6b6b; }
.medal.m1 { background: linear-gradient(160deg, #f6d77a, var(--gold-deep)); }
.medal.m2 { background: linear-gradient(160deg, #e8e8e8, #9a9a9a); }
.medal.m3 { background: linear-gradient(160deg, #d9955b, #8a4f27); }

/* 房间 */
.room-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.room-card { text-align: center; }
.room-card .art {
  aspect-ratio: 1; border-radius: 22px; display: grid; place-items: center; margin-bottom: 8px; position: relative; overflow: hidden;
  background: radial-gradient(70% 70% at 50% 30%, #3a2410, #120c06); border: 1px solid var(--line-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.room-card .art b { font-family: var(--num); font-size: 30px; font-weight: 800; color: var(--gold); line-height: 0.9; letter-spacing: 0.02em; }
.room-card .art small { display: block; font-size: 13px; font-weight: 700; color: var(--paper); letter-spacing: 0.2em; margin-top: 2px; }
.room-card .art .live { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--win); box-shadow: 0 0 8px var(--win); }
.room-card.is-closed .art { filter: grayscale(1) opacity(0.4); border-color: rgba(255, 255, 255, 0.1); }
.room-card .name { font-size: 13px; font-weight: 600; }
.room-card .count { font-family: var(--num); font-weight: 700; font-size: 16px; color: var(--gold); }
.room-card.is-closed .name { color: var(--mute); }

/* 我 */
.me-top { display: flex; align-items: center; gap: 12px; padding: 10px 0 18px; }
.me-top .avatar { width: 56px; height: 56px; font-size: 22px; }
.me-top .who b { display: block; font-size: 20px; }
.me-top .who small { color: var(--mute); font-size: 12px; }
.me-top .since { margin-left: auto; text-align: right; color: var(--mute); font-size: 12px; line-height: 1.5; }
.me-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 6px; }
.me-grid button { padding: 16px 4px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--paper); font-size: 14px; }
.me-grid button .ico { font-size: 28px; }
.me-grid button:active { background: var(--gold-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-family: var(--num); font-size: 26px; font-weight: 800; color: var(--gold); line-height: 1; }
.stat small { color: var(--mute); font-size: 12px; }
.foot { text-align: center; color: var(--mute); font-size: 12px; letter-spacing: 0.2em; margin: 28px 0 8px; }

/* ---------- 子页面 ---------- */
.sub { background: var(--ink); }
.sub-top {
  position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 12px 10px; background: rgba(11, 9, 6, 0.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.sub-top h2 { text-align: center; font-size: 17px; }
.sub-body { padding: 14px 16px calc(24px + var(--safe-b)); }
.ledger .row .end.pos { color: var(--win); }
.ledger .row .end.neg { color: var(--loss); }
.rank-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 12px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.rank-row .pos { font-family: var(--num); font-weight: 800; font-size: 22px; color: var(--mute); }
.rank-row .meta { color: var(--mute); font-size: 12px; }
.rank-row .bal { font-family: var(--num); font-weight: 800; font-size: 22px; }

/* 规则 */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.cell { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 6px 10px; text-align: center; }
.cell .t { font-weight: 700; font-size: 15px; }
.cell .ex { font-family: var(--num); font-weight: 800; font-size: 28px; color: var(--gold); line-height: 1.1; margin: 5px 0 2px; }
.cell .h { color: var(--mute); font-size: 11px; min-height: 16px; }
.cell .m { margin-top: 8px; padding: 6px 0; border-radius: 10px; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 12px; }
.steps { display: flex; flex-direction: column; gap: 14px; margin: 12px 0 8px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.step .no { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.step h4 { margin: 2px 0 4px; font-size: 15px; }
.step p { margin: 0; color: var(--mute); font-size: 13px; }

/* ---------- 牌桌 / 聊天室 ---------- */
.table { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--ink); }
.t-top {
  display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.t-title { text-align: center; font-weight: 700; font-size: 17px; }
.t-online { font-size: 12px; color: var(--mute); font-weight: 400; }
.t-online i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--win); margin-right: 5px; }
.t-phase {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink-2); border-bottom: 1px solid var(--line);
}
.t-phase-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.t-phase-name { font-weight: 700; font-size: 15px; }
.t-clock { font-family: var(--num); font-weight: 800; font-size: 22px; color: var(--red); line-height: 1; min-width: 0; }
.t-phase.is-betting .t-clock { color: var(--gold); }
.t-phase-hint { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.t-phase-track { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.t-phase-fill { height: 100%; width: 0; background: var(--red); transition: width 0.25s linear; }
.t-phase.is-betting .t-phase-fill { background: var(--gold); }
.t-phase.is-revealing .t-phase-fill, .t-phase.is-settled .t-phase-fill { background: linear-gradient(90deg, var(--red), var(--gold)); }

.feed { flex: 1; overflow-y: auto; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.feed > * { flex-shrink: 0; }
.feed > .packets, .feed > .card, .feed > .result { margin-right: 60px; }
.feed.only-game .m-chat:not(.has-effect), .feed.only-game .m-join:not(.fair-line) { display: none; }
.msg { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: start; max-width: 100%; }
.msg .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; }
.msg .av.bot { background: radial-gradient(circle at 30% 30%, #ff7a6e, var(--red-deep)); color: #ffe7b0; font-size: 18px; }
.msg .name { font-size: 12px; color: var(--mute); margin-bottom: 4px; display: flex; gap: 6px; align-items: baseline; }
.msg .name time { font-size: 11px; opacity: 0.7; }
.bubble { display: inline-block; background: var(--bubble); border-radius: 4px 14px 14px 14px; padding: 8px 12px; max-width: 86%; word-break: break-word; }
.bubble .t { font-size: 15px; }
.bubble.num .t { font-family: var(--num); font-size: 24px; font-weight: 700; line-height: 1; }
.bubble time { font-size: 11px; color: var(--mute); margin-left: 10px; }
.effect { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.effect.bid { background: var(--gold-soft); color: var(--gold); }
.effect.bet, .effect.showhand { background: rgba(200, 53, 44, 0.2); color: #ff9d94; }
.effect.unbet { background: rgba(255, 255, 255, 0.08); color: var(--mute); }
.effect.rejected { background: rgba(224, 115, 106, 0.15); color: var(--loss); }
.m-join { text-align: center; color: var(--mute); font-size: 12px; }
.m-system .bubble { background: #1a150d; border: 1px solid rgba(233, 193, 90, 0.1); }
.m-system .bubble .t { font-size: 14px; }
.m-system .bubble .t b { color: var(--gold); }
.mine .bubble { background: #2a2214; }

.banner {
  position: relative; margin: 2px 0 2px 46px; padding: 12px 16px 12px 70px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(90deg, #1a1208, #0d0a05); border: 2px solid var(--gold-deep);
  box-shadow: 0 0 0 1px #3a2a10 inset, 0 8px 22px rgba(0, 0, 0, 0.45);
}
.banner::before { content: 'Boss\A Panda'; white-space: pre; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-family: var(--num); font-weight: 800; font-size: 15px; line-height: 0.95; color: var(--gold); text-align: center; }
.banner .t { font-size: 26px; font-weight: 800; letter-spacing: 0.08em; color: var(--gold); text-shadow: 0 2px 0 #4a3510; }
.banner.stop_bid .t, .banner.redo .t { color: var(--paper); }

.card { margin-left: 46px; background: var(--bubble); border-radius: 16px; padding: 12px 14px; max-width: 86%; }
.card h4 { font-size: 16px; color: var(--gold); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.card .r { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; font-size: 14px; }
.card .r span:first-child { color: var(--mute); flex: none; }
.card .r span:last-child { text-align: right; }
.card .r .gold { color: var(--gold); font-weight: 700; }
.card .r .tag { background: var(--gold-soft); color: var(--gold); padding: 1px 8px; border-radius: 6px; font-size: 13px; }

/* 红包开奖(签名元素) */
.packets { margin-left: 46px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.packet { perspective: 900px; }
.packet-body {
  position: relative; border-radius: 14px; overflow: hidden; min-height: 132px;
  background: linear-gradient(170deg, #d13f36 0%, var(--red-deep) 100%); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.packet-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 52%; z-index: 2; background: linear-gradient(180deg, #e0574c, #b52f27);
  border-radius: 0 0 50% 50% / 0 0 38% 38%; transform-origin: top center; transition: transform 0.7s cubic-bezier(0.6, 0, 0.3, 1);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
}
.packet-seal {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fbe4a0, var(--gold-deep) 70%); color: #6b1d16; font-weight: 700; font-size: 13px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.packet-owner {
  position: absolute; left: 10px; top: 8px; z-index: 3; font-size: 11px; color: rgba(255, 240, 220, 0.85); display: flex; align-items: center; gap: 5px;
  max-width: calc(100% - 20px); overflow: hidden; white-space: nowrap;
}
.packet-owner .tag { background: rgba(0, 0, 0, 0.25); padding: 1px 6px; border-radius: 6px; font-size: 10px; }
.packet-owner.is-banker .tag { background: var(--gold); color: #3a1a12; font-weight: 700; }
.packet-amount { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; z-index: 1; opacity: 0; transform: translateY(8px); transition: opacity 0.4s 0.5s, transform 0.4s 0.5s; }
.packet-amount .rm { font-family: var(--num); font-weight: 800; font-size: 34px; line-height: 1; color: #fff6dd; }
.packet-amount .rm small { font-size: 12px; font-family: var(--body); opacity: 0.7; margin-right: 3px; }
.packet-amount .hand { margin-top: 4px; font-size: 12px; color: #ffd98a; font-weight: 700; opacity: 0; transition: opacity 0.35s 1.1s; }
.packet-amount .formula { font-size: 10px; color: rgba(255, 240, 220, 0.6); opacity: 0; transition: opacity 0.35s 1.1s; }
.packet.is-open .packet-flap { transform: rotateX(-160deg); }
.packet.is-open .packet-amount { opacity: 1; transform: translateY(0); }
.packet.is-open .hand, .packet.is-open .formula { opacity: 1; }
.packet.is-banker .packet-body { outline: 2px solid var(--gold); outline-offset: 2px; }

.result { margin-left: 46px; background: var(--bubble); border-radius: 16px; padding: 12px 14px; }
.result h4 { font-size: 16px; color: var(--gold); margin-bottom: 8px; display: flex; justify-content: space-between; }
.result h4 small { color: var(--mute); font-weight: 400; font-size: 12px; }
.res { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.res .who { font-weight: 600; font-size: 14px; }
.res .who .tag { font-size: 10px; color: var(--ink); background: var(--gold); padding: 1px 6px; border-radius: 6px; margin-left: 6px; }
.res .what { color: var(--mute); font-size: 12px; }
.res .delta { grid-row: 1 / 3; font-family: var(--num); font-weight: 800; font-size: 24px; align-self: center; }
.res.is-win .delta { color: var(--win); }
.res.is-loss .delta { color: var(--loss); }
.res.is-me { background: rgba(233, 193, 90, 0.06); margin: 0 -8px; padding: 8px; border-radius: 8px; }

.t-side { position: absolute; right: 10px; top: 132px; display: flex; flex-direction: column; gap: 10px; z-index: 2; }
.side-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px; width: 52px; padding: 5px 2px; border-radius: 12px; font-size: 10px; font-weight: 700; color: var(--gold);
  background: rgba(11, 9, 6, 0.85); border: 1px solid var(--line); backdrop-filter: blur(6px);
}
.side-btn span { font-size: 18px; }
.side-btn.is-on { background: var(--gold); color: var(--ink); }

.t-chips { display: flex; gap: 8px; padding: 8px 12px 0; background: var(--ink-2); overflow-x: auto; }
.t-chips button { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--gold); font-family: var(--num); font-weight: 800; font-size: 17px; }
.t-chips button.sh { color: #ff9d94; border-color: rgba(200, 53, 44, 0.4); }
.t-input { background: var(--ink-2); border-top: 1px solid rgba(255, 255, 255, 0.06); padding: 8px 12px calc(10px + var(--safe-b)); }
.t-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); padding: 2px 4px 8px; }
.t-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.t-status .t-bal { margin-left: auto; font-family: var(--num); font-weight: 800; font-size: 17px; color: var(--gold); }
.t-form { display: flex; gap: 8px; align-items: center; }
.t-form input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; background: var(--card); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--paper); outline: none; font-size: 16px; }
.t-form input:focus { border-color: var(--line-strong); }
.t-form .send { background: var(--gold-soft); color: var(--gold); border-color: var(--line); }

/* ---------- toast / sheet ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%); z-index: 20;
  pointer-events: none; /* 只是一句话:点在它上面要落到底下的按钮(以前会吃掉压在下面的「收钱」) */
  background: #2a2216; color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 14px; border: 1px solid var(--line-strong); max-width: 88%; text-align: center;
}
/* 冲天鹰开着的时候,提示条挪到最上面那排(返回、标题、余额;点照样穿过去):原来的位置压在两个「收钱」按钮上(小屏手机能盖掉一半),
   放在舞台上又会盖住倍数和「收了」。宽度不再被 left:50% 卡成半个屏幕(一句话折成好几行) */
body:has(#eagle:not([hidden])) .toast { top: calc(var(--safe-t, 0px) + 8px); bottom: auto; width: max-content; }
/* 牛牛牌桌的快捷键(抢庄 / 加到 RM x / 下注…)里面点不到:按下、松手、click 都落在按钮本身。
   别人每抢一次庄按钮上的金额就换一次,PA 金币那层会把它换成新的 <span>+<img>,不能让手指落在会被换掉的东西上 */
#tQuick > *, #tQuick * { pointer-events: none; }
.sheet { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; }
/* 德州开着时从牌桌里开充值(余额不够):牌桌 iframe 是 z-index 80,弹窗和提示条要盖在它上面,关掉回到牌桌 */
.sheet-over-holdem .sheet { z-index: 90; }
.sheet-over-holdem .toast { z-index: 91; }
.sheet-card { width: 100%; background: var(--card); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); max-height: 80vh; overflow-y: auto; }
.sheet-card > .btn { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .packet-flap, .packet-amount, .packet-amount .hand, .packet-amount .formula, .t-phase-fill { transition: none; }
  .feed { scroll-behavior: auto; }
}

/* ---------- 详细规则(折叠) ---------- */
.rules-panel { padding: 4px 16px; }
.rule-sec { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.rule-sec:last-child { border-bottom: 0; }
.rule-sec summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 0; font-weight: 700; font-size: 16px; cursor: pointer; }
.rule-sec summary::-webkit-details-marker { display: none; }
.rule-sec summary::after { content: '⌄'; margin-left: auto; color: var(--mute); transition: transform 0.2s; }
.rule-sec[open] summary::after { transform: rotate(180deg); }
.rule-sec summary .ico { font-size: 20px; }
.rule-body { padding: 0 0 12px 30px; }
.rule { margin: 0 0 10px; color: var(--mute); font-size: 14px; line-height: 1.55; }
.rule b { color: var(--paper); }

/* ---------- 设置 / 开关 ---------- */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #2a2620; transition: background 0.2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + i { background: var(--gold); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--line-strong); }
html.big body { font-size: 17px; }
html.big .t-clock { font-size: 28px; }
html.big .packet-amount .rm { font-size: 42px; }
html.big .balance-card .amount .num { font-size: 60px; }

/* ---------- 排行榜 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; }
.tabs button { flex: 1; white-space: nowrap; padding: 10px 6px; color: var(--mute); font-size: 14px; border-bottom: 2px solid transparent; }
.tabs button.is-active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 700; }
.rank-me { color: var(--mute); font-size: 13px; padding: 6px 4px 10px; }
.rank-me b { color: var(--gold); font-weight: 600; margin: 0 4px; }
.rank-row .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--gold); font-weight: 700; }
.rank-row.four { grid-template-columns: 30px 34px 1fr auto; }
.rank-row .medal { width: 30px; height: 30px; font-size: 13px; }
.rank-row .bal small { font-family: var(--body); font-weight: 400; color: var(--mute); font-size: 12px; margin-left: 4px; }
.seg { display: inline-flex; gap: 8px; margin: 0 auto 14px; }
.seg button { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); color: var(--mute); font-size: 14px; }
.seg button.is-active { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.center { text-align: center; }

/* ---------- 总览卡 ---------- */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.summary > div { padding: 4px 0; border-right: 1px solid rgba(255, 255, 255, 0.06); }
.summary > div:last-child { border-right: 0; }
.summary small { display: block; color: var(--mute); font-size: 12px; }
.summary b { display: block; font-family: var(--num); font-weight: 800; font-size: 24px; margin: 2px 0; }
.summary b.pos { color: var(--win); }
.summary b.neg { color: var(--loss); }
.summary-note { color: var(--mute); font-size: 12px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.empty-state { text-align: center; padding: 34px 16px; }
.empty-state .mark { margin-bottom: 12px; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { color: var(--mute); font-size: 14px; margin: 0 0 16px; }
.empty-state .btn { width: auto; padding: 12px 28px; }
.inout { display: grid; grid-template-columns: 1fr 1fr; margin: 12px 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.inout small { display: block; color: var(--mute); font-size: 12px; }
.inout b { font-family: var(--num); font-size: 22px; font-weight: 800; }
.inout > div:last-child { border-left: 1px solid rgba(255, 255, 255, 0.06); padding-left: 14px; }

/* ---------- 推广 ---------- */
.invite-code { font-family: var(--num); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: 0.04em; color: var(--paper); display: flex; align-items: center; gap: 10px; }
.invite-code button { font-size: 16px; color: var(--mute); }
.dashed { border-top: 1px dashed var(--line-strong); margin: 14px 0; }
.lvls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.lvls > div { background: var(--card-2); border-radius: 12px; padding: 10px 6px; text-align: center; }
.lvls .p { color: var(--gold); font-weight: 700; font-size: 13px; }
.lvls .n { font-family: var(--num); font-weight: 800; font-size: 22px; }
.lvls small { color: var(--mute); font-size: 11px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; }
.kv span:first-child { color: var(--mute); font-size: 13px; }
.kv b { font-family: var(--num); font-size: 20px; font-weight: 800; }
.stepline { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; position: relative; margin-top: 4px; }
.stepline .no { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; margin: 0 auto 8px; font-weight: 700; font-size: 13px; background: var(--card); position: relative; z-index: 1; }
.stepline::before { content: ''; position: absolute; left: 16%; right: 16%; top: 14px; border-top: 1px dashed var(--line-strong); }
.stepline b { display: block; font-size: 14px; }
.stepline small { color: var(--mute); font-size: 12px; }
.lang-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); margin-bottom: 8px; font-size: 16px; text-align: left; }
.lang-list button.is-active { border-color: var(--gold); }
.lang-list button .flag { font-size: 22px; }
.lang-list button .chk { margin-left: auto; color: var(--gold); }

/* ---------- 公平哈希卡 ---------- */
.card.fair { border: 1px solid var(--line); }
.card.fair .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--gold); word-break: break-all; line-height: 1.4; }
.card.fair .r .mono { text-align: right; max-width: 70%; }
.card.fair .hint { margin-top: 6px; font-size: 12px; }
.card.fair .verify-out { margin-top: 8px; line-height: 1.6; }

/* ---------- 核验(只给绿勾) ---------- */
.fair-line { font-size: 12px; color: var(--mute); display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.fair-line .mono { font-family: ui-monospace, Menlo, monospace; opacity: 0.7; }
.fair-line .ok { color: var(--win); }
.fair-line .bad { color: var(--loss); }
.fair-line .link-btn { font-size: 12px; }
.packet-owner .stamp { margin-left: auto; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.packet-owner .stamp.ok { background: var(--win); color: #0b2a18; }
.packet-owner .stamp.bad { background: var(--loss); color: #fff; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; word-break: break-all; }

/* ---------- 对照卡 ---------- */
.cmp { background: var(--card-2); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; position: relative; }
.cmp-title { font-weight: 700; margin-bottom: 6px; }
.cmp-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; align-items: baseline; }
.cmp-row small { color: var(--mute); font-size: 12px; flex: none; max-width: 55%; }
.cmp-row .mono { color: var(--paper); font-size: 13px; text-align: right; }
.cmp-ok { position: absolute; right: 12px; top: 10px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.cmp-ok.ok { background: rgba(111, 207, 151, 0.15); color: var(--win); }
.cmp-ok.bad { background: rgba(224, 115, 106, 0.15); color: var(--loss); }

/* ---------- 图槽(把图放进 public/img/ 即生效,缺图时保持原样) ---------- */
.hero { background-size: cover; background-position: right center; background-repeat: no-repeat; }
.hero.has-art .packet-stack { display: none; }
.hero.has-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23, 19, 12, 0.96) 0%, rgba(23, 19, 12, 0.85) 45%, rgba(23, 19, 12, 0.15) 100%); pointer-events: none; }
.hero.has-art > * { position: relative; z-index: 1; }
.hero.has-art::after { z-index: 0; }
.art-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.mascot { width: 120px; height: 120px; object-fit: contain; margin: 0 auto 10px; display: block; }
.banner.has-art { padding: 0; border: 0; background: none; box-shadow: none; }
.banner.has-art::before { display: none; }
.banner.has-art img { display: block; width: 100%; border-radius: 12px; }
.banner.has-art .t { display: none; }
.av img, .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.room-card .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.room-card .art.has-art > div { display: none; }

/* ---------- 自己拆红包 ---------- */
.packet-cta { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; z-index: 1; font-size: 12px; color: rgba(255, 240, 220, 0.7); transition: opacity 0.3s; }
.packet.is-open .packet-cta { opacity: 0; }
.packet.can-open { cursor: pointer; }
.packet.can-open .packet-body { animation: shake 1.1s ease-in-out infinite; outline: 2px solid var(--gold); outline-offset: 2px; box-shadow: 0 0 24px rgba(233, 193, 90, 0.45), 0 10px 26px rgba(0, 0, 0, 0.35); }
.packet.can-open .packet-cta { color: var(--gold); font-weight: 700; font-size: 14px; }
.packet.can-open .packet-seal { animation: pulse 1.1s ease-in-out infinite; }
.packet.no-anim .packet-flap, .packet.no-anim .packet-amount, .packet.no-anim .hand, .packet.no-anim .formula { transition: none; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-2.5deg); } 40% { transform: rotate(2.5deg); } 60% { transform: rotate(-1.5deg); } 80% { transform: rotate(1.5deg); } }
@keyframes pulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .packet.can-open .packet-body, .packet.can-open .packet-seal { animation: none; } }

/* ---------- 群红包卡(微信式) ---------- */
.hb-wrap { margin-left: 46px; max-width: 78%; }
.hb { border-radius: 14px; overflow: hidden; cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); position: relative; }
.hb-top { display: flex; align-items: center; gap: 14px; padding: 18px 16px; background: linear-gradient(170deg, #c9463c, #8f2a22); color: #ffe7b0; }
.hb-icon { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-size: 34px; background: rgba(0, 0, 0, 0.12); }
.hb-title { font-size: 17px; font-weight: 700; }
.hb-foot { display: flex; justify-content: space-between; padding: 8px 14px; background: #e9dcc0; color: #7a5a1e; font-size: 12px; }
.hb.is-done .hb-top { background: linear-gradient(170deg, #7a3a35, #4a2320); color: rgba(255, 231, 176, 0.75); }
.hb.is-done .hb-foot { background: #c9bda6; }
.hb.is-live::before { content: ''; position: absolute; left: -4px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.hb.is-live .hb-top { animation: hbpulse 1.4s ease-in-out infinite; }
@keyframes hbpulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }

/* 红包详情 */
.hb-head { margin: -18px -16px 12px; padding: 26px 16px 22px; text-align: center; background: linear-gradient(170deg, #c9463c, #8f2a22); color: #ffe7b0; border-radius: 22px 22px 0 0; }
.hb-avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; font-size: 26px; font-weight: 700; background: #fff3d6; color: #8f2a22; overflow: hidden; }
.hb-from { font-size: 14px; opacity: 0.9; }
.hb-from b { color: #ffd98a; }
.hb-amount { font-family: var(--num); font-weight: 800; font-size: 44px; line-height: 1.1; margin-top: 10px; color: #fff6dd; }
.hb-amount small { font-family: var(--body); font-size: 13px; font-weight: 500; opacity: 0.8; margin-left: 4px; }
.hb-amount.muted { font-size: 22px; opacity: 0.8; font-family: var(--body); font-weight: 600; }
.hb-hand { font-size: 14px; color: #ffd98a; font-weight: 700; margin-top: 2px; }
.hb-meta { font-size: 13px; opacity: 0.85; margin-top: 8px; }
.hb-grab { margin: 12px auto 0; width: auto; padding: 12px 36px; }
.hb-sum { display: flex; justify-content: space-between; background: var(--card-2); border-radius: 12px; padding: 10px 14px; color: var(--mute); font-size: 13px; margin-bottom: 8px; }
.hb-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.hb-row .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.hb-row .body { flex: 1; min-width: 0; }
.hb-row .body b { display: block; font-weight: 600; }
.hb-row .body small { color: var(--mute); font-size: 12px; }
.hb-row .end { text-align: right; }
.hb-row .end b { display: block; font-family: var(--num); font-size: 20px; font-weight: 800; }
.hb-row .end small { color: var(--mute); font-size: 12px; }
.hb-row.is-banker { background: rgba(200, 53, 44, 0.12); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; margin: 0 -6px; padding-left: 9px; }
.hb-row.is-banker .av { outline: 2px solid var(--gold); outline-offset: 2px; }
.hb-row.is-banker .end small { color: var(--gold); font-weight: 700; }
.hb-row.is-pending { opacity: 0.5; }
.crown { font-size: 11px; background: var(--gold); color: var(--ink); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }

/* ---------- 自己的消息靠右,金色气泡 ---------- */
.msg.mine { grid-template-columns: 1fr 38px; }
.msg.mine .av { order: 2; }
.msg.mine > div:last-child { order: 1; text-align: right; }
.msg.mine .name { justify-content: flex-end; }
.msg.mine .bubble { background: linear-gradient(160deg, #e2bb5c, #b8902f); color: #1a1205; border-radius: 14px 4px 14px 14px; text-align: left; }
.msg.mine .bubble time { color: rgba(26, 18, 5, 0.6); }
.msg.mine .effect { margin-left: auto; }
.mention-tag { font-size: 11px; background: var(--gold); color: var(--ink); padding: 1px 7px; border-radius: 6px; font-weight: 700; }
.m-system.mentions-me .bubble { border-color: var(--line-strong); }
.m-system.mentions-me .bubble .t { color: var(--paper); }

/* ---------- 后台 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid2 .field { margin-bottom: 10px; }
.grid2 .field input { padding: 9px 10px; font-size: 14px; }
.notice-edit .field { margin-bottom: 8px; }

/* ---------- 新人红包活动说明(2026-11-04):「游戏」页 sheet 跟红包弹窗里那一层共用(弹窗那层另外换成深红底的颜色)---------- */
.nbr { --nbr-gold: var(--neon, #e5ff3d); --nbr-text: var(--paper, #fff); color: var(--nbr-text); text-align: left; }
.nbr-title { margin: 0 0 10px; color: var(--nbr-gold); font-size: 18px; font-weight: 900; line-height: 1.35; }
.nbr-full { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); font-size: 13px; font-weight: 800; line-height: 1.45; }
.nbr-list { margin: 0; padding: 0; list-style: none; counter-reset: nbr; display: grid; gap: 10px; }
.nbr-list li { counter-increment: nbr; position: relative; padding-left: 26px; font-size: 14px; line-height: 1.55; }
.nbr-list li::before {
  content: counter(nbr); position: absolute; left: 0; top: .15em;
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--nbr-gold); color: #0a0a0a; font-size: 11px; font-weight: 900; line-height: 1;
}
.nbr-list b { display: block; color: var(--nbr-gold); font-weight: 800; }
.nbr-list span { display: block; opacity: .92; }
.nbr-limit { margin: 12px 0 14px; font-size: 13px; font-weight: 700; line-height: 1.5; opacity: .75; }
.nbr:lang(th) .nbr-list li, .nbr:lang(my) .nbr-list li, .nbr:lang(bn) .nbr-list li { line-height: 1.7; }
