:root {
  --paper: #f6efe2;
  --surface: #fffaf0;
  --ink: #231c15;
  --muted: #76695a;
  --line: #231c15;
  --red: #e5482d;
  --red-soft: #fbd9cd;
  --teal: #0f7f78;
  --teal-soft: #cdeae4;
  --on-accent: #fffaf0;
  --shadow: 3px 3px 0 var(--line);
  /* 信息块用浅描边，只有能点的东西用粗黑边和错位阴影 */
  --line-soft: color-mix(in srgb, var(--ink) 16%, transparent);
  --line-mid: color-mix(in srgb, var(--ink) 30%, transparent);
  --lift: 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent), 0 6px 16px -10px color-mix(in srgb, var(--ink) 35%, transparent);
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1d1813;
    --surface: #2a231c;
    --ink: #f4eadb;
    --muted: #ab9d8b;
    --line: #000;
    --red: #ef5a3e;
    --red-soft: #4d2219;
    --teal: #24a198;
    --teal-soft: #12403c;
  }
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--surface) 70%, transparent), transparent 55%),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--ink) 2%, transparent) 0 1px, transparent 1px 3px),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

#app { height: var(--app-h, 100dvh); }

h1, h2, p { margin: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* 控件 */

.btn {
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  font: 700 16px var(--sans);
  cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.primary { background: var(--red); color: var(--on-accent); }
.btn.ghost {
  min-height: 40px;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.ghost:active { transform: none; opacity: .6; }
.btn.small { flex: none; min-height: 42px; padding: 0 14px; box-shadow: 2px 2px 0 var(--line); white-space: nowrap; }
.word-form .btn, .join-row .btn { flex: none; white-space: nowrap; }

.field {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font: 16px var(--sans);
}
.field::placeholder { color: var(--muted); }
.field:focus { outline: 3px solid var(--teal); outline-offset: 1px; }
button:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* 首页 */

.home {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(100%, 420px);
  height: 100%;
  margin: 0 auto;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
/* 内容超出一屏时不能整体居中，否则顶部会被裁掉、滑不回去 */
.home > :first-child, .home > .home-account + *, .home > .page-back + * { margin-top: auto; }
.home > :last-child { margin-bottom: auto; }
.logo { display: flex; justify-content: center; margin-bottom: 4px; }
.logo-card {
  display: grid;
  place-items: center;
  width: 92px;
  height: 118px;
  border: 3px solid var(--line);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--line);
  color: var(--on-accent);
  font: 900 60px var(--serif);
}
.tilt-l { background: var(--red); transform: rotate(-6deg) translateX(9px); }
.tilt-m { z-index: 1; background: #d99a12; transform: translateY(-6px); }
.tilt-r { background: var(--teal); transform: rotate(5deg) translate(-9px, 8px); }
.tagline { margin: 12px 0 12px; text-align: center; font: 700 20px/1.5 var(--serif); }
.site-pulse { margin: 0 0 8px; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.or { color: var(--muted); font-size: 14px; text-align: center; }
.join-row { display: flex; gap: 10px; }
.code-field { letter-spacing: .14em; text-transform: uppercase; }
.invite { text-align: center; }
.full-title { text-align: center; font: 900 42px var(--serif); }

.home-stats-link { align-self: center; }
.stats-page { width: min(100%, 1040px); gap: 16px; }
.home.stats-page > * { flex: none; margin-top: 0; margin-bottom: 0; }
.stats-page > .page-back { position: static; align-self: flex-start; margin: -10px 0 -8px; }
.stats-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stats-heading .page-title { text-align: left; font-size: 30px; }
.stats-date { margin-top: 6px; color: var(--muted); font-size: 12px; }
.stats-status { min-height: 18px; color: var(--muted); font-size: 12px; }
.stats-status.stats-error { color: var(--red); }
.stats-content { display: flex; flex-direction: column; gap: 18px; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-stats-grid > div { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 22px 8px; border: 1.5px solid var(--line-mid); border-radius: 12px; background: var(--surface);  box-shadow: var(--lift); }
.admin-stats-grid strong { max-width: 100%; overflow-wrap: anywhere; font: 900 28px var(--serif); }
.admin-stats-grid span { color: var(--muted); font-size: 12px; }
.stats-panel { min-width: 0; padding: 20px; border: 1.5px solid var(--line-mid); border-radius: 14px; background: var(--surface);  box-shadow: var(--lift); }
.stats-panel > h2 { margin-bottom: 12px; font: 800 19px var(--serif); }
.announcement-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.announcement-panel > .announcement-text { margin-bottom: 12px; }
.announcement-form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.announcement-form label { font-weight: 700; }
.announcement-input { padding: 12px 14px; resize: vertical; min-height: 130px; line-height: 1.6; }
.announcement-form .stats-caption { margin: 0; align-self: flex-end; }
.announcement-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.announcement-panel > .stats-status { margin-top: 12px; }
.stats-caption, .stats-empty { color: var(--muted); font-size: 12px; line-height: 1.6; }
.stats-caption { margin: 0 0 12px; }
.stats-empty { padding: 18px 0; }
.stats-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.stats-table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 10px 6px; text-align: right; border-bottom: 1px solid var(--paper); white-space: nowrap; }
.stats-table th { color: var(--muted); font-weight: 500; }
.stats-table th:first-child { text-align: left; }
.stats-table tbody tr:last-child > * { border-bottom: 0; }
.stats-legend { display: flex; gap: 16px; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.stats-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.stats-legend i { width: 9px; height: 9px; border-radius: 2px; }
.stats-legend .visits, .stats-bar.visits { background: var(--red); }
.stats-legend .entries, .stats-bar.entries { background: var(--teal); }
.stats-legend .registrations, .stats-bar.registrations { background: #d99a12; }
.stats-trend { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 9px; }
.stats-day { min-width: 0; }
.stats-day-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 160px; border-bottom: 1px solid var(--muted); }
.stats-bar { position: relative; flex: 1; max-width: 14px; border-radius: 3px 3px 0 0; }
.stats-bar.is-missing::after { content: ''; position: absolute; bottom: 3px; left: 0; right: 0; border-top: 1px dashed var(--muted); }
.stats-day-label { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; text-align: center; }
.stats-chart-scale { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 11px; }
.stats-details > summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.stats-details:not(.stats-methods) { margin-top: 18px; }
.stats-details[open] > summary { margin-bottom: 12px; }
.stats-popularity { display: flex; flex-direction: column; gap: 15px; }
.stats-game-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.stats-game-label b { font-weight: 500; }
.stats-game-label > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.stats-game-track { height: 7px; overflow: hidden; border-radius: 4px; background: var(--paper); }
.stats-game-track > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.stats-runtime { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; margin: 0; }
.stats-runtime dt { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.stats-runtime dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .stats-page { padding-left: 16px; padding-right: 16px; }
  .admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .admin-stats-grid > div { padding: 18px 8px; }
  .stats-panel { padding: 16px 12px; }
  .stats-columns { grid-template-columns: minmax(0, 1fr); }
  .stats-runtime { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-trend { gap: 4px; }
  .stats-day-bars { gap: 1px; }
  .stats-table { font-size: 12px; }
  .stats-table th, .stats-table td { padding-left: 3px; padding-right: 3px; }
}

.records { margin-top: 16px; }
.friends { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.friends h2, .records h2 { display: flex; align-items: center; gap: 12px; font: 800 17px var(--serif); }
.friends h2::before, .friends h2::after, .records h2::before, .records h2::after { flex: 1; height: 0; border-top: 1.5px dashed var(--line-mid); content: ""; }
.friends .hint { text-align: center; }
.friend { padding: 4px 10px; border: 1.5px solid var(--line-soft); border-radius: 12px; background: var(--surface); box-shadow: var(--lift); }
.friend small { flex: none; color: var(--muted); font-size: 12px; }
.friend-join { margin-left: auto; min-height: 36px; }
.friend-remove {
  flex: none;
  width: 32px;
  min-height: 32px;
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.friend-join + .friend-remove { margin-left: 0; }
.my-code { color: var(--muted); font-size: 13px; text-align: center; }
.my-code b { color: var(--ink); font: 800 15px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; }
.friend-tag { flex: none; margin-left: auto; color: var(--teal); }
.add-friend { border-color: var(--teal); color: var(--teal); }
.add-friend + .kick-btn, .friend-tag + .kick-btn { margin-left: 0; }
/* 账号入口和账号页 */
.home { position: relative; }
.home > .home-account { margin-top: 0; }
.home-account { display: grid; flex: none; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.home-left { display: flex; align-items: center; gap: 8px; justify-self: start; min-width: 0; }
.portal-chip { display: inline-flex; flex: none; align-items: center; gap: 3px; height: 34px; padding: 0 11px 0 8px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 2px 2px 0 var(--line); color: var(--ink); font: 800 13px var(--sans); text-decoration: none; white-space: nowrap; }
.portal-chip span { margin-top: -2px; font: 900 18px/1 var(--serif); }
.portal-chip:active { transform: translate(2px, 2px); box-shadow: none; }
.home-account .account-chip { min-width: 0; max-width: 100%; justify-self: end; padding: 6px 9px; }
.home-author-actions { display: flex; justify-content: center; align-items: center; gap: 10px; }
.home-author-link { min-height: 36px; padding: 4px 0; border: 0; background: none; color: var(--teal); font: 700 12px/1.4 var(--sans); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; cursor: pointer; }
.home-author-link:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px; }
.info-btn {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--line);
  color: var(--ink);
  font: 900 italic 18px var(--serif);
  text-decoration: none;
}
.info-btn.unseen::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--red);
}
.changelog-entry { padding: 12px 16px; border: 1.5px solid var(--line-soft); border-radius: 14px; background: var(--surface); box-shadow: var(--lift); }
.changelog-entry h2 { display: flex; align-items: baseline; gap: 8px; font: 800 18px var(--serif); }
.changelog-entry small { color: var(--muted); font: 12px var(--sans); }
.changelog-entry em { padding: 1px 7px; border-radius: 6px; background: var(--red); color: var(--on-accent); font: 700 11px var(--sans); }
.changelog-entry ul { margin: 6px 0 0; padding-left: 20px; }
.changelog-entry li { padding: 2px 0; font-size: 14px; line-height: 1.5; }
.changelog-page { overflow-anchor: none; }
.changelog-page > * { flex: none; }
.changelog-entries { display: flex; flex-direction: column; gap: 16px; }
.changelog-more { align-self: center; }
.changelog-more:disabled { cursor: default; color: var(--muted); text-decoration: none; }
.account-chip {
  max-width: 60%;
  padding: 6px 12px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--line);
  color: var(--ink);
  font: 700 14px var(--sans);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chip:active, .info-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.page-back { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 8px; }
.page-title { text-align: center; font: 900 34px var(--serif); }
.perks { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 12px 14px; border: 2px dashed var(--muted); border-radius: 12px; list-style: none; }
.perks li { display: flex; gap: 10px; font-size: 15px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.tab { min-height: 40px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 700 16px var(--sans); cursor: pointer; }
.tab.on { background: var(--red); color: var(--on-accent); }
.account-note { text-align: center; }
.account-note.error { color: var(--red); font-weight: 700; }
.account-name { text-align: center; font: 800 22px var(--serif); }
.account-page .hint { text-align: center; }
.members-title { margin: 8px 0 2px; color: var(--muted); font: 700 13px var(--sans); text-align: left; }
.invite-friends { text-align: left; }
.invite-btn:disabled { opacity: .55; cursor: default; }
.invite-banner {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  right: 0;
  left: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(calc(100% - 24px), 520px);
  margin: 0 auto;
  padding: 8px 6px 8px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.invite-banner span { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.legacy-notice {
  position: static;
  z-index: auto;
  flex: none;
  max-height: 20vh;
  overflow-y: auto;
  margin: 8px auto;
  background: var(--red-soft);
}
/* 表情吐槽 */
.rx { width: 100%; text-align: left; }
.rank .rx { grid-column: 1 / -1; }
.rx.empty { display: inline-block; width: auto; margin-left: 6px; vertical-align: middle; }
.rx.empty .rx-row { margin-top: 0; }
.rx.empty .rx-add { min-height: 24px; padding: 0 7px; }
.rank .rx.empty { grid-column: auto; margin-left: 0; }
.rx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.rx-chip, .rx-add, .rx-pick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--muted);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 14px var(--sans);
  cursor: pointer;
  touch-action: manipulation;
}
.rx-chip small { font-size: 12px; font-weight: 700; }
.rx-chip.mine, .rx-pick.mine { border-color: var(--teal); background: var(--teal-soft); }
.rx-add { color: var(--muted); font-size: 13px; border-style: dashed; }
.rx-comment { margin-top: 3px; padding: 3px 8px; border-radius: 8px; background: var(--red-soft); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.rx-comment b { font-weight: 700; }
.rx-picker { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding: 8px; border: 1px dashed var(--muted); border-radius: 10px; }
.rx-emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.rx-pick { min-height: 36px; padding: 0 10px; font-size: 18px; }
.rx-form { display: flex; gap: 6px; }
.rx-input { min-height: 38px; font-size: 15px; }
.rx-item { display: inline-flex; flex-wrap: wrap; align-items: center; max-width: 100%; }
.story-line .rx, .num-vals .rx { font-weight: 400; }
.records-empty { text-align: center; }
.records h2 { margin-bottom: 10px; }
.record { margin-bottom: 8px; border: 1.5px solid var(--line-soft); border-radius: 14px; background: var(--surface); box-shadow: var(--lift); }
.record summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; cursor: pointer; }
.record summary b { font: 800 16px var(--serif); }
.record summary small { color: var(--muted); font-size: 12px; }
.record summary span { width: 100%; font-size: 14px; overflow-wrap: anywhere; }
.record-players { padding: 0 12px; color: var(--muted); font-size: 13px; }
.record-section { padding: 6px 12px 10px; }
.record-section h3 { margin: 4px 0; font: 700 14px var(--sans); }
.record-section p { padding: 3px 0; border-bottom: 1px dashed var(--line-mid); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

/* 房间骨架 */

.room { display: flex; flex-direction: column; height: 100%; max-width: 560px; margin: 0 auto; }

.topbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1.5px solid var(--line-mid);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.icon-btn { width: 40px; height: 40px; border: 0; background: none; color: var(--ink); font-size: 22px; cursor: pointer; }
.room-code { display: flex; flex: none; align-items: center; gap: 2px; }
.room-code span { white-space: nowrap; }
.room-code button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.room-code b { font: 800 16px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; }
.room-code span { color: var(--teal); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.status {
  overflow: hidden;
  min-height: 40px;
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status[data-tone="ok"]::before { background: #2fb36d; }
.status[data-tone="warn"]::before { background: #e3a21a; }

.board { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }

/* 游戏区 */

.stage { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.stage h2 { font: 800 22px/1.3 var(--serif); }
.round-tag { color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--muted); font-size: 14px; }
.big-code { font: 900 44px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .1em; }
.big-code-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
/* 空房间：房间码做成一张票根，提示和按钮都放在票里 */
.stage[data-phase="invite"] { gap: 14px; padding-top: 6px; }
.stage[data-phase="invite"] > .eyebrow { align-self: center; padding: 3px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font: 800 12px var(--sans); letter-spacing: .08em; }
.stage[data-phase="invite"] > .big-code-row { position: relative; padding: 18px 14px 16px; border: 2px dashed var(--line-mid); border-radius: 16px; background: var(--surface); box-shadow: var(--lift); }
.stage[data-phase="invite"] .big-code { font-size: clamp(34px, 11vw, 46px); }
.stage[data-phase="invite"] > .members-title { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.stage[data-phase="invite"] > .members-title::after { flex: 1; border-top: 1.5px dashed var(--line-mid); content: ""; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.6; }
.hint.ready { color: var(--teal); font-weight: 700; }

.word-form { display: flex; gap: 10px; }
.word-input { font: 700 20px var(--serif); text-align: center; }

.last-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 800 18px var(--serif);
}
.last-pair span { padding: 3px 10px; border-radius: 8px; background: var(--red-soft); overflow-wrap: anywhere; }
.last-pair span:last-child { background: var(--teal-soft); }
.last-pair i { color: var(--muted); font-style: normal; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; perspective: 700px; }
.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 112px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.card small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card strong { font: 900 30px/1.2 var(--serif); overflow-wrap: anywhere; }
.card strong.long { font-size: 20px; }
.card.mine { background: var(--red-soft); }
.card.theirs { background: var(--teal-soft); }
.card.back { align-items: center; background: var(--teal); color: var(--on-accent); }
.dots { font: 900 44px var(--serif); animation: bob 1.1s ease-in-out infinite; }
.card.flip { animation: flip .55s cubic-bezier(.2, .8, .3, 1.2) both; }
.card.flip.theirs { animation-delay: .12s; }

.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 2px; }

.win-title { color: var(--red); font: 900 52px/1.1 var(--serif); text-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 18%, transparent); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }

@keyframes flip { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bob { 50% { transform: translateY(-5px) rotate(8deg); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1.5px dashed var(--line-soft); }
.stage-head .round-tag { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--muted); font-weight: 700; }
.switch-btn {
  flex: none;
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.game-list { display: flex; flex-direction: column; gap: 14px; }
.game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.game-card:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }
.game-card:disabled { opacity: .55; cursor: default; }
.game-item { position: relative; }
.game-item .game-card { padding-right: 52px; }
/* 竖直居中在卡片右侧，和左边的大图标对称 */
.rules-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  margin-top: -18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.rules-btn:active { transform: translate(2px, 2px); }
.rules-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 64px);
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--surface);
  color: var(--ink);
}
.rules-dialog::backdrop { background: rgb(0 0 0 / .45); }
.rules-dialog h2 { font: 900 22px var(--serif); }
.rules-dialog h3 { margin-top: 12px; font: 800 16px var(--serif); }
.rules-dialog ul { margin: 4px 0 0; padding-left: 20px; }
.rules-dialog li { padding: 2px 0; font-size: 14px; line-height: 1.55; }
.rules-dialog .btn { width: 100%; margin-top: 16px; }
.game-card.red { background: var(--red-soft); }
.game-card.teal { background: var(--teal-soft); }
.game-icon { font-size: 38px; line-height: 1; }
.game-text { display: flex; flex-direction: column; gap: 4px; }
.game-text b { font: 900 22px var(--serif); }
.game-text small { color: var(--muted); font-size: 13px; line-height: 1.4; }

.scoreboard { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.score-chip { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; max-width: 84px; }
.score-chip small { overflow: hidden; max-width: 100%; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pips { display: flex; gap: 3px; }
.pips i { width: 11px; height: 11px; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); }
.pips i.on { background: var(--red); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip { padding: 3px 10px; border: 1px solid var(--muted); border-radius: 999px; color: var(--muted); font-size: 13px; }
.chip.done { border-color: var(--teal); background: var(--teal-soft); color: var(--ink); font-weight: 700; }
.chip.away { border-style: dashed; opacity: .7; }
.my-answer { font: 800 20px var(--serif); overflow-wrap: anywhere; }
.wait-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.skip-btn { min-height: 42px; font-size: 14px; }
.skip-btn:disabled { opacity: .6; box-shadow: none; cursor: default; }
.progress-block, .skip-action { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; }
.skip-action { align-items: center; }
.wait-actions .skip-action { flex: 1 1 100%; }
.decision-status { color: var(--teal); font-size: 13px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.decision-status[hidden] { display: none; }
.skip-action .decision-status { color: var(--muted); font-size: 12px; font-weight: 500; }
.word-decision { padding: 8px 12px; border: 1px dashed var(--teal); border-radius: 10px; background: var(--teal-soft); }

/* One quiet entry stays outside the game scroll. Details share one dialog. */
.room-actions-bar { flex: none; height: 38px; border-top: 1.5px solid var(--line-mid); background: var(--surface); }
.room-actions-bar[hidden] { display: none; }
.room-actions-bar[data-mode="proposal"] { background: var(--red-soft); }
.room-actions-bar[data-mode="ready"] { background: var(--teal-soft); }
.room-actions-entry { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 100%; padding: 0 12px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.room-actions-summary { overflow: hidden; min-width: 0; font: 700 12px var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.room-actions-badge { flex: none; padding: 2px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: 800 11px var(--sans); white-space: nowrap; }
.room-actions-dialog { position: fixed; inset: 0; width: calc(100% - 24px); max-width: 520px; max-height: min(85dvh, calc(var(--app-h, 100dvh) - 24px)); margin: auto; padding: 0; overflow: hidden; border: 2px solid var(--line); border-radius: 16px; box-shadow: 5px 5px 0 var(--line); background: var(--paper); color: var(--ink); }
.room-actions-dialog[open] { display: flex; flex-direction: column; }
.room-actions-dialog:not([open]) { display: none; }
.room-actions-dialog::backdrop { background: rgb(35 28 21 / .5); }
.room-actions-dialog-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1.5px solid var(--line-mid); background: var(--surface); }
.room-actions-dialog-head h2 { font: 900 23px/1.2 var(--serif); }
.room-actions-dialog-head .icon-btn { flex: none; }
.room-actions-dialog-content { flex: 1 1 auto; min-height: 0; max-height: calc(85dvh - 64px); overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.room-actions-dialog .btn.primary { background: #cc3e25; color: var(--on-accent); }
.room-actions-dialog .btn:disabled { opacity: .65; box-shadow: none; cursor: default; }
.room-actions-overview, .room-actions-picker, .action-proposal, .action-ready { display: flex; flex-direction: column; gap: 14px; }
.room-actions-picker { gap: 10px; }
.room-actions-picker .game-list { padding-bottom: 4px; }
.room-actions-picker .game-card[aria-current="true"] { outline: 2px solid var(--teal); outline-offset: 2px; }
.decision-back { align-self: flex-start; padding: 2px 0; border: 0; background: none; color: var(--teal); font: 800 14px var(--sans); cursor: pointer; }
.decision-head { display: flex; align-items: center; gap: 14px; }
.decision-icon { display: grid; flex: none; place-items: center; width: 58px; height: 58px; border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); background: var(--red-soft); font-size: 30px; transform: rotate(-4deg); }
.decision-head.teal .decision-icon { background: var(--teal-soft); transform: rotate(4deg); }
.decision-title { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.decision-title small { color: var(--muted); font: 700 12px var(--sans); letter-spacing: .04em; }
.action-game-title { font: 900 24px/1.25 var(--serif); overflow-wrap: anywhere; }
.decision-sub { color: var(--red); font: 700 12px/1.4 var(--sans); }
.decision-tally { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1.5px dashed color-mix(in srgb, var(--line) 35%, transparent); }
.action-vote-count { color: var(--muted); font: 700 13px var(--sans); }
.action-vote-count strong { color: var(--ink); font: 900 22px var(--serif); }
.decision-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.decision-person { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 10px 3px 4px; overflow: hidden; border: 1.5px solid color-mix(in srgb, var(--line) 30%, transparent); border-radius: 999px; background: var(--surface); color: var(--muted); font: 700 13px var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.decision-mark { display: grid; flex: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 18%, transparent); font-size: 11px; }
.decision-person.yes { border-color: var(--teal); color: var(--ink); }
.decision-person.yes .decision-mark { background: var(--teal); color: var(--on-accent); }
.decision-person.no { border-color: var(--red); color: var(--ink); }
.decision-person.no .decision-mark { background: var(--red); color: var(--on-accent); }
.room-actions-dialog .decision-status { color: var(--muted); font-size: 12px; font-weight: 600; }
.decision-buttons { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.decision-buttons.single { grid-template-columns: 1fr; }
.decision-buttons .btn { width: 100%; margin: 0; }
.decision-foot { color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.account-notice-dialog { max-width: 430px; }
.account-notice-dialog .room-actions-dialog-head h2 { font-size: 22px; }
.account-notice-content { display: flex; flex-direction: column; gap: 16px; }
.account-notice-message { font: 700 17px/1.7 var(--sans); }
.announcement-dialog-content { display: flex; flex-direction: column; gap: 20px; }
.announcement-dialog .announcement-text { font-size: 17px; }
.account-notice-content .hint { line-height: 1.6; }
.author-dialog { max-width: 430px; }
.author-dialog .room-actions-dialog-head h2 { font-size: 22px; }
.author-content { display: flex; flex-direction: column; gap: 16px; text-align: center; line-height: 1.6; }
.author-email { color: var(--teal); font-weight: 700; overflow-wrap: anywhere; }
.author-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.author-actions .btn, .author-support > .btn { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; }
.author-payment-image { display: block; width: min(100%, 300px); height: auto; margin: 0 auto; border-radius: 12px; background: #fff; }
.author-support > .btn { align-self: center; }
@media (max-width: 600px) {
  .room-actions-dialog { margin: auto auto calc(12px + env(safe-area-inset-bottom)); }
  .room-actions-dialog-content { padding: 12px; }
}

.ranks { display: flex; flex-direction: column; gap: 6px; }
.rank {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  border: 1.5px solid var(--line-mid);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}
.rank.won { background: var(--teal-soft); outline: 2px solid #d99a12; }
.rank-name { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.rank b { font: 900 18px var(--serif); overflow-wrap: anywhere; }
.rank small { color: var(--muted); font-size: 12px; white-space: nowrap; }

.members {
  flex: none;
  max-height: 38dvh;
  overflow-y: auto;
  padding: 6px 12px;
  border-bottom: 1.5px solid var(--line-mid);
  background: var(--surface);
}
.members[hidden] { display: none; }
.host-notice { flex: none; margin: 0; padding: 6px 12px; border-bottom: 1.5px solid var(--line-mid); background: #f5d77a; color: #231c15; font-size: 14px; font-weight: 700; text-align: center; }
.host-notice[hidden] { display: none; }
.member { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.member-name { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }
.member small { color: var(--muted); font-size: 12px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: #2fb36d; }
.host-tag { flex: none; padding: 1px 7px; border-radius: 6px; background: #d99a12; color: #231c15; font: 700 12px var(--sans); }
.kick-btn {
  flex: none;
  min-height: 34px;
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: none;
  color: var(--red);
  font-size: 13px;
  cursor: pointer;
}

.word-row { display: flex; gap: 8px; padding: 7px 4px; border-bottom: 1px dashed var(--muted); }
.word-row em { flex: none; width: 20px; color: var(--muted); font: 700 12px/1.8 var(--sans); }
.word-row.hit { border-bottom: 0; border-radius: 8px; background: var(--red-soft); font-weight: 800; }
.word-row-items { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.word-row-items small { margin-right: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }
.bubble-name { display: block; color: var(--muted); font-size: 11px; }

.question { padding: 12px; border-block: 2px dashed var(--muted); font: 800 19px/1.45 var(--serif); }
.guess-preview { min-height: 18px; margin-top: -6px; color: var(--teal); }
.answer { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 6px; }
.answer small { width: 100%; color: var(--muted); font-size: 12px; }
.answer strong { color: var(--red); font: 900 38px/1.1 var(--serif); overflow-wrap: anywhere; }
.card.won { outline: 3px solid #d99a12; outline-offset: 1px; }
.round-verdict { font-weight: 800; }
.trivia { font-size: 15px; line-height: 1.5; }
.source { color: var(--muted); font-size: 12px; }

.num-row { padding: 9px 0; border-bottom: 1px dashed var(--muted); text-align: left; }
.num-row p { font-size: 14px; line-height: 1.4; }
.num-vals { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; color: var(--muted); font-size: 13px; }
.num-vals b { color: var(--ink); }
.num-vals .hit { color: var(--red); font-weight: 800; }

/* 派对游戏 */

.btn:disabled { opacity: .5; box-shadow: none; cursor: default; }
.score-num { font: 900 20px var(--serif); }

.option-list, .pick-list { display: flex; gap: 8px; }
.option-list { flex-direction: column; }
.pick-list { flex-wrap: wrap; justify-content: center; }
.option, .pick {
  min-height: 46px;
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 700 16px var(--sans);
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
}
.pick.num { width: 46px; padding: 0; }
.option small { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.option:disabled { cursor: default; opacity: .65; }
.option.picked, .pick.picked { background: var(--teal); color: var(--on-accent); opacity: 1; }

.reveal-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}
.reveal-option b { font: 800 17px var(--serif); overflow-wrap: anywhere; }
.reveal-option small { color: var(--muted); font-size: 12px; }
.reveal-option.truth { background: var(--teal-soft); outline: 2px solid #d99a12; }

.spectrum { display: flex; justify-content: space-between; gap: 12px; font: 800 15px var(--serif); }
.wave-slider { width: 100%; height: 44px; margin: 0; accent-color: var(--red); touch-action: pan-y; }
.wave-track {
  position: relative;
  height: 54px;
  margin: 0 14px;
  border-bottom: 10px solid var(--line);
  border-radius: 0 0 6px 6px;
}
.wave-mark { position: absolute; bottom: -10px; width: 2px; height: 30px; background: var(--teal); }
.wave-mark span {
  position: absolute;
  bottom: 28px;
  left: 50%;
  max-width: 64px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}
.wave-mark.edge-left span { left: 0; transform: none; }
.wave-mark.edge-right span { right: 0; left: auto; transform: none; }
.wave-mark.target { width: 4px; background: var(--red); }
.wave-mark.target span { color: var(--red); font-weight: 800; }

/* 神回复对决、排队感应、疯狂填词 */
.quip-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.quip-option small { margin-left: 0; }
.ito-theme { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-block: 2px dashed var(--muted); }
.ito-theme b { font: 800 20px var(--serif); }
.ito-theme span { color: var(--muted); font-size: 14px; }
.ito-number { display: flex; flex-direction: column; align-items: center; }
.ito-number small { color: var(--muted); font-size: 12px; }
.ito-number strong { color: var(--red); font: 900 48px/1.1 var(--serif); }
.ito-card { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border: 1.5px solid var(--line-mid); border-radius: 10px; background: var(--surface); text-align: left;  box-shadow: var(--lift); }
.ito-card.played { background: var(--teal-soft); }
.ito-card em { color: var(--teal); font: 900 16px var(--serif); font-style: normal; }
.ito-card span { flex: none; color: var(--muted); font-size: 13px; }
.ito-card b { font: 800 17px var(--serif); overflow-wrap: anywhere; }
.rank.miss { background: var(--red-soft); }
.libs-field { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.libs-field small { color: var(--teal); font-size: 13px; font-weight: 700; }
.libs-story { font: 17px/1.8 var(--serif); text-align: left; overflow-wrap: anywhere; }
.libs-story mark { padding: 0 3px; border-radius: 4px; background: #f5d77a; color: #231c15; font-weight: 800; }
.libs-story sup { margin-left: 2px; color: var(--muted); font: 10px var(--sans); }
.emoji-big { font-size: 40px; line-height: 1.3; letter-spacing: 2px; overflow-wrap: anywhere; }
.emoji-input { font-size: 24px; }
.emoji-panel { border: 1.5px solid var(--line-mid); border-radius: 12px; background: var(--surface); overflow: hidden;  box-shadow: var(--lift); }
.emoji-tabs { display: flex; gap: 4px; padding: 6px; overflow-x: auto; border-bottom: 1px solid var(--muted); scrollbar-width: none; }
.emoji-tab { flex: none; min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 700 13px var(--sans); cursor: pointer; }
.emoji-tab.on { background: var(--teal); color: var(--on-accent); }
.word-form .emoji-back { flex: none; padding: 0 12px; color: var(--red); font-size: 18px; }
.emoji-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); max-height: 210px; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.emoji-key { min-height: 40px; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 24px; cursor: pointer; touch-action: manipulation; }
.emoji-key:active { background: var(--teal-soft); transform: scale(.9); }
.emoji-category { align-self: center; padding: 2px 12px; border-radius: 999px; background: var(--teal-soft); font-size: 14px; font-weight: 700; }
.emoji-setup-icon { font-size: 56px; line-height: 1.2; }
.emoji-setup-kind { display: flex; width: 100%; max-width: 340px; flex-direction: column; gap: 8px; text-align: left; }
.emoji-setup-kind > span { color: var(--muted); font-size: 14px; font-weight: 700; }
.emoji-category-select { width: 100%; min-height: 50px; font-size: 18px; }
.emoji-category-select:disabled { opacity: .8; color: var(--ink); }
.game-text .emoji-card-kind { color: var(--teal); font-weight: 800; }
.emoji-step { padding: 6px 0; border-bottom: 1px dashed var(--muted); }
.emoji-step.origin .emoji-text { color: var(--red); }
.emoji-step:last-child { border-bottom: 0; }
.emoji-step small { color: var(--muted); font-size: 12px; }
.emoji-step .emoji-big { font-size: 32px; }
.emoji-text { font: 800 17px/1.5 var(--serif); overflow-wrap: anywhere; }
.story-form { display: flex; flex-direction: column; gap: 8px; }
.story-input {
  min-height: 84px;
  max-height: 40dvh;
  padding: 10px 12px;
  font: 17px/1.5 var(--serif);
  resize: none;
  overflow-y: auto;
}
.story-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.char-count { color: var(--muted); font-size: 12px; }
.story-line, .stage[data-phase="input"] .question { white-space: pre-wrap; }
.story-theme { color: var(--teal); font-size: 14px; font-weight: 700; }
.must-word { padding: 6px 10px; border-radius: 8px; background: var(--red-soft); font-size: 15px; }
.must-word b { color: var(--red); font: 900 18px var(--serif); }
.story-title { font-size: 34px; }
.story { padding: 10px 12px; border: 1.5px solid var(--line-mid); border-radius: 12px; background: var(--surface); text-align: left;  box-shadow: var(--lift); }
.story h3 { margin: 0 0 6px; font: 800 16px var(--serif); }
.story-line { padding: 3px 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.story-line small { margin-left: 6px; color: var(--muted); font-size: 11px; }
.story-line.starter { color: var(--muted); }

/* 历史 */

.history { margin-top: 18px; font-size: 15px; }
.history:empty { display: none; }
.history-title { margin: 0 0 10px; text-align: center; font: 800 17px var(--serif); }

/* 聊天 */

.chat {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--line-mid);
  background: var(--surface);
  box-shadow: 0 -8px 20px -16px color-mix(in srgb, var(--ink) 40%, transparent);
}
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: var(--chat-h, clamp(56px, 11dvh, 110px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.chat-handle {
  flex: none;
  height: 24px;
  margin: -8px 0 -6px;
  border: 0;
  background: none;
  cursor: ns-resize;
  touch-action: none;
}
.chat-handle::before {
  content: "";
  display: block;
  width: 44px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: var(--muted);
}
.chat-empty { margin: auto; color: var(--muted); font-size: 13px; }
.chat-fx { align-self: center; color: var(--muted); font-size: 12px; }
.bubble {
  align-self: flex-start;
  max-width: 82%;
  padding: 5px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 12px 12px 12px 3px;
  background: var(--teal-soft);
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.bubble.mine { align-self: flex-end; border-radius: 12px 12px 3px 12px; background: var(--red-soft); }

.fx-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.fx-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 48px;
  padding: 3px 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}
.fx-btn:active { background: var(--red-soft); transform: scale(.92); }
.fx-icon { font-size: 22px; line-height: 1.2; }
.fx-btn small { font-size: 11px; }

.chat-form { display: flex; gap: 8px; }
.chat-input { min-height: 42px; }

/* 键盘弹起时给输入区让位 */
@media (max-height: 500px) {
  .fx-bar, .chat-handle { display: none; }
  .chat-log { height: 48px; }
  .board { padding: 8px 16px; }
  .history { display: none; }
}

/* 特效层 */

#fx { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.fx-sprite, .fx-paper { position: absolute; top: 0; left: 0; line-height: 1; will-change: transform; user-select: none; }
.fx-questions { position: absolute; inset: 0; contain: layout style; transform-origin: center; }
.fx-question-mark { position: absolute; top: 0; left: 0; line-height: 1; font-weight: 900; user-select: none; }
.fx-bang { color: var(--red); font-family: var(--serif); font-weight: 900; -webkit-text-stroke: 2px var(--line); }
.fx-paper { border-radius: 2px; }

#toast {
  position: fixed;
  inset: auto auto 30% 50%;
  z-index: 60;
  margin: 0;
  border: 0;
  overflow: visible;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .2s;
}
#toast.show { opacity: 1; }
.btn.back-room { background: var(--teal); color: var(--on-accent); }
.old-tag { flex: none; padding: 1px 6px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 11px; font-weight: 700; }
/* 表情连发冷却 */
.fx-bar { position: relative; }
.fx-bar.cooling .fx-btn { opacity: .35; }
.fx-bar.cooling::after {
  content: attr(data-rest);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
/* 键盘弹起（屏幕高度不够）时，在游戏里打字就收起聊天区 */
@media (max-height: 600px) {
  body.stage-typing .chat { display: none; }
}
.rename-btn { flex: none; min-height: 30px; padding: 0 10px; border: 1px solid var(--teal); border-radius: 8px; background: none; color: var(--teal); font-size: 12px; cursor: pointer; }

/* 聊天：每人一个气泡颜色（按座位分），深色模式用深一档的同色系 */
:root {
  --b0: #fbd9cd; --b1: #cdeae4; --b2: #f5e3a8; --b3: #dcdcf7;
  --b4: #f6d4e8; --b5: #d6ecc6; --b6: #f9dfc0; --b7: #d3e6f7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --b0: #4d2219; --b1: #12403c; --b2: #4a3d14; --b3: #2e3058;
    --b4: #4b2340; --b5: #26401c; --b6: #4c3216; --b7: #1b3550;
  }
}
.bubble.c0 { background: var(--b0); } .bubble.c1 { background: var(--b1); }
.bubble.c2 { background: var(--b2); } .bubble.c3 { background: var(--b3); }
.bubble.c4 { background: var(--b4); } .bubble.c5 { background: var(--b5); }
.bubble.c6 { background: var(--b6); } .bubble.c7 { background: var(--b7); }
.bubble { -webkit-touch-callout: none; cursor: context-menu; }
.bubble-quote {
  display: block;
  margin: 2px 0 4px;
  padding: 2px 8px;
  border-left: 3px solid var(--muted);
  border-radius: 4px;
  background: rgba(0, 0, 0, .06);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
/* 聊天里的表情只显示别人贴的，不显示“＋”（用长按菜单贴） */
.bubble .rx.empty, .bubble .rx-add, .bubble .rx-comment { display: none; }
.bubble .rx-row { margin-top: 3px; }
.bubble .rx-chip { min-height: 22px; padding: 0 6px; font-size: 12px; }

.reply-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 10px;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: var(--teal-soft);
  font-size: 13px;
}
.reply-bar[hidden] { display: none; }
.reply-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .icon-btn { width: 30px; height: 30px; font-size: 18px; }

.msg-menu {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.msg-menu-emojis { display: flex; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--muted); }
.msg-menu-emojis .rx-pick { flex: 1; justify-content: center; padding: 0; }
.msg-menu-item { min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 15px var(--sans); text-align: left; cursor: pointer; }
.msg-menu-item:active { background: var(--teal-soft); }

.chat-emoji[hidden] { display: none; }
.chat-emoji .emoji-palette { max-height: 150px; }
.chat-emoji-btn { padding: 0 10px; font-size: 18px; }
.typing-bar { min-height: 16px; margin: -4px 0 -2px; color: var(--muted); font-size: 12px; }
.typing-bar:empty { min-height: 0; margin: 0; }
.read-mark { align-self: flex-end; margin: -4px 4px 0 0; color: var(--muted); font-size: 11px; }
.read-mark .unread { color: var(--red); }

/* ---------- 德州扑克 ---------- */
.poker { --felt: #13756c; --felt-deep: #0a4843; --rail: #3a2a1d; --gold: #e9b640; --gold-deep: #b9801a; --chip-ink: #2b2420;
  display: flex; flex-direction: column; gap: 10px; text-align: left; }
.pk-top { display: flex; align-items: center; gap: 8px; }
.pk-top .stage-head { flex: 1; min-width: 0; }
.pk-top .round-tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-hands { flex: none; min-height: 30px; padding: 0 6px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 700 12px var(--sans); }
.pk-hands:disabled { border-style: dashed; opacity: .8; }

.pk-wrap { padding: 30px 34px 30px; overflow-x: clip; }
.pk-table { position: relative; width: 100%; aspect-ratio: 1.3; }
.pk-felt { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border: 3px solid var(--line); border-radius: 50%;
  box-shadow: 5px 6px 0 var(--line), inset 0 0 0 9px var(--rail), inset 0 0 0 11px rgb(255 250 240 / .22), inset 0 0 0 13px var(--rail), inset 0 0 40px 12px rgb(0 0 0 / .35);
  background: radial-gradient(ellipse at 50% 38%, #1c9184, var(--felt) 45%, var(--felt-deep) 100%); }
.pk-felt::after { content: ""; position: absolute; inset: 20px; border: 1.5px dashed rgb(255 250 240 / .16); border-radius: 50%; }
.pk-logo { margin-top: 36%; color: rgb(255 250 240 / .16); font: 900 20px var(--serif); letter-spacing: .3em; }
.pk-table.sweat .pk-felt { animation: pk-heart 0.65s ease-in-out infinite; }
@keyframes pk-heart { 50% { box-shadow: 5px 6px 0 var(--line), inset 0 0 0 9px var(--rail), inset 0 0 0 11px rgb(255 250 240 / .22), inset 0 0 0 13px var(--rail), inset 0 0 70px 30px rgb(120 0 0 / .45); } }

.pk-center { position: absolute; top: 50%; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translate(-50%, -58%); }
.pk-board { display: flex; gap: 4px; perspective: 600px; }
.pk-slot { display: grid; place-items: center; width: 34px; height: 48px; border: 1.5px dashed rgb(255 250 240 / .25); border-radius: 6px; }
.pk-slot:has(.pk-card) { border-color: transparent; }
.pk-pot { display: flex; align-items: flex-end; gap: 6px; min-height: 26px; }
.pk-pot-num { padding: 2px 9px; border-radius: 999px; background: rgb(0 0 0 / .4); color: #fff6dc; font: 800 12px var(--sans); white-space: nowrap; }
.pk-pot-num:empty { display: none; }

/* 扑克牌 */
.pk-card { position: relative; display: inline-grid; flex: none; place-items: center; width: 34px; height: 48px; padding-top: 6px; border: 1.5px solid var(--line); border-radius: 6px;
  background: #fffaf0; box-shadow: 1px 2px 0 rgb(0 0 0 / .35); color: #231c15; line-height: 1; backface-visibility: hidden; transition: transform .25s, opacity .25s, box-shadow .25s; }
.pk-card b { position: absolute; top: 3px; left: 4px; font: 900 14px/1 var(--serif); letter-spacing: -.04em; }
.pk-card i { font: normal 19px/1 var(--sans); }
.pk-card.red { color: #d2361f; }
.pk-card.back { background: repeating-linear-gradient(45deg, #c9412a 0 4px, #e5482d 4px 8px); box-shadow: inset 0 0 0 2px #fffaf0, 1px 2px 0 rgb(0 0 0 / .35); }
.pk-card.mini { width: 19px; height: 27px; padding-top: 9px; border-width: 1px; border-radius: 3px; }
.pk-card.mini b { top: 1px; left: 2px; font-size: 9px; }
.pk-card.mini i { font-size: 10px; }
.pk-card.back.mini { box-shadow: inset 0 0 0 1.5px #fffaf0, 1px 1px 0 rgb(0 0 0 / .35); }
.pk-card.big { width: 60px; height: 84px; padding-top: 12px; border-width: 2px; border-radius: 9px; box-shadow: 3px 3px 0 var(--line); }
.pk-card.big b { top: 5px; left: 6px; font-size: 22px; }
.pk-card.big i { font-size: 34px; }
.pk-card.lit { box-shadow: 0 0 0 2px var(--gold), 0 0 16px 4px rgb(233 182 64 / .8); transform: translateY(-5px); }
.pk-card.dim { opacity: .4; }

/* 实体筹码：侧面看是一摞带边纹的扁圆 */
.pk-pile { display: inline-flex; align-items: flex-end; gap: 1px; transition: opacity .2s; pointer-events: none; }
.pk-pile.over-cards, .pk-bet > b.over-cards, .pk-pot-num.over-cards { opacity: .15; }
.pk-col { display: flex; flex-direction: column-reverse; }
.pk-chip { display: block; width: 16px; height: 7px; border: 1px solid #1a1410; border-radius: 50%; background: repeating-linear-gradient(90deg, var(--c) 0 3px, #fffaf0 3px 5px); }
.pk-chip + .pk-chip { margin-bottom: -3.6px; }
.pk-col.gold { --c: var(--gold); }
.pk-col.ink { --c: var(--chip-ink); }
.pk-col.red { --c: #d8432a; }
.pk-col.teal { --c: #1f8f86; }
.pk-chip.flying { position: absolute; z-index: 4; width: 18px; height: 18px; border-width: 1.5px; background: radial-gradient(circle, var(--c) 0 38%, #fffaf0 39% 48%, var(--c) 49%); pointer-events: none; }
.pk-chip.flying.gold { --c: var(--gold); }
.pk-chip.flying.red { --c: #d8432a; }

/* 座位 */
.pk-seat { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 72px; transform: translate(-50%, -50%); transition: opacity .3s, filter .3s; }
.pk-avatar { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 2.5px solid var(--line); border-radius: 50%; background: var(--surface); box-shadow: 2px 2px 0 var(--line); }
.pk-initial { color: var(--ink); font: 900 17px var(--serif); }
.pk-seat.me .pk-avatar { background: #fff1c9; }
.pk-seat.me .pk-initial, .pk-seat.winner .pk-initial, .pk-seat.winner .pk-name { color: #231c15; }
.pk-ring { position: absolute; inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); transform: rotate(-90deg); pointer-events: none; }
.pk-ring circle { fill: none; stroke: transparent; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 113; }
.pk-seat.turn .pk-ring circle { stroke: var(--gold); filter: drop-shadow(0 0 3px rgb(233 182 64 / .9)); }
.pk-seat.turn .pk-avatar { animation: pk-turn 1.2s ease-in-out infinite; }
@keyframes pk-turn { 50% { box-shadow: 2px 2px 0 var(--line), 0 0 0 6px rgb(233 182 64 / .35); } }
.pk-dealer { position: absolute; right: -8px; bottom: -5px; display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 50%; background: #fffaf0; color: #231c15; font: 900 10px var(--sans); box-shadow: 1px 1px 0 var(--line); }
.pk-dealer[hidden] { display: none; }
.pk-plate { display: flex; flex-direction: column; align-items: center; max-width: 76px; margin-top: 4px; padding: 1px 7px 2px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 1.5px 1.5px 0 var(--line); line-height: 1.25; }
.pk-name { max-width: 62px; overflow: hidden; color: var(--ink); font: 700 11px var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.pk-stack { color: var(--teal); font: 900 12px var(--sans); white-space: nowrap; }
.pk-tower { position: absolute; top: 2px; left: calc(50% + 24px); min-height: 38px; display: flex; align-items: flex-end; }
.pk-seat.flip .pk-tower { right: calc(50% + 24px); left: auto; }
.pk-hole { position: absolute; top: -12px; left: calc(50% - 30px); display: flex; }
.pk-hole .pk-card + .pk-card { margin-left: -8px; transform: rotate(9deg); }
.pk-hole .pk-card:first-child { transform: rotate(-7deg); }
.pk-seat.flip .pk-hole { left: auto; right: calc(50% - 30px); }
.pk-bubble { position: absolute; top: -26px; padding: 1px 8px; border: 1.5px solid var(--line); border-radius: 999px; background: #fffaf0; color: #231c15; font: 800 11px var(--sans); white-space: nowrap; box-shadow: 1.5px 1.5px 0 var(--line); animation: pk-pop .3s cubic-bezier(.2,1.6,.4,1); }
.pk-bubble[hidden] { display: none; }
.pk-bubble[data-t="r"], .pk-bubble[data-t="b"] { background: var(--gold); }
.pk-bubble[data-t="a"] { background: #d8432a; color: #fffaf0; }
.pk-bubble[data-t="c"] { background: #cdeae4; }
.pk-bubble[data-t="f"] { background: #d8d0c2; color: #76695a; }
@keyframes pk-pop { from { transform: scale(.4); opacity: 0; } }
.pk-seat.folded { opacity: .45; filter: grayscale(.8); }
.pk-seat.offline .pk-avatar { border-style: dashed; }
.pk-seat.allin .pk-avatar { border-color: #d8432a; box-shadow: 2px 2px 0 var(--line), 0 0 0 3px rgb(216 67 42 / .35); }
.pk-seat.allin .pk-stack { color: #d8432a; }
.pk-seat.winner .pk-avatar { border-color: var(--gold-deep); background: #ffe7a3; animation: pk-win 0.9s ease-in-out 3; }
.pk-seat.winner .pk-plate { background: #ffe7a3; }
@keyframes pk-win { 50% { box-shadow: 0 0 0 8px rgb(233 182 64 / .45), 0 0 24px 8px rgb(233 182 64 / .7); transform: scale(1.12); } }

/* 下注区：每人面前的筹码 */
.pk-bet { position: absolute; z-index: 1; display: flex; align-items: flex-end; gap: 3px; transform: translate(-50%, -50%); pointer-events: none; }
.pk-bet b { padding: 0 5px; border-radius: 999px; background: rgb(0 0 0 / .45); color: #fff6dc; font: 800 10px var(--sans); white-space: nowrap; }

/* 特效层 */
.pk-fx { position: absolute; inset: -20px; z-index: 6; pointer-events: none; }
.pk-flash { position: absolute; inset: -40px; border-radius: 30px; }
.pk-flash.allin { background: radial-gradient(circle, transparent 30%, rgb(216 67 42 / .85)); }
.pk-flash.big { background: radial-gradient(circle, transparent 40%, rgb(233 182 64 / .6)); }
.pk-flash.gold { background: radial-gradient(circle, rgb(255 240 190 / .9), rgb(233 182 64 / .5) 50%, transparent 80%); }
.pk-stamp { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 4px; }
.pk-stamp > b { position: relative; z-index: 1; font: 900 46px/1.05 var(--serif); letter-spacing: .02em; white-space: nowrap; color: #ffe9a8;
  -webkit-text-stroke: 2px #231c15; paint-order: stroke fill; text-shadow: 3px 4px 0 #231c15; transform: skew(-8deg) rotate(-6deg); animation: pk-slam .55s cubic-bezier(.2,1.5,.35,1) both; }
.pk-stamp > small { position: relative; z-index: 1; padding: 3px 12px; border: 2px solid #231c15; border-radius: 999px; background: #fffaf0; color: #231c15; font: 800 13px var(--sans); box-shadow: 2px 2px 0 #231c15; animation: pk-pop .4s .25s cubic-bezier(.2,1.6,.4,1) both; }
.pk-stamp.allin > b { color: #fff; font-size: 54px; background: linear-gradient(180deg, #fff3c4 10%, #ffb23a 50%, #e5482d 90%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pk-stamp.great > b, .pk-stamp.epic > b, .pk-stamp.legend > b { background: linear-gradient(180deg, #fffbe6 5%, #ffd75e 45%, #c47b12 95%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pk-stamp.epic > b { font-size: 58px; }
.pk-stamp.legend > b { font-size: 66px; animation: pk-slam .7s cubic-bezier(.2,1.5,.35,1) both, pk-glow 1s .7s ease-in-out infinite alternate; }
.pk-rays { position: absolute; top: 50%; left: 50%; width: 150%; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0; }
.pk-stamp.great .pk-rays, .pk-stamp.epic .pk-rays, .pk-stamp.legend .pk-rays, .pk-stamp.allin .pk-rays { opacity: 1; animation: pk-spin 7s linear infinite;
  background: repeating-conic-gradient(rgb(255 225 140 / .5) 0 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 62%); mask: radial-gradient(circle, #000 12%, transparent 62%); }
.pk-stamp.allin .pk-rays { background: repeating-conic-gradient(rgb(255 120 60 / .55) 0 6deg, transparent 6deg 16deg); animation-duration: 3s; }
.pk-stamp.legend .pk-rays { width: 220%; background: repeating-conic-gradient(rgb(255 230 150 / .7) 0 8deg, rgb(255 180 60 / .15) 8deg 18deg); }
@keyframes pk-slam { 0% { transform: skew(-8deg) rotate(-6deg) scale(3.2); opacity: 0; filter: blur(6px); } 60% { opacity: 1; filter: none; } 100% { transform: skew(-8deg) rotate(-6deg) scale(1); } }
@keyframes pk-glow { to { filter: drop-shadow(0 0 14px rgb(255 214 100 / .95)); } }
@keyframes pk-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* 我的手牌 */
.pk-console { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; margin-top: -10px; }
.pk-dock { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 104px; }
.pk-mine { display: flex; perspective: 600px; }
.pk-mine .pk-card:first-child { transform: rotate(-6deg); }
.pk-mine .pk-card + .pk-card { margin-left: -14px; transform: rotate(6deg) translateY(2px); }
.pk-mine .pk-card.lit { transform: translateY(-8px); }
.pk-mine.folded { opacity: .45; filter: grayscale(1); }
.pk-mine-info { display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center; }
.pk-mine-info small { display: none; }
.pk-mine-info b { font: 900 17px/1.2 var(--serif); }
.pk-mine-info span { color: var(--teal); font: 800 12px var(--sans); }
.pk-watch { color: var(--muted); font-size: 13px; }

/* 操作按钮 */
.pk-actions { display: flex; flex-direction: column; gap: 10px; }
.pk-actions.wait p { padding: 12px; border: 2px dashed color-mix(in srgb, var(--line) 30%, transparent); border-radius: 12px; color: var(--muted); font: 700 14px var(--sans); text-align: center; }
.pk-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pk-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 52px; padding: 4px 6px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--surface); box-shadow: 3px 3px 0 var(--line); color: var(--ink); cursor: pointer; transition: transform .08s; }
.pk-btn span { overflow: hidden; max-width: 100%; font: 900 16px/1.15 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.pk-btn small { font: 800 10px var(--sans); letter-spacing: .08em; opacity: .75; }
.pk-btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }
.pk-btn:disabled { opacity: .4; box-shadow: none; cursor: default; }
.pk-btn.fold { background: #e9e1d2; color: #5b4f42; }
.pk-btn.check, .pk-btn.call { background: var(--teal); color: #fffaf0; }
.pk-btn.raise-open, .pk-btn.raise { background: var(--gold); color: #231c15; }
.pk-btn.raise-open.on { box-shadow: none; transform: translate(3px, 3px); }
.pk-btn.allin { position: relative; overflow: hidden; background: #231c15; color: #ffd75e; }
.pk-btn.allin span { font-size: 17px; letter-spacing: .02em; }
.pk-btn.allin:not(:disabled)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgb(255 230 150 / .45) 50%, transparent 65%); animation: pk-shine 2.2s ease-in-out infinite; }
@keyframes pk-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.pk-raise { position: absolute; z-index: 8; right: 0; bottom: calc(100% + 8px); left: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 3px 3px 0 var(--line); animation: pk-pop .2s ease-out; }
.pk-raise[hidden] { display: none; }
.pk-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pk-chipbtn { min-height: 34px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: 800 13px var(--sans); cursor: pointer; }
.pk-chipbtn:active { background: var(--gold); }
.pk-raise-row { display: flex; align-items: center; gap: 10px; }
.pk-slider { flex: 1; min-width: 0; accent-color: var(--gold-deep); height: 28px; }
.pk-raise-row .pk-btn { flex: none; min-width: 112px; min-height: 48px; }
.pk-raise-row .pk-btn b { font: 900 15px var(--sans); }

/* 结算与历史 */
.pk-final { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.pk-rank { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; text-align: left; }
.pk-rank li { display: grid; grid-template-columns: 26px minmax(0, 5em) 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border: 1.5px solid var(--line-mid); border-radius: 10px; background: var(--surface);  box-shadow: var(--lift); }
.pk-rank li.first { background: #ffe7a3; box-shadow: 3px 3px 0 var(--line); color: #231c15; }
.pk-rank-no { font: 900 18px var(--serif); text-align: center; }
.pk-rank-name { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pk-rank-bar { height: 10px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--line) 12%, transparent); }
.pk-rank-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.pk-hist { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1.5px dashed color-mix(in srgb, var(--line) 25%, transparent); }
.pk-hist-head { display: flex; align-items: center; gap: 10px; }
.pk-hist-head b { font: 900 16px var(--serif); }
.pk-hist-head span { color: var(--muted); font-size: 13px; }
.pk-hist-share { margin-left: auto; padding: 3px 10px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 700 12px var(--sans); cursor: pointer; }
.pk-hist-board { display: flex; align-items: center; gap: 4px; min-height: 30px; padding: 6px 10px; border-radius: 10px; background: linear-gradient(#1c9184, #0d5d57); }
.pk-hist-board small { color: rgb(255 250 240 / .8); font-size: 12px; }
.pk-hist-players { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pk-hist-players li { display: grid; grid-template-columns: minmax(0, 5.5em) auto 1fr auto; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; font-size: 13px; }
.pk-hist-players li.won { background: #ffe7a3; color: #231c15; }
.pk-hist-players li.secret .pk-hist-cards { opacity: .6; }
.pk-hist-name { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pk-hist-cards { display: flex; gap: 2px; }
.pk-hist-cards small { color: var(--muted); font-size: 12px; }
.pk-hist-hand { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pk-hist-players li.won .pk-hist-hand { color: #8a3b10; font-weight: 800; }
.pk-hist-net { font: 800 13px var(--sans); }
.pk-hist-net.up { color: var(--teal); }
.pk-hist-net.down { color: var(--red); }

@media (max-width: 420px) {
  .pk-wrap { padding: 24px 26px 28px; }
  .pk-table { aspect-ratio: 1.12; }
  .pk-slot, .pk-board .pk-card { width: 29px; height: 41px; }
  .pk-board .pk-card b { font-size: 12px; }
  .pk-board .pk-card i { font-size: 16px; }
  .pk-seat { width: 64px; }
  .pk-avatar { width: 36px; height: 36px; }
  .pk-tower { left: calc(50% + 21px); }
  .pk-seat.flip .pk-tower { right: calc(50% + 21px); }
  .pk-btn span { font-size: 14px; }
  .pk-btn.allin span { font-size: 15px; }
  .pk-stamp > b { font-size: 38px; }
  .pk-stamp.allin > b { font-size: 44px; }
  .pk-stamp.epic > b { font-size: 46px; }
  .pk-stamp.legend > b { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .pk-rays, .pk-btn.allin::after, .pk-seat.turn .pk-avatar, .pk-table.sweat .pk-felt { animation: none !important; }
}

/* ---------- 飞花令 ---------- */
.feihua-character { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 12px; }
.feihua-character small { color: var(--muted); font-size: 13px; }
.feihua-character strong { display: grid; place-items: center; width: 108px; height: 108px; border: 3px solid var(--line); border-radius: 26px 12px 26px 12px; background: var(--red-soft); box-shadow: 4px 4px 0 var(--line); color: var(--red); font: 900 72px/1 var(--serif); }
.feihua-seats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.feihua-seat { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 3px; padding: 8px; border: 2px solid color-mix(in srgb, var(--ink) 20%, transparent); border-radius: 12px; background: var(--surface); }
.feihua-seat.turn { border-color: var(--teal); background: var(--teal-soft); box-shadow: 2px 2px 0 var(--teal); }
.feihua-seat.out { opacity: .65; }
.feihua-seat b { max-width: 100%; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.feihua-seat small { color: var(--muted); font-size: 11px; }
.feihua-hearts { font-size: 18px; letter-spacing: 2px; white-space: nowrap; }
.feihua-turn { font: 800 19px/1.4 var(--serif); overflow-wrap: anywhere; }
.feihua-clock { min-height: 24px; color: var(--teal); font: 800 16px/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.feihua-clock.hurry { color: var(--red); }
.feihua-entry { display: flex; flex-direction: column; gap: 10px; }
.feihua-form { display: flex; flex-direction: column; gap: 10px; }
.feihua-input { min-height: 52px; font-size: 18px; }
.feihua-poem { margin: 0; padding: 18px 14px; border-block: 2px dashed var(--muted); font: 800 24px/1.6 var(--serif); overflow-wrap: anywhere; white-space: pre-wrap; }
.feihua-votes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feihua-votes .btn { min-height: 54px; font-size: 20px; }
.feihua-yes { background: var(--teal-soft); }
.feihua-no { background: var(--red-soft); }
.feihua-votes .picked { outline: 3px solid var(--teal); outline-offset: 2px; }
.feihua-ranking { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; text-align: left; }
.feihua-ranking li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; padding: 12px; border: 1.5px solid var(--line-mid); border-radius: 12px; background: var(--surface);  box-shadow: var(--lift); }
.feihua-ranking .first { background: var(--teal-soft); box-shadow: 3px 3px 0 var(--line); }
.feihua-ranking small { color: var(--muted); }
.feihua-history-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); }
.feihua-history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.feihua-history-head b { min-width: 0; overflow-wrap: anywhere; }
.feihua-history-head strong { flex: none; color: var(--red); }
.feihua-history-row.accepted .feihua-history-head strong { color: var(--teal); }
.feihua-history-poem { font: 700 19px/1.6 var(--serif); overflow-wrap: anywhere; white-space: pre-wrap; }
.feihua-history-row > small { color: var(--muted); font-size: 12px; }
@media (min-width: 560px) {
  .feihua-seats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .feihua-form { flex-direction: row; }
  .feihua-form .btn { flex: none; white-space: nowrap; }
}

/* ---------- 最后一张 ---------- */
.lc-game { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.lc-game > .stage-head { margin-bottom: 0; }
.lc-r { --lc-color: #c84932; --lc-bg: #fbd9cd; --lc-fg: #6b281b; }
.lc-y { --lc-color: #b58b13; --lc-bg: #f8e7a7; --lc-fg: #5a4307; }
.lc-g { --lc-color: #377c55; --lc-bg: #d4ebd8; --lc-fg: #214c33; }
.lc-b { --lc-color: #3d6f9c; --lc-bg: #d4e5f4; --lc-fg: #24445f; }
.lc-wild { --lc-color: #68586e; --lc-bg: #ebe1ec; --lc-fg: #493850; }
.lc-seats { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.lc-seat { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 4px; padding: 7px 5px; border: 2px solid color-mix(in srgb, var(--ink) 20%, transparent); border-radius: 12px; background: var(--surface); }
.lc-seat.turn { border-color: var(--teal); background: var(--teal-soft); box-shadow: 2px 2px 0 var(--teal); }
.lc-seat b { max-width: 100%; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.lc-seat small { max-width: 100%; color: var(--muted); font-size: 11px; white-space: nowrap; }
.lc-seat .lc-called { color: var(--red); font-weight: 900; }
.lc-seat-cards { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.lc-card-back { display: grid; width: 22px; height: 29px; place-items: center; border: 1.5px solid var(--line); border-radius: 5px; background: var(--teal-soft); font-size: 14px; font-style: normal; }
.lc-center { display: grid; grid-template-columns: 70px 108px; align-items: center; justify-content: center; gap: 10px 20px; padding: 12px 10px; border: 2px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 18px; background: color-mix(in srgb, var(--teal-soft) 25%, var(--paper)); }
.lc-deck, .lc-discard { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.lc-deck > small, .lc-discard > small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.lc-deck-back { display: grid; width: 66px; height: 98px; place-items: center; padding: 9px; border: 2px solid var(--line); border-radius: 12px; background: repeating-linear-gradient(90deg, var(--teal-soft), var(--teal-soft) 8px, var(--surface) 8px, var(--surface) 11px); box-shadow: 3px 3px 0 var(--line); color: var(--teal); font: 900 19px/1.3 var(--serif); writing-mode: vertical-rl; }
/* 牌面：整张上色，左上和右下角标在叠牌时也能认出点数。 */
.lc-card { --w: 82px; position: relative; display: flex; width: var(--w); height: calc(var(--w) * 1.45); flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px; overflow: hidden; border: 2px solid var(--line); border-radius: 11px; background: var(--lc-color); box-shadow: 2px 3px 0 var(--line); color: #fffaf0; font-family: var(--sans); text-align: center; touch-action: manipulation; }
.lc-card::before { position: absolute; inset: 5px; border: 1.5px solid rgb(255 250 240 / .5); border-radius: 7px; content: ''; pointer-events: none; }
.lc-wild { --lc-color: #2c2530; }
.lc-card.lc-wild { background: linear-gradient(135deg, #c84932 0 25%, #c99a14 25% 50%, #377c55 50% 75%, #3d6f9c 75%); }
.lc-card.lc-wild::before { inset: 22% 14%; border: 2px solid var(--line); border-radius: 8px; background: #2c2530; }
.lc-corner { position: absolute; top: 4px; left: 6px; font: 900 15px/1 var(--sans); letter-spacing: -.02em; text-shadow: 1px 1px 0 rgb(0 0 0 / .35); }
.lc-corner-end { top: auto; right: 6px; bottom: 4px; left: auto; transform: rotate(180deg); }
.lc-card-color { position: relative; font: 800 10px/1.2 var(--sans); opacity: .9; }
.lc-card > strong { position: relative; font: 900 36px/1 var(--serif); text-shadow: 2px 2px 0 var(--line); white-space: nowrap; }
.lc-card > .lc-card-wide { font-size: 24px; }
.lc-card-caption { position: relative; font: 700 9px/1.3 var(--sans); opacity: .9; }
.lc-card.lc-top { --w: 104px; }
.lc-top > strong { font-size: 48px; }
.lc-top > .lc-card-wide { font-size: 30px; }
.lc-table-info { display: flex; grid-column: 1 / -1; flex-direction: column; align-items: center; gap: 5px; }
.lc-current-color { padding: 5px 13px; border: 2px solid var(--lc-color); border-radius: 9px; background: var(--lc-bg); color: var(--lc-fg); font: 900 16px/1.4 var(--sans); }
.lc-direction { color: var(--muted); font: 800 13px/1.4 var(--sans); }
.lc-clock { min-height: 21px; color: var(--teal); font: 900 14px/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.lc-clock.hurry { color: var(--red); }
.lc-controls { display: flex; min-width: 0; flex-direction: column; gap: 10px; }
.lc-phase-title { font: 800 18px/1.5 var(--serif); overflow-wrap: anywhere; }
.lc-actions, .lc-catch-list { display: flex; flex-wrap: wrap; gap: 9px; }
.lc-actions .btn, .lc-catch-list .btn { flex: 1; min-width: 100px; }
.lc-color-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lc-color-choice { min-height: 50px; border-color: var(--lc-color); background: var(--lc-bg); color: var(--lc-fg); }
.lc-announce { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.lc-catch { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.lc-hand-wrap { min-width: 0; padding-top: 4px; }
.lc-hand-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; text-align: left; }
.lc-hand-heading b { font-size: 14px; }
.lc-hand-heading small { color: var(--muted); font-size: 11px; }
/* 手牌按颜色一行一行排，同色牌叠成一把扇子：放得下就摊开，放不下就收紧只露角标。 */
.lc-hand { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 4px; }
.lc-row { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border: 2px solid transparent; border-radius: 12px; }
.lc-row.current { border-color: var(--lc-color); background: var(--lc-bg); }
.lc-row-label { display: flex; width: 30px; flex: none; flex-direction: column; align-items: center; color: var(--lc-color); font-size: 12px; line-height: 1.3; }
.lc-wild .lc-row-label, .lc-row.lc-wild { color: var(--ink); }
.lc-row-label small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.lc-fan { display: flex; min-width: 0; flex: 1; padding: 10px 2px 3px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.lc-slot { position: relative; min-width: 17px; flex: 0 1 calc(var(--hand-w) + 6px); }
.lc-slot:last-child { flex: none; }
.lc-hand { --hand-w: 60px; }
.lc-hand .lc-card { --w: var(--hand-w); height: calc(var(--w) * 1.3); gap: 1px; border-radius: 9px; box-shadow: -2px 2px 0 rgb(0 0 0 / .25); transition: transform .12s, filter .12s; }
.lc-hand .lc-card > strong { font-size: calc(var(--hand-w) * .46); }
.lc-hand .lc-card > .lc-card-wide { font-size: calc(var(--hand-w) * .3); }
.lc-hand .lc-card-color, .lc-hand .lc-card-caption, .lc-hand .lc-corner-end { display: none; }
.lc-hand.my-turn .blocked { filter: saturate(.25) brightness(1.1); opacity: .5; }
.lc-hand.my-turn .playable { z-index: 1; cursor: pointer; transform: translateY(-6px); box-shadow: -2px 2px 0 rgb(0 0 0 / .25), 0 0 0 3px var(--surface), 0 0 0 5px var(--teal); }
.lc-hand.my-turn .playable:hover, .lc-hand.my-turn .playable:focus-visible { z-index: 2; transform: translateY(-9px); }
.lc-hand .just-drawn { box-shadow: -2px 2px 0 rgb(0 0 0 / .25), 0 0 0 3px var(--surface), 0 0 0 5px #c99a14; }
.lc-hand button:disabled { cursor: default; }
@media (min-width: 560px) { .lc-hand { --hand-w: 70px; } }
.lc-risk { text-align: left; }
.lc-ranking { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; text-align: left; }
.lc-ranking li { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 7px; padding: 12px; border: 1.5px solid var(--line-mid); border-radius: 12px; background: var(--surface);  box-shadow: var(--lift); }
.lc-ranking li.first { background: var(--teal-soft); box-shadow: 3px 3px 0 var(--line); }
.lc-ranking li > small { color: var(--muted); font-size: 12px; }
.lc-final-hand { display: flex; width: 100%; min-width: 0; max-width: 100%; gap: 6px; padding-bottom: 5px; overflow-x: auto; }
.lc-card.lc-small { --w: 46px; gap: 0; border-radius: 8px; box-shadow: 1px 2px 0 var(--line); }
.lc-small > strong { font-size: 21px; }
.lc-small > .lc-card-wide { font-size: 16px; }
.lc-small .lc-card-color, .lc-small .lc-card-caption, .lc-small .lc-corner { display: none; }
.lc-log-row { display: flex; flex-direction: column; gap: 5px; padding: 10px 0; border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); text-align: left; }
.lc-log-row p { font: 700 14px/1.5 var(--sans); overflow-wrap: anywhere; }
@media (min-width: 360px) {
  .lc-seats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 560px) {
  .lc-seats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lc-center { grid-template-columns: 70px 108px minmax(0, 1fr); }
  .lc-table-info { grid-column: auto; }
  .lc-color-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .lc-hand .lc-card { transition: none; }
  .lc-hand.my-turn .playable, .lc-hand.my-turn .playable:hover { transform: none; }
}

/* ---------- 房间语音 ---------- */
.voice-ctl { display: flex; flex: none; align-items: center; gap: 6px; margin-left: auto; }
.voice-ctl + .status { margin-left: 4px; }
.voice-btn { min-height: 32px; padding: 0 10px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 2px 2px 0 var(--line); color: var(--ink); font: 800 12px var(--sans); white-space: nowrap; cursor: pointer; }
.voice-btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.voice-btn:disabled { opacity: .55; cursor: default; }
.voice-btn.join { background: var(--teal-soft); }
.voice-btn.mic { background: #e9e1d2; color: #5b4f42; }
.voice-btn.mic.on { background: #2fb36d; color: #fff; }
.voice-btn.hang { padding: 0 9px; background: var(--red); color: var(--on-accent); }
.voice-strip { display: flex; flex: none; align-items: center; gap: 6px; padding: 6px 12px; overflow-x: auto; border-bottom: 1.5px dashed color-mix(in srgb, var(--line) 30%, transparent); background: var(--surface); scrollbar-width: none; }
.voice-strip[hidden] { display: none; }
.voice-label { flex: none; color: var(--muted); font: 800 11px var(--sans); }
.voice-chip { display: inline-flex; flex: none; align-items: center; gap: 3px; padding: 2px 9px 2px 6px; border: 1.5px solid color-mix(in srgb, var(--line) 35%, transparent); border-radius: 999px; background: var(--paper); color: var(--ink); font: 700 12px var(--sans); white-space: nowrap; transition: box-shadow .15s, border-color .15s; }
.voice-chip i { font-style: normal; font-size: 12px; }
.voice-chip small { color: var(--muted); font-size: 10px; }
.voice-chip.off { opacity: .75; }
.voice-chip.talking { border-color: #2fb36d; box-shadow: 0 0 0 3px rgb(47 179 109 / .35); }
.voice-tag { color: var(--teal); }
.pk-seat.voice-on .pk-avatar::before, .pk-seat.voice-muted .pk-avatar::before { position: absolute; top: -6px; left: -8px; display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 50%; background: #fffaf0; font-size: 10px; }
.pk-seat.voice-on .pk-avatar::before { content: "🎤"; background: #c9f1d8; }
.pk-seat.voice-muted .pk-avatar::before { content: "🎤"; background: linear-gradient(135deg, transparent 44%, #d8432a 44% 56%, transparent 56%), #e9e1d2; }
.pk-seat.talking .pk-avatar { box-shadow: 2px 2px 0 var(--line), 0 0 0 4px rgb(47 179 109 / .55), 0 0 14px 4px rgb(47 179 109 / .5); }
@media (max-width: 420px) {
  .voice-btn { padding: 0 8px; font-size: 11px; }
  .room-code-copy span { display: none; }
  .room-code-share span { font-size: 12px; }
}

/* 麦克风图标：闭麦时划一道红斜线 */
.mic-ico { position: relative; display: inline-grid; place-items: center; width: 16px; font-size: 12px; font-style: normal; line-height: 1; }
.mic-ico.off { opacity: .55; }
.mic-ico.off::after { content: ""; position: absolute; top: 50%; left: -1px; width: 18px; height: 2px; border-radius: 2px; background: #d8432a; transform: rotate(-45deg); }
.voice-btn.mic { display: inline-flex; align-items: center; gap: 4px; }

/* 顶栏喇叭：分开静音游戏音效和语音 */
.sound-wrap { position: relative; flex: none; margin-left: 6px; }
.sound-btn { display: grid; place-items: center; width: 34px; height: 32px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 2px 2px 0 var(--line); font-size: 15px; cursor: pointer; }
.sound-btn.muted { background: #e9e1d2; }
.sound-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.sound-btn.pulse { animation: sound-pulse 1s ease-in-out infinite; }
@keyframes sound-pulse { 50% { box-shadow: 2px 2px 0 var(--line), 0 0 0 6px rgb(233 182 64 / .55); } }
.sound-wrap + .status { margin-left: 4px; }
.sound-menu { position: absolute; top: calc(100% + 8px); right: -6px; z-index: 60; display: flex; flex-direction: column; gap: 4px; width: 236px; padding: 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 4px 4px 0 var(--line); }
.sound-menu[hidden] { display: none; }
.sound-title { padding: 2px 6px 4px; color: var(--muted); font: 800 11px var(--sans); }
.sound-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.sound-row:hover { background: var(--paper); }
.sound-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.sound-text b { font: 800 14px var(--sans); }
.sound-text small { color: var(--muted); font-size: 11px; }
.switch { position: relative; flex: none; width: 38px; height: 22px; border: 2px solid var(--line); border-radius: 999px; background: #d8d0c2; transition: background .15s; }
.switch i { position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; border: 1.5px solid var(--line); border-radius: 50%; background: #fffaf0; transition: transform .15s; }
.sound-row.on .switch { background: var(--teal); }
.sound-row.on .switch i { transform: translateX(16px); }

/* 进德州时指向喇叭的提示 */
.sound-tip { position: fixed; z-index: 90; display: flex; flex-direction: column; gap: 6px; width: min(250px, calc(100vw - 24px)); padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff1c9; box-shadow: 4px 4px 0 var(--line); color: #231c15; animation: pk-pop .35s cubic-bezier(.2,1.6,.4,1); }
.sound-tip::before { content: ""; position: absolute; top: -10px; right: var(--arrow-right, 14px); width: 16px; height: 16px; border-top: 2px solid var(--line); border-left: 2px solid var(--line); background: #fff1c9; transform: rotate(45deg); }
.sound-tip b { font: 900 15px var(--serif); }
.sound-tip span { font: 600 13px/1.5 var(--sans); }
.sound-tip-ok { align-self: flex-end; padding: 4px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: #231c15; color: #fff1c9; font: 800 12px var(--sans); cursor: pointer; }

/* ---------- 战绩长图 ---------- */
.btn.share-record { background: var(--surface); }
.record .share-record { margin-top: 10px; }
.finish-tail { display: flex; flex-direction: column; gap: 12px; }
.share-dialog { max-width: 460px; }
.share-content { display: flex; flex-direction: column; gap: 12px; }
.share-preview { max-height: min(60dvh, 560px); overflow-y: auto; border: 1.5px solid var(--line-mid); border-radius: 12px; background: var(--paper);  box-shadow: var(--lift); }
.share-preview img { display: block; width: 100%; height: auto; -webkit-touch-callout: default; user-select: auto; }
.share-hint { text-align: center; }
.share-content .decision-buttons a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* 游戏卡上的人数范围；人不够时整张卡变淡并写明还差几人 */
.game-size { margin-left: 8px; padding: 1px 7px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 800 11px var(--sans); font-style: normal; vertical-align: 2px; white-space: nowrap; }
.game-item.short .game-card { opacity: .6; }
.game-item.short .game-size { border-color: var(--red); background: var(--red); color: var(--on-accent); }

/* 德州牌型手册 */
.pk-guide { flex: none; min-height: 30px; padding: 0 9px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 700 12px var(--sans); cursor: pointer; }
.pk-rankings ol { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pk-rankings li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--line) 5%, transparent); }
.pk-rankings li:first-child { background: #ffe7a3; color: #231c15; }
.pk-rank-place { display: grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: var(--on-accent); font: 900 12px var(--sans); }
.pk-rank-body { display: flex; flex: 1; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; min-width: 0; }
.pk-rank-title { display: flex; flex-direction: column; min-width: 6.5em; }
.pk-rank-title b { font: 900 15px var(--serif); }
.pk-rank-title small { color: var(--muted); font-size: 11px; }
.pk-rankings li:first-child .pk-rank-title small { color: #6b5a3e; }
.pk-rank-cards { display: flex; gap: 3px; }
.rules-dialog .pk-rankings .hint { margin-top: 8px; }
