/* =========================================================
   雀友汇 · 四人麻将
   视觉：深玉、旧金、宣纸牌面；无外部字体与图片依赖。
   ========================================================= */

:root {
  --bg: #071a15;
  --bg-deep: #04120e;
  --felt: #0e4233;
  --felt-deep: #082e25;
  --felt-light: #175843;
  --gold: #d9b36a;
  --gold-bright: #f1d79a;
  --gold-deep: #96733b;
  --cream: #f2e7cf;
  --cream-dim: #d9ccb2;
  --ink: #22211b;
  --ink-soft: #4d483d;
  --red: #b74335;
  --red-deep: #8c2f28;
  --jade: #2e8064;
  --jade-bright: #51ab88;
  --text: #e9e0cd;
  --muted: #9dac9f;
  --muted-2: #71877a;
  --line: rgba(217, 179, 106, 0.18);
  --line-strong: rgba(217, 179, 106, 0.38);
  --panel: rgba(8, 27, 21, 0.78);
  --panel-solid: #0b251d;
  --shadow-deep: 0 26px 80px rgba(0, 0, 0, 0.48);
  --font-ui: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-display: "KaiTi", "STKaiti", "Kaiti SC", "Songti SC", "SimSun", serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --topbar-h: 58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow-anchor: none;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  overflow-anchor: none;
  overscroll-behavior: none;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; user-select: none; }
.tile, .player-pill, .action-dock, .seat { touch-action: manipulation; }
input { color: var(--text); }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: 0.45; }
[hidden] { display: none !important; }
::selection { background: rgba(217, 179, 106, 0.35); color: #fff; }

.page-noise {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.25;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.05) 0.6px, transparent 0.8px),
    radial-gradient(rgba(0, 0, 0, 0.08) 0.6px, transparent 0.8px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 2px;
  mix-blend-mode: soft-light;
}

.screen { display: none; }
.screen.is-active { display: flex; animation: screen-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }

.eyebrow {
  margin: 0 0 5px;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
}

/* ---------------- Landing ---------------- */

.screen-landing {
  position: relative;
  min-height: 100dvh;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 60% 55% at 12% 16%, rgba(39, 123, 93, 0.34), transparent 60%),
    radial-gradient(ellipse 50% 60% at 88% 88%, rgba(150, 52, 41, 0.17), transparent 64%),
    radial-gradient(ellipse 30% 35% at 75% 15%, rgba(217, 179, 106, 0.08), transparent 70%),
    linear-gradient(154deg, #061711 0%, #0b271f 48%, #061510 100%);
}
.screen-landing::before {
  content: "雀";
  position: fixed;
  right: -5vw;
  bottom: -15vh;
  font-family: var(--font-display);
  font-size: min(62vw, 780px);
  line-height: 1;
  color: rgba(217, 179, 106, 0.035);
  pointer-events: none;
  z-index: 0;
}
.screen-landing::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(217, 179, 106, 0.04) 50%, transparent 50.1%),
    linear-gradient(0deg, transparent 49.9%, rgba(217, 179, 106, 0.025) 50%, transparent 50.1%);
  background-size: 220px 220px;
  mask-image: radial-gradient(ellipse at center, black, transparent 78%);
  z-index: 0;
}

.landing-nav {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 48px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-nav-actions { display: flex; align-items: center; gap: 22px; }
.text-btn {
  border: 0;
  background: transparent;
  color: var(--cream-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.text-btn:hover { color: var(--gold-bright); border-color: var(--line-strong); }

.brand { display: flex; align-items: center; gap: 11px; }
.brand--compact { gap: 10px; }
.brand-seal {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--cream);
  background:
    linear-gradient(150deg, rgba(183, 67, 53, 0.95), rgba(126, 36, 31, 0.98));
  border-radius: 6px;
  border: 1px solid rgba(241, 215, 154, 0.45);
  box-shadow: inset 0 0 0 3px rgba(94, 27, 23, 0.45), 0 6px 18px rgba(0, 0, 0, 0.25);
  transform: rotate(-2deg);
}
.brand-word {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.16em;
  color: var(--cream);
}

.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}
.conn-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6fa98e;
  box-shadow: 0 0 0 3px rgba(111, 169, 142, 0.12);
}
.conn-pill.is-offline i { background: #c97058; box-shadow: 0 0 0 3px rgba(201, 112, 88, 0.14); }
.conn-pill--quiet { font-size: 9px; padding: 4px 8px; }

.landing-main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1230px;
  margin: auto;
  padding: 32px 48px 55px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, 410px);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  flex: 1;
}

.hero { padding-bottom: 6px; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--gold);
  font-weight: 600;
}
.hero-kicker span { width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.hero-kicker span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }

.hero-title {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 26px);
  margin: 0;
  line-height: 1;
}
.hero-seal {
  flex: none;
  width: clamp(64px, 7.6vw, 94px);
  height: clamp(64px, 7.6vw, 94px);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 4.6vw, 58px);
  color: #f5e7c9;
  background:
    linear-gradient(142deg, #bb4939 0%, #9c342b 55%, #7e2924 100%);
  border: 1px solid rgba(241, 215, 154, 0.55);
  border-radius: 9px;
  box-shadow:
    inset 0 0 0 5px rgba(105, 31, 26, 0.38),
    inset 0 0 35px rgba(255, 224, 174, 0.12),
    0 18px 40px rgba(0, 0, 0, 0.3);
  transform: rotate(-3deg);
  position: relative;
}
.hero-seal::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 239, 203, 0.24);
  border-radius: 3px;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(62px, 9vw, 122px);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12), 0 18px 45px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
}
.hero-tagline {
  margin: 26px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.45vw, 19px);
  line-height: 1.9;
  color: rgba(233, 224, 205, 0.72);
  letter-spacing: 0.08em;
}
.hero-hand {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  height: clamp(94px, 11vw, 138px);
  margin: 36px 0 24px 4px;
  padding-left: 16px;
  position: relative;
}
.hero-hand::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 70%;
  height: 55%;
  background: radial-gradient(ellipse, rgba(217, 179, 106, 0.14), transparent 65%);
  filter: blur(18px);
  pointer-events: none;
}
.hero-hand .tile {
  --tw: clamp(38px, 4.6vw, 62px);
  margin-left: -10px;
  transform-origin: 50% 100%;
  transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38);
}
.hero-hand .tile:nth-child(odd) { --lift: -3px; }
.hero-hand .tile:nth-child(even) { --lift: 4px; }
.hero-hand .tile:first-child { margin-left: 0; }

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(217, 179, 106, 0.12);
  max-width: 560px;
  font-size: 10px;
  letter-spacing: 0.09em;
  color: rgba(233, 224, 205, 0.48);
}
.feature-row span { display: inline-flex; gap: 7px; align-items: center; }
.feature-row i { color: var(--gold); font-style: normal; font-size: 7px; }

.entry-card {
  position: relative;
  width: 100%;
  padding: 28px 28px 22px;
  border-radius: 20px;
  background:
    linear-gradient(155deg, rgba(19, 51, 41, 0.94), rgba(7, 25, 19, 0.97) 65%);
  border: 1px solid rgba(217, 179, 106, 0.22);
  box-shadow:
    var(--shadow-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 60px rgba(46, 128, 100, 0.05);
  backdrop-filter: blur(20px);
}
.entry-card::before, .entry-card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(217, 179, 106, 0.4);
  border-style: solid;
  pointer-events: none;
}
.entry-card::before { top: 9px; left: 9px; border-width: 1px 0 0 1px; border-radius: 6px 0 0 0; }
.entry-card::after { bottom: 9px; right: 9px; border-width: 0 1px 1px 0; border-radius: 0 0 6px 0; }
.entry-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.entry-card-top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--cream);
}
.entry-stamp {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  color: rgba(241, 215, 154, 0.8);
  border: 1px solid rgba(217, 179, 106, 0.3);
  border-radius: 5px;
  transform: rotate(3deg);
}

.field { display: block; margin-bottom: 17px; }
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.field input, .join-form input {
  width: 100%;
  height: 43px;
  border-radius: 9px;
  border: 1px solid rgba(217, 179, 106, 0.18);
  background: rgba(1, 13, 9, 0.4);
  padding: 0 13px;
  font-size: 14px;
  letter-spacing: 0.03em;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.field input::placeholder, .join-form input::placeholder { color: rgba(157, 172, 159, 0.45); }
.field input:focus, .join-form input:focus {
  outline: none;
  border-color: rgba(217, 179, 106, 0.55);
  background: rgba(2, 17, 12, 0.55);
  box-shadow: 0 0 0 3px rgba(217, 179, 106, 0.08);
}

.avatar-block { margin-bottom: 19px; }
.avatar-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatar-option {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
  filter: saturate(0.7);
  transition: transform 0.16s, border-color 0.16s, background 0.16s, filter 0.16s;
}
.avatar-option:hover { transform: translateY(-2px); border-color: rgba(217, 179, 106, 0.28); filter: saturate(1); }
.avatar-option.is-selected {
  border-color: var(--gold);
  background: rgba(217, 179, 106, 0.1);
  box-shadow: 0 0 0 1px rgba(217, 179, 106, 0.22), 0 6px 15px rgba(0, 0, 0, 0.2);
  filter: saturate(1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s, border-color 0.16s, color 0.16s;
  position: relative;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-gold {
  color: #251d12;
  background: linear-gradient(135deg, #f4e4bd 0%, #ddba75 48%, #c59a4e 100%);
  border-color: rgba(255, 246, 220, 0.45);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-weight: 700;
}
.btn-gold:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), 0 0 22px rgba(217, 179, 106, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.8); }
.btn-outline {
  color: var(--cream);
  border-color: rgba(217, 179, 106, 0.27);
  background: rgba(217, 179, 106, 0.045);
}
.btn-outline:hover { border-color: rgba(217, 179, 106, 0.5); background: rgba(217, 179, 106, 0.09); }
.btn-jade {
  color: #eaf4e9;
  background: linear-gradient(135deg, #337e64, #225d49);
  border-color: rgba(120, 190, 160, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-jade:hover { background: linear-gradient(135deg, #3b8d70, #276a53); }
.btn-small { min-height: 34px; padding: 0 13px; font-size: 11px; }
.btn-ghost-danger { color: #d6aaa0; border-color: rgba(201, 112, 88, 0.2); background: transparent; }
.btn-ghost-danger:hover { border-color: rgba(201, 112, 88, 0.42); background: rgba(201, 112, 88, 0.08); }
.btn-xl {
  width: 100%;
  min-height: 62px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  text-align: left;
  border-radius: 11px;
  margin-bottom: 16px;
}
.btn-xl .btn-main { font-size: 17px; letter-spacing: 0.1em; font-weight: 700; }
.btn-xl .btn-sub { grid-column: 1; font-size: 9px; font-weight: 500; opacity: 0.62; letter-spacing: 0.1em; margin-top: 2px; }
.btn-xl .btn-arrow { grid-column: 2; grid-row: 1 / span 2; font-size: 22px; font-weight: 400; opacity: 0.65; transition: transform 0.2s; }
.btn-xl:hover .btn-arrow { transform: translateX(3px); }
.entry-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3px 0 14px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.12em;
}
.entry-divider::before, .entry-divider::after { content: ""; height: 1px; flex: 1; background: rgba(217, 179, 106, 0.12); }
.entry-row { display: grid; grid-template-columns: 0.85fr 1.25fr; gap: 9px; }
.entry-row > .btn { min-height: 44px; }
.join-form { display: flex; gap: 7px; }
.join-form input {
  height: 44px;
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 600;
  padding: 0 10px;
  font-size: 13px;
}
.join-form .btn { min-height: 44px; padding: 0 15px; }
.invite-hint {
  margin: 13px 0 0;
  padding: 8px 10px;
  border: 1px dashed rgba(217, 179, 106, 0.27);
  border-radius: 7px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--gold-bright);
  background: rgba(217, 179, 106, 0.05);
}
.entry-footnote { margin: 14px 0 0; font-size: 9px; color: var(--muted-2); letter-spacing: 0.04em; text-align: center; }
.entry-conn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 9px;
  color: var(--muted-2);
}
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #c97058; }
.status-dot.is-online { background: #69a78d; box-shadow: 0 0 0 3px rgba(105, 167, 141, 0.1); }

.landing-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 48px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(233, 224, 205, 0.32);
  font-size: 9px;
  letter-spacing: 0.12em;
}
.footer-mark { color: rgba(217, 179, 106, 0.4); }

/* ---------------- Common top bar / lobby ---------------- */

.screen-lobby, .screen-game {
  flex-direction: column;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 55% 45% at 10% 0%, rgba(34, 103, 79, 0.2), transparent 60%),
    radial-gradient(ellipse 45% 50% at 90% 100%, rgba(151, 58, 46, 0.1), transparent 65%),
    linear-gradient(150deg, #061813, #0a211a 55%, #06130f);
  overflow: hidden;
}
.screen-lobby { overflow-y: auto; }

.app-topbar, .game-topbar {
  flex: 0 0 var(--topbar-h);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: rgba(4, 17, 13, 0.72);
  border-bottom: 1px solid rgba(217, 179, 106, 0.12);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 30;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left { flex: 1; }
.topbar-right { justify-content: flex-end; }
.topbar-status {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.12em;
  text-align: center;
}
.brand--topbar .brand-seal { width: 29px; height: 29px; font-size: 17px; border-radius: 5px; }
.brand--topbar .brand-word { font-size: 15px; letter-spacing: 0.14em; }
.topbar-divider { width: 1px; height: 18px; background: rgba(217, 179, 106, 0.14); margin: 0 3px; }
.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(217, 179, 106, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.room-chip b { color: var(--gold-bright); font-size: 12px; letter-spacing: 0.15em; font-weight: 600; }
.room-chip .copy-glyph { font-style: normal; font-size: 11px; opacity: 0.45; margin-left: 2px; }
.room-chip:hover { border-color: rgba(217, 179, 106, 0.36); background: rgba(217, 179, 106, 0.05); }
.round-chip {
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  padding-left: 4px;
  white-space: nowrap;
}
.icon-btn, .icon-text-btn {
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  border-radius: 7px;
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
  white-space: nowrap;
}
.icon-btn { width: 31px; padding: 0; font-size: 15px; }
.icon-text-btn > span {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  font-size: 9px;
  border-radius: 3px;
  background: rgba(217, 179, 106, 0.08);
  color: var(--gold);
}
.icon-text-btn:hover, .icon-btn:hover { color: var(--gold-bright); border-color: rgba(217, 179, 106, 0.3); background: rgba(217, 179, 106, 0.06); }
.icon-text-btn--danger { color: #c39b91; }
.icon-text-btn--danger:hover { color: #efb2a3; border-color: rgba(201, 112, 88, 0.35); background: rgba(201, 112, 88, 0.08); }
.icon-btn.is-on { color: var(--gold-bright); border-color: rgba(217, 179, 106, 0.3); }
.music-btn { font-size: 16px; }
.music-btn:not(.is-on) { color: var(--muted-2); opacity: 0.65; }
.unread-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  border: 1px solid var(--bg-deep);
}
.panel-toggle-btn { display: none; position: relative; }

.lobby-main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(24px, 4vh, 45px) 36px 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 26px;
  align-items: center;
  min-height: 0;
}
.lobby-stage { min-width: 0; }
.lobby-heading { margin-bottom: 20px; }
.lobby-heading h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--cream);
}
.lobby-heading p:last-child { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: 0.05em; }

.lobby-table {
  position: relative;
  min-height: clamp(350px, 49vh, 490px);
  border-radius: 27px;
  border: 7px solid transparent;
  background:
    linear-gradient(#081e17, #081e17) padding-box,
    linear-gradient(135deg, #78552d, #2e1c10 40%, #694929 70%, #3a2413) border-box;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38), inset 0 0 100px rgba(17, 70, 54, 0.25);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lobby-table::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(217, 179, 106, 0.13);
  border-radius: 17px;
  pointer-events: none;
}
.lobby-felt {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 42% 46% at 50% 48%, rgba(50, 142, 111, 0.19), transparent 70%),
    repeating-radial-gradient(circle at 50% 48%, transparent 0 48px, rgba(217, 179, 106, 0.022) 49px 50px),
    linear-gradient(145deg, #0e3a2c, #0a2e24 55%, #08261d);
}
.lobby-felt::after {
  content: "東 南 西 北";
  position: absolute;
  left: 50%;
  bottom: 35%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2.2em;
  color: rgba(217, 179, 106, 0.12);
  pointer-events: none;
}
.lobby-center {
  position: relative;
  z-index: 3;
  width: min(330px, 52%);
  padding: 20px 22px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid rgba(217, 179, 106, 0.2);
  background: rgba(3, 18, 13, 0.65);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(8px);
}
.lobby-center-label { display: block; font-size: 8px; letter-spacing: 0.24em; color: var(--muted-2); margin-bottom: 4px; }
.lobby-code {
  border: 0;
  background: transparent;
  color: var(--gold-bright);
  font-family: var(--font-serif);
  font-size: clamp(29px, 3.4vw, 42px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding: 0 0 0 0.22em;
  display: block;
  margin: 0 auto 12px;
}
.lobby-code small {
  display: block;
  margin-top: 2px;
  font-family: var(--font-ui);
  font-size: 8px;
  color: var(--muted-2);
  letter-spacing: 0.12em;
  font-weight: 400;
}
.lobby-code:hover { color: #fff0c9; }
.lobby-start-area { min-height: 44px; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; }
.lobby-start-hint { font-size: 9px; color: var(--muted-2); line-height: 1.5; }
.lobby-start-btn {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(217, 179, 106, 0.28);
  background: linear-gradient(135deg, #e6cf9e, #cda85f);
  color: #21180e;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: transform 0.16s, box-shadow 0.16s;
}
.lobby-start-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
.lobby-waiting { font-size: 10px; color: var(--muted); line-height: 1.6; }
.lobby-waiting b { color: var(--cream-dim); font-weight: 500; }

.lobby-seat-pos { position: absolute; z-index: 4; }
.lobby-seat-pos--top { top: 16px; left: 50%; transform: translateX(-50%); }
.lobby-seat-pos--bottom { bottom: 16px; left: 50%; transform: translateX(-50%); }
.lobby-seat-pos--left { left: 16px; top: 50%; transform: translateY(-50%); }
.lobby-seat-pos--right { right: 16px; top: 50%; transform: translateY(-50%); }

.lobby-seat {
  min-width: 174px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px 9px 9px;
  border-radius: 11px;
  background: rgba(5, 23, 17, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}
.lobby-seat.is-you { border-color: rgba(217, 179, 106, 0.4); background: rgba(15, 41, 31, 0.9); }
.lobby-seat.is-empty { border-style: dashed; background: rgba(5, 23, 17, 0.36); opacity: 0.6; min-height: 51px; justify-content: center; }
.lobby-seat-avatar {
  flex: none;
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  font-size: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.14)), var(--seat-color, #1e4e3c);
  border: 1px solid rgba(255, 255, 255, 0.13);
}
.lobby-seat.is-empty .lobby-seat-avatar { background: transparent; border-style: dashed; color: var(--muted-2); font-size: 15px; }
.lobby-seat-info { min-width: 0; flex: 1; }
.lobby-seat-name { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--cream); line-height: 1.4; }
.lobby-seat-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-seat-meta { font-size: 8px; color: var(--muted-2); letter-spacing: 0.06em; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.lobby-seat-meta .wind { color: var(--gold); }
.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 14px;
  padding: 0 4px;
  font-size: 7px;
  line-height: 1;
  border-radius: 3px;
  border: 1px solid rgba(217, 179, 106, 0.24);
  color: var(--gold);
  background: rgba(217, 179, 106, 0.06);
  letter-spacing: 0.04em;
}
.mini-badge--ai { color: #9ccab8; border-color: rgba(108, 174, 148, 0.25); background: rgba(73, 133, 110, 0.1); }

.invite-strip {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 179, 106, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}
.invite-desc { margin: 0; font-size: 10px; color: var(--muted-2); }
.invite-copy-row { display: flex; gap: 7px; flex: 1; max-width: 420px; }
.invite-copy-row input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  padding: 0 10px;
  font-size: 10px;
}
.remote-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(217, 179, 106, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.5;
}
.remote-line[hidden] { display: none !important; }
.remote-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b59659;
  box-shadow: 0 0 0 3px rgba(181, 150, 89, 0.08);
}
.remote-line.is-active {
  color: #a9c8b8;
  border-color: rgba(105, 176, 138, 0.26);
  background: rgba(57, 128, 98, 0.065);
}
.remote-line.is-active .remote-dot {
  background: #69b087;
  box-shadow: 0 0 0 3px rgba(105, 176, 135, 0.1), 0 0 8px rgba(105, 176, 135, 0.35);
}
.remote-line.is-starting { color: var(--gold-bright); border-color: rgba(217, 179, 106, 0.22); }
.remote-line.is-starting .remote-dot { background: var(--gold); animation: blink 1.2s ease-in-out infinite; }
.remote-line.is-error { color: #d7a596; border-color: rgba(201, 112, 88, 0.25); background: rgba(201, 112, 88, 0.05); }
.remote-line.is-error .remote-dot { background: #c97058; }
.remote-note {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.03em;
  opacity: 0.8;
  white-space: nowrap;
}

.career-card {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 179, 106, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(217, 179, 106, 0.035), transparent 52%),
    rgba(255, 255, 255, 0.018);
}
.career-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.career-card-head h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: 0.06em;
}
.career-link {
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  padding: 3px 0;
  cursor: pointer;
  white-space: nowrap;
}
.career-link:hover { color: var(--gold-bright); }
.career-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.career-grid > div {
  min-width: 0;
  padding: 5px 7px;
  border-left: 1px solid rgba(255, 255, 255, 0.055);
}
.career-grid > div:first-child { border-left: 0; padding-left: 0; }
.career-grid b {
  display: block;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--gold-bright);
}
.career-grid span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.panel-card {
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(15, 42, 33, 0.88), rgba(5, 22, 16, 0.92));
  border: 1px solid rgba(217, 179, 106, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
  min-height: 0;
}
.lobby-side {
  height: min(600px, 68vh);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-head, .side-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 19px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.panel-head h2, .side-panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--cream);
}
.panel-badge {
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid rgba(217, 179, 106, 0.2);
  border-radius: 999px;
  padding: 4px 8px;
}

/* ---------------- Shared chat ---------------- */

.chat-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 15px;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 179, 106, 0.2) transparent;
}
.chat-feed::-webkit-scrollbar { width: 6px; }
.chat-feed::-webkit-scrollbar-thumb { background: rgba(217, 179, 106, 0.18); border-radius: 999px; }
.feed-item { margin-bottom: 9px; animation: feed-in 0.3s ease; }
.feed-system {
  text-align: center;
  font-size: 9px;
  color: var(--muted-2);
  line-height: 1.55;
  padding: 4px 6px;
  letter-spacing: 0.02em;
}
.feed-action {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.55;
  padding: 2px 3px;
}
.feed-action::before {
  content: "";
  flex: none;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(217, 179, 106, 0.42);
  transform: translateY(-2px);
}
.feed-action b { color: var(--cream-dim); font-weight: 500; }
.feed-action.is-win b, .feed-action.is-win { color: var(--gold-bright); }
.feed-action.is-claim { color: rgba(217, 179, 106, 0.62); }
.feed-chat { display: flex; gap: 8px; align-items: flex-start; }
.feed-avatar {
  flex: none;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  font-size: 14px;
  border-radius: 50%;
  background: var(--seat-color, #1e4e3c);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1px;
}
.feed-body { min-width: 0; }
.feed-name { display: flex; align-items: center; gap: 5px; font-size: 8px; color: var(--muted-2); margin-bottom: 3px; }
.feed-name b { color: var(--cream-dim); font-weight: 500; font-size: 9px; }
.feed-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 3px 9px 9px 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.55;
  word-break: break-word;
}
.feed-bubble.is-me { background: rgba(217, 179, 106, 0.08); border-color: rgba(217, 179, 106, 0.13); }
.quick-chats {
  display: flex;
  gap: 5px;
  padding: 7px 14px 0;
  flex-wrap: wrap;
}
.quick-chats button {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: var(--muted-2);
  font-size: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  transition: 0.15s;
}
.quick-chats button:hover { color: var(--gold-bright); border-color: rgba(217, 179, 106, 0.25); background: rgba(217, 179, 106, 0.05); }
.chat-form {
  display: flex;
  gap: 7px;
  padding: 10px 14px 14px;
}
.chat-form input {
  flex: 1;
  min-width: 0;
  height: 35px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(0, 0, 0, 0.18);
  padding: 0 11px;
  font-size: 11px;
  color: var(--cream);
}
.chat-form input:focus { outline: none; border-color: rgba(217, 179, 106, 0.35); }
.chat-form input::placeholder { color: var(--muted-2); opacity: 0.6; }
.chat-send {
  flex: none;
  width: 35px;
  height: 35px;
  border-radius: 7px;
  border: 1px solid rgba(217, 179, 106, 0.24);
  background: rgba(217, 179, 106, 0.1);
  color: var(--gold-bright);
  font-size: 16px;
  line-height: 1;
}
.chat-send:hover { background: rgba(217, 179, 106, 0.18); }

/* ---------------- Game layout ---------------- */

/* 对局屏幕固定为一屏，禁止页面/内部容器被焦点或瞬态内容带偏。 */
.screen-game { overflow: hidden; }
.screen-game.is-active {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
  overflow-anchor: none;
}
.game-topbar { gap: 10px; padding: 0 16px; }
.game-topbar .topbar-left { gap: 7px; flex: 1 1 0; }
.game-topbar .topbar-right { gap: 6px; flex: 1 1 0; }
.game-topbar .topbar-status { flex: 0 0 auto; }
.game-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-anchor: none;
  overscroll-behavior: none;
}
.table-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 11px 14px 13px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  overflow: clip;
  overflow-anchor: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
.table {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1240px;
  max-height: 860px;
  min-height: 0;
  margin: auto;
  padding: 8px;
  border-radius: 31px;
  background:
    linear-gradient(135deg, #76532f 0%, #3e2815 18%, #2b1a0e 45%, #6a4a28 72%, #392312 100%);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 238, 198, 0.28),
    inset 0 -2px 3px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(230, 200, 146, 0.12);
}
.table::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 27px;
  border: 1px solid rgba(242, 219, 169, 0.14);
  pointer-events: none;
  z-index: 2;
}
.table-rim { position: absolute; inset: 8px; border-radius: 25px; overflow: hidden; pointer-events: none; }
.table-rim::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 18% 10%, rgba(255, 233, 191, 0.08), transparent 40%),
    repeating-linear-gradient(48deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 9px);
  mix-blend-mode: soft-light;
}
.table-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(105px, 12.5%) minmax(0, 1fr) minmax(105px, 12.5%);
  grid-template-rows: 104px minmax(0, 1fr) 190px;
  grid-template-areas:
    ". top ."
    "left center right"
    "bottom bottom bottom";
  gap: 2px;
  background:
    radial-gradient(ellipse 46% 45% at 50% 46%, rgba(43, 132, 102, 0.22), transparent 72%),
    radial-gradient(ellipse 90% 80% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.18) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #104434, #0b3629 52%, #082b20);
  box-shadow:
    inset 0 0 70px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(217, 179, 106, 0.13);
  overflow: hidden;
  overflow: clip;
  overflow-anchor: none;
  overscroll-behavior: none;
}
.table-content::before {
  content: "雀";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: min(28vw, 330px);
  color: rgba(217, 179, 106, 0.026);
  pointer-events: none;
  z-index: 0;
}
.table-content > * { position: relative; z-index: 1; }

.seat { min-width: 0; min-height: 0; }
.seat--top { grid-area: top; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding-bottom: 3px; }
.seat--left { grid-area: left; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 2px 0; }
.seat--right { grid-area: right; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 2px 0; }
.seat--bottom {
  grid-area: bottom;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: 27px auto auto;
  grid-template-areas:
    "selfmeta selfmelds selfting"
    "dock dock dock"
    "hand hand hand";
  align-items: center;
  align-content: end;
  gap: 5px 8px;
  padding: 2px 8px 0;
}
.seat--top.is-active, .seat--left.is-active, .seat--right.is-active { filter: drop-shadow(0 0 16px rgba(217, 179, 106, 0.09)); }

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 9px 4px 4px;
  border-radius: 999px;
  background: rgba(3, 18, 13, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  position: relative;
}
.player-pill .avatar {
  flex: none;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.16), transparent 40%),
    var(--seat-color, #1e4e3c);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
  position: relative;
}
.player-pill .avatar::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.player-pill-main { min-width: 0; line-height: 1.1; }
.player-name {
  display: block;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: 0.02em;
}
.player-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 8.5px;
  line-height: 1;
  color: var(--muted-2);
  white-space: nowrap;
}
.player-sub .wind { color: var(--gold); font-size: 9px; }
.player-sub .score { color: #9ab5a5; }
.player-sub .score.is-neg { color: #c48778; }
.pill-badges { display: flex; align-items: center; gap: 3px; margin-left: 1px; }
.pill-badges .mini-badge { height: 13px; font-size: 6.5px; padding: 0 3px; }
.player-pill.is-active {
  border-color: rgba(217, 179, 106, 0.65);
  background: rgba(18, 45, 33, 0.92);
  box-shadow: 0 0 0 1px rgba(217, 179, 106, 0.13), 0 0 20px rgba(217, 179, 106, 0.13), 0 7px 18px rgba(0, 0, 0, 0.22);
}
.player-pill.is-active .avatar::after { border-color: rgba(241, 215, 154, 0.55); animation: soft-pulse 2s ease-in-out infinite; }
.player-pill.is-active .player-name { color: #fff3d3; }
.turn-dot {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(241, 215, 154, 0.7);
  animation: blink 1.4s ease-in-out infinite;
  margin-left: 3px;
}
.seat--side .player-pill { max-width: 100%; padding-right: 7px; }
.seat--side .player-name { max-width: 67px; }
.seat--side .player-sub { font-size: 7px; }

.backs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 19px;
  padding-left: 4px;
}
.backs-row .tile { margin-left: -4px; }
.backs-row .tile:first-child { margin-left: 0; }
.backs-row .tile--back { --tw: 18px; }
.backs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 1px 0;
  flex: 0 1 auto;
  justify-content: center;
  min-height: 0;
  max-height: 58%;
}
.backs-col .tile { margin-top: -4px; }
.backs-col .tile:first-child { margin-top: 0; }
.backs-col .tile--back.back-side { --tw: 26px; aspect-ratio: 1.75; }
.back-side .tile-shell { padding: 1px; border-radius: 3px; }
.back-side .back-pattern { border-radius: 2px; }
.back-side .back-pattern::before { inset: 25% 32%; border-width: 1px; }
.side-empty { font-size: 8px; color: rgba(157, 172, 159, 0.45); letter-spacing: 0.06em; }

.melds-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  min-height: 0;
}
.melds-row .meld .tile { --tw: 16px; }
.seat--side .melds-row { gap: 3px; width: 100%; }
.seat--side .melds-row .meld .tile { --tw: 13px; }
.meld {
  display: inline-flex;
  gap: 1px;
  padding: 2px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.045);
  position: relative;
  flex: none;
}
.meld .tile { width: var(--tw); }
.meld-badge {
  position: absolute;
  bottom: -4px;
  right: -2px;
  font-size: 6px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 3px;
  color: #2a2113;
  background: rgba(217, 179, 106, 0.82);
  opacity: 0;
  transition: opacity 0.15s;
}
.meld:hover .meld-badge { opacity: 1; }
.seat--bottom .melds-row .meld .tile { --tw: 17px; }

/* Center discard pool */
.center-area {
  grid-area: center;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 152px minmax(0, 1fr);
  grid-template-areas:
    "discard-top discard-top discard-top"
    "discard-left core discard-right"
    "discard-bottom discard-bottom discard-bottom";
  gap: 4px;
}
.discard-zone {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 18px 8px 7px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid rgba(217, 179, 106, 0.075);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(35, 105, 81, 0.09), transparent 68%),
    rgba(0, 0, 0, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.022);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.zone-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 62px;
  line-height: 1;
  color: rgba(217, 179, 106, 0.035);
  pointer-events: none;
}
.zone-empty {
  position: relative;
  z-index: 1;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(157, 172, 159, 0.22);
  pointer-events: none;
}
.discard-zone .tile { --tw: clamp(14px, 1.4vw, 21px); }
.discard-zone--top { grid-area: discard-top; }
.discard-zone--bottom { grid-area: discard-bottom; }
.discard-zone--left { grid-area: discard-left; }
.discard-zone--right { grid-area: discard-right; }
.discard-zone.is-active {
  border-color: rgba(217, 179, 106, 0.22);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(53, 130, 101, 0.14), transparent 68%),
    rgba(217, 179, 106, 0.035);
  box-shadow: inset 0 0 0 1px rgba(217, 179, 106, 0.035), inset 0 0 30px rgba(217, 179, 106, 0.025);
}
.discard-zone.is-active .zone-watermark { color: rgba(217, 179, 106, 0.06); }
.discard-zone.is-active .zone-empty { color: rgba(241, 215, 154, 0.38); }
.zone-tag {
  position: absolute;
  top: 4px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: rgba(217, 179, 106, 0.35);
  pointer-events: none;
}
.zone-tag .zone-count { color: rgba(157, 172, 159, 0.3); }
.zone-tag.is-active { color: rgba(241, 215, 154, 0.78); }
.zone-tag.is-active::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px rgba(241, 215, 154, 0.6);
}
.discard-zone .tile.is-last-discard {
  filter: drop-shadow(0 0 5px rgba(241, 215, 154, 0.75));
  outline: 1px solid rgba(241, 215, 154, 0.55);
  outline-offset: 1px;
  animation: last-discard 1.8s ease-out;
}
.discard-zone .empty-hint {
  font-size: 8px;
  color: rgba(157, 172, 159, 0.2);
  letter-spacing: 0.14em;
}

.core {
  grid-area: core;
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(217, 179, 106, 0.16);
  background:
    radial-gradient(ellipse at 50% 40%, rgba(58, 151, 118, 0.12), transparent 68%),
    rgba(3, 18, 13, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 8px 26px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px;
  overflow: hidden;
}
.core::before {
  content: "";
  position: absolute;
  width: 92%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(217, 179, 106, 0.07);
  pointer-events: none;
}
.core::after {
  content: "東";
  position: absolute;
  font-family: var(--font-display);
  font-size: 92px;
  color: rgba(217, 179, 106, 0.025);
  pointer-events: none;
}
.core-round {
  position: relative;
  z-index: 1;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--muted-2);
}
.wall-ring {
  --progress: 1;
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  flex: none;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(var(--gold) calc(var(--progress) * 360deg), rgba(217, 179, 106, 0.1) 0);
  box-shadow: 0 0 22px rgba(217, 179, 106, 0.08);
  transition: background 0.25s linear;
}
.wall-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, rgba(41, 107, 85, 0.48), transparent 70%),
    #062019;
  border: 1px solid rgba(217, 179, 106, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.wall-num {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--cream);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.wall-label { font-size: 6.5px; letter-spacing: 0.18em; color: var(--muted-2); margin-top: 3px; }
.core-status {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  font-size: 8.5px;
  color: var(--muted);
  line-height: 1.35;
}
.core-status b { color: var(--cream-dim); font-weight: 500; }
.core-timer {
  font-family: var(--font-serif);
  font-size: 9.5px;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.core-timer.is-urgent { color: #e3a58e; }
.core.is-claim { border-color: rgba(217, 179, 106, 0.3); background-color: rgba(36, 51, 30, 0.35); }
.claim-tile-row { display: flex; align-items: center; gap: 4px; margin-top: 1px; }
.claim-tile-row .tile { --tw: 18px; }
.claim-text { font-size: 7px; color: var(--gold); letter-spacing: 0.08em; }

/* Bottom seat */
.self-meta { grid-area: selfmeta; justify-self: start; min-width: 0; max-width: 100%; }
.self-melds { grid-area: selfmelds; justify-self: center; min-width: 0; max-width: 100%; overflow: hidden; }
.self-ting { grid-area: selfting; justify-self: end; min-width: 0; max-width: 100%; display: flex; justify-content: flex-end; }
.self-dock { grid-area: dock; }
.self-hand-wrap { grid-area: hand; min-width: 0; display: flex; align-items: flex-end; justify-content: center; }
.self-meta .player-pill { max-width: 100%; }

.ting-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(217, 179, 106, 0.26);
  background: rgba(217, 179, 106, 0.07);
  color: var(--gold-bright);
  font-size: 8px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ting-pill b { font-weight: 600; }
.ting-pill .ting-label {
  font-size: 6.5px;
  padding: 2px 3px;
  border-radius: 2px;
  background: rgba(217, 179, 106, 0.16);
  letter-spacing: 0.05em;
}
.ting-pill.is-tenpai { animation: soft-glow 2.8s ease-in-out infinite; }

.action-dock {
  min-height: 43px;
  width: 100%;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(2, 15, 11, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 4px 10px;
  position: relative;
  overflow: visible;
  transition: border-color 0.2s, background 0.2s;
}
.action-dock.is-own-turn {
  border-color: rgba(217, 179, 106, 0.35);
  background: linear-gradient(90deg, rgba(31, 68, 51, 0.55), rgba(9, 33, 25, 0.66), rgba(31, 68, 51, 0.55));
  box-shadow: inset 0 0 20px rgba(217, 179, 106, 0.035), 0 0 16px rgba(217, 179, 106, 0.045);
}
.action-dock.is-claim {
  border-color: rgba(217, 179, 106, 0.45);
  background: linear-gradient(90deg, rgba(69, 45, 21, 0.4), rgba(18, 36, 26, 0.7), rgba(69, 45, 21, 0.4));
}
.dock-idle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: 0.05em;
  text-align: center;
}
.dock-idle .dock-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); opacity: 0.6; }
.dock-idle b { color: var(--cream-dim); font-weight: 500; }
.dock-actions { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; }
.self-dock { display: flex; align-items: flex-end; }
.self-dock > .action-dock { width: 100%; }
.dock-label {
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-right: 2px;
  white-space: nowrap;
}
.dock-label b { color: var(--gold-bright); font-weight: 500; }
.action-dock.is-own-turn .dock-label { color: var(--cream-dim); }
.act-btn {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  color: var(--cream);
  font-size: 12px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.14s, background 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.act-btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.075); border-color: rgba(255, 255, 255, 0.18); }
.act-btn b { font-size: 13px; }
.act-btn--hu {
  min-width: 78px;
  min-height: 35px;
  font-size: 15px;
  font-weight: 700;
  color: #291d0d;
  background: linear-gradient(135deg, #f7e7bd, #e2bd74 55%, #cb9b48);
  border-color: rgba(255, 246, 218, 0.6);
  box-shadow: 0 0 18px rgba(217, 179, 106, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: hu-breathe 1.8s ease-in-out infinite;
}
.act-btn--hu:hover { background: linear-gradient(135deg, #fff0c9, #e9c983 55%, #d6a753); }
.act-btn--pass { color: var(--muted); background: transparent; border-color: rgba(255, 255, 255, 0.065); }
.act-btn--pass:hover { color: var(--cream); }
.act-btn--claim { border-color: rgba(217, 179, 106, 0.2); background: rgba(217, 179, 106, 0.05); }
.act-btn--ghost { min-height: 28px; padding: 0 9px; font-size: 10px; color: var(--muted-2); background: transparent; border-color: transparent; }
.act-btn--ghost:hover { color: var(--gold-bright); background: rgba(217, 179, 106, 0.05); }
.act-btn--discard {
  color: #241b10;
  background: linear-gradient(135deg, #e9d6a9, #cfae6d);
  border-color: rgba(217, 179, 106, 0.4);
  font-weight: 600;
}
.act-btn--discard.is-ready { animation: ready-pulse 1.6s ease-in-out infinite; }
.act-btn .mini-tiles { display: inline-flex; gap: 1px; margin-left: 1px; }
.act-btn .mini-tiles .tile { --tw: 14px; }
.dock-spacer { flex: 1; }
.dock-timer {
  font-family: var(--font-serif);
  font-size: 11px;
  color: var(--gold);
  min-width: 25px;
  text-align: right;
  letter-spacing: 0.04em;
}
.dock-timer.is-urgent { color: #e6a38b; }
.dock-timer-bar {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(217, 179, 106, 0.4), var(--gold));
  width: var(--timer-width, 100%);
  transition: width 0.2s linear, background 0.3s;
  opacity: 0.7;
}
.dock-timer-bar.is-urgent { background: linear-gradient(90deg, rgba(201, 112, 88, 0.5), #d88468); }

.hint-panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%);
  width: min(470px, 90%);
  border-radius: 10px;
  border: 1px solid rgba(217, 179, 106, 0.25);
  background: rgba(5, 24, 18, 0.97);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  z-index: 20;
  animation: hint-in 0.22s ease;
}
.hint-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.hint-panel-head b { font-size: 10px; color: var(--gold-bright); font-weight: 500; letter-spacing: 0.06em; }
.hint-close { border: 0; background: transparent; color: var(--muted-2); font-size: 15px; line-height: 1; padding: 0 2px; }
.hint-content { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 10px; color: var(--muted); line-height: 1.6; }
.hint-content .tile { --tw: 20px; }
.hint-content b { color: var(--cream); font-weight: 500; }
.hint-waits { color: var(--gold-bright); }

.chi-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 210px;
  border-radius: 10px;
  border: 1px solid rgba(217, 179, 106, 0.3);
  background: rgba(5, 24, 18, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  padding: 9px;
  z-index: 25;
  animation: hint-in 0.2s ease;
}
.chi-menu-title { font-size: 8px; letter-spacing: 0.1em; color: var(--muted-2); margin-bottom: 6px; }
.chi-option {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 6px;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.chi-option:last-child { margin-bottom: 0; }
.chi-option:hover { border-color: rgba(217, 179, 106, 0.35); background: rgba(217, 179, 106, 0.07); }
.chi-option .mini-tiles { display: flex; gap: 2px; }
.chi-option .tile { --tw: 17px; }
.chi-option span { font-size: 9px; color: var(--muted); }

/* Own hand */
.hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  padding-top: 9px;
  gap: 2px;
}
.hand .tile {
  --tw: clamp(27px, 3.6vw, 48px);
  transition: transform 0.14s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.14s, box-shadow 0.14s;
}
.hand .tile--interactive { cursor: pointer; }
.hand .tile--interactive:hover { transform: translateY(-5px); z-index: 3; }
.hand .tile.is-selected {
  transform: translateY(-13px);
  z-index: 4;
}
.hand .tile.is-selected .tile-shell {
  box-shadow: 0 0 0 2px rgba(241, 215, 154, 0.75), 0 0 20px rgba(241, 215, 154, 0.25), 0 14px 22px rgba(0, 0, 0, 0.35);
}
.hand .tile.is-drawn .tile-shell::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(241, 215, 154, 0.35);
  pointer-events: none;
}
.hand-drawn-gap { flex: none; width: 10px; height: 1px; position: relative; }
.hand-drawn-gap::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 1px;
  height: 16px;
  background: linear-gradient(transparent, rgba(217, 179, 106, 0.24), transparent);
}
.hand .tile.is-winning .tile-shell { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 24px rgba(241, 215, 154, 0.35); }

/* Side panel game */
.side-panel {
  flex: 0 0 306px;
  width: 306px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(165deg, rgba(12, 36, 28, 0.94), rgba(4, 19, 14, 0.95));
  border-left: 1px solid rgba(217, 179, 106, 0.12);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.16);
  position: relative;
  z-index: 18;
}
.side-panel-head { padding: 17px 16px 12px; }
.side-panel-head h2 { font-size: 20px; }
.side-actions { display: flex; align-items: center; gap: 7px; }
.online-count { font-size: 8px; color: var(--muted-2); letter-spacing: 0.04em; white-space: nowrap; }
.panel-close { display: none; border: 0; background: transparent; color: var(--muted); font-size: 21px; line-height: 1; padding: 0 2px; }
.mini-scores {
  flex: none;
  padding: 8px 12px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.1);
}
.mini-scores-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 5px;
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}
.mini-scores-head span:last-child { color: rgba(217, 179, 106, 0.55); }
.mini-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-size: 9px;
  color: var(--muted);
  transition: background 0.2s, border-color 0.2s;
}
.mini-score-row.is-active {
  background: rgba(217, 179, 106, 0.055);
  border-color: rgba(217, 179, 106, 0.12);
}
.mini-score-row.is-you .mini-score-name { color: var(--cream); }
.mini-score-wind {
  flex: none;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--gold);
  border: 1px solid rgba(217, 179, 106, 0.18);
  background: rgba(217, 179, 106, 0.04);
}
.mini-score-avatar {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  font-size: 10px;
  background: var(--seat-color, #1e4e3c);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.mini-score-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.mini-score-name i {
  margin-left: 4px;
  font-style: normal;
  font-size: 6px;
  color: rgba(124, 178, 155, 0.75);
  border: 1px solid rgba(124, 178, 155, 0.22);
  border-radius: 2px;
  padding: 1px 2px;
}
.mini-score-row b {
  flex: none;
  font-family: var(--font-serif);
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
  min-width: 27px;
  text-align: right;
}
.mini-score-row b.is-neg { color: #c58e80; }
.game-feed { padding-top: 10px; }
.panel-scrim { display: none; }

/* Sidebar quick chat */
.side-panel .quick-chats { padding: 7px 14px 0; }
.side-panel .chat-form { padding: 9px 13px 13px; }

/* ---------------- Action bubbles / toasts / banners ---------------- */

.action-bubbles {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}
.action-bubble {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(241, 215, 154, 0.45);
  background: linear-gradient(135deg, rgba(125, 44, 35, 0.96), rgba(90, 30, 24, 0.96));
  color: #f7e8c6;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 24px rgba(183, 67, 53, 0.18);
  letter-spacing: 0.08em;
  animation: bubble-rise 1.15s cubic-bezier(0.18, 0.75, 0.25, 1) forwards;
}
.action-bubble small { display: block; font-family: var(--font-ui); font-size: 7px; letter-spacing: 0.12em; opacity: 0.6; margin-top: 2px; }
.action-bubble--gold {
  border-color: rgba(241, 215, 154, 0.65);
  background: linear-gradient(135deg, rgba(199, 158, 77, 0.97), rgba(137, 96, 32, 0.97));
  color: #251b0d;
}
.action-bubble--jade {
  border-color: rgba(141, 208, 179, 0.4);
  background: linear-gradient(135deg, rgba(38, 105, 81, 0.97), rgba(16, 66, 48, 0.97));
  color: #e6f4eb;
}

.toast-stack {
  position: fixed;
  right: 20px;
  top: calc(var(--topbar-h) + 12px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}
.toast {
  max-width: min(360px, calc(100vw - 30px));
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid rgba(217, 179, 106, 0.22);
  background: rgba(5, 24, 18, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  font-size: 11px;
  line-height: 1.5;
  color: var(--cream);
  animation: toast-in 0.28s ease;
  backdrop-filter: blur(12px);
}
.toast--error { border-color: rgba(201, 112, 88, 0.35); color: #f0c7b9; }
.toast--success { border-color: rgba(108, 174, 148, 0.3); color: #cce7da; }
.toast.is-leaving { animation: toast-out 0.3s ease forwards; }

.connection-banner {
  position: fixed;
  z-index: 110;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  height: 33px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(201, 112, 88, 0.32);
  background: rgba(34, 17, 13, 0.94);
  color: #f0c9bb;
  font-size: 10px;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
}
.spinner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 201, 187, 0.3);
  border-top-color: #f0c9bb;
  animation: spin 0.8s linear infinite;
}

/* ---------------- Blocking / modal ---------------- */

.blocking-layer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 10, 8, 0.78);
  backdrop-filter: blur(10px);
}
.block-card {
  width: min(430px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(217, 179, 106, 0.22);
  background: linear-gradient(155deg, rgba(17, 48, 37, 0.98), rgba(5, 21, 15, 0.99));
  box-shadow: var(--shadow-deep);
  padding: 24px;
  text-align: left;
}
.block-card h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 26px; font-weight: 500; color: var(--cream); }
.block-card p { margin: 0 0 16px; font-size: 11px; line-height: 1.8; color: var(--muted); }
.block-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

#modal-root:empty { display: none; }
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 10, 8, 0.72);
  backdrop-filter: blur(9px);
  animation: fade-in 0.2s ease;
}
.modal {
  width: min(660px, 100%);
  max-height: min(84vh, 780px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 17px;
  border: 1px solid rgba(217, 179, 106, 0.24);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(44, 108, 84, 0.2), transparent 50%),
    linear-gradient(160deg, #0e2e24, #061b13 70%);
  box-shadow: var(--shadow-deep);
  animation: modal-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal--small { width: min(420px, 100%); }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 21px 23px 15px;
  border-bottom: 1px solid rgba(217, 179, 106, 0.12);
}
.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 27px; font-weight: 500; color: var(--cream); letter-spacing: 0.05em; }
.modal-close {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.modal-close:hover { color: var(--cream); border-color: rgba(217, 179, 106, 0.25); }
.modal-body { padding: 20px 23px 24px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(217, 179, 106, 0.2) transparent; }
.modal-body h3 {
  margin: 20px 0 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 600;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p, .modal-body li { font-size: 11px; line-height: 1.85; color: var(--muted); }
.modal-body p { margin: 0 0 10px; }
.modal-body ul { margin: 0 0 12px; padding-left: 17px; }
.modal-body li { margin-bottom: 4px; }
.modal-body b { color: var(--cream-dim); font-weight: 500; }
.rule-callout {
  border: 1px dashed rgba(217, 179, 106, 0.22);
  border-radius: 8px;
  background: rgba(217, 179, 106, 0.04);
  padding: 10px 12px;
  font-size: 10px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 15px;
}
.fan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 17px; }
.fan-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 10px;
  color: var(--muted);
}
.fan-row b { color: var(--cream-dim); font-weight: 500; }
.fan-row span { color: var(--gold); flex: none; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* Score modal */
.score-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.score-table th { text-align: left; font-weight: 400; font-size: 8px; letter-spacing: 0.12em; color: var(--muted-2); padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.score-table td { padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--muted); }
.score-table td:first-child { color: var(--cream); }
.score-table td:last-child { text-align: right; font-family: var(--font-serif); font-size: 14px; color: var(--gold-bright); }
.score-table .is-me td { background: rgba(217, 179, 106, 0.04); }
.score-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--seat-color, #1e4e3c); margin-right: 7px; font-size: 13px; vertical-align: middle; }

/* Career / stats modal */
.stats-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 13px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.stats-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(217, 179, 106, 0.25);
  background: rgba(217, 179, 106, 0.07);
  font-size: 22px;
}
.stats-profile h3 {
  margin: 0 0 3px !important;
  font-size: 18px !important;
  letter-spacing: 0.04em;
}
.stats-profile p { margin: 0; font-size: 9.5px; }
.stats-syncing {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.stats-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.stats-kpi > div {
  padding: 9px 8px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}
.stats-kpi b {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--gold-bright);
}
.stats-kpi span {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.1em;
}
.stats-subline {
  margin: 9px 0 3px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.6;
}
.stats-list { display: flex; flex-direction: column; gap: 4px; }
.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.014);
}
.stats-row-main { min-width: 0; }
.stats-row-main b {
  display: block;
  color: var(--cream-dim);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-row-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-row-score {
  flex: none;
  min-width: 42px;
  text-align: right;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--muted);
}
.stats-row-score.is-plus, .stats-kpi .is-plus, .score-table td.is-plus { color: #8fceaa; }
.stats-row-score.is-minus, .stats-kpi .is-minus, .score-table td.is-minus { color: #d59a89; }
.stats-board { margin-top: 4px; }
.stats-board td:last-child { color: var(--muted); font-size: 13px; }
.stats-empty {
  padding: 12px 4px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
}
.stats-room-list { display: flex; flex-direction: column; gap: 3px; }
.stats-room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 9px;
  color: var(--muted-2);
}
.stats-room b { color: var(--gold); font-weight: 500; letter-spacing: 0.12em; }
.stats-room span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-foot {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.6;
}

/* ---------------- Result overlay ---------------- */

.result-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(30, 91, 70, 0.32), transparent 55%),
    rgba(2, 10, 7, 0.86);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  animation: fade-in 0.35s ease;
}
.result-layer.is-minimized { display: none; }
.result-shell {
  width: min(900px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px;
  border: 1px solid rgba(217, 179, 106, 0.28);
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(61, 134, 106, 0.18), transparent 70%),
    linear-gradient(160deg, rgba(15, 43, 33, 0.99), rgba(5, 20, 14, 0.99));
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: clamp(20px, 3vw, 34px);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 179, 106, 0.2) transparent;
}
.result-shell::before, .result-shell::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  border-color: rgba(217, 179, 106, 0.35);
  border-style: solid;
  pointer-events: none;
}
.result-shell::before { top: 11px; left: 11px; border-width: 1px 0 0 1px; border-radius: 8px 0 0 0; }
.result-shell::after { bottom: 11px; right: 11px; border-width: 0 1px 1px 0; border-radius: 0 0 8px 0; }
.result-head { text-align: center; margin-bottom: 20px; }
.result-eyebrow { font-size: 8px; letter-spacing: 0.28em; color: var(--gold); margin-bottom: 7px; }
.result-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 68px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--cream);
  text-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.result-title span { color: var(--gold-bright); }
.result-sub { margin: 9px 0 0; font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }
.result-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.result-close:hover { color: var(--cream); border-color: rgba(217, 179, 106, 0.28); }
.winners { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.winner-card {
  border: 1px solid rgba(217, 179, 106, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.winner-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(var(--gold), rgba(217, 179, 106, 0.1));
}
.winner-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.winner-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 19px;
  border-radius: 50%;
  background: var(--seat-color, #1e4e3c);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.winner-name { flex: 1; min-width: 0; }
.winner-name b { display: block; font-size: 14px; color: var(--cream); font-weight: 500; }
.winner-name small { font-size: 8px; color: var(--muted-2); letter-spacing: 0.06em; }
.winner-fan { text-align: right; flex: none; }
.winner-fan strong { display: block; font-family: var(--font-serif); font-size: 26px; line-height: 1; color: var(--gold-bright); font-weight: 500; }
.winner-fan small { font-size: 7px; color: var(--muted-2); letter-spacing: 0.12em; }
.winner-hand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(0, 0, 0, 0.12);
}
.winner-hand-block--melds { align-items: flex-start; background: transparent; border-color: transparent; padding: 2px 6px 5px; margin-bottom: 8px; }
.winner-block-label {
  flex: none;
  font-size: 8px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.winner-win-tile {
  flex: none;
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  border: 1px solid rgba(217, 179, 106, 0.22);
  background: rgba(217, 179, 106, 0.06);
  padding: 3px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.winner-hand {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  min-height: 38px;
}
.winner-hand .tile { --tw: clamp(24px, 3.1vw, 36px); }
.winner-hand .tile.is-winning .tile-shell { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 18px rgba(241, 215, 154, 0.35); }
.winner-melds { flex: 1; display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin: 0; }
.winner-melds .meld .tile { --tw: 18px; }
.winner-melds .meld-badge { opacity: 1; bottom: -5px; }
.patterns { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.pattern-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(217, 179, 106, 0.18);
  background: rgba(217, 179, 106, 0.055);
  color: var(--cream-dim);
  font-size: 9px;
}
.pattern-chip b { color: var(--gold); font-weight: 500; }
.result-draw {
  text-align: center;
  padding: 24px 0 12px;
  border-top: 1px solid rgba(217, 179, 106, 0.1);
  border-bottom: 1px solid rgba(217, 179, 106, 0.1);
  margin-bottom: 18px;
}
.result-draw .result-title { font-size: clamp(40px, 5vw, 60px); }
.result-scoreboard {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  overflow: hidden;
  margin-bottom: 18px;
}
.result-score-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 7px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.1);
  font-size: 7px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}
.result-score-head span:not(:first-child) { min-width: 44px; text-align: right; }
.result-score-head span:last-child { min-width: 46px; }
.result-score-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 11px;
}
.result-score-row:last-child { border-bottom: 0; }
.result-score-row.is-me { background: rgba(217, 179, 106, 0.04); }
.result-score-name { display: flex; align-items: center; gap: 7px; color: var(--cream-dim); min-width: 0; }
.result-score-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-score-name .avatar { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--seat-color, #1e4e3c); overflow: hidden; }
.result-score-name .result-wind {
  flex: none;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  border: 1px solid rgba(217, 179, 106, 0.17);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 9px;
  overflow: visible;
}
.result-score-name .result-dealer {
  flex: none;
  font-size: 7px;
  color: #2a2113;
  background: rgba(217, 179, 106, 0.8);
  padding: 1px 3px;
  border-radius: 2px;
  overflow: visible;
}
.result-score-delta { font-family: var(--font-serif); font-size: 13px; min-width: 44px; text-align: right; color: var(--muted-2); }
.result-score-delta.is-plus { color: #8fcaae; }
.result-score-delta.is-minus { color: #d39180; }
.result-score-total { font-family: var(--font-serif); font-size: 14px; color: var(--gold-bright); min-width: 46px; text-align: right; }
.result-footer { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.result-countdown { font-size: 9px; color: var(--muted-2); letter-spacing: 0.03em; width: 100%; text-align: center; margin-top: 2px; }
.result-actions .btn-ghost-danger { min-height: 34px; font-size: 10px; }
body.is-offline .action-dock,
body.is-offline .hand .tile {
  pointer-events: none;
}
body.is-offline .action-dock { opacity: 0.5; }
body.is-offline .hand { opacity: 0.72; }
.result-ready-label {
  text-align: center;
  font-size: 7px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.ready-dots { display: flex; justify-content: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.ready-dot { display: flex; align-items: center; gap: 4px; font-size: 8px; color: var(--muted-2); }
.ready-dot i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.ready-dot.is-ready { color: var(--muted); }
.ready-dot.is-ready i { background: #7fb598; box-shadow: 0 0 5px rgba(127, 181, 152, 0.4); }
.result-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.result-minimized-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(217, 179, 106, 0.35);
  background: rgba(10, 34, 25, 0.96);
  color: var(--gold-bright);
  font-size: 11px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  animation: float-in 0.3s ease;
}

/* ---------------- Tiles ---------------- */

.tile {
  --tw: 46px;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: var(--tw);
  aspect-ratio: 0.715;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1;
  vertical-align: bottom;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s, filter 0.14s;
}
.tile--xxs { --tw: 18px; }
.tile--xs { --tw: 22px; }
.tile--sm { --tw: 28px; }
.tile--md { --tw: 36px; }
.tile--lg { --tw: 46px; }
.tile--xl { --tw: 58px; }
.tile--interactive { cursor: pointer; }
.tile-shell {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: calc(var(--tw) * 0.13);
  padding: calc(var(--tw) * 0.035);
  background:
    linear-gradient(145deg, #fbf6e7 0%, #e4d7bc 46%, #c7b38c 100%);
  border: 1px solid rgba(48, 36, 18, 0.33);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 -2px 0 rgba(93, 68, 34, 0.22) inset,
    0 calc(var(--tw) * 0.07) calc(var(--tw) * 0.1) rgba(0, 0, 0, 0.32);
  transform: translateZ(0);
}
.tile-shell::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.55), transparent 32%, rgba(82, 58, 25, 0.06) 100%);
  z-index: 2;
  mix-blend-mode: soft-light;
}
.tile-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--tw) * 0.095);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(255, 255, 255, 0.55), transparent 52%),
    repeating-linear-gradient(93deg, rgba(102, 78, 44, 0.02) 0 1px, transparent 1px 4px),
    linear-gradient(158deg, #fffdf4 0%, #f7efdc 56%, #ecdfc5 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), inset 0 -1px 2px rgba(91, 64, 28, 0.12);
  display: grid;
  place-items: center;
}
.tile-glint {
  position: absolute;
  top: -20%;
  left: -55%;
  width: 55%;
  height: 150%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: rotate(18deg);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.5s, opacity 0.5s;
}
.tile--interactive:hover .tile-glint { opacity: 1; transform: translateX(250%) rotate(18deg); }

.tile--back .tile-shell {
  padding: calc(var(--tw) * 0.04);
  background: linear-gradient(145deg, #f0e4c9, #d2bd98 50%, #b39a72);
}
.back-pattern {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--tw) * 0.08);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(217, 179, 106, 0.18) 0 22%, transparent 23%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 1.5px, transparent 1.5px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.08) 0 1.5px, transparent 1.5px 6px),
    linear-gradient(150deg, #1a5a47, #0c392d 55%, #082a21);
  border: 1px solid rgba(4, 25, 19, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(217, 179, 106, 0.08);
}
.back-pattern::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid rgba(217, 179, 106, 0.3);
}
.back-pattern::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(217, 179, 106, 0.09);
  border-radius: 2px;
}
.back-pattern i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  background: rgba(217, 179, 106, 0.4);
  box-shadow: 0 0 5px rgba(217, 179, 106, 0.18);
}

/* Tile face artwork */
.wan-art {
  position: absolute;
  inset: 7% 6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.wan-num {
  font-family: var(--font-display);
  font-size: calc(var(--tw) * 0.54);
  font-weight: 700;
  color: #20342b;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.wan-mark {
  margin-top: 2%;
  font-family: var(--font-display);
  font-size: calc(var(--tw) * 0.33);
  color: #9d322a;
  line-height: 1;
  font-weight: 600;
}
.wan-line {
  width: 36%;
  height: 1px;
  margin-top: 5%;
  background: linear-gradient(90deg, transparent, rgba(155, 50, 42, 0.3), transparent);
}
.pip-art, .bamboo-art, .bird-art {
  position: absolute;
  inset: 10% 8%;
  display: block;
}
.pip {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--tw) * 0.18 * var(--s, 1));
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.9) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, #fbf3df 0 18%, var(--dot) 20% 52%, #f7eed9 54% 64%, var(--dot) 66% 100%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18), inset 0 0 0 0.5px rgba(0, 0, 0, 0.1);
}
.pip--one {
  width: calc(var(--tw) * 0.42);
  height: calc(var(--tw) * 0.42);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.8) 0 6%, transparent 7%),
    radial-gradient(circle at 50% 50%, #fbf2dc 0 16%, #a53a31 17% 45%, #f8efd9 46% 55%, #265d91 56% 78%, #f8efd9 79% 87%, #2f6c50 88% 100%);
  left: 50%;
  top: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}
.bamboo {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--tw) * 0.085);
  height: calc(var(--tw) * 1.38 * var(--h));
  min-height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 99px;
  background:
    linear-gradient(90deg, rgba(8, 50, 35, 0.45), transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 74%, rgba(5, 37, 27, 0.4)),
    linear-gradient(180deg, #36775a, #255f46 50%, #1c4c38);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.bamboo b {
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(243, 232, 207, 0.55);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}
.bamboo--red {
  background:
    linear-gradient(90deg, rgba(78, 18, 14, 0.4), transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 74%, rgba(70, 15, 12, 0.35)),
    linear-gradient(180deg, #bf4a3a, #9e352c 55%, #7f2923);
}
.bamboo--red b { background: rgba(249, 228, 200, 0.55); }
.bird-art svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45)); }
.honor {
  position: absolute;
  inset: 2% 4%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--tw) * 0.72);
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.honor--wind { color: #253b4a; }
.honor--red { color: #a8322a; }
.honor--green { color: #28704e; }
.honor--white i {
  display: block;
  width: 48%;
  height: 56%;
  border: calc(var(--tw) * 0.035) solid #315f88;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(49, 95, 136, 0.25);
}
.face--p .tile-glint, .face--s .tile-glint { mix-blend-mode: normal; }

/* ---------------- Animations ---------------- */

@keyframes screen-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes feed-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes soft-pulse { 0%, 100% { transform: scale(1); opacity: 0.65; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes soft-glow { 0%, 100% { box-shadow: 0 0 0 rgba(217, 179, 106, 0); } 50% { box-shadow: 0 0 16px rgba(217, 179, 106, 0.08); } }
@keyframes hu-breathe { 0%, 100% { box-shadow: 0 0 15px rgba(217, 179, 106, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6); } 50% { box-shadow: 0 0 28px rgba(217, 179, 106, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.7); } }
@keyframes ready-pulse { 0%, 100% { box-shadow: 0 0 0 rgba(217, 179, 106, 0); } 50% { box-shadow: 0 0 14px rgba(217, 179, 106, 0.18); } }
@keyframes last-discard { 0% { transform: translateY(-7px); filter: brightness(1.4); } 100% { transform: none; filter: none; } }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, 5px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes bubble-rise { 0% { opacity: 0; transform: translate(-50%, 2px) scale(0.8); } 16% { opacity: 1; transform: translate(-50%, -8px) scale(1.04); } 30% { transform: translate(-50%, -10px) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -24px) scale(0.96); } }
@keyframes float-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes winner-glow { 0%, 100% { box-shadow: 0 0 0 rgba(217, 179, 106, 0); } 50% { box-shadow: 0 0 50px rgba(217, 179, 106, 0.06); } }

/* ---------------- Responsive ---------------- */

@media (max-width: 1240px) {
  .table-content { grid-template-columns: 118px minmax(0, 1fr) 118px; }
  .center-area { grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr); }
  .side-panel { flex-basis: 288px; width: 288px; }
  .hand .tile { --tw: clamp(25px, 3.35vw, 43px); }
  .table-content { grid-template-rows: 98px minmax(0, 1fr) 180px; }
  .seat--bottom { grid-template-rows: 25px auto auto; }
}

@media (max-width: 1100px) {
  .side-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: min(340px, 88vw);
    flex-basis: auto;
    transform: translateX(103%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: -30px 0 70px rgba(0, 0, 0, 0.45);
  }
  .side-panel.is-open { transform: translateX(0); }
  .panel-toggle-btn { display: inline-flex; }
  .panel-close { display: inline-block; }
  .panel-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(2, 10, 7, 0.55);
    backdrop-filter: blur(3px);
  }
  .panel-scrim.is-open { display: block; animation: fade-in 0.2s ease; }
  .table-area { padding: 10px 12px 12px; }
  .table { max-width: none; }
}

@media (max-width: 980px) {
  .landing-main {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 370px);
    gap: 35px;
    padding: 25px 32px 45px;
  }
  .landing-nav { padding: 22px 32px 0; }
  .landing-footer { padding: 16px 32px 24px; }
  .hero-name { font-size: clamp(56px, 9vw, 86px); }
  .hero-tagline { margin-top: 20px; }
  .hero-hand { margin-top: 25px; margin-bottom: 18px; }
  .lobby-main { grid-template-columns: minmax(0, 1fr) 300px; padding: 26px 24px 32px; }
  .lobby-seat { min-width: 148px; padding: 8px 9px 8px 7px; }
  .lobby-seat-avatar { width: 29px; height: 29px; font-size: 16px; }
  .lobby-seat-name { font-size: 11px; }
  .lobby-table { min-height: 420px; }
}

@media (max-width: 820px) {
  .screen-landing::before { opacity: 0.6; }
  .landing-main {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 24px 24px 40px;
    max-width: 560px;
  }
  .hero { text-align: center; }
  .hero-kicker { justify-content: center; }
  .hero-title { justify-content: center; }
  .hero-tagline { font-size: 14px; }
  .hero-hand { justify-content: center; margin-left: 0; padding-left: 0; height: 105px; }
  .hero-hand .tile { --tw: clamp(34px, 7vw, 50px); margin-left: -7px; }
  .feature-row { justify-content: center; max-width: none; }
  .entry-card { max-width: 430px; margin: 0 auto; }
  .landing-nav { padding: 20px 22px 0; }
  .landing-footer { padding: 12px 24px 22px; }
  .landing-footer .footer-mark { display: none; }
  .landing-main { padding-top: 18px; }

  .game-topbar { padding: 0 9px; gap: 6px; }
  .game-topbar .brand-word { display: none; }
  .game-topbar .topbar-divider { display: none; }
  .game-topbar .topbar-left { gap: 5px; }
  .game-topbar .room-chip { padding: 0 7px; }
  .game-topbar .room-chip span { display: none; }
  .round-chip { display: none; }
  .topbar-status { display: none; }
  .game-topbar .conn-pill { display: none; }
  .game-topbar .topbar-right { gap: 4px; }
  .game-topbar .icon-text-btn { padding: 0 8px; }
  .game-topbar .icon-text-btn--danger { padding: 0 8px; }
  .game-topbar .icon-btn { width: 29px; height: 29px; }
  .game-topbar .icon-text-btn { height: 29px; }

  .table-area { padding: 6px 7px 8px; }
  .table { padding: 5px; border-radius: 22px; }
  .table::before { display: none; }
  .table-rim { inset: 5px; border-radius: 18px; }
  .table-content {
    border-radius: 18px;
    padding: 7px 7px;
    grid-template-columns: 76px minmax(0, 1fr) 76px;
    grid-template-rows: 84px minmax(0, 1fr) 158px;
    gap: 1px;
  }
  .seat--top { gap: 3px; padding-bottom: 1px; }
  .seat--left, .seat--right { gap: 5px; padding-top: 3px; }
  .seat--bottom {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: 24px auto auto;
    gap: 3px 5px;
    padding: 0 2px;
  }
  .player-pill { gap: 5px; padding: 3px 6px 3px 3px; }
  .player-pill .avatar { width: 22px; height: 22px; font-size: 12px; }
  .player-name { font-size: 9px; max-width: 66px; }
  .player-sub { font-size: 7px; margin-top: 2px; gap: 3px; }
  .player-sub .wind { font-size: 8px; }
  .pill-badges .mini-badge { font-size: 6px; height: 12px; }
  .seat--side .player-name { max-width: 52px; }
  .seat--side .player-sub { font-size: 6.5px; }
  .backs-row .tile--back { --tw: 12px; }
  .backs-row .tile { margin-left: -3px; }
  .backs-col .tile--back.back-side { --tw: 19px; }
  .backs-col .tile { margin-top: -3px; }
  .melds-row .meld .tile { --tw: 13px; }
  .seat--side .melds-row .meld .tile { --tw: 10px; }
  .seat--bottom .melds-row .meld .tile { --tw: 13px; }
  .meld-badge { display: none; }

  .center-area {
    grid-template-columns: minmax(0, 1fr) 94px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 103px minmax(0, 1fr);
    gap: 2px;
  }
  .discard-zone { padding: 13px 2px 2px; gap: 1px; border-radius: 6px; }
  .discard-zone .tile { --tw: clamp(12px, 3vw, 17px); }
  .zone-tag { top: 3px; left: 4px; font-size: 6px; letter-spacing: 0.06em; }
  .core { border-radius: 9px; padding: 3px; gap: 2px; }
  .core::after { font-size: 56px; }
  .core-round { font-size: 6.5px; letter-spacing: 0.08em; }
  .wall-ring { width: 53px; height: 53px; }
  .wall-num { font-size: 18px; }
  .wall-label { font-size: 5.5px; margin-top: 1px; }
  .core-status { font-size: 6.5px; min-height: 17px; gap: 0; }
  .core-timer { font-size: 7.5px; }
  .claim-tile-row .tile { --tw: 14px; }
  .claim-text { font-size: 6px; }

  .action-dock { min-height: 34px; padding: 3px 5px; gap: 4px; border-radius: 7px; }
  .dock-idle { font-size: 8px; gap: 5px; }
  .dock-label { font-size: 7.5px; }
  .act-btn { min-height: 27px; padding: 0 9px; font-size: 10px; border-radius: 5px; }
  .mini-scores { padding: 7px 9px 8px; }
  .mini-score-row { font-size: 8.5px; gap: 5px; padding: 2px 3px; }
  .mini-score-wind { width: 15px; height: 15px; font-size: 9px; }
  .mini-score-avatar { width: 16px; height: 16px; font-size: 9px; }
  .act-btn--hu { min-width: 57px; min-height: 29px; font-size: 12px; }
  .act-btn--ghost { min-height: 24px; padding: 0 6px; font-size: 9px; }
  .dock-timer { font-size: 9px; min-width: 18px; }
  .dock-actions { gap: 4px; }
  .hand { padding-top: 5px; gap: 1px; }
  .hand .tile { --tw: clamp(20px, 5.55vw, 34px); }
  .hand-drawn-gap { width: 5px; }
  .self-ting .ting-pill { font-size: 7px; padding: 3px 5px; gap: 3px; }
  .ting-pill .ting-label { font-size: 6px; }
  .hint-panel { width: min(96%, 390px); bottom: calc(100% + 6px); padding: 8px 9px; }
  .chi-menu { min-width: 180px; bottom: calc(100% + 6px); }
  .action-bubble { font-size: 16px; padding: 4px 10px; }

  .result-layer { padding: 10px; align-items: flex-start; }
  .result-shell { padding: 22px 14px 18px; border-radius: 16px; max-height: calc(100dvh - 20px); }
  .result-close { top: 10px; right: 10px; }
  .winner-card { padding: 11px 12px; }
  .winner-hand-block { gap: 5px; padding: 5px 6px; flex-wrap: wrap; }
  .winner-block-label { font-size: 7px; }
  .winner-hand { padding: 4px; min-height: 30px; }
  .winner-hand .tile { --tw: clamp(22px, 5vw, 31px); }
  .winner-win-tile { font-size: 7px; padding: 2px 4px; }
  .result-score-row { padding: 8px 10px; gap: 9px; }
  .fan-grid { grid-template-columns: 1fr; }
  .modal-head { padding: 17px 17px 12px; }
  .modal-body { padding: 16px 17px 20px; }

  .lobby-main { grid-template-columns: 1fr; align-items: start; padding: 20px 16px 28px; gap: 18px; max-width: 650px; }
  .lobby-table { min-height: 390px; }
  .lobby-heading h1 { font-size: 34px; }
  .lobby-seat { min-width: 136px; padding: 7px; gap: 6px; }
  .lobby-seat-avatar { width: 26px; height: 26px; font-size: 14px; }
  .lobby-seat-name { font-size: 10px; }
  .lobby-seat-meta { font-size: 7px; }
  .lobby-center { width: min(290px, 62%); padding: 15px; }
  .lobby-code { font-size: 30px; }
  .lobby-side { height: 360px; min-height: 320px; }
  .invite-strip { flex-direction: column; align-items: stretch; gap: 10px; }
  .invite-copy-row { max-width: none; }
  .remote-line { font-size: 9px; padding: 7px 9px; }
  .remote-note { width: 100%; margin-left: 13px; }

  .app-topbar { padding: 0 13px; gap: 8px; }
  .app-topbar .brand-word { font-size: 13px; }
  .app-topbar .conn-pill { display: none; }
  .app-topbar .topbar-divider { display: none; }
  .lobby-main > .lobby-side { order: 2; }
}

@media (max-width: 620px) {
  :root { --topbar-h: 50px; }
  .landing-nav { padding: 15px 16px 0; }
  .landing-nav-actions { gap: 12px; }
  .landing-nav-actions .text-btn { font-size: 10px; }
  .landing-main { padding: 14px 15px 30px; gap: 20px; }
  .brand--compact .brand-seal { width: 31px; height: 31px; font-size: 19px; }
  .brand-word { font-size: 17px; }
  .hero-kicker { font-size: 7px; letter-spacing: 0.17em; gap: 8px; margin-bottom: 16px; }
  .hero-seal { width: 54px; height: 54px; font-size: 33px; border-radius: 7px; }
  .hero-title { gap: 14px; }
  .hero-name { font-size: clamp(50px, 15vw, 72px); letter-spacing: 0.02em; }
  .hero-tagline { margin-top: 15px; font-size: 12px; line-height: 1.8; }
  .hero-hand { height: 82px; margin: 17px 0 13px; }
  .hero-hand .tile { --tw: clamp(30px, 8.5vw, 42px); margin-left: -6px; }
  .feature-row { padding-top: 13px; font-size: 8px; gap: 7px 12px; }
  .entry-card { padding: 20px 17px 16px; border-radius: 15px; }
  .entry-card-top { margin-bottom: 14px; }
  .entry-card-top h2 { font-size: 25px; }
  .field { margin-bottom: 13px; }
  .field-label { margin-bottom: 6px; font-size: 9px; }
  .field input { height: 39px; font-size: 13px; }
  .avatar-block { margin-bottom: 15px; }
  .avatar-picker { gap: 4px; }
  .avatar-option { font-size: 16px; border-radius: 6px; }
  .btn-xl { min-height: 56px; margin-bottom: 12px; }
  .btn-xl .btn-main { font-size: 15px; }
  .entry-row { grid-template-columns: 1fr 1.3fr; }
  .entry-row > .btn, .join-form input, .join-form .btn { min-height: 40px; height: 40px; }
  .entry-footnote { font-size: 8px; margin-top: 11px; }
  .entry-conn { margin-top: 10px; padding-top: 9px; }
  .landing-footer { padding: 9px 16px 16px; font-size: 8px; }
  .hero-hand::before { display: none; }

  .app-topbar .brand-word { display: none; }
  .app-topbar .topbar-left { gap: 7px; }
  .app-topbar .room-chip { height: 27px; }
  .app-topbar .room-chip b { font-size: 11px; }
  .app-topbar .topbar-right { gap: 5px; }
  .app-topbar .text-btn { display: inline-block; font-size: 9px; padding: 5px 1px; }
  .app-topbar .btn-ghost-danger { padding: 0 9px; }

  .game-topbar .brand-seal { width: 26px; height: 26px; font-size: 15px; }
  .game-topbar .room-chip b { font-size: 11px; letter-spacing: 0.1em; }
  .game-topbar .icon-text-btn > span { width: 14px; height: 14px; font-size: 8px; }
  .game-topbar .icon-text-btn { font-size: 0; padding: 0 7px; gap: 0; }
  .game-topbar .icon-text-btn > span { font-size: 9px; }
  .game-topbar .icon-text-btn--danger { font-size: 9px; padding: 0 6px; gap: 2px; }
  .game-topbar .icon-text-btn--danger > span { display: none; }
  .game-topbar .icon-btn { width: 27px; height: 27px; font-size: 14px; }
  .game-topbar .icon-text-btn { height: 27px; }

  .table { padding: 4px; border-radius: 18px; }
  .table-rim { inset: 4px; border-radius: 15px; }
  .table-content {
    padding: 6px 5px;
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    grid-template-rows: 76px minmax(0, 1fr) 146px;
    border-radius: 15px;
  }
  .seat--top { gap: 2px; }
  .seat--left, .seat--right { gap: 4px; }
  .seat--bottom { grid-template-rows: 21px auto auto; gap: 3px 3px; }
  .player-pill { padding: 2px 5px 2px 2px; gap: 4px; border-radius: 7px; }
  .player-pill .avatar { width: 20px; height: 20px; font-size: 11px; }
  .player-name { font-size: 8px; max-width: 52px; }
  .player-sub { font-size: 6px; margin-top: 1px; gap: 2px; }
  .player-sub .wind { font-size: 7px; }
  .pill-badges { display: none; }
  .seat--side .player-pill { flex-direction: column; gap: 3px; padding: 3px; text-align: center; }
  .seat--side .player-pill-main { max-width: 100%; }
  .seat--side .player-name { max-width: 50px; font-size: 7.5px; }
  .seat--side .player-sub { justify-content: center; font-size: 6px; }
  .seat--side .backs-col .tile--back.back-side { --tw: 16px; }
  .seat--side .melds-row .meld .tile { --tw: 8px; }
  .backs-row .tile--back { --tw: 10px; }
  .backs-row .tile { margin-left: -2.5px; }
  .melds-row { gap: 3px; }
  .melds-row .meld .tile { --tw: 11px; }
  .seat--bottom .melds-row .meld .tile { --tw: 11px; }
  .meld { padding: 1px; }

  .center-area {
    grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 88px minmax(0, 1fr);
    gap: 1px;
  }
  .discard-zone { padding: 11px 1px 1px; gap: 1px; border-radius: 4px; }
  .zone-watermark { font-size: 30px; }
  .zone-empty { font-size: 6px; letter-spacing: 0.08em; }
  .discard-zone .tile { --tw: clamp(11.5px, 3.2vw, 15px); }
  .zone-tag { top: 2px; left: 3px; font-size: 5.5px; }
  .zone-tag .zone-count { display: none; }
  .core { border-radius: 7px; padding: 2px; gap: 1px; }
  .core::before { display: none; }
  .core-round { font-size: 5.5px; }
  .wall-ring { width: 43px; height: 43px; padding: 1.5px; }
  .wall-num { font-size: 15px; }
  .wall-label { font-size: 5px; letter-spacing: 0.05em; margin-top: 1px; }
  .core-status { font-size: 6px; min-height: 14px; }
  .core-timer { font-size: 7px; }
  .core.is-claim .core-round { display: none; }
  .claim-tile-row .tile { --tw: 12px; }
  .claim-text { display: none; }

  .seat--bottom {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "selfmeta selfmelds selfting"
      "dock dock dock"
      "hand hand hand";
  }
  .self-melds { justify-self: end; margin-left: 4px; display: flex; align-items: center; min-width: 0; }
  .self-ting { display: flex; justify-self: end; max-width: 92px; overflow: hidden; }
  .self-ting .ting-pill { padding: 2px 4px; font-size: 6.5px; gap: 3px; }
  .self-ting .ting-pill > span:last-child { display: none; }
  .self-ting .ting-label { font-size: 5.5px; padding: 1px 2px; }
  .seat--bottom .melds-row { flex-wrap: nowrap; }
  .action-dock { min-height: 31px; padding: 2px 4px; }
  .action-dock .dock-label { font-size: 7px; white-space: nowrap; }
  .dock-idle { font-size: 7px; }
  .act-btn { min-height: 25px; padding: 0 8px; font-size: 9px; }
  .act-btn--hu { min-width: 50px; min-height: 27px; font-size: 11px; }
  .act-btn--ghost { min-height: 22px; padding: 0 5px; font-size: 8px; }
  .dock-timer { font-size: 8px; }
  .hand { padding-top: 4px; gap: 1px; }
  .hand .tile { --tw: clamp(21px, 6.1vw, 30px); }
  .mini-score-row { font-size: 8px; }
  .mini-scores-head { font-size: 6.5px; }
  .hand-drawn-gap { width: 4px; }
  .back-side .back-pattern::before { border-width: 0.5px; }
  .action-bubble { font-size: 14px; }
  .hint-panel { width: 94%; }
  .hint-content { font-size: 9px; gap: 5px; }
  .hint-content .tile { --tw: 17px; }

  .lobby-main { padding: 15px 11px 25px; }
  .lobby-heading { margin-bottom: 13px; }
  .lobby-heading h1 { font-size: 27px; }
  .lobby-heading p:last-child { font-size: 9px; }
  .lobby-table {
    min-height: 0;
    border-width: 5px;
    border-radius: 19px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .lobby-table::before { inset: 4px; border-radius: 13px; }
  .lobby-center {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    padding: 11px;
    order: 1;
  }
  .lobby-code { font-size: 27px; margin-bottom: 8px; }
  .lobby-start-area { min-height: 34px; }
  .lobby-start-btn { min-height: 32px; font-size: 11px; }
  .lobby-seat-pos { position: static; transform: none; width: 100%; order: 2; }
  .lobby-seat-pos--top, .lobby-seat-pos--right, .lobby-seat-pos--bottom, .lobby-seat-pos--left { position: static; transform: none; }
  .lobby-seat { min-width: 0; width: 100%; padding: 6px; }
  .lobby-seat-avatar { width: 25px; height: 25px; font-size: 13px; }
  .lobby-seat-name { font-size: 9px; }
  .lobby-seat-meta { font-size: 6.5px; }
  .invite-strip { padding: 11px; }
  .invite-desc { font-size: 9px; }
  .remote-line { font-size: 8.5px; }
  .lobby-side { height: 330px; }
  .side-panel { width: min(330px, 92vw); }
  .chat-feed { padding: 10px 12px; }
  .toast-stack { top: calc(var(--topbar-h) + 8px); right: 10px; left: 10px; align-items: center; }
  .toast { max-width: 100%; font-size: 10px; }
  .result-shell { padding: 20px 11px 15px; }
  .result-title { font-size: 42px; }
  .winner-hand { padding: 8px 3px; gap: 2px; }
  .winner-hand .tile { --tw: clamp(19px, 5.4vw, 27px); }
  .patterns { gap: 4px; }
  .pattern-chip { font-size: 8px; padding: 3px 6px; }
  .result-score-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; font-size: 10px; padding: 7px 8px; }
  .result-score-head { gap: 6px; padding: 7px 8px; font-size: 6.5px; }
  .result-score-head span:not(:first-child) { min-width: 32px; }
  .result-score-head span:last-child { min-width: 35px; }
  .result-score-name .avatar { width: 19px; height: 19px; font-size: 11px; }
  .result-score-delta { min-width: 32px; font-size: 11px; }
  .result-score-total { min-width: 35px; font-size: 12px; }
  .ready-dots { gap: 6px; }
  .result-actions .btn { min-height: 37px; font-size: 11px; }
  .result-minimized-btn { right: 11px; bottom: 11px; }
}

@media (max-height: 690px) and (min-width: 821px) {
  .table-content { grid-template-rows: 82px minmax(0, 1fr) 164px; }
  .seat--bottom { grid-template-rows: 23px auto auto; gap: 3px 8px; }
  .game-topbar { --topbar-h: 50px; height: 50px; flex-basis: 50px; }
  .side-panel-head { padding-top: 12px; padding-bottom: 9px; }
  .hand { padding-top: 5px; }
  .hand .tile { --tw: clamp(25px, 3.1vw, 40px); }
  .action-dock { min-height: 36px; }
  .discard-zone .tile { --tw: clamp(13px, 1.35vw, 18px); }
  .center-area { grid-template-rows: minmax(0, 1fr) 124px minmax(0, 1fr); }
  .wall-ring { width: 58px; height: 58px; }
  .wall-num { font-size: 20px; }
  .core-round { display: none; }
}

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

/* Career responsive */
@media (max-width: 620px) {
  .career-card { padding: 10px 11px; }
  .career-card-head { margin-bottom: 7px; }
  .career-card-head h3 { font-size: 16px; }
  .career-grid { gap: 2px; }
  .career-grid > div { padding: 4px 5px; }
  .career-grid > div:first-child { padding-left: 0; }
  .career-grid b { font-size: 17px; }
  .stats-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-kpi > div { padding: 8px; }
  .stats-profile h3 { font-size: 16px !important; }
  .stats-row { padding: 7px; gap: 8px; }
  .stats-row-main span { font-size: 8px; }
  .stats-board th, .stats-board td { padding: 6px 5px; }
  .stats-board th:nth-child(3), .stats-board td:nth-child(3) { display: none; }
}
