/* =========================================================
   蜀韵麻将 · 视觉系统
   墨绿、朱砂、宣纸、鎏金；移动优先，桌面舒展。
   ========================================================= */

:root {
  --ink-deep: #061a15;
  --ink: #0d2b23;
  --ink-soft: #163b31;
  --jade: #1e5a49;
  --jade-bright: #2f7660;
  --jade-pale: #9dba9f;
  --paper: #f6eddb;
  --paper-soft: #fbf6ea;
  --paper-deep: #ebddc3;
  --line: #d8c5a3;
  --line-dark: #bca77f;
  --text: #1c2d27;
  --text-soft: #63736a;
  --muted: #8b948a;
  --vermilion: #b74234;
  --vermilion-bright: #d25b42;
  --vermilion-dark: #8e2f26;
  --gold: #c6a25c;
  --gold-light: #e7d19a;
  --gold-dark: #9c7b39;
  --shadow: 0 24px 70px rgba(8, 26, 21, 0.24);
  --shadow-soft: 0 10px 30px rgba(8, 26, 21, 0.12);
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", "Times New Roman", serif;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-num: "Avenir Next", "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--ink-deep);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
  background: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

svg {
  display: block;
}

::selection {
  background: rgba(183, 66, 52, 0.24);
}

.app-shell {
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  animation: screen-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.serif {
  font-family: var(--font-serif);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--vermilion);
  color: #fff7e7;
  box-shadow: 0 10px 24px rgba(150, 45, 32, 0.28);
}

.btn-primary:hover {
  background: var(--vermilion-bright);
}

.btn-gold {
  background: linear-gradient(135deg, #e3c986, #bd9650);
  color: #2b2213;
  box-shadow: 0 10px 24px rgba(157, 123, 58, 0.24);
}

.btn-gold:hover {
  filter: brightness(1.04);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.28);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.7);
}

.btn-dark-ghost {
  border: 1px solid rgba(231, 209, 154, 0.3);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.05);
}

.btn-dark-ghost:hover {
  background: rgba(255, 255, 255, 0.11);
}

.btn[disabled] {
  opacity: 0.55;
  transform: none;
}

.btn-wide {
  width: 100%;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: currentColor;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.icon-button:active {
  transform: scale(0.94);
}

.icon-button.is-off {
  opacity: 0.55;
}

.coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.coin-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1px solid rgba(137, 98, 30, 0.45);
  background: radial-gradient(circle at 35% 30%, #f2dfaa, #c7a259 70%);
  color: #5e4419;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-serif);
  flex: 0 0 auto;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2d6a57, #17483a);
  color: #f3e7ca;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  flex: 0 0 auto;
  border: 1px solid rgba(231, 209, 154, 0.3);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.avatar[data-color="amber"] {
  background: linear-gradient(145deg, #a77932, #674719);
}
.avatar[data-color="jade"] {
  background: linear-gradient(145deg, #3f7d63, #1d4d3c);
}
.avatar[data-color="coral"] {
  background: linear-gradient(145deg, #b35b48, #7a3126);
}
.avatar[data-color="bamboo"] {
  background: linear-gradient(145deg, #648b55, #355534);
}
.avatar[data-color="red"] {
  background: linear-gradient(145deg, #9f3c32, #68231d);
}
.avatar[data-color="slate"] {
  background: linear-gradient(145deg, #4f6d6d, #2a4445);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid currentColor;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

.chip-jade {
  color: #2b6d55;
  background: rgba(47, 118, 96, 0.08);
}

.chip-red {
  color: var(--vermilion);
  background: rgba(183, 66, 52, 0.08);
}

.chip-gold {
  color: #89682c;
  background: rgba(198, 162, 92, 0.12);
}

.chip-dark {
  color: var(--paper);
  background: rgba(5, 24, 20, 0.5);
  border-color: rgba(231, 209, 154, 0.26);
}

/* ---------------- 加载 ---------------- */
.initial-loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(46, 108, 88, 0.5), transparent 55%),
    var(--ink-deep);
  color: var(--paper);
  gap: 18px;
  transition: opacity 0.45s ease;
}

.initial-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-seal {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 34px;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 5px var(--ink-deep),
    inset 0 0 0 6px rgba(198, 162, 92, 0.3);
  animation: seal-breathe 2.4s ease-in-out infinite;
}

.loader-title {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.24em;
}

.loader-line {
  width: 120px;
  height: 1px;
  background: rgba(231, 209, 154, 0.18);
  overflow: hidden;
}

.loader-line span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--gold);
  animation: loader-line 1.4s ease-in-out infinite;
}

.initial-loader p {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(246, 237, 219, 0.52);
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
}

/* ---------------- 登录 / 注册 ---------------- */
.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  background: var(--ink-deep);
}

.auth-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(34px + var(--safe-top)) clamp(28px, 5vw, 80px)
    calc(42px + var(--safe-bottom));
  color: var(--paper);
  background:
    radial-gradient(circle at 74% 20%, rgba(72, 139, 113, 0.36), transparent 36%),
    radial-gradient(circle at 10% 84%, rgba(163, 66, 47, 0.25), transparent 42%),
    linear-gradient(155deg, #103b30 0%, #09281f 52%, #061a15 100%);
  isolation: isolate;
}

.auth-art::before {
  content: "";
  position: absolute;
  width: min(65vw, 760px);
  aspect-ratio: 1;
  right: -24%;
  top: 8%;
  border-radius: 50%;
  border: 1px solid rgba(231, 209, 154, 0.16);
  box-shadow:
    0 0 0 42px rgba(231, 209, 154, 0.025),
    0 0 0 43px rgba(231, 209, 154, 0.08);
  z-index: -1;
}

.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(231, 209, 154, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 209, 154, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 86%);
  z-index: -1;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 3;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-seal {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--vermilion);
  color: #f9edda;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.14),
    0 5px 16px rgba(110, 30, 22, 0.32);
  position: relative;
}

.brand-seal::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(249, 237, 218, 0.45);
  border-radius: 6px;
}

.brand-words {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-words strong {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.brand-words span {
  font-family: var(--font-num);
  font-size: 8px;
  letter-spacing: 0.3em;
  color: rgba(246, 237, 219, 0.48);
  text-transform: uppercase;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.86;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-toggle button {
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  color: inherit;
  opacity: 0.55;
  transition: all 0.18s ease;
}

.lang-toggle button.is-active {
  background: currentColor;
  opacity: 1;
}

.lang-toggle button.is-active span {
  mix-blend-mode: difference;
  color: #fff;
}

.auth-art .lang-toggle {
  color: rgba(246, 237, 219, 0.72);
}

.auth-copy {
  position: relative;
  z-index: 2;
  margin-top: clamp(40px, 8vh, 110px);
  max-width: 620px;
}

.auth-kicker {
  color: var(--gold-light);
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: 0.3em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-kicker::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
}

.auth-title {
  margin-top: 22px;
  font-family: var(--font-serif);
  font-size: clamp(46px, 5.8vw, 86px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: 0.035em;
  white-space: pre-line;
  text-wrap: balance;
}

.auth-title em {
  font-style: normal;
  color: var(--gold-light);
}

.auth-sub {
  margin-top: 22px;
  max-width: 430px;
  color: rgba(246, 237, 219, 0.65);
  font-size: 13px;
  line-height: 1.9;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 28px;
}

.auth-features span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 11px;
  border: 1px solid rgba(231, 209, 154, 0.18);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(246, 237, 219, 0.7);
  background: rgba(255, 255, 255, 0.03);
}

.auth-features span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.auth-tile-fan {
  position: absolute;
  right: clamp(18px, 4vw, 70px);
  bottom: clamp(108px, 15vh, 170px);
  width: 260px;
  height: 220px;
  z-index: 1;
  opacity: 0.9;
  pointer-events: none;
}

.auth-tile-fan .tile {
  position: absolute;
  width: 84px;
  filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.35));
}

.auth-tile-fan .tile:nth-child(1) {
  left: 10px;
  bottom: 26px;
  transform: rotate(-18deg);
}

.auth-tile-fan .tile:nth-child(2) {
  left: 82px;
  bottom: 70px;
  transform: rotate(-3deg);
  z-index: 2;
}

.auth-tile-fan .tile:nth-child(3) {
  left: 158px;
  bottom: 30px;
  transform: rotate(14deg);
}

.auth-signature {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  color: rgba(246, 237, 219, 0.46);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.auth-signature .seal-line {
  width: 28px;
  height: 1px;
  background: rgba(231, 209, 154, 0.3);
}

.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(34px + var(--safe-top)) clamp(24px, 5vw, 80px)
    calc(34px + var(--safe-bottom));
  background:
    radial-gradient(circle at 85% 8%, rgba(198, 162, 92, 0.14), transparent 32%),
    var(--paper);
  color: var(--text);
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(28, 45, 39, 0.055) 0.7px, transparent 0.7px);
  background-size: 7px 7px;
  opacity: 0.65;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: min(400px, 100%);
  animation: card-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  z-index: 2;
}

.auth-panel-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 22px;
}

.auth-panel .lang-toggle {
  color: var(--text-soft);
  border-color: var(--line);
}

.auth-form-head {
  margin-bottom: 28px;
}

.auth-form-head .eyebrow {
  color: var(--vermilion);
}

.auth-form-head h2 {
  margin-top: 13px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.4vw, 41px);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.auth-form-head p {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.75;
}

.auth-tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.auth-tabs button {
  position: relative;
  padding: 0 2px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.auth-tabs button.is-active {
  color: var(--text);
}

.auth-tabs button.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--vermilion);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 15px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.46);
  border-radius: 12px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.field-control:focus-within {
  border-color: rgba(183, 66, 52, 0.6);
  background: var(--paper-soft);
  box-shadow: 0 0 0 3px rgba(183, 66, 52, 0.08);
}

.field-control input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 15px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}

.field-control input::placeholder {
  color: #a9aa9e;
}

.field-icon {
  position: absolute;
  right: 14px;
  color: #9b9c8f;
  pointer-events: none;
}

.field-reveal {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #8b8d80;
  border-radius: 8px;
}

.field-reveal:hover {
  background: rgba(28, 45, 39, 0.05);
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-left: 2px solid var(--vermilion);
  background: rgba(183, 66, 52, 0.065);
  color: var(--vermilion-dark);
  font-size: 11px;
  line-height: 1.55;
  animation: shake-in 0.35s ease;
}

.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  border-radius: 12px;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
}

.auth-switch button {
  color: var(--vermilion);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-guest {
  margin-top: 18px;
}

.auth-guest-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-guest-divider::before,
.auth-guest-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(188, 167, 127, 0.4);
}

.auth-guest-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border-radius: 12px;
  justify-content: center;
  font-size: 12px;
}

.auth-guest-note {
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
  text-align: center;
}

.auth-trust {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(188, 167, 127, 0.4);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.auth-trust svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--gold-dark);
}

.auth-footnote {
  margin-top: 20px;
  font-size: 9px;
  letter-spacing: 0.09em;
  color: #9c9c8f;
  text-align: center;
}

.auth-mobile-brand {
  display: none;
}

/* ---------------- 大厅 ---------------- */
.lobby-screen {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 0%, rgba(198, 162, 92, 0.16), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(36, 101, 82, 0.11), transparent 32%),
    linear-gradient(180deg, #f7efdf 0%, #f3e8d2 54%, #f6eedf 100%);
  color: var(--text);
  overflow-x: hidden;
}

.lobby-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(70, 87, 75, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 87, 75, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.lobby-header {
  position: relative;
  z-index: 10;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: calc(22px + var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.lobby-header .brand-seal {
  width: 38px;
  height: 38px;
  font-size: 21px;
}

.lobby-header .brand-words strong {
  color: var(--ink);
  font-size: 17px;
}

.lobby-header .brand-words span {
  color: var(--muted);
}

.lobby-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(188, 167, 127, 0.65);
  background: rgba(255, 252, 244, 0.7);
  color: #6a5225;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.coin-pill .coin-mark {
  width: 20px;
  height: 20px;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.36);
  transition: background 0.18s ease;
}

.profile-button:hover {
  background: rgba(255, 255, 255, 0.68);
}

.profile-button .avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.profile-button span {
  font-size: 11px;
  font-weight: 700;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-header .icon-button {
  color: var(--text-soft);
}

.language-quick {
  display: none;
}

.lobby-header .lang-toggle {
  color: var(--text-soft);
  border-color: var(--line);
  height: 34px;
}

.lobby-main {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(14px, 1.6vw, 20px) 0 40px;
}

.lobby-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.lobby-intro-copy .eyebrow {
  color: var(--vermilion);
}

.lobby-intro-copy h1 {
  margin-top: 13px;
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.8vw, 64px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.025em;
}

.lobby-intro-copy p {
  margin-top: 12px;
  max-width: 600px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.8;
}

.lobby-intro-side {
  display: flex;
  gap: 22px;
  padding-bottom: 4px;
  flex: 0 0 auto;
}

.intro-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 64px;
}

.intro-stat strong {
  font-family: var(--font-num);
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.intro-stat span {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.lobby-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.78fr);
  gap: 18px;
  align-items: stretch;
}

.mode-hero {
  position: relative;
  overflow: hidden;
  min-height: 368px;
  padding: clamp(26px, 4vw, 44px);
  border-radius: 26px;
  color: var(--paper);
  background:
    radial-gradient(circle at 82% 26%, rgba(86, 145, 114, 0.34), transparent 33%),
    radial-gradient(circle at 12% 100%, rgba(165, 57, 42, 0.26), transparent 35%),
    linear-gradient(140deg, #184d3e 0%, #0d3329 53%, #09271f 100%);
  box-shadow: 0 28px 70px rgba(18, 47, 38, 0.24);
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

.mode-hero::before {
  content: "戰";
  position: absolute;
  right: -6px;
  bottom: -66px;
  font-family: var(--font-serif);
  font-size: 300px;
  line-height: 1;
  color: rgba(231, 209, 154, 0.055);
  z-index: -1;
  pointer-events: none;
}

.mode-hero::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(231, 209, 154, 0.14);
  border-radius: 18px;
  pointer-events: none;
}

.mode-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.mode-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mode-hero-tags .chip {
  color: rgba(246, 237, 219, 0.75);
  border-color: rgba(231, 209, 154, 0.24);
  background: rgba(255, 255, 255, 0.045);
}

.mode-hero-body {
  position: relative;
  z-index: 2;
  margin-top: -5px;
  margin-bottom: auto;
  padding-top: 0;
  max-width: 70%;
}

.mode-hero-body .eyebrow {
  color: var(--gold-light);
  font-size: 9px;
}

.mode-hero-title {
  margin-top: 13px;
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.6vw, 62px);
  letter-spacing: 0.06em;
  line-height: 1.08;
  font-weight: 600;
}

.mode-hero-desc {
  margin-top: 14px;
  color: rgba(246, 237, 219, 0.62);
  font-size: 12px;
  line-height: 1.8;
  max-width: 460px;
}

.mode-hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.mode-hero-actions .btn {
  min-height: 48px;
  padding: 0 25px;
}

.mode-hero-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(231, 209, 154, 0.13);
  position: relative;
  z-index: 2;
}

.mode-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-meta-item span {
  font-size: 9px;
  color: rgba(246, 237, 219, 0.42);
  letter-spacing: 0.1em;
}

.mode-meta-item strong {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 600;
  color: rgba(246, 237, 219, 0.9);
  font-variant-numeric: tabular-nums;
}

.hero-tile-stack {
  position: absolute;
  right: clamp(22px, 4.5vw, 58px);
  top: 50%;
  transform: translateY(-55%);
  width: 190px;
  height: 220px;
  z-index: 1;
  pointer-events: none;
}

.hero-tile-stack .tile {
  position: absolute;
  width: 78px;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.4));
}

.hero-tile-stack .tile:nth-child(1) {
  left: 0;
  top: 18px;
  transform: rotate(-16deg);
}

.hero-tile-stack .tile:nth-child(2) {
  right: 0;
  top: 0;
  transform: rotate(8deg);
}

.hero-tile-stack .tile:nth-child(3) {
  left: 55px;
  bottom: 0;
  transform: rotate(-2deg);
  z-index: 2;
}

.lobby-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.profile-card {
  position: relative;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 252, 244, 0.72);
  border: 1px solid rgba(188, 167, 127, 0.55);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.profile-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-card-head .avatar {
  width: 48px;
  height: 48px;
  font-size: 20px;
  background: linear-gradient(145deg, #2b6351, #143f32);
}

.profile-card-info {
  min-width: 0;
}

.profile-card-info strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card-info span {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.balance-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(188, 167, 127, 0.4);
}

.balance-block span {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.balance-block strong {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--font-num);
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.balance-block strong small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 20px;
  background: rgba(188, 167, 127, 0.32);
  border: 1px solid rgba(188, 167, 127, 0.32);
  border-radius: 12px;
  overflow: hidden;
}

.profile-stat {
  background: rgba(255, 252, 244, 0.9);
  padding: 11px 8px;
  text-align: center;
}

.profile-stat strong {
  display: block;
  font-family: var(--font-num);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.profile-stat span {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.lobby-section {
  margin-top: clamp(32px, 5vw, 52px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.7vw, 31px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-head p {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 178px;
  padding: 22px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(188, 167, 127, 0.55);
  background: rgba(255, 252, 244, 0.55);
  overflow: hidden;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: rgba(183, 66, 52, 0.42);
  background: rgba(255, 252, 244, 0.92);
  box-shadow: var(--shadow-soft);
}

.mode-card.is-current {
  border-color: rgba(31, 91, 73, 0.55);
  background:
    radial-gradient(circle at 100% 0, rgba(47, 118, 96, 0.18), transparent 48%),
    rgba(255, 252, 244, 0.86);
}

.mode-card.is-soon {
  opacity: 0.66;
  cursor: default;
}

.mode-card.is-soon:hover {
  transform: none;
  border-color: rgba(188, 167, 127, 0.55);
  box-shadow: none;
}

.mode-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 18px;
  border: 1px solid rgba(231, 209, 154, 0.24);
}

.mode-card h3 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}

.mode-card p {
  margin-top: 7px;
  font-size: 10px;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 260px;
}

.mode-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding-top: 15px;
  font-size: 9px;
  color: var(--muted);
}

.mode-card-foot .arrow {
  color: var(--vermilion);
  transition: transform 0.2s ease;
}

.mode-card:hover .mode-card-foot .arrow {
  transform: translateX(3px);
}

.lobby-footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 calc(24px + var(--safe-bottom));
  border-top: 1px solid rgba(188, 167, 127, 0.38);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.lobby-footer .seal-small {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(183, 66, 52, 0.5);
  border-radius: 5px;
  color: var(--vermilion);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 12px;
}

.resume-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(31, 91, 73, 0.35);
  background: rgba(47, 118, 96, 0.09);
  font-size: 11px;
  color: #285c4b;
}

.resume-banner .dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3a8468;
  box-shadow: 0 0 0 4px rgba(58, 132, 104, 0.12);
  flex: 0 0 auto;
}

.resume-banner strong {
  font-weight: 700;
}

/* ---------------- 弹窗通用 ---------------- */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(18px, var(--safe-top)) 16px max(18px, var(--safe-bottom));
  background: rgba(4, 17, 14, 0.62);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fade-in 0.22s ease both;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-layer.is-top {
  z-index: 150;
}

.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: min(88dvh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(198, 162, 92, 0.12), transparent 28%),
    var(--paper-soft);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(231, 209, 154, 0.45);
  animation: modal-rise 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal::-webkit-scrollbar {
  width: 5px;
}

.modal::-webkit-scrollbar-thumb {
  background: rgba(28, 45, 39, 0.2);
  border-radius: 999px;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 16px;
  background: linear-gradient(180deg, var(--paper-soft) 72%, rgba(251, 246, 234, 0));
}

.modal-head h2 {
  margin-top: 9px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.modal-head h2 .modal-title-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(30, 90, 73, 0.1);
  color: var(--jade);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .modal-head h2 .modal-title-badge {
    margin-left: 6px;
    padding: 4px 8px;
    font-size: 10px;
  }
}

.modal-head p {
  margin-top: 7px;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.65;
}

.menu-modal .modal-head {
  background: var(--paper-soft);
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--text-soft);
  background: rgba(28, 45, 39, 0.06);
}

.modal-close:hover {
  background: rgba(28, 45, 39, 0.12);
}

.modal-body {
  padding: 0 26px 26px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 16px 26px 24px;
  border-top: 1px solid rgba(188, 167, 127, 0.38);
  background: rgba(235, 221, 195, 0.25);
  position: sticky;
  bottom: 0;
  backdrop-filter: blur(8px);
}

.rules-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(235, 221, 195, 0.4);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rules-tabs::-webkit-scrollbar {
  display: none;
}

.rules-tabs button {
  flex: 1;
  min-width: 88px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
  white-space: nowrap;
}

.rules-tabs button.is-active {
  background: var(--paper-soft);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(28, 45, 39, 0.08);
}

.rule-section {
  padding: 15px 0;
  border-bottom: 1px solid rgba(188, 167, 127, 0.32);
}

.rule-section:first-child {
  padding-top: 0;
}

.rule-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rule-section h3 {
  display: flex;
  gap: 9px;
  align-items: baseline;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
}

.rule-section h3 span {
  color: var(--vermilion);
  font-family: var(--font-num);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.rule-section p {
  margin: 7px 0 0 20px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.8;
}

.rules-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--gold);
  background: rgba(198, 162, 92, 0.09);
  font-size: 10px;
  color: #746036;
  line-height: 1.65;
}

.menu-grid {
  display: grid;
  gap: 12px;
}

.menu-account {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid rgba(188, 167, 127, 0.45);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
}

.menu-account .avatar {
  width: 44px;
  height: 44px;
}

.menu-account-info {
  min-width: 0;
}

.menu-account-info strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-account-info span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-soft);
}

.menu-coin {
  margin-left: auto;
  color: #79602b;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(188, 167, 127, 0.3);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--jade);
  background: rgba(47, 118, 96, 0.08);
  flex: 0 0 auto;
}

.setting-copy {
  min-width: 0;
}

.setting-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.setting-copy span {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: var(--muted);
}

.setting-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.3);
}

.segmented button {
  min-width: 52px;
  height: 27px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-soft);
}

.segmented button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c9c0ad;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fffdf6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.switch.is-on {
  background: var(--jade-bright);
}

.switch.is-on::after {
  transform: translateX(18px);
}

.switch:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 4px;
  border-top: 1px solid rgba(188, 167, 127, 0.3);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

.menu-link svg {
  color: var(--jade);
}

.menu-link.danger {
  color: var(--vermilion);
}

.menu-link.danger svg {
  color: var(--vermilion);
}

.confirm-modal {
  width: min(400px, 100%);
}

.confirm-modal .modal-body {
  padding-top: 2px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.confirm-actions .btn {
  flex: 1;
  min-height: 44px;
}

.btn-danger {
  background: var(--vermilion);
  color: #fff6e8;
}

.btn-danger:hover {
  background: var(--vermilion-bright);
}

/* ---------------- 游戏 ---------------- */
.game-screen {
  height: 100vh;
  height: 100dvh;
  min-height: 480px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 50% 30%, #133d32 0%, #0a241d 42%, #061712 100%);
  color: var(--paper);
  overflow: hidden;
}

.game-topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: calc(54px + var(--safe-top));
  padding: calc(7px + var(--safe-top)) max(12px, 2.6vw) 7px;
  background: rgba(5, 22, 18, 0.82);
  border-bottom: 1px solid rgba(231, 209, 154, 0.09);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.game-topbar-left,
.game-topbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.game-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.game-brand .brand-seal {
  width: 30px;
  height: 30px;
  font-size: 17px;
  border-radius: 8px;
  box-shadow: none;
}

.game-brand .brand-seal::after {
  inset: 3px;
  border-radius: 4px;
}

.game-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.game-brand-text strong {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.game-brand-text span {
  font-size: 8px;
  color: rgba(246, 237, 219, 0.42);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.game-room-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(231, 209, 154, 0.14);
  font-size: 9px;
  color: rgba(246, 237, 219, 0.55);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.game-room-info .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.65;
}

.game-topbar .icon-button {
  color: rgba(246, 237, 219, 0.68);
  width: 34px;
  height: 34px;
}

.game-topbar .icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topbar-coins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(231, 209, 154, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: var(--gold-light);
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.topbar-coins .coin-mark {
  width: 17px;
  height: 17px;
  font-size: 9px;
}

.table-stage {
  position: relative;
  min-height: 0;
  padding: 8px 10px 10px;
}

.mahjong-table {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: clamp(18px, 3vw, 34px);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(47, 125, 99, 0.34), transparent 58%),
    radial-gradient(ellipse at 50% 110%, rgba(0, 0, 0, 0.4), transparent 62%),
    linear-gradient(150deg, #185443 0%, #0f3d31 36%, #0b3027 66%, #0a2a23 100%);
  border: 1px solid rgba(231, 209, 154, 0.18);
  box-shadow:
    inset 0 0 0 8px rgba(4, 24, 19, 0.22),
    inset 0 0 70px rgba(0, 0, 0, 0.32),
    0 18px 40px rgba(0, 0, 0, 0.28);
  isolation: isolate;
}

.mahjong-table::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(231, 209, 154, 0.06) 0 1px, transparent 1.5px),
    radial-gradient(circle at 68% 74%, rgba(231, 209, 154, 0.045) 0 1px, transparent 1.5px);
  background-size: 23px 23px, 31px 31px;
  opacity: 0.8;
  z-index: 0;
}

.mahjong-table::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: inherit;
  border: 1px solid rgba(231, 209, 154, 0.09);
  pointer-events: none;
  z-index: 1;
}

.table-corner {
  position: absolute;
  width: 38px;
  height: 38px;
  z-index: 2;
  opacity: 0.45;
  pointer-events: none;
}

.table-corner::before,
.table-corner::after {
  content: "";
  position: absolute;
  background: var(--gold);
}

.table-corner::before {
  width: 100%;
  height: 1px;
  top: 0;
  left: 0;
}

.table-corner::after {
  width: 1px;
  height: 100%;
  top: 0;
  left: 0;
}

.table-corner.tl {
  top: 20px;
  left: 20px;
}
.table-corner.tr {
  top: 20px;
  right: 20px;
  transform: rotate(90deg);
}
.table-corner.bl {
  bottom: 20px;
  left: 20px;
  transform: rotate(-90deg);
}
.table-corner.br {
  bottom: 20px;
  right: 20px;
  transform: rotate(180deg);
}

.table-orbit {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(231, 209, 154, 0.055);
  z-index: 0;
  pointer-events: none;
}

.orbit-a {
  width: min(58%, 780px);
  aspect-ratio: 1;
  box-shadow:
    0 0 0 24px rgba(231, 209, 154, 0.012),
    0 0 0 25px rgba(231, 209, 154, 0.028);
}

.orbit-b {
  width: min(39%, 520px);
  aspect-ratio: 1;
  border-style: dashed;
  border-color: rgba(231, 209, 154, 0.075);
  opacity: 0.8;
}

.seat {
  position: absolute;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 138px;
  max-width: 190px;
  padding: 7px 9px;
  border-radius: 13px;
  border: 1px solid rgba(231, 209, 154, 0.16);
  background: rgba(4, 22, 17, 0.58);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.seat-top {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.seat-left {
  left: 12px;
  top: 45%;
  transform: translateY(-50%);
}

.seat-right {
  right: 12px;
  top: 45%;
  transform: translateY(-50%);
}

.seat.is-turn {
  border-color: rgba(231, 209, 154, 0.62);
  background: rgba(15, 55, 44, 0.92);
  box-shadow:
    0 0 0 1px rgba(231, 209, 154, 0.13),
    0 0 24px rgba(198, 162, 92, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.24);
}

.seat.is-won {
  border-color: rgba(183, 66, 52, 0.5);
  background: rgba(56, 25, 20, 0.76);
}

.seat .avatar {
  width: 36px;
  height: 36px;
  font-size: 16px;
  flex: 0 0 auto;
}

.seat-body {
  min-width: 0;
  flex: 1;
}

.seat-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.seat-name .name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.dealer-badge {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--vermilion);
  color: #f9edda;
  font-family: var(--font-serif);
  font-size: 9px;
  flex: 0 0 auto;
}

.seat-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 8px;
  color: rgba(246, 237, 219, 0.48);
  white-space: nowrap;
}

.seat-meta .coin {
  font-size: 9px;
  color: rgba(231, 209, 154, 0.7);
}

.seat-meta .coin-mark {
  width: 12px;
  height: 12px;
  font-size: 7px;
  border-width: 0.5px;
}

.void-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(246, 237, 219, 0.75);
}

.void-chip b {
  font-family: var(--font-serif);
  font-size: 10px;
}

.void-chip.suit-0 {
  color: #f0b0a4;
  background: rgba(183, 66, 52, 0.18);
}
.void-chip.suit-1 {
  color: #a9d6b8;
  background: rgba(47, 118, 96, 0.2);
}
.void-chip.suit-2 {
  color: #a9c6e4;
  background: rgba(43, 93, 134, 0.2);
}

.seat-hand-count {
  position: absolute;
  right: -5px;
  bottom: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 17px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d8c08a;
  color: #22352c;
  font-family: var(--font-num);
  font-size: 9px;
  font-weight: 800;
  border: 2px solid #0b3027;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.seat-hand-count::after {
  content: "张";
  font-size: 7px;
  margin-left: 1px;
  opacity: 0.7;
}

html[lang="en"] .seat-hand-count::after {
  content: "";
}

.seat-status {
  position: absolute;
  top: -8px;
  right: 8px;
  min-height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--vermilion);
  color: #fff4e4;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
}

.seat-status.status-win {
  background: linear-gradient(135deg, #e1c37b, #b88e40);
  color: #2b2213;
}

.seat-status.status-ready {
  background: rgba(86, 137, 112, 0.92);
  color: #edf6ec;
}

.seat-backs {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  width: 96px;
  margin-top: 5px;
  padding-left: 6px;
  row-gap: 2px;
  overflow: hidden;
}

.seat-backs .tile {
  width: 18px;
  flex: 0 0 auto;
  margin-left: -6px;
  border-radius: 2px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
  transform-origin: 50% 100%;
}

.seat-backs .tile:first-child {
  margin-left: 0;
}

.seat-backs .tile:nth-child(odd) {
  transform: translateY(-0.5px) rotate(-1deg);
}

.seat-backs .tile:nth-child(even) {
  transform: translateY(0) rotate(1deg);
}

@media (orientation: landscape) and (max-height: 560px) {
  .seat {
    min-width: 154px;
    max-width: 162px;
  }
}

.seat-melds {
  display: flex;
  gap: 2px;
  margin-top: 5px;
  max-width: 145px;
  flex-wrap: wrap;
}

.seat-melds .tile {
  width: 19px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.24));
}

.seat-melds .meld-group {
  display: flex;
  gap: 0;
  margin-right: 3px;
  padding: 1px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.1);
}

.turn-marker {
  position: absolute;
  top: 50%;
  left: -5px;
  transform: translate(-100%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  color: var(--gold-light);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.seat.is-turn .turn-marker {
  opacity: 1;
}

.turn-marker::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(198, 162, 92, 0.14);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.seat-right .turn-marker {
  left: auto;
  right: -5px;
  transform: translate(100%, -50%);
  flex-direction: row-reverse;
}

.seat-top .turn-marker {
  left: 50%;
  top: auto;
  bottom: -11px;
  transform: translate(-50%, 100%);
}

/* 中央河牌区 */
.center-board {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 44%;
  width: min(58%, 650px);
  height: min(48%, 410px);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: 0.92fr 1.3fr 0.92fr;
  grid-template-rows: 0.94fr 1.22fr 0.94fr;
  gap: 4px;
}

.river {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 7px;
  border-radius: 9px;
  overflow: hidden;
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  max-height: 100%;
  justify-self: center;
  align-self: center;
  background: rgba(3, 20, 16, 0.14);
  border: 1px solid rgba(231, 209, 154, 0.05);
  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}

.river.is-empty {
  background: transparent;
  border-color: transparent;
}

.river.is-empty .river-empty {
  opacity: 0.45;
}

.river-top {
  grid-area: 1 / 2;
  align-self: end;
}
.river-left {
  grid-area: 2 / 1;
  justify-self: end;
  align-self: flex-start;
}
.river-right {
  grid-area: 2 / 3;
  justify-self: start;
  align-self: flex-start;
}
.river-self {
  grid-area: 3 / 2;
  align-self: start;
}

.river .tile {
  width: clamp(22px, 2.2vw, 30px);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.26));
  animation: river-in 0.22s ease both;
}

.river .tile.is-last {
  box-shadow:
    0 0 0 1.5px var(--gold-light),
    0 0 9px rgba(231, 209, 154, 0.5);
  border-radius: 3px;
  z-index: 2;
}

.river-label {
  position: absolute;
  top: 2px;
  left: 5px;
  font-size: 7px;
  color: rgba(246, 237, 219, 0.34);
  letter-spacing: 0.08em;
  pointer-events: none;
}

.river-left .river-label,
.river-right .river-label {
  writing-mode: vertical-rl;
}

.river-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 10px;
  color: rgba(246, 237, 219, 0.12);
  letter-spacing: 0.16em;
}

.center-hub {
  grid-area: 2 / 2;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 28%, rgba(28, 82, 65, 0.94), rgba(8, 37, 29, 0.96));
  border: 1px solid rgba(231, 209, 154, 0.26);
  box-shadow:
    inset 0 0 0 4px rgba(6, 28, 22, 0.34),
    0 8px 20px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  width: min(100%, 150px);
}

.hub-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.hub-summary .hub-wall-count {
  line-height: 1;
}

.hub-summary .hub-last {
  max-width: 100%;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
}

.hub-last em {
  font-style: normal;
  color: rgba(246, 237, 219, 0.28);
}

.hub-seal {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
  color: rgba(231, 209, 154, 0.72);
  text-shadow: 0 0 20px rgba(198, 162, 92, 0.2);
}

.hub-wall {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.hub-wall-backs {
  display: flex;
  gap: 1px;
}

.hub-wall-backs .tile {
  width: 11px;
  opacity: 0.8;
}

.hub-wall-count {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}

.hub-wall-count small {
  font-size: 7px;
  color: rgba(246, 237, 219, 0.36);
  font-weight: 500;
  margin-left: 2px;
}

.hub-base {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  color: rgba(246, 237, 219, 0.4);
}

.hub-base b {
  color: rgba(246, 237, 219, 0.8);
  font-weight: 700;
}

.center-turn-arrow {
  position: relative;
  left: auto;
  bottom: auto;
  z-index: 4;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  transform: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 209, 154, 0.45);
  background:
    radial-gradient(circle at 50% 35%, rgba(198, 162, 92, 0.3), transparent 68%),
    rgba(5, 27, 20, 0.92);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.32),
    0 0 0 4px rgba(5, 27, 20, 0.26);
  animation: turn-arrow-pulse 1.8s ease-in-out infinite;
}

.center-turn-arrow .arrow-inner {
  display: grid;
  place-items: center;
  transform: rotate(var(--turn-rot, 0deg));
  transition: transform 0.22s ease;
}

.center-turn-arrow .icon {
  width: 20px;
  height: 20px;
  color: var(--gold-light);
  stroke-width: 2.2;
}

@keyframes turn-arrow-pulse {
  0%,
  100% {
    box-shadow:
      0 6px 16px rgba(0, 0, 0, 0.32),
      0 0 0 4px rgba(5, 27, 20, 0.26);
  }
  50% {
    box-shadow:
      0 6px 16px rgba(0, 0, 0, 0.32),
      0 0 0 7px rgba(198, 162, 92, 0.1);
  }
}

.hub-turn {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(246, 237, 219, 0.55);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-turn.is-mine {
  color: #f6e7bd;
  background: rgba(183, 66, 52, 0.35);
  box-shadow: 0 0 0 1px rgba(231, 209, 154, 0.15);
}

.hub-last {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 7px;
  color: rgba(246, 237, 219, 0.3);
}

.hub-last .tile {
  width: 12px;
  filter: none;
}

/* 自己的区域 */
.self-zone {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 14px calc(7px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.self-zone > * {
  pointer-events: auto;
}

.self-info {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(760px, 100%);
  justify-content: center;
  flex-wrap: wrap;
  min-height: 20px;
}

.self-void {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 8px;
  color: rgba(246, 237, 219, 0.55);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(231, 209, 154, 0.1);
}

.self-void b {
  font-family: var(--font-serif);
  font-size: 11px;
}

.self-void.suit-0 b {
  color: #e8a095;
}
.self-void.suit-1 b {
  color: #9fceb0;
}
.self-void.suit-2 b {
  color: #9dbddd;
}

.self-hint {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(4, 22, 17, 0.38);
  border: 1px solid rgba(231, 209, 154, 0.1);
  font-size: 9px;
  color: rgba(246, 237, 219, 0.5);
}

.self-hint.is-warn {
  color: #f3d09b;
  border-color: rgba(198, 162, 92, 0.24);
  background: rgba(124, 79, 30, 0.28);
}

.self-melds {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.self-melds .meld-group {
  display: flex;
  gap: 0;
  padding: 1px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
}

.self-melds .tile {
  width: clamp(17px, 2.1vw, 25px);
}

.self-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 8px;
  color: rgba(246, 237, 219, 0.48);
  background: rgba(255, 255, 255, 0.04);
}

.self-status strong {
  color: rgba(246, 237, 219, 0.8);
  font-weight: 700;
}

.self-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 21px;
  padding: 0 8px 0 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(231, 209, 154, 0.12);
  font-size: 8px;
  color: rgba(246, 237, 219, 0.7);
}

.self-avatar .avatar {
  width: 16px;
  height: 16px;
  font-size: 8px;
  border-width: 0;
}

.action-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: min(760px, 100%);
  min-height: 46px;
  flex-wrap: wrap;
  position: relative;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.action-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(5, 24, 19, 0.42);
  border: 1px solid rgba(231, 209, 154, 0.12);
  color: rgba(246, 237, 219, 0.58);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.action-hint .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.action-hint strong {
  color: rgba(246, 237, 219, 0.85);
}

.ai-wait {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 17px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(231, 209, 154, 0.24);
  background: rgba(198, 162, 92, 0.12);
  color: var(--gold-light);
  font-family: var(--font-num);
  font-size: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 58px;
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(231, 209, 154, 0.18);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.16);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    opacity 0.16s ease;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-action:active {
  transform: scale(0.96);
}

.btn-action[disabled] {
  opacity: 0.38;
  box-shadow: none;
}

.btn-action .fan-badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  font-family: var(--font-num);
  font-size: 8px;
  font-weight: 700;
}

.btn-action .tile {
  width: 17px;
  filter: none;
  margin: -2px 0;
  pointer-events: none;
}

.claim-prompt .tile {
  width: 20px;
  filter: none;
  pointer-events: none;
}

.btn-discard {
  min-width: 88px;
  background: var(--vermilion);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 7px 20px rgba(134, 40, 29, 0.36);
}

.btn-discard:hover {
  background: var(--vermilion-bright);
}

.btn-discard[disabled] {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(231, 209, 154, 0.12);
  opacity: 0.45;
}

.btn-hu {
  background: linear-gradient(135deg, #e3c986, #bd9650);
  color: #2b2213;
  border-color: rgba(255, 245, 215, 0.4);
  animation: hu-glow 1.8s ease-in-out infinite;
}

.btn-hu:hover {
  filter: brightness(1.06);
  background: linear-gradient(135deg, #e3c986, #bd9650);
}

.btn-peng {
  background: rgba(47, 118, 96, 0.7);
  border-color: rgba(155, 209, 179, 0.3);
}

.btn-gang {
  background: rgba(145, 99, 48, 0.68);
  border-color: rgba(231, 209, 154, 0.3);
}

.btn-pass {
  background: rgba(255, 255, 255, 0.055);
  color: rgba(246, 237, 219, 0.62);
}

.claim-prompt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 13px 0 5px;
  border-radius: 999px;
  background: rgba(5, 24, 19, 0.64);
  border: 1px solid rgba(231, 209, 154, 0.18);
  font-size: 9px;
  color: rgba(246, 237, 219, 0.55);
}

.claim-prompt .tile {
  width: 20px;
}

.claim-prompt strong {
  color: var(--gold-light);
  font-weight: 700;
}

.hand-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 2px 0 0;
}

.hand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--hand-gap, 2px);
  padding: 5px 4px 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.hand::-webkit-scrollbar {
  display: none;
}

.hand .tile {
  width: var(--hand-tile, 42px);
  flex: 0 0 auto;
  border-radius: 6px;
  transition:
    transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.16s ease;
}

.hand .tile.is-drawn {
  margin-left: var(--drawn-gap, 9px);
  animation: tile-drawn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.hand .tile:hover {
  transform: translateY(-5px);
}

.hand .tile.is-selected {
  transform: translateY(-11px);
  filter: drop-shadow(0 0 9px rgba(231, 209, 154, 0.52));
  z-index: 3;
}

.hand .tile.is-selected .tile-face {
  outline: 2px solid var(--gold-light);
  outline-offset: 1px;
  border-radius: 7px;
}

.hand .tile.is-void {
  filter: drop-shadow(0 0 5px rgba(183, 66, 52, 0.35));
}

.hand .tile.is-void .tile-face::after {
  content: "";
}

.hand .tile.is-illegal {
  opacity: 0.52;
}

.hand .tile.tile-mine-drawn {
  position: relative;
}

.hand .tile.tile-mine-drawn::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-light);
  transform: translateX(-50%);
  opacity: 0.7;
}

.game-feed {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 230px;
  pointer-events: none;
}

.feed-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(6, 27, 21, 0.5);
  color: rgba(246, 237, 219, 0.48);
  font-size: 8px;
  line-height: 1.4;
  animation: feed-in 0.25s ease;
  backdrop-filter: blur(3px);
}

.feed-item:last-child {
  color: rgba(246, 237, 219, 0.8);
  background: rgba(6, 27, 21, 0.7);
}

.feed-item .tiny-tile {
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-weight: 700;
}

.game-disconnected {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(183, 66, 52, 0.92);
  color: #fff3e3;
  font-size: 9px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.game-disconnected.is-visible {
  opacity: 1;
}

.game-screen.is-busy .mahjong-table {
  cursor: progress;
}

.game-screen.is-busy .action-dock {
  opacity: 0.7;
  pointer-events: none;
}

.game-screen.is-busy .hand .tile {
  pointer-events: none;
}

/* 定缺弹窗 */
.void-modal {
  width: min(620px, 100%);
  overflow: visible;
}

.void-modal .modal-head {
  position: static;
  padding-bottom: 8px;
}

.void-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.void-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.34);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.void-choice:hover {
  border-color: rgba(183, 66, 52, 0.38);
  transform: translateY(-2px);
}

.void-choice.is-active {
  border-color: var(--vermilion);
  background: rgba(183, 66, 52, 0.06);
  box-shadow: 0 0 0 1px rgba(183, 66, 52, 0.16);
}

.void-choice .tile {
  width: 62px;
  filter: drop-shadow(0 6px 8px rgba(28, 45, 39, 0.16));
}

.void-choice-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
}

.void-choice-count {
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--text-soft);
}

.void-choice-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  height: 17px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: rgba(47, 118, 96, 0.12);
  color: #2b6d55;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.void-choice.is-recommended .void-choice-badge {
  background: rgba(198, 162, 92, 0.16);
  color: #826326;
}

.void-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.7;
}

.void-note strong {
  color: var(--vermilion);
  font-weight: 700;
}

.void-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* 结算：结果、四家牌面与按钮要在一屏内看全 */
.settlement-modal {
  width: min(560px, 100%);
  max-height: min(94dvh, 900px);
}

.settlement-modal .modal-head {
  position: relative;
  padding: 14px 18px 4px;
}

.settlement-modal .modal-head h2 {
  margin-top: 4px;
  font-size: 20px;
}

.settlement-modal .modal-body {
  padding: 0 14px 8px;
}

.settlement-modal .modal-footer {
  padding: 8px 14px calc(10px + var(--safe-bottom));
}

.settlement-hero {
  position: relative;
  margin: 0 0 8px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--paper);
  background:
    radial-gradient(circle at 90% 15%, rgba(231, 209, 154, 0.18), transparent 34%),
    linear-gradient(140deg, #1b5544, #0d3228);
  overflow: hidden;
}

.settlement-hero::after {
  content: "和";
  position: absolute;
  right: 4px;
  bottom: -22px;
  font-family: var(--font-serif);
  font-size: 84px;
  line-height: 1;
  color: rgba(231, 209, 154, 0.06);
  pointer-events: none;
}

.settlement-hero-top {
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.settlement-result {
  margin-right: auto;
  font-family: var(--font-serif);
  font-size: clamp(18px, 5vw, 23px);
  letter-spacing: 0.03em;
}

.settlement-reason {
  margin-top: 2px;
  font-size: 9px;
  color: rgba(246, 237, 219, 0.56);
  position: relative;
  z-index: 2;
}

.settlement-winners {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

.settlement-winner {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid rgba(231, 209, 154, 0.12);
}

.settlement-winner:first-child {
  padding-top: 0;
  border-top: 0;
}

.settlement-winner strong {
  font-size: 11px;
}

.winner-patterns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.winner-patterns span {
  display: inline-flex;
  height: 16px;
  align-items: center;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(231, 209, 154, 0.12);
  color: var(--gold-light);
  font-size: 7px;
}

.winner-fan {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--gold-light);
  font-weight: 700;
}

.winner-fan-detail {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.winner-fan-detail span {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(47, 118, 96, 0.18);
  color: #b9e3cb;
  font-size: 7px;
}

/* 四家战绩与牌面合并成一行一张卡，保证一屏能看全 */
.settlement-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settlement-item {
  padding: 6px 8px 7px;
  border-radius: 10px;
  border: 1px solid rgba(188, 167, 127, 0.24);
  background: rgba(255, 255, 255, 0.42);
}

.settlement-item.is-me {
  border-color: rgba(198, 162, 92, 0.55);
  background: rgba(198, 162, 92, 0.13);
}

.settlement-item.is-winner {
  border-color: rgba(183, 66, 52, 0.28);
}

.settlement-item-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.settlement-item-head .avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  font-size: 10px;
  border-width: 1px;
}

.settlement-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.settlement-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.settlement-item-name {
  display: block;
  min-width: 0;
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settlement-name-row em {
  flex: 0 0 auto;
}

.settlement-item-score {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}

/* 牌面分三块：碰杠（比手牌小 20%）、手牌、听牌；块与块之间留白，块内并拢。
   每张牌宽度由渲染时写入的 --settle-tile 决定（按牌数自适应），这里只留回退值。 */
.settlement-item-tiles {
  --settle-tile: 20px;
  --settle-radius: calc(var(--settle-tile) * 0.14);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-top: 6px;
  min-width: 0;
}

.settlement-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  row-gap: 1px;
  flex: 0 1 auto;
  min-width: 0;
}

.settlement-meld-run {
  display: flex;
  align-items: flex-end;
  gap: 0;
}

.settlement-item-tiles .tile {
  flex: 0 0 auto;
  align-self: flex-end;
  border-radius: var(--settle-radius, 3px);
  filter: drop-shadow(0 1px 1px rgba(5, 19, 15, 0.18));
}

.settlement-item-tiles .tile .tile-face {
  border-radius: inherit;
}

.settlement-tiles .tile,
.settlement-winning .tile {
  width: var(--settle-tile);
}

.settlement-meld-run .tile {
  width: calc(var(--settle-tile) * 0.8);
}

.settlement-tags {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.settlement-tags em,
.settlement-name-row em {
  font-style: normal;
  font-size: 7px;
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-soft);
  background: rgba(28, 45, 39, 0.06);
}

.settlement-tags em.warn,
.settlement-name-row em.warn {
  color: var(--vermilion);
  background: rgba(183, 66, 52, 0.08);
}

.settlement-tags em.good,
.settlement-name-row em.good {
  color: #2b6d55;
  background: rgba(47, 118, 96, 0.09);
}

.settlement-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.settlement-breakdown > span {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 7px;
  line-height: 1.35;
  color: var(--text-soft);
  background: rgba(28, 45, 39, 0.06);
}

.settlement-breakdown > span.positive {
  color: #2b6d55;
  background: rgba(47, 118, 96, 0.09);
}

.settlement-breakdown > span.negative,
.settlement-breakdown > span.warn {
  color: var(--vermilion);
  background: rgba(183, 66, 52, 0.08);
}

.settlement-breakdown > span.warn {
  font-weight: 700;
}

.settlement-breakdown small {
  margin-left: 3px;
  font-size: 6px;
  font-weight: 400;
  opacity: 0.85;
}

.delta {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta.positive {
  color: #2b7c5d;
}
.delta.negative {
  color: var(--vermilion);
}
.delta.zero {
  color: var(--muted);
}

.balance-cell {
  display: block;
  margin-top: 2px;
  font-family: var(--font-num);
  font-size: 8px;
  color: var(--muted);
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.confetti i {
  position: absolute;
  top: -12px;
  width: 6px;
  height: 10px;
  border-radius: 1px;
  opacity: 0;
  animation: confetti-fall 3.2s ease-in infinite;
}

.confetti i:nth-child(3n) {
  background: var(--vermilion);
}
.confetti i:nth-child(3n + 1) {
  background: var(--gold);
}
.confetti i:nth-child(3n + 2) {
  background: #60987c;
}
.confetti i:nth-child(1) { left: 6%; animation-delay: 0.1s; }
.confetti i:nth-child(2) { left: 14%; animation-delay: 0.7s; }
.confetti i:nth-child(3) { left: 23%; animation-delay: 0.35s; }
.confetti i:nth-child(4) { left: 31%; animation-delay: 1.1s; }
.confetti i:nth-child(5) { left: 39%; animation-delay: 0.55s; }
.confetti i:nth-child(6) { left: 46%; animation-delay: 1.4s; }
.confetti i:nth-child(7) { left: 54%; animation-delay: 0.2s; }
.confetti i:nth-child(8) { left: 61%; animation-delay: 0.95s; }
.confetti i:nth-child(9) { left: 69%; animation-delay: 0.45s; }
.confetti i:nth-child(10) { left: 76%; animation-delay: 1.25s; }
.confetti i:nth-child(11) { left: 84%; animation-delay: 0.65s; }
.confetti i:nth-child(12) { left: 91%; animation-delay: 1.5s; }

/* 牌力 / 提示 */
.tile {
  display: inline-block;
  position: relative;
  width: 48px;
  aspect-ratio: 64 / 88;
  border: 0;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  filter: drop-shadow(0 2px 2px rgba(5, 19, 15, 0.2));
  -webkit-user-select: none;
  user-select: none;
}

.tile-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: transparent;
}

.tile-face svg {
  width: 100%;
  height: 100%;
}

.tile-mini {
  border-radius: 4px;
}

.tile-back .tile-face {
  border-radius: inherit;
}

.static-tile {
  display: inline-block;
}

/* 提示 */
.toast-root {
  position: fixed;
  top: calc(64px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  width: min(420px, calc(100% - 32px));
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(8, 29, 23, 0.93);
  border: 1px solid rgba(231, 209, 154, 0.14);
  color: rgba(246, 237, 219, 0.9);
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  animation: toast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.is-error {
  background: rgba(121, 38, 29, 0.95);
  border-color: rgba(255, 204, 174, 0.25);
}

.toast.is-success {
  background: rgba(20, 74, 57, 0.95);
}

.toast.is-out {
  animation: toast-out 0.25s ease forwards;
}

.toast-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 auto;
}

.toast.is-error .toast-dot {
  background: #f2b49f;
}

.global-overlay-busy {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  background: rgba(4, 17, 14, 0.3);
  backdrop-filter: blur(1px);
  pointer-events: none;
}

.busy-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(8, 29, 23, 0.88);
  color: var(--paper);
  font-size: 10px;
  border: 1px solid rgba(231, 209, 154, 0.18);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
}

.busy-chip .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(246, 237, 219, 0.2);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 滚动条 */
.lobby-screen::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 6px;
}
.lobby-screen::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
  background: transparent;
}
.lobby-screen::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background: rgba(28, 45, 39, 0.18);
  border-radius: 999px;
}

/* ---------------- 动画 ---------------- */
@keyframes screen-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes seal-breathe {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 5px var(--ink-deep),
      inset 0 0 0 6px rgba(198, 162, 92, 0.3);
  }
  50% {
    box-shadow:
      inset 0 0 0 5px var(--ink-deep),
      inset 0 0 0 6px rgba(198, 162, 92, 0.55),
      0 0 30px rgba(198, 162, 92, 0.12);
  }
}

@keyframes loader-line {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(360%);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes river-in {
  from {
    opacity: 0;
    transform: translateY(3px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tile-drawn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hu-glow {
  0%,
  100% {
    box-shadow: 0 7px 20px rgba(150, 110, 40, 0.26);
  }
  50% {
    box-shadow:
      0 7px 20px rgba(150, 110, 40, 0.3),
      0 0 18px rgba(231, 209, 154, 0.35);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translateY(-10px) rotate(0);
  }
  8% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(68vh) translateX(28px) rotate(420deg);
  }
}

@keyframes shake-in {
  0% {
    transform: translateX(-3px);
  }
  35% {
    transform: translateX(2px);
  }
  70% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- 桌面压缩 / 平板 ---------------- */
@media (max-width: 1020px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.92fr);
  }

  .auth-tile-fan {
    opacity: 0.6;
    transform: scale(0.8);
    transform-origin: right bottom;
  }

  .lobby-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  }

  .hero-tile-stack {
    transform: translateY(-55%) scale(0.82);
    transform-origin: right center;
    right: 14px;
  }

  .mode-hero-body {
    max-width: 72%;
  }

  .game-room-info {
    display: none;
  }
}

@media (max-width: 820px) {
  .auth-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    background: var(--paper);
  }

  .auth-art {
    min-height: 205px;
    padding: calc(18px + var(--safe-top)) 22px 20px;
    justify-content: flex-start;
    background:
      radial-gradient(circle at 86% 10%, rgba(72, 139, 113, 0.4), transparent 44%),
      linear-gradient(155deg, #123f33 0%, #0a2b22 60%, #071f19 100%);
  }

  .auth-art::before {
    width: 340px;
    height: 340px;
    right: -120px;
    top: -150px;
  }

  .auth-copy {
    margin-top: 30px;
    max-width: 70%;
  }

  .auth-title {
    margin-top: 11px;
    font-size: clamp(32px, 8.2vw, 48px);
    line-height: 1.1;
  }

  .auth-sub,
  .auth-features,
  .auth-signature {
    display: none;
  }

  .auth-kicker {
    font-size: 8px;
  }

  .auth-tile-fan {
    display: block;
    right: 10px;
    bottom: 8px;
    width: 160px;
    height: 145px;
    transform: scale(0.58);
    transform-origin: right bottom;
    opacity: 0.72;
  }

  .auth-panel {
    align-items: flex-start;
    padding: 22px 22px calc(26px + var(--safe-bottom));
    min-height: calc(100dvh - 205px);
  }

  .auth-panel-top {
    display: none;
  }

  .auth-card {
    margin: 0 auto;
    padding-top: 6px;
  }

  .auth-form-head h2 {
    font-size: 30px;
  }

  .auth-mobile-brand {
    display: none;
  }

  .lobby-header {
    width: calc(100% - 32px);
    padding-top: calc(16px + var(--safe-top));
  }

  .lobby-header .brand-words span {
    display: none;
  }

  .lobby-header-right {
    gap: 4px;
  }

  .profile-button > span:last-child {
    display: none;
  }

  .profile-button {
    padding: 0 3px;
  }

  .language-quick {
    display: inline-flex !important;
  }

  .resume-banner {
    flex-wrap: nowrap;
  }

  .resume-banner > span:not(.dot-live) {
    display: none;
  }

  .coin-pill {
    padding: 0 10px;
    font-size: 11px;
  }

  .lobby-header .lang-toggle {
    display: none;
  }

  .lobby-main {
    width: calc(100% - 32px);
    padding-top: 16px;
  }

  .lobby-intro {
    display: block;
    margin-bottom: 20px;
  }

  .lobby-intro-copy h1 {
    font-size: clamp(32px, 8vw, 46px);
  }

  .lobby-intro-side {
    display: none;
  }

  .lobby-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .mode-hero {
    min-height: 348px;
    padding: 24px;
  }

  .mode-hero-body {
    max-width: 100%;
    padding-top: 0;
  }

  .mode-hero-title {
    font-size: clamp(34px, 9vw, 50px);
  }

  .hero-tile-stack {
    top: 14px;
    right: 12px;
    transform: scale(0.64);
    transform-origin: right top;
    width: 170px;
    height: 190px;
    opacity: 0.9;
  }

  .mode-hero-meta {
    gap: 16px;
  }

  .lobby-side {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-card {
    padding: 18px;
  }

  .balance-block {
    margin-top: 16px;
    padding-top: 14px;
  }

  .balance-block strong {
    font-size: 29px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mode-card {
    min-height: 146px;
    padding: 18px;
  }

  .mode-card p {
    max-width: 100%;
  }

  .lobby-footer {
    width: calc(100% - 32px);
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head p {
    max-width: 240px;
    text-align: right;
  }

  /* 游戏平板/手机 */
  .table-stage {
    padding: 5px 6px 6px;
  }

  .mahjong-table {
    border-radius: 20px;
  }

  .seat {
    min-width: 108px;
    max-width: 148px;
    padding: 5px 7px;
    gap: 6px;
    border-radius: 11px;
  }

  .seat .avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .seat-name {
    font-size: 9px;
  }

  .seat-name .name-text {
    max-width: 63px;
  }

  .dealer-badge {
    width: 13px;
    height: 13px;
    font-size: 7px;
  }

  .seat-meta {
    font-size: 7px;
    gap: 3px;
  }

  .seat-meta .coin {
    font-size: 8px;
  }

  .seat-melds .tile {
    width: 13px;
  }

  .seat-melds {
    max-width: 104px;
  }

  .seat-hand-count {
    min-width: 22px;
    height: 15px;
    font-size: 8px;
  }

  .seat-top {
    top: 7px;
  }

  .seat-left {
    left: 7px;
  }

  .seat-right {
    right: 7px;
  }

  .center-board {
    width: 74%;
    height: 45%;
    top: 42%;
    grid-template-columns: 0.88fr 1.4fr 0.88fr;
    grid-template-rows: 0.88fr 1.2fr 0.88fr;
    gap: 3px;
  }

  .river {
    padding: 2px;
    gap: 1.5px;
  }

  .river .tile {
    width: clamp(18px, 4.8vw, 24px);
  }

  .river-label {
    font-size: 6px;
  }

  .center-hub {
    width: min(100%, 132px);
    gap: 2px;
    padding: 4px;
  }

  .hub-seal {
    font-size: 24px;
  }

  .hub-wall-count {
    font-size: 11px;
  }

  .hub-wall-backs .tile {
    width: 8px;
  }

  .hub-base,
  .hub-last {
    font-size: 7px;
  }

  .hub-turn {
    font-size: 7px;
    height: 16px;
    min-height: 16px;
    padding: 0 6px;
  }

  .self-zone {
    padding: 6px 7px calc(4px + var(--safe-bottom));
    gap: 2px;
  }

  .self-info {
    gap: 5px;
    min-height: 18px;
  }

  .self-hint {
    font-size: 8px;
  }

  .self-void,
  .self-status,
  .self-avatar {
    height: 18px;
    font-size: 7px;
    padding: 0 6px;
  }

  .self-void b {
    font-size: 9px;
  }

  .self-avatar .avatar {
    width: 14px;
    height: 14px;
  }

  .self-melds .tile {
    width: clamp(14px, 3.4vw, 20px);
  }

  .action-dock {
    min-height: 40px;
    gap: 5px;
  }

  .action-hint {
    min-height: 26px;
    padding: 0 10px;
    font-size: 8px;
  }

  .btn-action {
    height: 36px;
    min-width: 52px;
    padding: 0 12px;
    font-size: 10px;
  }

  .btn-discard {
    min-width: 74px;
  }

  .claim-prompt {
    height: 32px;
    padding: 0 10px 0 4px;
    font-size: 8px;
  }

  .claim-prompt .tile {
    width: 17px;
  }

  .hand {
    padding-top: 3px;
  }

  .game-feed {
    display: none;
  }

  .game-topbar {
    min-height: calc(46px + var(--safe-top));
    padding: calc(4px + var(--safe-top)) 8px 4px;
  }

  .game-brand-text strong {
    font-size: 11px;
  }

  .game-brand-text span {
    font-size: 7px;
  }

  .game-brand .brand-seal {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .topbar-coins {
    height: 29px;
    font-size: 10px;
    padding: 0 8px;
  }

  .game-topbar .icon-button {
    width: 30px;
    height: 30px;
  }

  .game-topbar .icon-button .icon {
    width: 16px;
    height: 16px;
  }

  .void-modal .modal-head {
    padding: 18px 18px 6px;
  }

  .modal {
    border-radius: 20px;
  }

  .modal-head {
    padding: 18px 18px 12px;
  }

  .modal-body {
    padding: 0 18px 20px;
  }

  .modal-footer {
    padding: 12px 18px 18px;
  }

  .void-choices {
    gap: 7px;
  }

  .void-choice {
    padding: 12px 5px 10px;
  }

  .void-choice .tile {
    width: 46px;
  }

  .void-choice-name {
    font-size: 12px;
  }

  .void-choice-count {
    font-size: 9px;
  }

  .void-choice-badge {
    top: 6px;
    right: 5px;
    height: 15px;
    font-size: 6px;
  }

  .settlement-hero {
    padding: 10px 12px;
  }

  .settlement-winner {
    gap: 6px;
  }

  .settlement-item {
    padding: 5px 7px 6px;
  }
}

/* ---------------- 窄屏手机 ---------------- */
@media (max-width: 420px) {
  .auth-art {
    min-height: 180px;
  }

  .auth-tile-fan {
    transform: scale(0.48);
    bottom: 0;
  }

  .auth-copy {
    max-width: 80%;
  }

  .auth-panel {
    min-height: calc(100dvh - 180px);
    padding-left: 18px;
    padding-right: 18px;
  }

  .auth-form-head {
    margin-bottom: 20px;
  }

  .auth-form-head h2 {
    font-size: 27px;
  }

  .auth-form-head p {
    font-size: 11px;
  }

  .lobby-header {
    width: calc(100% - 24px);
  }

  .rooms-header-left .brand-words {
    display: none;
  }

  .lobby-main {
    width: calc(100% - 24px);
  }

  .lobby-intro-copy h1 {
    font-size: 32px;
  }

  .lobby-intro-copy p {
    font-size: 11px;
  }

  .mode-hero {
    min-height: 330px;
    padding: 20px;
  }

  .mode-hero-body {
    padding-top: 0;
  }

  .mode-hero-title {
    font-size: 32px;
  }

  .mode-hero-desc {
    font-size: 11px;
  }

  .mode-hero-meta {
    gap: 13px;
    margin-top: 18px;
    padding-top: 14px;
  }

  .mode-meta-item strong {
    font-size: 11px;
  }

  .mode-hero-actions .btn {
    min-height: 44px;
    padding: 0 19px;
    font-size: 12px;
  }

  .hero-tile-stack {
    transform: scale(0.52);
  }

  .seat {
    min-width: 95px;
    max-width: 124px;
    padding: 4px 6px;
  }

  .seat .avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .seat-name {
    font-size: 8px;
  }

  .seat-name .name-text {
    max-width: 53px;
  }

  .seat-meta .coin {
    display: none;
  }

  .seat-melds {
    max-width: 86px;
  }

  .seat-melds .tile {
    width: 11px;
  }

  .seat-hand-count {
    min-width: 20px;
    height: 14px;
    font-size: 7px;
    border-width: 1.5px;
  }

  .turn-marker {
    display: none;
  }

  .center-board {
    width: 82%;
    height: 43%;
    top: 41%;
  }

  .center-hub {
    width: min(100%, 106px);
  }

  .hub-seal {
    font-size: 20px;
  }

  .hub-wall-count {
    font-size: 10px;
  }

  .hub-base {
    display: none;
  }

  .river .tile {
    width: clamp(17px, 4.6vw, 22px);
  }

  .self-void,
  .self-status {
    padding: 0 5px;
  }

  .self-hint {
    display: block;
    font-size: 8px;
  }

  .action-hint {
    font-size: 7px;
    padding: 0 8px;
  }

  .btn-action {
    height: 34px;
    min-width: 48px;
    padding: 0 10px;
    font-size: 9px;
  }

  .btn-action .fan-badge {
    font-size: 7px;
    height: 15px;
    padding: 0 4px;
  }

  .claim-prompt {
    height: 30px;
  }

  .modal-layer {
    padding-left: 10px;
    padding-right: 10px;
  }

  .modal-head h2 {
    font-size: 23px;
  }

  .void-choice .tile {
    width: 40px;
  }

  .void-choice-name {
    font-size: 11px;
  }

  .void-actions {
    margin-top: 16px;
  }

  .settlement-winner .winner-fan {
    margin-left: 0;
  }
}

/* 超矮横屏手机：收紧上下空间 */
@media (orientation: landscape) and (max-height: 560px) {
  .game-screen {
    min-height: 320px;
  }

  .game-topbar {
    min-height: calc(38px + var(--safe-top));
    padding-top: calc(2px + var(--safe-top));
    padding-bottom: 2px;
  }

  .game-brand-text span {
    display: none;
  }

  .table-stage {
    padding: 3px 5px 4px;
  }

  .mahjong-table {
    border-radius: 14px;
  }

  .seat {
    padding: 3px 5px;
    min-width: 82px;
    max-width: 118px;
  }

  .seat .avatar {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .seat-name {
    font-size: 8px;
  }

  .seat-meta {
    font-size: 6px;
    margin-top: 1px;
  }

  .seat-meta .coin {
    display: none;
  }

  .seat-melds {
    display: none;
  }

  .seat-hand-count {
    height: 13px;
    min-width: 19px;
    font-size: 7px;
  }

  .seat-top {
    top: 5px;
  }

  .seat-left {
    left: 5px;
    top: 44%;
  }

  .seat-right {
    right: 5px;
    top: 44%;
  }

  .center-board {
    width: min(58%, 560px);
    height: 60%;
    top: 42%;
  }

  .center-hub {
    width: min(100%, 120px);
  }

  .hub-seal {
    font-size: 20px;
  }

  .river .tile {
    width: clamp(21px, 2.5vw, 26px);
  }

  .self-zone {
    padding: 2px 8px calc(1px + var(--safe-bottom));
    gap: 0;
  }

  .self-info {
    min-height: 14px;
  }

  .self-hint {
    display: none;
  }

  .self-melds .tile {
    width: 15px;
  }

  .self-void,
  .self-status,
  .self-avatar {
    height: 15px;
    font-size: 6px;
  }

  .action-dock {
    min-height: 32px;
  }

  .btn-action {
    height: 30px;
    min-width: 44px;
    font-size: 8px;
    padding: 0 9px;
  }

  .action-hint {
    min-height: 22px;
    font-size: 7px;
  }

  .hand {
    padding-top: 1px;
  }

  .hand .tile {
    width: var(--hand-tile, 26px);
  }

  .hand .tile.is-selected {
    transform: translateY(-7px);
  }

  .game-feed {
    display: none;
  }

  .modal {
    max-height: 94dvh;
  }
}

@media (max-width: 360px) {
  .auth-title {
    font-size: 30px;
  }

  .lobby-intro-copy h1 {
    font-size: 29px;
  }

  .mode-hero-title {
    font-size: 29px;
  }

  .btn-action {
    min-width: 44px;
    padding: 0 8px;
  }
}

/* 横屏与页面横屏下，座位需要容纳一整排牌背 */
@media (orientation: landscape) and (max-height: 560px) {
  .seat {
    min-width: 154px;
    max-width: 162px;
  }
}

/* 矮屏：结算里省掉 hero 的胡家明细（四家卡片已带番型），保证一屏放下 */
@media (max-height: 660px) {
  .settlement-hero .settlement-winners {
    display: none;
  }
}
