/* ================= 144 · 皇上娘娘 ================= */

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

:root {
  --card-w: 70px;
  --card-h: calc(var(--card-w) * 1.42);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --r-lg: 26px;
  --r-md: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --bg-0: #04100b;
  --bg-1: #0a2b21;
  --bg-2: #061a14;
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .085);
  --stroke: rgba(255, 255, 255, .13);
  --stroke-soft: rgba(255, 255, 255, .07);
  --text: #edf4f0;
  --muted: rgba(237, 244, 240, .54);
  --gold: #e9c47c;
  --gold-2: rgba(233, 196, 124, .15);
  --danger: #e5545a;
  --card-face: linear-gradient(163deg, #fffefb 0%, #f4f1e9 100%);
  --ink: #1b1b20;
  --ink-red: #c8353c;
  --shadow-lg: 0 30px 70px -18px rgba(0, 0, 0, .7);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 22px -10px rgba(0, 0, 0, .55);
  --felt-a: rgba(255, 255, 255, .05);
}

html[data-theme="light"] {
  --bg-0: #dfe6dc;
  --bg-1: #c6d8ca;
  --bg-2: #eaefe6;
  --glass: rgba(255, 255, 255, .74);
  --glass-2: rgba(255, 255, 255, .9);
  --stroke: rgba(20, 45, 35, .1);
  --stroke-soft: rgba(20, 45, 35, .06);
  --text: #12211b;
  --muted: rgba(18, 33, 27, .52);
  --gold: #a8762a;
  --gold-2: rgba(168, 118, 42, .12);
  --danger: #c9303a;
  --card-face: linear-gradient(163deg, #ffffff 0%, #fbfaf6 100%);
  --ink: #16161a;
  --ink-red: #c0262d;
  --shadow-lg: 0 30px 60px -20px rgba(20, 45, 35, .28);
  --shadow-card: 0 1px 2px rgba(20, 45, 35, .12), 0 8px 18px -10px rgba(20, 45, 35, .3);
  --felt-a: rgba(255, 255, 255, .5);
}

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .5s var(--ease), color .4s var(--ease);
}

/* 背景光晕 */
.bg-fx { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-fx span {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5;
  animation: float 18s ease-in-out infinite;
}
.bg-fx span:nth-child(1) { width: 46vw; height: 46vw; left: -10vw; top: -12vw; background: radial-gradient(circle, rgba(46, 140, 108, .55), transparent 68%); }
.bg-fx span:nth-child(2) { width: 40vw; height: 40vw; right: -8vw; bottom: -10vw; background: radial-gradient(circle, rgba(196, 158, 88, .3), transparent 70%); animation-delay: -6s; }
.bg-fx span:nth-child(3) { width: 34vw; height: 34vw; right: 22vw; top: -14vw; background: radial-gradient(circle, rgba(70, 120, 170, .28), transparent 70%); animation-delay: -12s; }
html[data-theme="light"] .bg-fx span { opacity: .75; filter: blur(90px); }
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2vw, 3vw, 0) scale(1.08); }
}

.screen {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  transform: scale(.985);
}
.screen:not(.hidden) { opacity: 1; pointer-events: auto; transform: none; }
.hidden { display: none !important; }

/* ---------- 玻璃 ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .1);
}

/* ---------- 按钮 ---------- */
.btn {
  font: 600 15px/1 var(--font);
  color: var(--text);
  background: var(--glass-2);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 13px 20px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .2s var(--ease-out), background .2s, box-shadow .25s, opacity .2s;
  letter-spacing: .02em;
}
.btn:hover { background: rgba(255, 255, 255, .14); }
html[data-theme="light"] .btn:hover { background: rgba(255, 255, 255, .95); }
.btn:active { transform: scale(.965); }
.btn:disabled { opacity: .32; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, #f0d194, var(--gold));
  color: #23180a; border-color: transparent;
  box-shadow: 0 8px 24px -8px rgba(233, 196, 124, .6), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn svg { width: 17px; height: 17px; fill: currentColor; flex: 0 0 auto; }
.btn.lg { padding: 16px 24px; font-size: 16px; border-radius: 16px; width: 100%; }
.btn.ghost { background: var(--glass); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--stroke);
  color: var(--text); cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(20px);
  transition: background .2s, transform .2s var(--ease-out);
}
.icon-btn:hover { background: var(--glass-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .ic-sun { display: none; }
html[data-theme="light"] .ic-moon { display: none; }

.link-btn {
  background: none; border: 0; color: var(--muted);
  font: 500 13px/1 var(--font); cursor: pointer; padding: 6px;
  transition: color .2s;
}
.link-btn:hover { color: var(--gold); }

/* ================= 大厅 ================= */
#lobby { align-items: center; justify-content: center; padding: 24px; }

.lobby-card {
  width: min(440px, 100%);
  border-radius: var(--r-lg);
  padding: 32px 28px 22px;
  display: flex; flex-direction: column; gap: 18px;
  animation: rise .6s var(--ease-out) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.brand { display: flex; align-items: center; gap: 16px; }
.brand-mark {
  width: 62px; height: 62px; flex: 0 0 auto;
  border-radius: 18px;
  display: grid; place-items: center;
  font: 800 20px/1 var(--font); letter-spacing: -.02em;
  color: #241906;
  background: linear-gradient(150deg, #f6dda6, #cfa85c 70%);
  box-shadow: 0 10px 26px -10px rgba(233, 196, 124, .7), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.brand-text h1 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.brand-text p { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.field input, .join-row input {
  width: 100%;
  background: rgba(0, 0, 0, .16);
  border: 1px solid var(--stroke);
  border-radius: 13px;
  padding: 13px 15px;
  color: var(--text);
  font: 500 15px var(--font);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
html[data-theme="light"] .field input, html[data-theme="light"] .join-row input { background: rgba(255, 255, 255, .75); }
.field input:focus, .join-row input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-2);
}

.avatar-pick { display: flex; gap: 10px; }
.av {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  font-size: 17px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s;
}
.av:hover { transform: translateY(-2px); }
.av.on { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-2); transform: translateY(-2px); }

.lobby-actions { display: flex; flex-direction: column; gap: 10px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; animation: rise .3s var(--ease-out); }
.join-row input { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; }

/* ================= 等待房 ================= */
#waiting { align-items: center; justify-content: center; padding: 24px; }
.wait-card { width: min(400px, 100%); border-radius: var(--r-lg); padding: 34px 28px 24px; text-align: center; animation: rise .5s var(--ease-out) both; }
.eyebrow { font-size: 12px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.code-show {
  font: 800 46px/1.2 var(--font); letter-spacing: .16em;
  color: var(--gold); margin: 10px 0 4px;
  text-shadow: 0 8px 30px rgba(233, 196, 124, .3);
}
.wait-seats { display: flex; justify-content: center; gap: 18px; margin: 28px 0 14px; }
.wait-seat { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 74px; }
.wait-seat .av { width: 52px; height: 52px; font-size: 20px; }
.wait-seat.empty .av { border-style: dashed; color: var(--muted); }
.wait-seat span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wait-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ================= 牌桌 ================= */
#table {
  background:
    radial-gradient(ellipse 70% 55% at 50% 44%, var(--bg-1), transparent 74%),
    linear-gradient(180deg, var(--bg-2), var(--bg-0));
}
html[data-theme="light"] #table {
  background:
    radial-gradient(ellipse 70% 55% at 50% 44%, #d3e2d5, transparent 74%),
    linear-gradient(180deg, #eef2e9, #dbe4da);
}

.hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 6px;
  z-index: 6;
}
.hud-mid { display: flex; gap: 8px; }
.pill {
  font: 600 11.5px/1 var(--font); color: var(--muted);
  padding: 7px 12px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--stroke-soft);
  backdrop-filter: blur(18px);
  letter-spacing: .04em;
}

.felt {
  position: relative; flex: 1; min-height: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .035) 1px, transparent 1.2px);
  background-size: 20px 20px;
}
html[data-theme="light"] .felt {
  background-image: radial-gradient(circle, rgba(60, 90, 70, .07) 1px, transparent 1.2px);
}

/* 座位 */
.seat { position: absolute; z-index: 3; }
.seat-left { left: clamp(20px, 6.5vw, 118px); top: 22%; }
.seat-right { right: clamp(20px, 6.5vw, 118px); top: 22%; }

.seat-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 16px 11px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--stroke-soft);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .8);
  min-width: 96px;
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease), background .35s;
}
.seat.active .seat-card {
  border-color: rgba(233, 196, 124, .5);
  background: var(--glass-2);
  box-shadow: 0 0 0 1px var(--gold-2), 0 16px 40px -22px rgba(233, 196, 124, .9);
}

.seat .ava {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font: 700 18px/1 var(--font);
  border: 1px solid rgba(255, 255, 255, .18);
  transition: box-shadow .4s var(--ease), transform .4s var(--ease);
}
.seat.active .ava {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--gold-2), 0 0 26px rgba(233, 196, 124, .5);
}
.seat.active .ava::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 1.5px solid var(--gold); opacity: .55;
  animation: ring 1.8s var(--ease) infinite;
}
@keyframes ring { 0% { transform: scale(.9); opacity: .6; } 70% { transform: scale(1.25); opacity: 0; } 100% { opacity: 0; } }

.seat .nm { font-size: 12.5px; font-weight: 600; max-width: 92px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .cnt {
  font: 600 10.5px/1 var(--font); color: var(--muted);
  padding: 4px 9px; border-radius: 99px;
  background: rgba(0, 0, 0, .14);
}
html[data-theme="light"] .seat .cnt { background: rgba(255, 255, 255, .7); }
.seat .backs { display: flex; margin-bottom: -2px; }
.seat .backs .card.back { width: 22px; height: 31px; margin-left: -15px; border-radius: 4px; border-width: 2px; }
.seat .backs .card.back:first-child { margin-left: 0; }
.seat.done .seat-card { opacity: .55; }

.otag {
  position: absolute; right: -8px; bottom: -6px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font: 800 12px/1 var(--font);
  background: linear-gradient(180deg, #f5dca6, #c9a154); color: #2a1d08;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .5), 0 0 0 2px rgba(10, 30, 22, .55);
}
.otag.queen { background: linear-gradient(180deg, #dbe1e9, #9aa6b5); color: #1b1f26; }

.title-badge {
  font: 700 10px/1 var(--font); padding: 4px 8px; border-radius: 6px;
  background: linear-gradient(180deg, #f3d79d, #c9a154); color: #2a1d08;
  letter-spacing: .06em;
  box-shadow: 0 4px 12px -4px rgba(233, 196, 124, .6);
}
.title-badge.queen { background: linear-gradient(180deg, #d9dee6, #a3adba); color: #1b1f26; box-shadow: none; }

/* 气泡 */
.bubble {
  position: absolute; left: 50%; top: calc(100% + 8px);
  transform: translate(-50%, -4px) scale(.86);
  opacity: 0; pointer-events: none;
  font: 600 12px/1 var(--font); padding: 7px 12px; border-radius: 12px;
  background: var(--glass-2); border: 1px solid var(--stroke);
  backdrop-filter: blur(18px); white-space: nowrap;
  transition: all .35s var(--ease-out);
  z-index: 4;
}
.bubble.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* 中央出牌区 */
.pot { position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); z-index: 2; }
.pot-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 120px; min-height: 90px; justify-content: center; }
.pot-cards { display: flex; justify-content: center; }
.pot-cards .card { --card-w: 70px; margin-left: -24px; animation: pop .34s var(--ease-out) both; }
.pot-cards .card:first-child { margin-left: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.86); } }
.pot-tag {
  font: 600 11.5px/1 var(--font); color: var(--muted);
  padding: 6px 12px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--stroke-soft);
  backdrop-filter: blur(16px);
  opacity: 0; transition: opacity .3s;
}
.pot-tag.show { opacity: 1; }

/* 桌面水印：中央毡垫 */
.felt::before {
  content: ''; position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%);
  width: min(46vh, 460px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012) 62%, transparent 72%);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .22), 0 0 0 1px var(--stroke-soft);
  pointer-events: none;
}
.felt::after {
  content: ''; position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%);
  width: min(34vh, 340px); aspect-ratio: 1; border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .06);
  pointer-events: none;
}
html[data-theme="light"] .felt::before {
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .5), rgba(255, 255, 255, .16) 62%, transparent 72%);
  box-shadow: inset 0 0 70px rgba(60, 90, 70, .1), 0 0 0 1px rgba(60, 90, 70, .07);
}
html[data-theme="light"] .felt::after { border-color: rgba(60, 90, 70, .1); }

/* 进贡横幅 */
.tribute-banner {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 99px;
  background: var(--gold-2); border: 1px solid rgba(233, 196, 124, .4);
  color: var(--gold); font: 600 12.5px/1.3 var(--font);
  backdrop-filter: blur(18px);
  animation: slideDown .5s var(--ease-out) both;
  max-width: 90vw; text-align: center;
  z-index: 5;
}
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -14px); } }

/* toast */
.toast-wrap { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 20; pointer-events: none; }
.toast {
  padding: 10px 16px; border-radius: 12px;
  background: rgba(0, 0, 0, .6); color: #fff;
  font: 500 13px/1.3 var(--font);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .12);
  animation: toastIn .35s var(--ease-out) both;
}
.toast.out { animation: toastOut .3s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px) scale(.96); } }

/* ---------- 手牌区 ---------- */
.me-zone::before {
  content: ''; position: absolute; left: 0; right: 0; top: -58px; height: 58px;
  background: linear-gradient(to top, var(--bg-0), transparent);
  pointer-events: none;
  opacity: .85;
}
.me-zone {
  position: relative; z-index: 4;
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 14px);
  display: flex; flex-direction: column; gap: 10px;
}
.me-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.me-id { display: flex; align-items: center; gap: 8px; }
.me-name { font-size: 13px; font-weight: 600; }
.turn-hint { font: 600 12px/1 var(--font); color: var(--gold); opacity: 0; transition: opacity .3s; letter-spacing: .04em; }
.turn-hint.show { opacity: 1; }
.me-hand-count { font: 500 11.5px/1 var(--font); color: var(--muted); }

.hand-wrap { position: relative; }
.hand {
  display: flex; justify-content: center; align-items: flex-end;
  padding-top: 26px; min-height: calc(var(--card-h) + 26px);
  max-width: min(100%, 920px); margin: 0 auto; box-sizing: border-box;
  transition: opacity .3s;
}
.hand .card { margin-left: var(--overlap, -26px); cursor: pointer; }
.hand .card:first-child { margin-left: 0; }
.hand .card:hover { transform: translateY(-12px); z-index: 3; }
.hand .card.sel { transform: translateY(-22px); z-index: 4; }
.hand .card.sel::after {
  content: ''; position: absolute; inset: -3px; border-radius: inherit;
  border: 2px solid var(--gold); box-shadow: 0 0 18px rgba(233, 196, 124, .5);
  pointer-events: none;
}
.hand .card.dealt { animation: dealIn .4s var(--ease-out) both; }
@keyframes dealIn { from { opacity: 0; transform: translateY(28px) rotate(4deg); } }

.actions { display: flex; gap: 10px; justify-content: center; }
.actions .btn { flex: 1; max-width: 210px; padding: 14px 0; }

/* ---------- 扑克牌 ---------- */
.card > * { pointer-events: none; }

.card {
  position: relative; flex: 0 0 auto;
  width: var(--card-w); height: var(--card-h);
  border-radius: calc(var(--card-w) * .115);
  background: var(--card-face);
  box-shadow: var(--shadow-card), inset 0 0 0 .5px rgba(0, 0, 0, .1);
  color: var(--ink);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), opacity .3s;
  will-change: transform;
  user-select: none;
}
.card .cnr {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  font: 700 calc(var(--card-w) * .27)/1 var(--font);
  letter-spacing: -.03em;
}
.card .cnr.tl { top: 6%; left: 9%; }
.card .cnr.br { bottom: 6%; right: 9%; transform: rotate(180deg); }
.card .cnr .su { font-size: calc(var(--card-w) * .22); margin-top: 1px; }
.card .pip {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: calc(var(--card-w) * .52); opacity: .95;
}
.card.red { color: var(--ink-red); }
.card.joker .pip { writing-mode: vertical-rl; font-size: calc(var(--card-w) * .27); font-weight: 800; letter-spacing: .14em; }
.card.joker .cnr { font-size: calc(var(--card-w) * .25); }

.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .07) 0 4px, transparent 4px 8px),
    linear-gradient(160deg, #1f6a51, #144834);
  border: 3px solid #f5f2e8;
  box-shadow: var(--shadow-card);
}

/* ================= 结算 ================= */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(10px);
  animation: fadeIn .3s var(--ease) both;
  padding: 20px;
}
html[data-theme="light"] .overlay { background: rgba(30, 45, 38, .28); }
@keyframes fadeIn { from { opacity: 0; } }

.result-card {
  width: min(400px, 100%); border-radius: var(--r-lg); padding: 34px 28px 24px;
  text-align: center; animation: rise .5s var(--ease-out) both;
  isolation: isolate;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(180deg, #172a22, #0e1d17);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .09);
}
html[data-theme="light"] .result-card {
  background: linear-gradient(180deg, #ffffff, #f7f8f4);
  box-shadow: var(--shadow-lg), inset 0 1px 0 #fff;
}
.rank-row { position: relative; z-index: 1; }
.result-crown { display: grid; place-items: center; margin-bottom: 8px; }
.result-crown svg { width: 46px; height: 46px; fill: var(--gold); filter: drop-shadow(0 6px 18px rgba(233, 196, 124, .5)); animation: crownIn .6s var(--ease-out) both; }
@keyframes crownIn { from { opacity: 0; transform: translateY(-12px) scale(.8) rotate(-8deg); } }
.result-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

.ranks { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--stroke-soft);
  animation: rise .45s var(--ease-out) both;
}
.rank-row:nth-child(1) { animation-delay: .06s; }
.rank-row:nth-child(2) { animation-delay: .12s; }
.rank-row:nth-child(3) { animation-delay: .18s; }
.rank-row .rk { font: 800 13px/1 var(--font); color: var(--muted); width: 34px; text-align: left; }
.rank-row .who { flex: 1; text-align: left; font-size: 14px; font-weight: 600; }
.rank-row .tag { font-size: 11px; padding: 4px 9px; border-radius: 7px; background: var(--gold-2); color: var(--gold); font-weight: 700; }
.rank-row.boss { border-color: rgba(233, 196, 124, .42); box-shadow: 0 0 0 1px var(--gold-2), 0 8px 22px -14px rgba(233, 196, 124, .8); }
.rank-row.queen .tag { background: rgba(160, 170, 185, .16); color: #9aa6b8; }
html[data-theme="light"] .rank-row.queen .tag { color: #5c6878; background: rgba(120, 130, 145, .14); }

.result-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.result-actions { display: flex; gap: 10px; }
.result-actions .btn { flex: 1; }
.result-wait { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ================= 规则 ================= */
.rules-card {
  width: min(540px, 100%); max-height: 88dvh; border-radius: var(--r-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: rise .45s var(--ease-out) both;
}
.rules-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 14px; border-bottom: 1px solid var(--stroke-soft); }
.rules-head h2 { font-size: 17px; font-weight: 700; }
.rules-body { padding: 18px 24px 28px; overflow-y: auto; }
.rules-body h3 { font-size: 12px; letter-spacing: .12em; color: var(--gold); text-transform: uppercase; margin: 20px 0 8px; }
.rules-body h3:first-child { margin-top: 0; }
.rules-body p { font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.rules-body p strong { color: var(--text); font-weight: 600; }
.rules-body ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.rules-body li { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.rules-body li b { color: var(--text); display: inline-block; min-width: 42px; font-weight: 600; }
html[data-theme="light"] .rules-body p, html[data-theme="light"] .rules-body li { color: rgba(16, 32, 25, .74); }
html[data-theme="light"] .rules-body p strong { color: #0c1a14; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px !important; color: var(--text) !important; letter-spacing: -.02em; }
.rules-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--stroke-soft); font-size: 12px !important; }

/* ================= 响应式 ================= */
@media (max-width: 1140px) {
  :root { --card-w: 58px; }
  .hand { padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 900px) {
  .seat-left { left: 12px; top: 11%; }
  .seat-right { right: 12px; top: 11%; }
  .pot { top: 52%; }
}
@media (max-width: 560px) {
  :root { --card-w: 50px; }
  .hud { padding-top: calc(env(safe-area-inset-top) + 10px); }
  .pill { font-size: 10.5px; padding: 6px 10px; }
  .seat .ava { width: 40px; height: 40px; font-size: 17px; }
  .seat-card { padding: 10px 13px 9px; gap: 6px; min-width: 84px; border-radius: 17px; }
  .pot { top: 60%; }
  .felt::before, .felt::after { top: 60% !important; }
  .felt::before { width: min(64vh, 420px) !important; height: min(64vh, 420px) !important; }
  .felt::after { width: min(46vh, 320px) !important; height: min(46vh, 320px) !important; }
  .hand { padding-left: 4px; padding-right: 4px; }
  .hand .card .cnr { font-size: 11.5px; letter-spacing: -.02em; }
  .hand .card .cnr .su { font-size: 8.5px; margin-top: .5px; }
  .seat .backs .card.back { width: 22px; height: 31px; margin-left: -15px; }
  .pot-cards .card { --card-w: 46px; margin-left: -18px; }
  .me-zone { padding: 6px 10px calc(env(safe-area-inset-bottom) + 10px); }
  .hand { padding-top: 22px; min-height: calc(var(--card-h) + 22px); }
  .actions .btn { padding: 13px 0; font-size: 14px; }
  .lobby-card { padding: 26px 20px 18px; }
  .brand-mark { width: 54px; height: 54px; font-size: 18px; border-radius: 16px; }
  .brand-text h1 { font-size: 20px; }
  .code-show { font-size: 38px; }
}
@media (max-height: 640px) and (orientation: landscape) {
  :root { --card-w: 46px; }
  .hand { padding-top: 16px; min-height: calc(var(--card-h) + 16px); }
  .me-zone { padding: 4px 12px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 手牌只显示左上角标，重叠时更干净 */
.hand .card .cnr.br { display: none; }
