:root {
  --felt: #0f3d2e;
  --felt-2: #14503c;
  --felt-3: #0a2a1f;
  --cream: #f7f1e3;
  --gold: #d4a94e;
  --gold-2: #f0d48a;
  --red: #c0392b;
  --red-2: #e05a4a;
  --ink: #f5f5f0;
  --muted: #a8bdb2;
  --panel: rgba(8, 30, 23, 0.94);
  --border: rgba(212, 169, 78, 0.28);
  --fs: 1;
  --cw: min(80px, calc((100vw - 44px) / 13 - 4px));
  --card-h: calc(var(--cw) * 1.38);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #061611;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.stage {
  position: relative;
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  max-width: 1280px;
  max-height: 720px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, #1b6249 0%, var(--felt) 48%, var(--felt-3) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 80px rgba(0, 0, 0, 0.55);
  border-radius: 12px;
  user-select: none;
  touch-action: manipulation;
}

.screen { position: absolute; inset: 0; }

/* ---------- rotate mask ---------- */
#rotate-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #14503c, #061611 70%);
  text-align: center;
  padding: 24px;
}
#rotate-mask .rotate-icon {
  font-size: 64px;
  color: var(--gold);
  transform: rotate(90deg);
  margin-bottom: 16px;
  animation: rotateHint 2s ease-in-out infinite;
}
#rotate-mask h2 { font-size: 28px; margin: 0 0 8px; letter-spacing: 2px; }
#rotate-mask p { color: var(--muted); font-size: 15px; margin: 0; }
#rotate-mask .rotate-wechat {
  max-width: 560px;
  margin-top: 12px;
  color: #ffe2a0;
  line-height: 1.75;
}
#rotate-mask .rotate-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
#rotate-mask #rotate-copy { min-width: 150px; }
@keyframes rotateHint {
  0%, 100% { transform: rotate(90deg) scale(1); }
  50% { transform: rotate(90deg) scale(1.08); }
}
@media (orientation: portrait) {
  html.is-mobile #rotate-mask {
    display: none !important;
  }
  html.is-mobile #rotate-mask .rotate-icon,
  html.is-mobile #rotate-mask h2,
  html.is-mobile #rotate-mask .rotate-wechat,
  html.is-mobile #rotate-mask .rotate-actions { display: none !important; }
  html.is-mobile #rotate-mask #rotate-hint {
    display: block;
    padding: 8px 14px;
    border: 1px solid rgba(255, 220, 150, 0.42);
    border-radius: 999px;
    background: rgba(4, 20, 14, 0.7);
    color: #ffe6a8;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  html.is-mobile .stage {
    display: block;
    position: fixed;
    left: 50%;
    top: 50%;
    width: 100dvh;
    height: 100vw;
    max-width: none;
    max-height: none;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    border-radius: 0;
  }
}
@keyframes rotateHintFade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

/* ---------- device split ---------- */
html.is-desktop #rotate-mask { display: none !important; }
html.is-desktop .voice-volume-row { display: none; }
html.in-game .stage {
  background: #04130f url("/table-bg.jpg?v=63") center / cover no-repeat;
}
:root { color-scheme: dark; }
html.is-mobile body {
  background: radial-gradient(ellipse at 50% 40%, #195b45 0%, #0b3b2d 70%, #061611 100%);
}
html.is-android .lobby-art,
html.is-desktop .lobby-art {
  filter: saturate(0.7) contrast(0.93) brightness(1.04);
}
html.is-mobile .stage {
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}
html.is-mobile .topbar {
  padding-left: max(2%, env(safe-area-inset-left));
  padding-right: max(2%, env(safe-area-inset-right));
}
html.is-mobile .top-actions { transform: translateY(3px); }
html.is-mobile .hud-btn {
  min-height: 30px;
  padding: 7px 9px;
  font-size: 11px;
}
html.is-mobile .actions .btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}
html.is-mobile #play-btn { min-width: 64px; }
html.is-mobile #pass-btn { min-width: 44px; }
html.is-mobile .modal-card {
  width: min(94%, 760px);
  max-height: 88dvh;
}
html.is-mobile .lobby-card { width: 94%; }
html.is-mobile .lobby-forms { gap: 14px; }
html.is-mobile .hand-area {
  height: 30%;
  padding: 0 1.4%;
  padding-bottom: env(safe-area-inset-bottom);
  --cw: inherit;
  --card-h: calc(var(--cw) * 1.55);
}
html.is-mobile .hand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% - 36px);
  gap: 2px;
  padding-top: 0;
}
html.is-mobile .self-info {
  position: absolute;
  left: 12%;
  top: -38px;
  width: 22%;
  height: 36px;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: visible;
  gap: 4px;
  padding: 0 4px;
  font-size: 10px;
}
html.is-mobile .self-info.has-selection {
  width: auto;
  min-width: 22%;
  max-width: 36%;
  z-index: 50;
}
html.is-mobile .self-info.has-selection .selection-info { max-width: 100%; }
html.is-mobile .selection-info {
  max-width: 220px;
  padding: 1px 6px;
  gap: 3px;
  font-size: 10px;
}
html.is-mobile .selected-names { display: none; }
html.is-mobile .hand .card:hover:not(.selected) { transform: none; }
html.is-mobile .clear-selection-btn { padding: 2px 7px 2px 6px; font-size: 10px; }
html.is-mobile .play-reason { display: none; }
html.is-mobile #hint-btn { display: inline-flex; }
html.is-mobile .table { bottom: 27%; }
html.is-mobile .center { top: 52%; width: 76%; gap: 5px; }
html.is-mobile .seat-top { top: 2%; width: 24%; padding: 4px 6px; }
html.is-mobile .actions {
  left: auto;
  right: 12%;
  top: -38px;
  bottom: auto;
  transform: none;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  border: 1px solid rgba(255, 232, 176, 0.16);
  border-radius: 999px;
  background: rgba(4, 20, 14, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
html.is-mobile .actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1;
}
html.is-mobile #hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
html.is-mobile .first-notice #first-text {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  padding-top: 1px;
}
html.is-mobile .table-msg { max-width: 90%; }
html.is-mobile .table-msg.my-turn {
  display: flex;
  align-items: center;
  justify-content: center;
  order: 0;
  min-height: 38px;
  font-size: 22px;
  color: #ffe58a;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(5, 25, 17, 0.4);
  line-height: 1.2;
  text-shadow: 0 0 10px rgba(255, 238, 150, 0.95), 0 0 26px rgba(255, 214, 80, 0.65), 0 2px 4px rgba(0, 0, 0, 0.85);
  animation: turnGlow 1.1s ease-in-out infinite;
}
html.is-mobile.is-android .table-msg.my-turn { transform: translateY(3px); }
html.is-mobile .last-label {
  order: 1;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(4, 20, 14, 0.55);
  font-size: 11px;
}
html.is-mobile .last-label:empty { display: none; }
html.is-mobile .last-play { order: 2; gap: 3px; }
html.is-mobile .last-play .card {
  width: calc(var(--cw) * 0.94);
  height: calc(var(--card-h) * 0.94);
  margin-left: 0;
}
html.is-mobile .last-play .card:first-child { margin-left: 0; }
html.is-mobile .table-msg { order: 3; }
@media (orientation: landscape) {
  html.is-mobile .stage {
    width: 100vw;
    height: 100dvh;
  }
}
html.is-mobile .lobby {
  align-items: flex-end;
  padding: 2% 5% max(3%, env(safe-area-inset-bottom));
}
html.is-mobile .lobby-card {
  width: min(500px, 68%);
  max-height: 84%;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 232, 176, 0.14);
  border-radius: 14px;
  background: rgba(4, 20, 14, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html.is-android .lobby-card { transform: translateY(calc(-3% - 16px)); }
html.is-mobile .lobby-forms {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html.is-mobile .form-col { gap: 6px; }
html.is-mobile .form-col h2 { font-size: 14px; padding-bottom: 4px; }
html.is-mobile .form-col label { font-size: 10px; gap: 2px; }
html.is-mobile .form-col input {
  height: 30px;
  font-size: 12px;
  padding: 4px 8px;
}
html.is-mobile .form-col .btn,
html.is-mobile .waiting-actions .btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}
html.is-mobile .lobby-foot { display: none; }
html.is-mobile .lobby-seats { grid-template-columns: repeat(4, 1fr); }
html.is-mobile .lobby-card.waiting-mode #lobby-waiting { transform: none; }


@media (orientation: portrait) {
  html.is-mobile .modal {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 100dvh;
    height: 100vw;
    padding: 2%;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
  }
  html.is-mobile .modal .modal-card {
    width: min(720px, 86%);
    max-height: 86%;
  }
}

/* ---------- lobby ---------- */
.lobby {
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 3% 11%;
}
.lobby-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #04130f url("/lobby-bg.jpg?v=58") center / cover no-repeat;
}
.lobby-art > svg { display: none; }
.lobby-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 46%, transparent 44%, rgba(0, 8, 5, 0.14) 80%, rgba(0, 8, 5, 0.34) 100%);
}
.lobby-dust circle { animation: dustGlow 3.8s ease-in-out infinite alternate; }
.lobby-dust circle:nth-child(2n) { animation-delay: -1.4s; }
.lobby-dust circle:nth-child(3n) { animation-delay: -2.2s; }
@keyframes dustGlow {
  from { opacity: 0.18; }
  to { opacity: 0.85; }
}
.lantern-left { animation: lanternGlow 4s ease-in-out infinite alternate; }
@keyframes lanternGlow {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

.brand { text-align: center; margin-bottom: 14px; }
.brand h1 {
  margin: 0;
  font-size: clamp(40px, 5.4vw, 72px);
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #fff8db 0%, #f8dfa0 28%, #d9ab52 48%, #a46f27 66%, #f6dfa0 86%, #8f5c1e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 2px 0 rgba(82, 48, 10, 0.9))
    drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
}
.brand h1::before,
.brand h1::after {
  content: "◆";
  display: inline-block;
  margin: 0 0.18em;
  font-size: 0.24em;
  vertical-align: 0.35em;
  color: #d4a94e;
  -webkit-text-fill-color: #d4a94e;
  background: none;
  filter: drop-shadow(0 0 8px rgba(255, 210, 110, 0.45));
}
.brand p {
  margin: 4px 0 0;
  color: rgba(234, 224, 194, 0.82);
  font-size: clamp(12px, 1.2vw, 15px);
  letter-spacing: 0.12em;
}

.lobby-card {
  position: relative;
  z-index: 2;
  width: min(820px, 86%);
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateY(-3%);
  view-transition-name: lobby-card;
}
::view-transition-old(lobby-card),
::view-transition-new(lobby-card) {
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.2, 0.9, 0.25, 1.05);
}

.lobby-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 2vw, 26px);
  margin-top: 0;
}
#lobby-forms:not(.hidden),
#lobby-waiting:not(.hidden) {
  animation: lobbyViewIn 0.34s cubic-bezier(0.2, 0.9, 0.25, 1.05) both;
}
@keyframes lobbyViewIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.form-col {
  background: radial-gradient(ellipse at 50% 20%, rgba(1, 20, 13, 0.34), transparent 74%);
  border: 0;
  border-radius: 0;
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-col h2 {
  margin: 0 0 2px;
  padding-bottom: 8px;
  font-size: clamp(17px, 1.7vw, 21px);
  color: var(--gold-2);
  border-bottom: 1px solid rgba(212, 169, 78, 0.18);
}
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: rgba(245, 235, 210, 0.88); }
input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(226, 184, 105, 0.68);
  background: rgba(1, 18, 13, 0.58);
  color: var(--ink);
  outline: none;
  font-size: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 170, 0.1),
    inset 0 8px 24px rgba(0, 0, 0, 0.14);
}
input:focus {
  border-color: rgba(245, 213, 130, 0.9);
  box-shadow:
    0 0 0 2px rgba(212, 169, 78, 0.12),
    inset 0 0 0 1px rgba(255, 230, 170, 0.12);
}

.btn {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px;
  transition: transform 0.12s, background 0.12s, opacity 0.12s, box-shadow 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.11); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #2b1d05;
  border-color: transparent;
  font-weight: 700;
}
.btn.liquid-glass {
  padding: 14px 18px;
  font-size: 17px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.3);
  color: #f7f1df;
  font-weight: 800;
  letter-spacing: 0.06em;
  isolation: isolate;
}
.btn.liquid-glass::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -35%;
  top: -80%;
  width: 170%;
  height: 240%;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, 0.48), rgba(212, 169, 78, 0.25), rgba(110, 220, 180, 0.3), rgba(255, 255, 255, 0.48));
  filter: blur(16px);
  opacity: 0.55;
  animation: liquidSpin 8s linear infinite;
}
.btn.liquid-glass::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -20%;
  left: -80%;
  width: 55%;
  height: 140%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
}
.btn.liquid-glass:hover {
  transform: translateY(-2px) scale(1.015);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 14px 36px rgba(0, 0, 0, 0.36),
    0 0 24px rgba(212, 169, 78, 0.22);
}
.btn.liquid-glass:hover::after { left: 130%; }
.btn.liquid-glass:active { transform: translateY(0) scale(0.975); }
#create-btn.liquid-glass {
  color: #2b1d05;
  background: linear-gradient(135deg, rgba(255, 234, 176, 0.72), rgba(212, 169, 78, 0.38));
  border-color: rgba(255, 232, 160, 0.7);
}
#join-btn.liquid-glass {
  background: linear-gradient(135deg, rgba(210, 255, 232, 0.2), rgba(255, 255, 255, 0.04));
  border-color: rgba(212, 169, 78, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 0 20px rgba(212, 169, 78, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.3);
}
#rematch-btn.liquid-glass {
  color: #2b1d05;
  background: linear-gradient(135deg, rgba(255, 234, 176, 0.72), rgba(212, 169, 78, 0.38));
  border-color: rgba(255, 232, 160, 0.7);
}
@keyframes liquidSpin {
  to { transform: rotate(360deg) scale(1.08); }
}
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  pointer-events: none;
  transform: scale(0);
  animation: btnRipple 0.55s ease-out forwards;
}
@keyframes btnRipple {
  to { transform: scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn.liquid-glass::before { animation: none; }
  .btn.liquid-glass:hover { transform: none; }
  .btn-ripple { animation-duration: 0.01s; }
}
.btn.ghost { background: transparent; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.tiny { padding: 5px 10px; font-size: 12px; }

.lobby-foot { margin: 16px 0 0; text-align: center; color: rgba(168, 189, 178, 0.72); font-size: 11px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

.lobby-waiting { margin-top: 6px; }
.lobby-card.waiting-mode #lobby-waiting { animation: none; transform: translateY(-42px); }
.room-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.room-head b { font-size: clamp(20px, 2.4vw, 30px); letter-spacing: 4px; color: var(--gold-2); }
.tag {
  display: inline-block;
  background: rgba(212, 169, 78, 0.16);
  border: 1px solid var(--border);
  color: var(--gold-2);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
}
.lobby-seats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.lobby-seat {
  min-height: 92px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}
.lobby-seat.filled { border-color: rgba(212, 169, 78, 0.28); }
.lobby-seat.bot { border-color: rgba(168, 189, 178, 0.3); background: rgba(168, 189, 178, 0.06); }
.lobby-seat.bot .avatar { background: linear-gradient(145deg, #3a4a44, #1d2b26); }
.lobby-seat.ready { box-shadow: inset 0 0 0 2px rgba(212, 169, 78, 0.45); }
.lobby-seat .avatar { width: 38px; height: 38px; font-size: 16px; }
.lobby-seat .name { font-size: 14px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-seat .state { font-size: 11px; color: var(--muted); }
.lobby-seat .state.ok { color: var(--gold-2); }
.waiting-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.waiting-actions .btn.liquid-glass { padding: 10px 15px; font-size: 14px; border-radius: 12px; }
#ready-btn.liquid-glass {
  color: #2b1d05;
  background: linear-gradient(135deg, rgba(255, 234, 176, 0.78), rgba(212, 169, 78, 0.46));
  border-color: rgba(255, 232, 160, 0.72);
}

/* ---------- game topbar ---------- */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8.2%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4%;
  background: linear-gradient(180deg, rgba(4, 20, 14, 0.78), rgba(4, 20, 14, 0));
  z-index: 20;
}
.top-left { display: flex; align-items: center; gap: 8px; }
.room-chip { font-size: clamp(11px, 1.1vw, 14px); color: var(--muted); }
.room-chip b { color: var(--gold-2); letter-spacing: 2px; font-size: clamp(13px, 1.3vw, 17px); }
.status-chip {
  font-size: clamp(10px, 1vw, 12px);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.timer { display: flex; align-items: center; gap: 6px; min-width: 120px; }
#timer-text { font-size: clamp(16px, 1.8vw, 24px); font-weight: 800; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.timer-unit { font-size: 11px; color: var(--muted); }
.timer-track { width: clamp(80px, 9vw, 150px); height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.timer-track i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6fd39a, var(--gold), var(--red-2)); transition: width 0.2s linear; }
.top-actions { display: flex; gap: 6px; }
.hud-dock {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(4, 23, 17, 0.82), rgba(11, 40, 30, 0.58));
  border: 1px solid rgba(212, 169, 78, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.hud-btn {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(235, 228, 208, 0.86);
  padding: 8px 12px;
  font-size: clamp(11px, 1.05vw, 13px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.2s, border-color 0.2s, transform 0.12s;
}
.hud-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: translateX(-50%) scale(0.4);
  transition: opacity 0.18s, transform 0.18s;
  box-shadow: 0 0 8px currentColor;
}
.hud-btn:hover {
  color: #fff8e4;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.hud-btn:hover::before { opacity: 0.9; transform: translateX(-50%) scale(1); }
.hud-btn:active { transform: scale(0.94); }
.hud-btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.hud-btn.hud-pause {
  color: #ffe2a0;
  background: rgba(212, 169, 78, 0.1);
  border-color: rgba(212, 169, 78, 0.3);
}
.hud-btn.hud-pause:hover {
  background: rgba(212, 169, 78, 0.2);
  box-shadow: 0 0 16px rgba(212, 169, 78, 0.25);
}
.hud-btn.hud-pause.paused {
  background: linear-gradient(135deg, rgba(255, 228, 156, 0.95), rgba(196, 146, 55, 0.9));
  color: #2b1d05;
  box-shadow: 0 0 18px rgba(255, 204, 100, 0.35);
}
.hud-btn.hud-pause.paused::before { opacity: 0; }
.hud-btn.hud-pause.voting { opacity: 0.5; }
.hud-btn.hud-exit {
  color: #ffb8ab;
  background: rgba(255, 76, 58, 0.1);
  border-color: rgba(255, 120, 100, 0.32);
}
.hud-btn.hud-exit::before { background: #ff6c58; }
.hud-btn.hud-exit:hover {
  color: #fff;
  background: rgba(255, 76, 58, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 100, 0.28), 0 0 16px rgba(255, 70, 50, 0.22);
}
.hud-btn.hud-exit:active {
  background: rgba(255, 76, 58, 0.26);
}
.hud-btn.hud-exit.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 82, 62, 0.34), rgba(120, 24, 16, 0.32));
  border-color: rgba(255, 136, 112, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 220, 210, 0.28), 0 0 18px rgba(255, 70, 50, 0.28);
}
.hud-btn.hud-settle { color: #ffe7a5; }
.hud-btn.hud-rule:hover { color: #d8ffe9; }
.hud-btn.hud-setting:hover { color: #cfe8ff; }
.hud-sep {
  width: 1px;
  height: 17px;
  margin: 0 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}
.icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: clamp(10px, 1vw, 12px);
}
.icon-btn:hover { border-color: var(--gold); }

/* ---------- table ---------- */
.table {
  position: absolute;
  top: 8.2%;
  left: 0; right: 0;
  bottom: 31%;
  z-index: 5;
}
.seat {
  position: absolute;
  width: 19%;
  min-width: 96px;
  max-width: 210px;
  padding: 7px 9px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: box-shadow 0.2s, border-color 0.2s, opacity 0.2s;
}
.seat-left { left: 1.4%; top: 34%; }
.seat-top { left: 50%; top: 9%; transform: translateX(-50%); width: 24%; }
.seat-right { right: 1.4%; top: 34%; }
.seat.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 169, 78, 0.35), 0 0 24px rgba(212, 169, 78, 0.22);
}
.seat.offline { opacity: 0.55; }
.seat.report { border-color: var(--red-2); box-shadow: 0 0 0 2px rgba(224, 90, 74, 0.35); }
.seat.first-hand {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  animation: firstPulse 1.1s ease-in-out infinite;
}
.self-info.first-hand {
  box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(212, 169, 78, 0.35);
  border-radius: 12px;
  padding: 3px 8px;
}
@keyframes firstPulse {
  0%, 100% { outline-color: rgba(212, 169, 78, 0.95); }
  50% { outline-color: rgba(255, 227, 150, 0.55); }
}
.report-alert {
  position: absolute;
  right: 7px;
  top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 77, 64, 0.7);
  background: rgba(110, 18, 14, 0.82);
  color: #ff6b5f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(255, 50, 40, 0.35);
  animation: reportShake 0.9s ease-in-out infinite;
}
.self-report-alert {
  position: static;
  transform: none;
  animation: none;
}
.alarm-icon {
  position: relative;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
}
.alarm-icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 8px #ff3b30;
  animation: alarmBlink 0.7s ease-in-out infinite;
}
.alarm-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 59, 48, 0.9);
  animation: alarmPing 1s ease-out infinite;
}
@keyframes alarmBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes alarmPing {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes reportShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
#report-banner { display: none !important; }
.first-notice {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: rgba(9, 38, 27, 0.94);
  color: var(--gold-2);
  font-weight: 800;
  font-size: clamp(13px, 1.35vw, 18px);
  box-shadow: 0 0 0 4px rgba(212, 169, 78, 0.16), 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: firstNoticeIn 0.35s ease both;
}
.d3-badge {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff8ea;
  color: #c0392b;
  font-size: 15px;
  font-weight: 900;
}
@keyframes firstNoticeIn {
  from { opacity: 0; transform: translate(-50%, 8px) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2d7259, #174333);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--gold-2);
  flex: 0 0 auto;
  font-size: 15px;
}
.avatar.small { width: 28px; height: 28px; font-size: 12px; }
.avatar-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.avatar-score {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: -6px;
  transform: translateX(-50%);
  min-width: 24px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #071d15;
  border: 1px solid rgba(212, 169, 78, 0.7);
  color: #ffe08a;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.seat-info { min-width: 0; flex: 1; }
.seat-name { display: block; font-size: clamp(11px, 1.1vw, 14px); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-count { display: block; font-size: clamp(10px, 0.95vw, 12px); color: var(--muted); }
.seat-count b { color: var(--gold-2); font-size: clamp(15px, 1.5vw, 20px); }
.seat-state { position: absolute; right: 7px; bottom: 4px; font-size: 10px; color: var(--muted); }
.seat-state.report { color: var(--red-2); font-weight: 700; }
.seat-state.active { color: var(--gold-2); }

.center {
  position: absolute;
  left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  width: 62%;
  min-height: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border-radius: 24px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.last-label { font-size: clamp(12px, 1.2vw, 15px); color: var(--gold-2); min-height: 18px; }
.last-play { display: flex; justify-content: center; align-items: flex-end; min-height: calc(var(--card-h) * 0.72); }
.last-play .card {
  width: calc(var(--cw) * 0.86);
  height: calc(var(--card-h) * 0.86);
  margin-left: calc(var(--cw) * -0.28);
  pointer-events: none;
}
.last-play .card:first-child { margin-left: 0; }
.table-msg { font-size: clamp(11px, 1.1vw, 14px); color: var(--muted); min-height: 17px; }
.table-msg.my-turn {
  font-size: clamp(20px, 2.4vw, 32px);
  color: #ffe58a;
  font-weight: 900;
  letter-spacing: 0.12em;
  min-height: 38px;
  text-shadow: 0 0 10px rgba(255, 238, 150, 0.9), 0 0 24px rgba(255, 214, 80, 0.55), 0 2px 4px rgba(0, 0, 0, 0.8);
  animation: turnGlow 1.1s ease-in-out infinite;
}
.top-warning {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 77, 64, 0.7);
  background: rgba(110, 18, 14, 0.82);
  color: #ffd36a;
  font-size: clamp(12px, 1.3vw, 17px);
  font-weight: 800;
  box-shadow: 0 0 16px rgba(255, 50, 40, 0.28);
  animation: topWarnPulse 1s ease-in-out infinite;
}
@keyframes turnGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(255, 238, 150, 0.55), 0 0 20px rgba(255, 214, 80, 0.35), 0 2px 4px rgba(0, 0, 0, 0.8); }
  50% { text-shadow: 0 0 18px rgba(255, 242, 170, 0.95), 0 0 38px rgba(255, 214, 80, 0.7), 0 2px 4px rgba(0, 0, 0, 0.8); }
}
@keyframes topWarnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

.banner {
  position: absolute;
  top: 1.5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: linear-gradient(180deg, #d94b3b, #a92a20);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: clamp(12px, 1.3vw, 16px);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: pulseReport 1.2s ease-in-out infinite;
}
@keyframes pulseReport {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.04); }
}

/* ---------- hand ---------- */
.hand-area {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 31%;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1.4% 0.6%;
  background: linear-gradient(0deg, rgba(3, 16, 11, 0.86), rgba(3, 16, 11, 0));
}
.self-info {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 2px;
  height: 24%;
  font-size: clamp(11px, 1.1vw, 14px);
}
#self-name { font-weight: 700; }
.self-info .avatar {
  border: 2px solid rgba(212, 169, 78, 0.75);
  box-shadow: 0 0 0 3px rgba(212, 169, 78, 0.14), 0 0 12px rgba(212, 169, 78, 0.22);
}
.self-info.first-hand .avatar {
  border-color: #ffe3a0;
  box-shadow: 0 0 0 4px rgba(212, 169, 78, 0.22), 0 0 18px rgba(255, 214, 120, 0.55);
}
.score { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.count-pill { background: rgba(255, 255, 255, 0.08); border-radius: 999px; padding: 2px 8px; color: var(--muted); font-size: 11px; }
.selection-info { display: inline-flex; align-items: center; gap: 4px; max-width: 360px; font-size: 11px; color: var(--gold-2); background: rgba(212, 169, 78, 0.12); border: 1px solid rgba(212, 169, 78, 0.25); border-radius: 999px; padding: 2px 8px; overflow: hidden; white-space: nowrap; }
.selected-names { color: var(--ink); opacity: 0.85; overflow: hidden; text-overflow: ellipsis; max-width: 220px; min-width: 0; }
.clear-selection-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 3px 9px 3px 7px;
  border: 1px solid rgba(255, 152, 126, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 102, 82, 0.28), rgba(255, 255, 255, 0.055));
  color: #ffe3d8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 220, 0.28),
    0 0 12px rgba(255, 100, 80, 0.12);
  transition: transform 0.14s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.clear-selection-btn::before {
  content: "×";
  font-size: 14px;
  line-height: 1;
  color: #ffb6a3;
  font-weight: 400;
}
.clear-selection-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 190, 160, 0.85);
  background: linear-gradient(135deg, rgba(255, 112, 90, 0.4), rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 230, 0.4),
    0 0 18px rgba(255, 100, 80, 0.3);
}
.clear-selection-btn:active { transform: scale(0.94); }
.clear-selection-btn .btn-ripple { background: rgba(255, 220, 205, 0.45); }
.mini-status { font-size: 11px; color: var(--gold-2); }

.hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  height: 68%;
  padding-top: 8px;
  gap: 4px;
  overflow: visible;
  touch-action: none;
}
.hand .card {
  width: var(--cw);
  height: var(--card-h);
  margin-left: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  cursor: pointer;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
.hand .card:first-child { margin-left: 0; }
.hand .card:hover { transform: translateY(-7px); }
.hand .card.selected {
  transform: translateY(calc(var(--card-h) * -0.28));
  box-shadow: 0 0 0 3px var(--gold), 0 14px 20px rgba(0, 0, 0, 0.45);
  /* 平铺后没有横向重叠，选中牌可以完整显示 */
  z-index: 2;
}
.hand .card.dealing {
  animation: dealIn 0.3s ease backwards;
}
@keyframes dealIn {
  from { opacity: 0; transform: translateY(20px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.hand .card.disabled { cursor: not-allowed; opacity: 0.6; }

.card {
  border-radius: calc(var(--cw) * 0.11);
  background: linear-gradient(160deg, #fffaf0 0%, #f3e8d1 70%, #e6d7ba 100%);
  border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.32);
  color: #1c1c1c;
  position: relative;
  overflow: hidden;
}
.card .rank {
  position: absolute;
  top: 3%;
  left: 7%;
  font-size: calc(var(--cw) * 0.33);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.card .suit {
  position: absolute;
  left: 50%;
  top: 53%;
  transform: translate(-50%, -50%);
  font-size: calc(var(--cw) * 0.52);
  line-height: 1;
}
.card.red { color: var(--red); }
.card.black { color: #1b1b1b; }
.card.mini { width: calc(var(--cw) * 0.8); height: calc(var(--card-h) * 0.8); }

.actions {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 40;
}
.actions .btn { padding: 9px 15px; font-size: clamp(12px, 1.2vw, 15px); }
#play-btn { min-width: 82px; }
#pass-btn { min-width: 56px; }
.play-reason {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  font-size: 11px;
  color: var(--red-2);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-reason:empty { display: none; }

/* ---------- social ---------- */
.social-dock {
  position: absolute;
  right: 0.8%;
  top: 38%;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dock-btn {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 22, 16, 0.75);
  color: var(--ink);
  font-size: 18px;
  position: relative;
}
.dock-btn:hover { border-color: var(--gold); }
.dock-btn.off { opacity: 0.45; }
.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
}

.panel {
  position: absolute;
  right: 58px;
  bottom: 28%;
  z-index: 60;
  width: 280px;
  height: 200px;
  background: linear-gradient(150deg, rgba(17, 54, 41, 0.9), rgba(4, 22, 16, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 18px 50px rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  animation: panelIn 0.24s cubic-bezier(0.2, 0.9, 0.25, 1.05) both;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
}
.panel-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
}
.chat-log { flex: 1; overflow-y: auto; padding: 7px 9px; font-size: 12px; line-height: 1.45; }
.chat-line { margin-bottom: 5px; word-break: break-word; }
.chat-line b { color: var(--gold-2); font-weight: 700; }
.chat-line.system { color: var(--muted); font-size: 11px; }
.chat-form { display: flex; gap: 5px; padding: 6px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.chat-form input { padding: 6px 8px; font-size: 12px; }
.emoji-targets { display: flex; gap: 5px; padding: 6px 8px 0; flex-wrap: wrap; }
.emoji-target {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 11px;
}
.emoji-target.active { border-color: var(--gold); color: var(--gold-2); }
.emoji-panel { height: 255px; }
.emoji-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 7px; flex: 1; overflow-y: auto; }
.emoji-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 38px;
  font-size: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.emoji-icon { font-size: 20px; line-height: 1; }
.emoji-label { font-size: 8px; line-height: 1; color: rgba(247, 241, 223, 0.72); white-space: nowrap; }
.emoji-grid button:active { cursor: grabbing; }
.emoji-panel.dragging { pointer-events: none; opacity: 0.42; }
.quick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 7px; overflow-y: auto; }
.quick-list button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 11px;
  text-align: left;
}

.reconnect, .auto-banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--border);
  color: var(--gold-2);
}
.reconnect { top: 9%; }
.auto-banner { top: 14%; }

/* ---------- toast ---------- */
.toast {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: calc(31% + 84px);
  transform: translateX(-50%) translateY(10px);
  z-index: 999;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.045) 48%, rgba(255, 255, 255, 0.1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff8e8;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  max-width: 86vw;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 10px 26px rgba(0, 0, 0, 0.34),
    0 0 18px rgba(212, 169, 78, 0.12);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.toast::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 46%);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
html.is-mobile .toast {
  left: 50%;
  top: calc(70% - 38px);
  bottom: auto;
  transform: translateX(-50%) translateY(10px);
  max-width: 30%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 14px;
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}
html.is-mobile .toast.show { transform: translateX(-50%) translateY(0); }
html.is-mobile .toast { z-index: 180; }
html.is-desktop .toast { z-index: 180; }
html.is-mobile body.has-selection .toast { top: calc(70% - 78px); }

/* ---------- modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 8, 5, 0.56);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3%;
  animation: modalBackdropIn 0.28s ease both;
}
.modal-card {
  position: relative;
  width: min(760px, 94vw);
  max-height: 88vh;
  overflow: auto;
  background:
    radial-gradient(110% 80% at 12% 0%, rgba(120, 220, 180, 0.14), transparent 46%),
    radial-gradient(90% 100% at 92% 100%, rgba(212, 169, 78, 0.1), transparent 52%),
    linear-gradient(145deg, rgba(17, 54, 41, 0.9), rgba(4, 22, 16, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 34px 90px rgba(0, 0, 0, 0.6);
  padding: 22px 24px;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  animation: modalCardIn 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.05) both;
}
.modal.is-closing {
  animation: modalBackdropOut 0.2s ease both;
}
.modal.is-closing .modal-card {
  animation: modalCardOut 0.2s ease both;
}
@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalCardIn {
  0% { opacity: 0; transform: translateY(24px) scale(0.92); filter: blur(10px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes modalBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes modalCardOut {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(12px) scale(0.96); filter: blur(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .modal, .modal-card, .modal.is-closing, .modal.is-closing .modal-card { animation: none; }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .panel { animation: none; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2, .settle-card h2 { margin: 0 0 8px; color: var(--gold-2); font-size: 22px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.rules-card { width: min(720px, 94vw); }
.rules-scroll { max-height: 72vh; overflow: auto; padding-right: 6px; }
.rules-scroll h3 { color: var(--gold-2); font-size: 15px; margin: 14px 0 4px; }
.rules-scroll p { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0; }
.settle-card { width: min(720px, 94vw); }
.settle-desc { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.settle-players { display: flex; flex-direction: column; gap: 5px; }
.settle-row {
  display: grid;
  grid-template-columns: 30px 1fr 70px 70px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}
.settle-row.winner { background: rgba(212, 169, 78, 0.14); border: 1px solid rgba(212, 169, 78, 0.28); }
.settle-row.water { background: rgba(255, 255, 255, 0.03); }
.settle-row.violator { background: rgba(255, 90, 70, 0.12); border: 1px solid rgba(255, 110, 90, 0.3); }
.settle-row .cards-mini { display: flex; gap: 2px; overflow: hidden; }
.settle-row .cards-mini .card { width: 22px; height: 30px; margin: 0; border-radius: 3px; }
.settle-row .cards-mini .card .rank { font-size: 8px; }
.settle-row .cards-mini .card .suit { font-size: 11px; }
.settle-flows { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.settle-flows b { color: var(--gold-2); }
.settle-total {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 169, 78, 0.22);
  background: rgba(212, 169, 78, 0.06);
}
.settle-total-title { color: var(--gold-2); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.settle-total-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); padding: 2px 0; }
.settle-total-row b { color: var(--gold-2); }
.score-card { width: min(560px, 94vw); }
.score-sub { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.score-list { display: flex; flex-direction: column; gap: 8px; }
.score-row {
  display: grid;
  grid-template-columns: 34px 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
.score-row:first-child { border-color: rgba(212, 169, 78, 0.45); background: rgba(212, 169, 78, 0.1); }
.score-rank { text-align: center; font-size: 15px; font-weight: 900; color: var(--gold-2); }
.score-row .avatar { width: 36px; height: 36px; border-color: rgba(212, 169, 78, 0.55); }
.score-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-value { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.score-value.pos { color: #3dff8f; text-shadow: 0 0 12px rgba(61, 255, 143, 0.75), 0 0 26px rgba(61, 255, 143, 0.35); }
.score-value.neg { color: #ff4d5e; text-shadow: 0 0 12px rgba(255, 77, 94, 0.75), 0 0 26px rgba(255, 77, 94, 0.35); }
.score-value.zero { color: var(--muted); }
.score-actions { display: flex; justify-content: center; gap: 18px; margin-top: 22px; }
.btn.big { padding: 14px 44px; font-size: 18px; border-radius: 14px; }
.btn.danger { background: linear-gradient(180deg, #c0392b, #8e1f16); border-color: #e05a4a; color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }

.settings-card { width: min(420px, 92vw); }
.switch-row, .select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  color: var(--ink);
}
.switch-row input { display: none; }
.switch {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.switch-row input:checked + .switch { background: var(--gold); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
}
.range-row input[type="range"] {
  flex: 1;
  min-width: 80px;
  accent-color: var(--gold);
}
html.is-mobile .range-row input[type="range"] { touch-action: none; }
.range-label {
  min-width: 38px;
  text-align: right;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}
select {
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 8px;
}
.settings-card .btn { margin-top: 14px; }

/* ---------- danmaku ---------- */
.danmaku-layer { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.danmaku {
  position: absolute;
  font-size: 30px;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
  animation: floatUp 1.6s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(1); }
}
.seat.emoji-drop-target,
#self-info.emoji-drop-target {
  outline: 2px dashed rgba(255, 224, 140, 0.95);
  outline-offset: 4px;
  box-shadow: 0 0 26px rgba(255, 210, 110, 0.35) !important;
}
.emoji-drag-ghost {
  position: fixed;
  z-index: 400;
  font-size: 38px;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.15) rotate(-8deg);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}
.emoji-projectile {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 170;
  font-size: 36px;
  line-height: 1;
  pointer-events: none;
  transform-origin: center;
  will-change: transform, opacity;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}
.emoji-trail {
  position: absolute;
  z-index: 168;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
  transform: translate(-50%, -50%);
  animation: emojiTrail 0.36s ease-out forwards;
}
@keyframes emojiTrail {
  from { opacity: 0.65; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
}
.emoji-impact {
  position: absolute;
  z-index: 169;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 224, 140, 0.95);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  box-shadow: 0 0 18px rgba(255, 210, 110, 0.55);
  animation: emojiImpact 0.5s ease-out forwards;
}
@keyframes emojiImpact {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.5); }
}
.emoji-hit {
  animation: emojiHit 0.42s ease both;
}
@keyframes emojiHit {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.18) rotate(-8deg); }
  55% { transform: scale(0.92) rotate(6deg); }
  80% { transform: scale(1.06) rotate(-2deg); }
}
.emoji-splash {
  position: absolute;
  z-index: 168;
  width: 0;
  height: 0;
  pointer-events: none;
}
.emoji-splat {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 36px;
  border-radius: 52% 48% 62% 38% / 46% 58% 42% 54%;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  filter: blur(0.4px);
  animation: emojiSplat 0.58s ease-out forwards;
}
@keyframes emojiSplat {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.2); }
  65% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}
.emoji-drop {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50% 42% 58% 46%;
  transform: translate(-50%, -50%);
  animation: emojiDrop 0.9s cubic-bezier(0.15, 0.7, 0.25, 1) forwards;
}
@keyframes emojiDrop {
  0% { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.45); }
}
.emoji-shell {
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 11px;
  background: #f7f0da;
  clip-path: polygon(50% 0, 100% 100%, 0 78%);
  transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) rotate(var(--sr));
  animation: emojiShell 0.9s ease-out forwards;
}
@keyframes emojiShell {
  0% { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) rotate(0); }
  100% { opacity: 0.75; transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) rotate(var(--sr)); }
}
.emoji-wet { box-shadow: inset 0 0 34px rgba(80, 190, 255, 0.5), 0 0 26px rgba(80, 190, 255, 0.28) !important; }
.emoji-egg { box-shadow: inset 0 0 34px rgba(255, 210, 63, 0.5), 0 0 26px rgba(255, 210, 63, 0.25) !important; }
.emoji-apple { box-shadow: inset 0 0 30px rgba(220, 50, 50, 0.4) !important; }
.emoji-tomato { box-shadow: inset 0 0 30px rgba(230, 60, 55, 0.45) !important; }
.emoji-cake { box-shadow: inset 0 0 32px rgba(255, 235, 220, 0.55) !important; }
.emoji-snow { box-shadow: inset 0 0 32px rgba(220, 248, 255, 0.55) !important; }
.emoji-shoe { box-shadow: inset 0 0 30px rgba(160, 100, 45, 0.45) !important; }
.emoji-fire { box-shadow: inset 0 0 32px rgba(255, 120, 30, 0.5) !important; }
.chat-danmaku-layer { position: absolute; inset: 0; pointer-events: none; z-index: 160; overflow: hidden; }
.chat-danmaku {
  position: absolute;
  left: 100%;
  max-width: 72vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(212, 169, 78, 0.35);
  background: rgba(3, 18, 12, 0.78);
  color: #fff8e7;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: chatFly 9s linear forwards;
}
.chat-danmaku b { color: var(--gold-2); }
@keyframes chatFly {
  from { left: 100%; }
  to { left: -100%; }
}

@media (max-height: 430px) {
  .topbar { height: 9%; }
  .table { top: 9%; bottom: 36%; }
  .hand-area { height: 36%; padding-right: 92px; --cw: min(39px, calc((100vw - 100px) / 13 - 4px)); }
  .hand { gap: 3px; }
  .seat-left, .seat-right { top: 18%; width: 22%; }
  .seat-top { top: 11%; width: 26%; }
  .seat { padding: 5px 7px; }
  .avatar { width: 30px; height: 30px; font-size: 12px; }
  .seat-name { font-size: 11px; }
  .seat-count { font-size: 10px; }
  .seat-count b { font-size: 14px; }
  .seat-state { font-size: 9px; }
  .center { top: 66%; width: 72%; min-height: 26%; }
  .last-label { font-size: 11px; }
  .table-msg { font-size: 11px; }
  .banner { top: 0; padding: 5px 12px; font-size: 11px; }
  .social-dock { top: 30%; gap: 5px; }
  .dock-btn { width: 34px; height: 34px; font-size: 15px; }
  .hand-area .self-info { height: 22%; font-size: 11px; }
  .hand .card.selected { transform: translateY(calc(var(--card-h) * -0.22)); }
  .selection-info { font-size: 10px; padding: 1px 6px; max-width: 250px; }
  .actions {
    left: auto;
    right: 1%;
    bottom: 8%;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .actions .btn { padding: 6px 9px; font-size: 11px; }
  #hint-btn { display: none; }
  #play-btn { min-width: 64px; }
  #pass-btn { min-width: 42px; }
  .play-reason { right: 0; bottom: calc(100% + 4px); font-size: 9px; max-width: 96px; text-align: right; }
  .panel { width: 250px; height: 175px; }
}

/* 弹窗按钮的液态玻璃覆盖（必须放在 ghost/primary/danger 之后） */
.btn.ghost.liquid-glass {
  background: linear-gradient(135deg, rgba(210, 255, 232, 0.2), rgba(255, 255, 255, 0.045));
  border-color: rgba(255, 255, 255, 0.32);
  color: #f7f1df;
}

/* ---------- pause vote ---------- */
.icon-btn.pause-top-btn {
  border-color: rgba(212, 169, 78, 0.5);
  color: var(--gold-2);
  box-shadow: 0 0 14px rgba(212, 169, 78, 0.16);
}
.icon-btn.pause-top-btn:hover { box-shadow: 0 0 20px rgba(212, 169, 78, 0.32); }
.pause-top-btn.paused {
  background: rgba(255, 215, 120, 0.16);
  border-color: rgba(255, 225, 150, 0.8);
  color: #ffe6a8;
}
.pause-top-btn.voting { opacity: 0.55; }
.modal.pause-modal { z-index: 260; }
.pause-modal .pause-card { width: min(590px, 92vw); }
.modal.pause-confirm-modal { z-index: 270; }
.pause-confirm-card {
  width: min(440px, 90vw);
  text-align: center;
}
.pause-confirm-card h2 { margin: 4px 0 8px; color: var(--gold-2); font-size: 23px; }
.pause-confirm-card p { margin: 0; color: rgba(245, 235, 210, 0.82); font-size: 13px; line-height: 1.7; }
.pause-confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.pause-confirm-actions .btn { min-width: 128px; }
#pause-confirm-yes.liquid-glass,
#exit-confirm-yes.liquid-glass {
  color: #2b1d05;
  background: linear-gradient(135deg, rgba(255, 234, 176, 0.9), rgba(212, 169, 78, 0.58));
  border-color: rgba(255, 232, 160, 0.8);
}
.pause-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
}
.pause-head h2 { margin: 0; color: var(--gold-2); font-size: 22px; }
.pause-top-meta { text-align: center; color: var(--gold-2); }
.pause-top-meta b { font-size: 30px; line-height: 1; color: #fff0bb; }
.pause-top-meta span { font-size: 13px; }
#pause-voted { margin-top: 2px; color: rgba(245, 235, 210, 0.78); font-size: 12px; }
.pause-sub { margin: 8px 0 12px; color: rgba(245, 235, 210, 0.8); font-size: 13px; }
.pause-players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pause-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 10px;
  border: 2px solid rgba(255, 226, 120, 0.72);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(2, 20, 14, 0.3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 14px rgba(255, 214, 100, 0.1);
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
}
.pause-player .avatar { width: 38px; height: 38px; font-size: 15px; flex: 0 0 auto; }
.pause-player .pp-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pause-player .pp-tag { font-size: 10px; color: var(--muted); }
.pause-player .pp-vote { margin-left: auto; font-size: 11px; color: #ffe68a; white-space: nowrap; }
.pause-player.approve {
  border-color: #5dff9d;
  background: linear-gradient(135deg, rgba(60, 255, 150, 0.14), rgba(2, 20, 14, 0.3));
  box-shadow: inset 0 1px 0 rgba(190, 255, 215, 0.3), 0 0 22px rgba(70, 255, 150, 0.3);
}
.pause-player.approve .pp-vote { color: #76ffae; }
.pause-player.reject {
  border-color: #ff5a5a;
  background: linear-gradient(135deg, rgba(255, 70, 70, 0.16), rgba(2, 20, 14, 0.3));
  box-shadow: inset 0 1px 0 rgba(255, 180, 180, 0.3), 0 0 22px rgba(255, 70, 70, 0.28);
}
.pause-player.reject .pp-vote { color: #ff8a8a; }
.pause-player.pending {
  border-color: rgba(255, 226, 120, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 245, 190, 0.25), 0 0 20px rgba(255, 214, 100, 0.18);
}
.pause-player.is-self { outline: 1px solid rgba(255, 230, 160, 0.28); outline-offset: 2px; }
.pause-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.pause-actions .btn { min-width: 132px; }
#pause-hint { text-align: center; min-height: 16px; }
@media (max-width: 640px) {
  .pause-modal .pause-card { width: 94vw; }
  .pause-player { min-height: 56px; padding: 6px 7px; gap: 7px; }
  .pause-player .avatar { width: 30px; height: 30px; }
  .pause-player .pp-name { font-size: 12px; }
  .pause-player .pp-vote { font-size: 10px; }
}
#score-exit.liquid-glass {
  background: linear-gradient(135deg, rgba(220, 70, 60, 0.82), rgba(120, 20, 15, 0.55));
  border-color: rgba(255, 120, 105, 0.7);
  color: #fff;
}
#score-back.liquid-glass {
  background: linear-gradient(135deg, rgba(255, 234, 176, 0.78), rgba(212, 169, 78, 0.45));
  border-color: rgba(255, 232, 160, 0.72);
  color: #2b1d05;
}

/* ---------- v64: smoked liquid glass UI ---------- */
.actions .btn,
.hud-dock,
.seat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 42%, rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(66, 53, 40, 0.64), rgba(19, 18, 16, 0.5));
  border: 1px solid rgba(255, 232, 200, 0.26);
  color: #fff5e6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px) saturate(132%);
  -webkit-backdrop-filter: blur(18px) saturate(132%);
}
.actions .btn {
  border-radius: 999px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.46);
}
.actions .btn.primary {
  background:
    linear-gradient(180deg, rgba(255, 239, 195, 0.3), rgba(255, 255, 255, 0.04) 46%, rgba(90, 58, 20, 0.2)),
    linear-gradient(135deg, rgba(104, 76, 38, 0.56), rgba(25, 20, 14, 0.46));
  border-color: rgba(255, 225, 164, 0.46);
  color: #fff3d2;
}
.hud-dock {
  padding: 4px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.015) 44%, rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(59, 49, 38, 0.7), rgba(15, 16, 15, 0.54));
}
.hud-dock .hud-btn {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: rgba(255, 246, 230, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.hud-dock .hud-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 238, 208, 0.24);
}
.hud-dock .hud-btn.hud-pause { color: #ffe2a0; }
.hud-dock .hud-btn.hud-exit { color: #ffb8ab; }
.hud-dock .hud-sep { background: rgba(255, 238, 210, 0.18); }
.seat {
  border-radius: 14px;
}
.seat .avatar {
  border-color: rgba(255, 239, 214, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 0 12px rgba(255, 219, 160, 0.12);
}
html.is-mobile .actions {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.actions .btn::before,
.seat::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.02) 42%, transparent 72%);
  pointer-events: none;
}

/* ---------- v65: clear liquid glass, lighter smoked tint ---------- */
.actions .btn,
.hud-dock,
.seat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.025) 46%, rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(52, 43, 32, 0.3), rgba(12, 16, 15, 0.2));
  border-color: rgba(255, 241, 218, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 10px 26px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
}
.actions .btn.primary {
  background:
    linear-gradient(180deg, rgba(255, 243, 208, 0.24), rgba(255, 255, 255, 0.03) 48%, rgba(120, 80, 25, 0.08)),
    linear-gradient(135deg, rgba(96, 71, 36, 0.26), rgba(20, 18, 14, 0.18));
  border-color: rgba(255, 229, 173, 0.5);
  color: #fff4d8;
}
.hud-dock {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02) 48%, rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(46, 39, 30, 0.34), rgba(10, 14, 13, 0.22));
}
.actions .btn::before,
.seat::before {
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.015) 42%, transparent 72%);
}

/* ---------- v66: ultra-clear liquid glass ---------- */
.actions .btn,
.hud-dock,
.seat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.035) 50%, rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(52, 43, 32, 0.16), rgba(12, 16, 15, 0.1));
  border-color: rgba(255, 246, 227, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    0 10px 26px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(24px) saturate(160%) brightness(1.12);
  -webkit-backdrop-filter: blur(24px) saturate(160%) brightness(1.12);
}
.actions .btn.primary {
  background:
    linear-gradient(180deg, rgba(255, 244, 212, 0.26), rgba(255, 255, 255, 0.04) 50%, rgba(140, 95, 30, 0.05)),
    linear-gradient(135deg, rgba(100, 74, 37, 0.14), rgba(18, 18, 15, 0.08));
  border-color: rgba(255, 233, 182, 0.54);
}
.hud-dock {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(48, 40, 30, 0.18), rgba(10, 14, 13, 0.11));
}

.seat .seat-name,
.seat .seat-count,
.seat .seat-state {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.68);
}

/* ---------- v67: self glass + compact HUD ---------- */
.self-info {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.035) 50%, rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(52, 43, 32, 0.16), rgba(12, 16, 15, 0.1));
  border: 1px solid rgba(255, 246, 227, 0.44);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    0 10px 26px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(24px) saturate(160%) brightness(1.12);
  -webkit-backdrop-filter: blur(24px) saturate(160%) brightness(1.12);
}
.self-info .avatar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(28, 30, 26, 0.24));
  border-color: rgba(255, 231, 186, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 0 2px rgba(212, 169, 78, 0.12),
    0 0 12px rgba(255, 219, 160, 0.18);
}
.self-info > * { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.62); }
.hud-dock {
  gap: 3px;
  padding: 3px;
}
.hud-btn {
  padding: 6px 9px;
  font-size: 12px;
}
html.is-mobile .hud-btn {
  min-height: 26px;
  padding: 5px 7px;
  font-size: 10px;
}

/* ---------- v69: glass social dock, shifted down one button ---------- */
.social-dock { top: calc(38% + 49px); }
html.is-mobile .social-dock { top: calc(30% + 39px); }
.social-dock .dock-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.035) 50%, rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(52, 43, 32, 0.16), rgba(12, 16, 15, 0.1));
  border: 1px solid rgba(255, 246, 227, 0.44);
  border-radius: 12px;
  color: #fff5e6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    0 10px 26px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(24px) saturate(160%) brightness(1.12);
  -webkit-backdrop-filter: blur(24px) saturate(160%) brightness(1.12);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.46);
}
.social-dock .dock-btn:hover {
  border-color: rgba(255, 241, 214, 0.65);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.04) 50%, rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, rgba(60, 49, 36, 0.18), rgba(12, 16, 15, 0.12));
}
.social-dock .dock-btn.off { opacity: 0.5; }

/* v70: mobile social dock one more button lower, desktop unchanged */
html.is-mobile .social-dock { top: calc(30% + 78px); }

/* ---------- v71: lighter modal animation on Android ---------- */
html.is-android .modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(0, 8, 5, 0.64);
  animation-duration: 0.12s;
}
html.is-android .modal-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: androidModalIn 0.16s ease both;
}
@keyframes androidModalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
html.is-android .modal.is-closing,
html.is-android .modal.is-closing .modal-card {
  animation-duration: 0.1s;
}

/* ---------- v72: restore modal motion on Android, keep it GPU-cheap ---------- */
html.is-android .modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(0, 8, 5, 0.64);
  animation: androidModalBackdropIn 0.18s ease both;
}
html.is-android .modal-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: androidModalCardIn 0.22s cubic-bezier(0.2, 0.9, 0.25, 1.05) both;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
@keyframes androidModalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes androidModalCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.93); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
html.is-android .modal.is-closing,
html.is-android .modal.is-closing .modal-card {
  animation-duration: 0.1s;
}

/* ---------- v73: all button-opened popups use the same clear glass ---------- */
.modal-card,
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.025) 42%, rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(58, 47, 35, 0.42), rgba(12, 16, 15, 0.32));
  border: 1px solid rgba(255, 246, 227, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 24px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
}
html.is-android .modal-card,
html.is-android .panel {
  backdrop-filter: blur(10px) saturate(135%);
  -webkit-backdrop-filter: blur(10px) saturate(135%);
}

/* ---------- v74: warmer, less gray Android popup glass ---------- */
html.is-android .modal {
  background: rgba(0, 8, 5, 0.42);
}
html.is-android .modal-card,
html.is-android .panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04) 44%, rgba(255, 255, 255, 0.07)),
    linear-gradient(135deg, rgba(84, 65, 42, 0.32), rgba(27, 26, 20, 0.2));
  border-color: rgba(255, 240, 210, 0.5);
  backdrop-filter: blur(12px) saturate(150%) brightness(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(150%) brightness(1.08);
}

/* ---------- v75: classic / guangyi themes ---------- */
#theme-toggle {
  position: absolute;
  top: 2.2%;
  right: 1.5%;
  z-index: 30;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 246, 227, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.035) 50%, rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(52, 43, 32, 0.18), rgba(12, 16, 15, 0.12));
  color: #fff5e6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 8px 22px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px) saturate(155%) brightness(1.08);
  -webkit-backdrop-filter: blur(20px) saturate(155%) brightness(1.08);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
#theme-toggle:hover { border-color: rgba(255, 240, 210, 0.7); }
html.is-mobile #theme-toggle {
  top: 2%;
  right: 2%;
  padding: 5px 9px;
  font-size: 10px;
}
html.in-game #theme-toggle { display: none; }

/* Classic: green table, no live glass */
html.theme-classic.in-game .stage {
  background: radial-gradient(ellipse at 50% 40%, #1b6249 0%, var(--felt) 48%, var(--felt-3) 100%);
}
html.theme-classic .actions .btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: none;
}
html.theme-classic .actions .btn.primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: transparent;
  color: #2b1d05;
}
html.theme-classic .actions .btn.ghost { background: transparent; }
html.theme-classic .actions .btn::before { display: none; }
html.theme-classic.is-mobile .actions {
  background: rgba(4, 20, 14, 0.72);
  border-color: rgba(255, 232, 176, 0.16);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .hud-dock {
  background: linear-gradient(135deg, rgba(4, 23, 17, 0.82), rgba(11, 40, 30, 0.58));
  border-color: rgba(212, 169, 78, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .hud-dock .hud-btn {
  color: rgba(235, 228, 208, 0.86);
  text-shadow: none;
}
html.theme-classic .seat {
  background: rgba(0, 0, 0, 0.24);
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  color: var(--ink);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .seat.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 169, 78, 0.35), 0 0 24px rgba(212, 169, 78, 0.22);
}
html.theme-classic .seat.report {
  border-color: var(--red-2);
  box-shadow: 0 0 0 2px rgba(224, 90, 74, 0.35);
}
html.theme-classic .seat::before { display: none; }
html.theme-classic .seat .avatar {
  background: linear-gradient(145deg, #2d7259, #174333);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}
html.theme-classic .seat .seat-name,
html.theme-classic .seat .seat-count,
html.theme-classic .seat .seat-state { text-shadow: none; }
html.theme-classic .self-info {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .self-info .avatar {
  background: linear-gradient(145deg, #2d7259, #174333);
  border: 2px solid rgba(212, 169, 78, 0.75);
  box-shadow: 0 0 0 3px rgba(212, 169, 78, 0.14), 0 0 12px rgba(212, 169, 78, 0.22);
}
html.theme-classic .self-info.first-hand {
  box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(212, 169, 78, 0.35);
}
html.theme-classic .self-info > * { text-shadow: none; }
html.theme-classic .social-dock .dock-btn {
  background: rgba(4, 22, 16, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: var(--ink);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: none;
}
html.theme-classic .social-dock .dock-btn:hover { border-color: var(--gold); }
html.theme-classic .toast {
  background: rgba(3, 18, 12, 0.95);
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: none;
}
html.theme-classic .toast::before { display: none; }
html.theme-classic .modal {
  background: rgba(0, 8, 5, 0.56);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .modal-card {
  background:
    radial-gradient(110% 80% at 12% 0%, rgba(120, 220, 180, 0.14), transparent 46%),
    radial-gradient(90% 100% at 92% 100%, rgba(212, 169, 78, 0.1), transparent 52%),
    linear-gradient(145deg, rgba(17, 54, 41, 0.9), rgba(4, 22, 16, 0.94));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 34px 90px rgba(0, 0, 0, 0.6);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .panel {
  background: linear-gradient(150deg, rgba(17, 54, 41, 0.9), rgba(4, 22, 16, 0.94));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 18px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .btn.liquid-glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .btn.liquid-glass::before,
html.theme-classic .btn.liquid-glass::after { display: none; }
html.theme-classic .btn.primary.liquid-glass {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: transparent;
  color: #2b1d05;
}
html.theme-classic .btn.ghost.liquid-glass { background: transparent; }
html.theme-classic .btn.danger.liquid-glass {
  background: linear-gradient(180deg, #c0392b, #8e1f16);
  border-color: #e05a4a;
  color: #fff;
}
html.theme-classic #theme-toggle {
  background: rgba(4, 20, 14, 0.78);
  border-color: rgba(212, 169, 78, 0.32);
  color: var(--gold-2);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: none;
}

/* ---------- v76: classic self frame + HUD accents ---------- */
html.theme-classic .self-info {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.theme-classic .self-info.first-hand {
  box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(212, 169, 78, 0.35);
}
html.theme-classic .hud-dock .hud-btn.hud-pause {
  color: #ffe2a0;
  background: rgba(212, 169, 78, 0.1);
  border-color: rgba(212, 169, 78, 0.3);
}
html.theme-classic .hud-dock .hud-btn.hud-exit {
  color: #ffb8ab;
  background: rgba(255, 76, 58, 0.1);
  border-color: rgba(255, 120, 100, 0.32);
}
