/* 星弈对战平台 · 轻奢电竞视觉体系 */
:root {
  --bg: #0b0f1d; --bg2: #111730; --panel: rgba(22, 29, 54, .82); --panel-solid: #161d36;
  --line: rgba(148, 163, 216, .16); --text: #e9ecf6; --text2: #9aa5c4; --text3: #6b7699;
  --gold: #d8b45a; --gold2: #f0d48a; --accent: #6c8cff; --accent2: #8b5cf6;
  --win: #3ecf8e; --lose: #f0616d; --warn: #f5a623;
  --grad: linear-gradient(135deg, #6c8cff 0%, #8b5cf6 100%);
  --grad-gold: linear-gradient(135deg, #d8b45a, #f0d48a);
  --shadow: 0 12px 40px rgba(0, 0, 0, .45); --radius: 16px;
  --wood1: #d9a866; --wood2: #c8955a; --woodline: #6b4a26;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
}
[data-theme="light"] {
  --bg: #f3f1ea; --bg2: #e9e6dc; --panel: rgba(255, 255, 255, .88); --panel-solid: #ffffff;
  --line: rgba(60, 60, 90, .12); --text: #23283d; --text2: #5d6580; --text3: #9098b0;
  --shadow: 0 12px 36px rgba(80, 80, 120, .14);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text); overflow-x: hidden;
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(108, 140, 255, .13), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(139, 92, 246, .10), transparent 60%);
  background-attachment: fixed;
  transition: background-color .4s, color .4s;
}
body.eye-care { filter: sepia(.14) saturate(.92); }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; backdrop-filter: blur(18px); background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff;
  box-shadow: 0 4px 16px rgba(108, 140, 255, .45); font-family: var(--serif); font-weight: 700;
}
.logo-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.logo-name em { font-style: normal; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .sp { flex: 1; }
.online-pill { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--win); box-shadow: 0 0 8px var(--win); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: transparent;
  color: var(--text2); font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: all .22s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(108, 140, 255, .25); }
.icon-btn:active { transform: scale(.93); }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; transition: all .22s; background: transparent; color: var(--text); }
.me-chip:hover { border-color: var(--gold); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-gold); color: #3a2c07; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; }

/* ---------- 布局与页面 ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 26px 20px 80px; animation: pageIn .45s cubic-bezier(.2, .8, .25, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero { text-align: center; padding: 34px 0 10px; }
.hero h1 { font-family: var(--serif); font-size: clamp(26px, 4.5vw, 42px); letter-spacing: 3px; }
.hero h1 em { font-style: normal; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text2); margin-top: 10px; font-size: 14px; }
.announce {
  margin: 20px auto 0; max-width: 760px; padding: 12px 18px; border-radius: 12px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text2);
  display: flex; gap: 10px; align-items: center;
}
.announce b { color: var(--gold); flex-shrink: 0; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 30px; }
.game-card {
  position: relative; border-radius: var(--radius); padding: 24px 22px; overflow: hidden; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); transition: all .3s cubic-bezier(.2, .8, .25, 1);
}
.game-card:hover { transform: translateY(-5px); border-color: rgba(216, 180, 90, .5); box-shadow: var(--shadow); }
.game-card:active { transform: scale(.98); }
.game-card .glyph { font-size: 40px; font-family: var(--serif); line-height: 1; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.game-card h3 { margin: 14px 0 6px; font-size: 18px; font-family: var(--serif); letter-spacing: 1px; }
.game-card p { font-size: 12.5px; color: var(--text2); line-height: 1.7; }
.game-card .tag { position: absolute; top: 16px; right: 16px; font-size: 11px; color: var(--text3); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }
.game-card.off { opacity: .45; pointer-events: none; }
.game-card .glow { position: absolute; inset: auto -30% -60% auto; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(108, 140, 255, .22), transparent 70%); pointer-events: none; }

.section-title { display: flex; align-items: center; gap: 12px; margin: 34px 0 16px; font-family: var(--serif); font-size: 19px; letter-spacing: 1px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 12px; padding: 11px 22px; font-size: 14px; font-weight: 600;
  background: var(--grad); color: #fff; transition: all .22s; position: relative; overflow: hidden;
  box-shadow: 0 4px 16px rgba(108, 140, 255, .3);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(108, 140, 255, .45); }
.btn:active { transform: scale(.96); }
.btn.gold { background: var(--grad-gold); color: #3a2c07; box-shadow: 0 4px 16px rgba(216, 180, 90, .3); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text2); box-shadow: none; }
.btn.ghost:hover { color: var(--text); border-color: var(--accent); }
.btn.danger { background: linear-gradient(135deg, #f0616d, #d43f5e); box-shadow: 0 4px 16px rgba(240, 97, 109, .3); }
.btn.sm { padding: 7px 14px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 大厅 ---------- */
.lobby-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lobby-head h2 { font-family: var(--serif); font-size: 26px; letter-spacing: 2px; }
.lobby-cols { display: grid; grid-template-columns: 340px 1fr; gap: 20px; margin-top: 22px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(12px); }
.panel h4 { font-size: 14px; color: var(--text2); margin-bottom: 14px; letter-spacing: 1px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text2); margin-bottom: 6px; }
.field select, .field input[type=text], .field input[type=number], .field input[type=password] {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font-size: 14px; outline: none; transition: border .2s;
}
.field select:focus, .field input:focus { border-color: var(--accent); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 56px; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--text2); font-size: 13px; transition: all .2s;
}
.seg button.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 3px 12px rgba(108, 140, 255, .35); }
.room-list { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.room-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg2); transition: all .22s; animation: pageIn .35s;
}
.room-item:hover { border-color: var(--accent); transform: translateX(3px); }
.room-item .ri-game { font-family: var(--serif); font-size: 15px; min-width: 76px; }
.room-item .ri-info { flex: 1; font-size: 12px; color: var(--text2); line-height: 1.6; }
.room-item .ri-ttl { font-size: 12px; color: var(--warn); font-variant-numeric: tabular-nums; }
.empty-tip { text-align: center; color: var(--text3); padding: 40px 0; font-size: 13px; }
.code-join { display: flex; gap: 8px; margin-top: 8px; }
.code-join input { flex: 1; letter-spacing: 6px; text-align: center; font-size: 18px; }

/* ---------- 对局页 ---------- */
.game-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.board-wrap {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 420px;
}
.player-bar { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; padding: 6px 4px; }
.player-bar .pb-name { font-size: 14px; font-weight: 600; }
.player-bar .pb-seat { font-size: 11px; color: var(--text3); }
.player-bar .pb-clock { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; color: var(--text2); padding: 4px 12px; border-radius: 8px; border: 1px solid var(--line); }
.player-bar.active .pb-clock { color: var(--gold); border-color: rgba(216, 180, 90, .5); box-shadow: 0 0 12px rgba(216, 180, 90, .18); }
.player-bar .pb-off { font-size: 11px; color: var(--lose); }
.turn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text3); }
.player-bar.active .turn-dot { background: var(--win); box-shadow: 0 0 8px var(--win); animation: pulse 1.6s infinite; }

.board-area { position: relative; touch-action: none; user-select: none; }
.board-area canvas { display: block; border-radius: 10px; }
.piece {
  position: absolute; display: flex; align-items: center; justify-content: center;
  transition: left .28s cubic-bezier(.25, .9, .3, 1.1), top .28s cubic-bezier(.25, .9, .3, 1.1), transform .18s, opacity .3s;
  cursor: pointer; z-index: 3; will-change: left, top;
}
.piece.new { animation: dropIn .34s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes dropIn { from { transform: scale(1.35) translateY(-10px); opacity: .3; } to { transform: none; opacity: 1; } }
.piece.captured { animation: capOut .38s forwards; pointer-events: none; }
@keyframes capOut { to { transform: scale(.2) rotate(20deg); opacity: 0; } }
.piece.sel { z-index: 6; filter: brightness(1.18); }
.piece.sel::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid var(--gold); box-shadow: 0 0 14px rgba(216, 180, 90, .6); animation: pulse 1.2s infinite; }
.xq-piece {
  border-radius: 50%; font-family: var(--serif); font-weight: 700;
  background: radial-gradient(circle at 32% 28%, #f7e3bd, #e2bc82 55%, #c69a5e);
  border: 2px solid #8a6437; box-shadow: 0 4px 10px rgba(0, 0, 0, .4), inset 0 2px 4px rgba(255, 255, 255, .5), inset 0 -3px 6px rgba(120, 80, 30, .35);
  color: #b02c2c; text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
}
.xq-piece.black { color: #1d2430; }
.ch-piece { font-size: inherit; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.ch-piece.white { color: #f5f0e6; text-shadow: 0 0 2px #000, 0 2px 3px rgba(0, 0, 0, .6); }
.ch-piece.black { color: #23283a; text-shadow: 0 0 2px rgba(255, 255, 255, .35), 0 2px 3px rgba(0, 0, 0, .5); }
.stone { border-radius: 50%; box-shadow: 0 3px 7px rgba(0, 0, 0, .5); }
.stone.b { background: radial-gradient(circle at 33% 28%, #5a6272, #14161d 65%); }
.stone.w { background: radial-gradient(circle at 33% 28%, #ffffff, #cfd3dd 70%); }
.stone.dead { opacity: .35; }
.stone.last::before { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: var(--lose); opacity: .9; }
.jq-piece {
  border-radius: 7px; font-size: 12px; font-weight: 700; font-family: var(--serif);
  background: linear-gradient(160deg, #3a4468, #232b47); border: 1.5px solid #5a6890;
  color: #dfe5f5; box-shadow: 0 3px 8px rgba(0, 0, 0, .45), inset 0 1px 2px rgba(255, 255, 255, .18);
}
.jq-piece.red { background: linear-gradient(160deg, #7a3040, #4d1f2c); border-color: #a05565; color: #ffdfe4; }
.jq-piece.unknown { color: #8b94b5; letter-spacing: 1px; }
.move-hint { position: absolute; border-radius: 50%; background: rgba(108, 140, 255, .4); box-shadow: 0 0 10px rgba(108, 140, 255, .5); z-index: 2; pointer-events: none; animation: pulse 1.4s infinite; }
.move-hint.cap { background: rgba(240, 97, 109, .45); box-shadow: 0 0 10px rgba(240, 97, 109, .55); border-radius: 8px; }
.last-from, .last-to { position: absolute; border: 2px solid rgba(216, 180, 90, .75); border-radius: 8px; z-index: 1; pointer-events: none; }

/* 侧栏 */
.side-col { display: flex; flex-direction: column; gap: 14px; }
.room-meta { font-size: 12.5px; color: var(--text2); line-height: 2; }
.room-meta b { color: var(--text); }
.code-big { font-size: 30px; letter-spacing: 10px; font-weight: 800; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; text-align: center; padding: 4px 0; font-variant-numeric: tabular-nums; }
.ttl-bar { height: 6px; border-radius: 3px; background: var(--bg2); overflow: hidden; margin-top: 8px; }
.ttl-bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; transition: width 1s linear; }
.ttl-bar.urgent i { background: linear-gradient(90deg, #f0616d, #f5a623); animation: pulse .8s infinite; }
.chat-box { display: flex; flex-direction: column; height: 260px; }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 4px 2px; font-size: 12.5px; }
.chat-msgs .cm { line-height: 1.5; animation: pageIn .25s; }
.chat-msgs .cm b { color: var(--gold); margin-right: 6px; font-weight: 600; }
.chat-msgs .cm.sys { color: var(--text3); font-style: italic; }
.chat-input { display: flex; gap: 6px; margin-top: 8px; }
.chat-input input { flex: 1; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 13px; outline: none; }
.quick-phrases { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.quick-phrases button { font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text2); transition: all .2s; }
.quick-phrases button:hover { color: var(--gold); border-color: var(--gold); }

/* 倒计时/提示横幅 */
.toast-wrap { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 11px 22px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 13.5px; animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2);
  max-width: 86vw;
}
.toast.err { border-color: rgba(240, 97, 109, .6); color: var(--lose); }
.toast.ok { border-color: rgba(62, 207, 142, .5); color: var(--win); }
.toast.warn { border-color: rgba(245, 166, 35, .55); color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.92); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.check-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20;
  padding: 8px 26px; border-radius: 999px; font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: 4px;
  background: linear-gradient(135deg, rgba(240, 97, 109, .92), rgba(212, 63, 94, .92)); color: #fff;
  box-shadow: 0 6px 24px rgba(240, 97, 109, .5); animation: checkIn .5s cubic-bezier(.2, .9, .3, 1.3); pointer-events: none;
}
@keyframes checkIn { from { opacity: 0; transform: translateX(-50%) scale(.5); } to { opacity: 1; transform: translateX(-50%) scale(1); } }

/* 结算遮罩 */
.result-overlay {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 9, 20, .72); backdrop-filter: blur(8px); animation: fadeIn .45s;
}
@keyframes fadeIn { from { opacity: 0; } }
.result-card {
  width: min(440px, 92vw); border-radius: 22px; padding: 38px 30px 30px; text-align: center;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: resultIn .55s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes resultIn { from { opacity: 0; transform: scale(.7) translateY(30px); } to { opacity: 1; transform: none; } }
.result-title { font-family: var(--serif); font-size: 44px; font-weight: 800; letter-spacing: 8px; }
.result-title.win { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; animation: winGlow 1.6s infinite alternate; }
@keyframes winGlow { from { filter: drop-shadow(0 0 4px rgba(216, 180, 90, .3)); } to { filter: drop-shadow(0 0 18px rgba(216, 180, 90, .75)); } }
.result-title.lose { color: var(--lose); }
.result-title.draw { color: var(--text2); }
.result-reason { color: var(--text2); margin: 12px 0 4px; font-size: 14px; }
.result-stats { display: flex; justify-content: center; gap: 26px; margin: 18px 0; font-size: 13px; color: var(--text2); }
.result-stats b { display: block; font-size: 20px; color: var(--text); margin-bottom: 2px; }
.confetti { position: fixed; top: -12px; z-index: 160; width: 9px; height: 14px; pointer-events: none; animation: confFall linear forwards; }
@keyframes confFall { to { transform: translateY(105vh) rotate(720deg); opacity: .2; } }

/* ---------- 斗地主 ---------- */
.ddz-table { position: relative; width: 100%; max-width: 720px; min-height: 430px; border-radius: 18px; background: radial-gradient(ellipse at 50% 40%, #1d4d3a, #123528 70%, #0d2a1f); border: 6px solid #3a2c1a; box-shadow: inset 0 0 60px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .4); overflow: hidden; }
.ddz-seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: #cfe3d8; }
.ddz-seat .ds-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #d8b45a, #a8823a); color: #2c2007; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 17px; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.ddz-seat.turn .ds-avatar { box-shadow: 0 0 0 3px rgba(216, 180, 90, .8), 0 0 18px rgba(216, 180, 90, .6); animation: pulse 1.5s infinite; }
.ddz-seat .ds-cnt { font-size: 11px; opacity: .8; }
.ddz-seat .ds-lord { font-size: 10px; background: var(--grad-gold); color: #3a2c07; padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.ddz-played { position: absolute; display: flex; gap: 3px; flex-wrap: wrap; max-width: 240px; justify-content: center; }
.ddz-played .pass-tag { font-size: 13px; color: #9fb8ab; background: rgba(0, 0, 0, .3); padding: 5px 14px; border-radius: 999px; }
.card {
  width: 52px; height: 74px; border-radius: 7px; background: linear-gradient(160deg, #ffffff, #eceaf0);
  border: 1px solid #b9b6c4; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); position: relative;
  display: inline-flex; flex-direction: column; padding: 4px 5px; cursor: pointer; transition: transform .18s, box-shadow .18s;
  font-weight: 800; flex-shrink: 0;
}
.card .cr { font-size: 17px; line-height: 1; }
.card .cs { font-size: 14px; line-height: 1.1; }
.card.red { color: #c8323e; } .card.black { color: #23283a; }
.card.joker { background: linear-gradient(160deg, #fff7e0, #f4e3b8); }
.card.small { width: 38px; height: 54px; } .card.small .cr { font-size: 13px; } .card.small .cs { font-size: 11px; }
.card.back { background: linear-gradient(160deg, #4a5a94, #2e3a66); border-color: #6a7ac0; }
.card.back::after { content: "弈"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .5); font-family: var(--serif); font-size: 18px; }
.ddz-hand { display: flex; justify-content: center; padding: 12px 6px 4px; min-height: 96px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.ddz-hand .card { margin-left: -20px; }
.ddz-hand .card:first-child { margin-left: 0; }
.ddz-hand .card:hover { transform: translateY(-8px); }
.ddz-hand .card.picked { transform: translateY(-16px); box-shadow: 0 8px 18px rgba(216, 180, 90, .5); border-color: var(--gold); }
.ddz-hand .card.played-out { animation: cardFly .4s forwards; }
@keyframes cardFly { to { transform: translateY(-90px) scale(.6); opacity: 0; } }
.ddz-bottom-cards { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.ddz-info { position: absolute; top: 12px; right: 14px; font-size: 12px; color: #cfe3d8; text-align: right; line-height: 1.8; }
.ddz-bid { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.bomb-fx { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; z-index: 30; pointer-events: none; animation: bombFx 1s forwards; }
@keyframes bombFx { 0% { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.4); opacity: 1; } 70% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- 个人中心/复盘 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 18px 0; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-align: center; }
.stat-card b { font-size: 26px; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card span { display: block; font-size: 12px; color: var(--text2); margin-top: 4px; }
.record-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); margin-bottom: 8px; font-size: 13px; background: var(--bg2); }
.record-item .rr { margin-left: auto; font-weight: 700; }
.record-item .rr.win { color: var(--win); } .record-item .rr.lose { color: var(--lose); } .record-item .rr.draw { color: var(--text2); }
.replay-ctrl { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 12px; }
.replay-ctrl input[type=range] { width: 220px; accent-color: var(--gold); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; z-index: 180; background: rgba(6, 9, 20, .6); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; animation: fadeIn .25s; }
.modal { width: min(430px, 92vw); max-height: 84vh; overflow-y: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; padding: 24px; animation: resultIn .35s cubic-bezier(.2, .9, .3, 1.15); }
.modal h3 { font-family: var(--serif); margin-bottom: 16px; letter-spacing: 1px; }
.modal .btn-row { margin-top: 18px; justify-content: flex-end; }

/* ---------- 加载 ---------- */
.boot { position: fixed; inset: 0; z-index: 999; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; transition: opacity .5s; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot-mark { width: 74px; height: 74px; border-radius: 22px; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 38px; color: #fff; font-family: var(--serif); animation: bootSpin 1.8s cubic-bezier(.6, .05, .3, .95) infinite; box-shadow: 0 10px 40px rgba(108, 140, 255, .5); }
@keyframes bootSpin { 0% { transform: rotateY(0); } 50% { transform: rotateY(180deg) scale(1.08); } 100% { transform: rotateY(360deg); } }
.boot p { color: var(--text2); font-size: 13px; letter-spacing: 3px; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .lobby-cols { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; }
  .side-col { flex-direction: row; flex-wrap: wrap; }
  .side-col .panel { flex: 1 1 280px; }
  .chat-box { height: 200px; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .logo-name { font-size: 16px; }
  .online-pill span.txt { display: none; }
  .page { padding: 16px 12px 70px; }
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-card { padding: 16px 14px; }
  .game-card .glyph { font-size: 30px; }
  .game-card p { display: none; }
  .board-wrap { padding: 10px; }
  .card { width: 42px; height: 60px; } .card .cr { font-size: 14px; }
  .ddz-hand .card { margin-left: -16px; }
  .result-title { font-size: 34px; }
  .hero { padding: 18px 0 4px; }
}
