:root {
  color-scheme: dark;
  --felt: #063b2b;
  --felt-deep: #052d23;
  --ink: #f7eedb;
  --muted: #c8d9ca;
  --line: #bb9d61;
  --gold: #f1c779;
  --tile-w: clamp(34px, min(5.1vw, 11.2vh), 60px);
  --tile-h: calc(var(--tile-w) * 1.41);
  --mini-w: clamp(18px, min(2.25vw, 5.1vh), 26px);
  --mini-h: calc(var(--mini-w) * 1.4);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { overflow: hidden; background: var(--felt-deep); color: var(--ink); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, .tile-button:focus-visible,
.sound-settings > summary:focus-visible {
  outline: 3px solid #fff1ad;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.game-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 375px; }
.topbar {
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(12px, 2vw, 28px);
  background: linear-gradient(180deg, #082b24, #05231d);
  border-bottom: 1px solid #bc9a5d;
  box-shadow: 0 3px 16px #00140e91;
  position: relative;
  z-index: 4;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  height: 26px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  font: 700 17px/1 "KaiTi", "STKaiti", serif;
  color: #fbe7a7;
}
.brand h1 {
  margin: 0;
  white-space: nowrap;
  color: #f6e2ac;
  font: 700 clamp(20px, 2.2vw, 26px)/1 "KaiTi", "STKaiti", serif;
  letter-spacing: .07em;
}
.round-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  color: #ebdeb7;
  font: 700 14px/1.2 "Microsoft YaHei", sans-serif;
  letter-spacing: .03em;
}
.round-meta strong { font-size: 16px; color: #fff0bb; }
.meta-divider { width: 1px; height: 18px; background: #a68e62; }
.top-actions { display: flex; justify-content: flex-end; gap: 8px; }
.top-button {
  min-height: 36px;
  min-width: 58px;
  padding: 5px 11px;
  background: #0b392b;
  border: 1px solid #b9975e;
  border-radius: 7px;
  color: #ffedc4;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.top-button:hover:not(:disabled) { background: #145a40; }
.voice-toggle { min-width: 67px; border-color: #dfbd79; color: #ffe7a7; }
.voice-toggle[aria-pressed="false"] { border-color: #87998a; color: #b8c8b9; }
.voice-toggle[data-playing="true"] { background: #186649; box-shadow: 0 0 0 2px #efcb7450; }
.sound-settings { position: relative; flex: 0 0 auto; }
.sound-settings > summary { display: grid; place-items: center; min-width: 52px; list-style: none; cursor: pointer; }
.sound-settings > summary::-webkit-details-marker { display: none; }
.sound-settings[open] > summary { background: #186649; }
.sound-settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  width: 162px;
  display: grid;
  gap: 6px;
  padding: 9px;
  background: #082e25;
  border: 1px solid #c5a46a;
  border-radius: 9px;
  box-shadow: 0 9px 24px #001710b8;
}
.sound-settings-panel button {
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid #678f78;
  border-radius: 6px;
  background: #124332;
  color: #f8e9c2;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.sound-settings-panel button[aria-pressed="false"] { color: #aebdb0; background: #17312a; }
.sound-settings-panel button:hover { background: #1a6248; }
.table {
  position: relative;
  flex: 1;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(155deg, #052f29ab, transparent 55%, #02271fc7), var(--felt) url("assets/felt.png") center / cover no-repeat;
}
.table::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 46%, #0b6b4d29, transparent 57%), radial-gradient(ellipse at 50% 50%, transparent 38%, #001b154f 100%);
  z-index: -1;
}
.table::after {
  content: "";
  position: absolute;
  inset: 12px clamp(24px, 3.6vw, 58px) clamp(132px, 20vh, 176px);
  border: 1px solid #bfa46b91;
  border-radius: 18px;
  box-shadow: inset 0 0 0 5px #124c3840, 0 0 0 5px #001b154d;
  pointer-events: none;
  z-index: 0;
}
.seat {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}
.seat-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 132px;
  max-width: 190px;
  padding: 7px 11px;
  border: 1px solid #aa93659c;
  border-radius: 7px;
  background: linear-gradient(180deg, #0b392de8, #05271fef);
  box-shadow: 0 5px 12px #001b1594, inset 0 1px #fff5ce16;
  color: #f3ecd5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
.seat-name-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.seat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-stats { display: flex; justify-content: space-between; gap: 10px; color: #f0c775; font-size: 11px; font-weight: 700; white-space: nowrap; }
.seat-jing { color: #d9f0e6; font-size: 10px; font-weight: 700; }
.seat-label .turn-dot, .seat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a2b6a5;
  display: inline-block;
}
.seat.active .turn-dot, .self-area.active .seat-dot {
  background: #f6ce74;
  box-shadow: 0 0 0 3px #f6ce743a, 0 0 9px #f6ce74;
}
.seat.active .seat-label { border-color: #f5ce7c; box-shadow: 0 0 0 2px #edc7774a, 0 4px 14px #001b1594; }
.seat-top {
  top: 10px;
  left: 50%;
  width: min(77%, 670px);
  transform: translateX(-50%);
  flex-direction: column;
}
.seat-top .back-row, .seat-top .seat-melds { display: flex; justify-content: center; }
.seat-tiles { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.seat-top .seat-boosts { display: grid; grid-template-columns: repeat(4, max-content); align-items: end; gap: 4px 3px; }
.seat-left, .seat-right {
  top: 45%;
  transform: translateY(-50%);
  flex-direction: column;
}
.seat-left { left: clamp(7px, 1.5vw, 20px); }
.seat-right { right: clamp(7px, 1.5vw, 20px); }
.seat-left .back-row, .seat-right .back-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.seat-left .seat-tiles, .seat-right .seat-tiles { align-items: flex-start; gap: 3px; }
.seat-left .seat-melds, .seat-right .seat-melds {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.seat-right .seat-melds { order: 0; }
.seat-right .seat-boosts { order: 1; }
.seat-right .back-row { order: 2; }
.tile {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--tile-w);
  height: var(--tile-h);
  overflow: hidden;
  padding: 0;
  border: 1px solid #d4c8aa;
  border-bottom: 4px solid #ad9e79;
  border-radius: 4px 4px 5px 5px;
  background: #fffbed;
  box-shadow: 0 3px 0 #52745d, 0 6px 8px #00150f89;
  vertical-align: bottom;
}
.tile img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.tile-button {
  position: relative;
  transition: transform .13s ease, box-shadow .13s ease;
  touch-action: manipulation;
}
.tile-button:hover { transform: translateY(-5px); }
.tile-button.selected, .tile-button.selected:hover {
  transform: translateY(-12px);
  border-color: #ffe09a;
  box-shadow: 0 0 0 2px #f7d17a, 0 5px 0 #53755e, 0 9px 12px #00190edb;
}
.hand .tile-button:disabled { opacity: 1; cursor: default; }
.hand .tile-button.unavailable { opacity: .42; filter: grayscale(.35); }
.hand .tile-button.jing-positive { border-color: #d09f4d; box-shadow: 0 0 0 2px #d09f4d77; }
.hand .tile-button.jing-vice { border-color: #6b9fb0; box-shadow: 0 0 0 2px #6b9fb077; }
.hand .tile-button.jing-positive::after,
.hand .tile-button.jing-vice::after { position: absolute; top: 1px; right: 1px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 2px; color: #fff9df; font-size: 10px; font-weight: 900; line-height: 1; box-shadow: 0 1px 3px #14241e66; }
.hand .tile-button.jing-positive::after { content: "正"; background: #a76b1d; }
.hand .tile-button.jing-vice::after { content: "副"; background: #39768a; }
.seat.finished .seat-label { color: #eac575; }
.tile.back {
  border: 1px solid #d8c89d;
  border-bottom: 3px solid #9b9c7c;
  background: #11583d;
  box-shadow: inset 0 0 0 3px #2d7054, inset 0 0 0 4px #b89b6c88, 0 2px 3px #00170f73;
}
.tile.back::after {
  content: "◇";
  color: #d5bd7f;
  font: 20px/1 Georgia, serif;
  opacity: .75;
}
.seat-top .back { width: calc(var(--tile-w) * .63); height: calc(var(--tile-h) * .59); margin-right: 2px; }
.seat-left .back, .seat-right .back {
  width: calc(var(--tile-w) * .64);
  height: calc(var(--tile-w) * .44);
  margin-bottom: 1px;
}
.seat-left .back::after, .seat-right .back::after { font-size: 12px; }
.seat-melds .meld { display: flex; }
.seat-melds .tile { width: calc(var(--mini-w) * .8); height: calc(var(--mini-h) * .8); border-bottom-width: 2px; box-shadow: 0 1px 2px #00180f88; }
.seat-left .seat-melds .tile, .seat-right .seat-melds .tile { width: 16px; height: 23px; }
.boost-zone { display: flex; flex: none; align-items: flex-end; gap: 4px; }
.boost-zone:empty { display: none; }
.boost-item { position: relative; display: inline-flex; flex: none; align-items: flex-end; }
.boost-item .boost-face { width: calc(var(--tile-w) * .58); height: calc(var(--tile-h) * .58); border-bottom-width: 3px; }
.boost-badge {
  position: absolute;
  right: -3px;
  bottom: -4px;
  z-index: 1;
  padding: 1px 2px;
  border: 1px solid #f9e8b9;
  border-radius: 3px;
  background: #9f542c;
  color: #fff9e9;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 2px #00160f8c;
}
.boost-wild .boost-badge { background: #126b5a; }
.boost-claimed-indicator .boost-face { box-shadow: 0 0 0 2px #f5c765, 0 2px 7px #30270a88; }
.boost-claimed-indicator .boost-badge { background: #bc771c; border-color: #ffe8a1; }
.seat-boosts .boost-face { width: calc(var(--tile-w) * .45); height: calc(var(--tile-h) * .45); border-bottom-width: 2px; }
.seat-boosts .boost-badge { font-size: 8px; }
.seat-left .seat-boosts, .seat-right .seat-boosts { flex-direction: column; align-items: flex-start; gap: 5px; }
.seat-left .seat-boosts .boost-face, .seat-right .seat-boosts .boost-face { width: 20px; height: 27px; }
.river {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 2px;
  z-index: 1;
  min-width: 0;
  overflow: visible;
}
.river:empty::before {
  content: none;
}
.river-top { top: 20%; left: 50%; width: 38%; transform: translateX(-50%); }
.river-left { top: 34%; left: 25%; width: 17%; }
.river-right { top: 34%; right: 25%; width: 17%; }
.river-bottom { top: 58%; left: 50%; width: 38%; transform: translateX(-50%); }
.river .tile {
  width: clamp(19px, min(2.2vw, 4vh), 27px);
  height: clamp(27px, min(3.1vw, 5.6vh), 38px);
  border-bottom-width: 2px;
  border-radius: 2px;
  box-shadow: 0 2px 3px #00140e79;
}
.river .tile.latest { outline: 2px solid #f6c86f; outline-offset: 1px; }
.table-center {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 180px;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 12px;
  transform: translate(-50%, -50%);
  background: linear-gradient(155deg, #0a3d31f5, #04271ff5);
  border: 1px solid #d8b776;
  border-radius: 11px;
  box-shadow: 0 8px 24px #001c16b0, inset 0 0 0 4px #ddb96d20;
  color: #f8e5ac;
  z-index: 2;
}
.center-round { font: 800 16px/1.2 "Microsoft YaHei", sans-serif; white-space: nowrap; }
.center-wall { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.center-caption { font: 700 11px/1.2 "Microsoft YaHei", sans-serif; }
.center-wall strong { font: 800 19px/1 Georgia, serif; color: #ffe39d; }
.center-wall small { font-size: 10px; }
.table-center:has(.ganzhou-marker:not([hidden])) { width: 218px; }
.event-line {
  position: absolute;
  top: 10px;
  left: clamp(10px, 2vw, 26px);
  max-width: 27%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f0e6c9;
  font-size: 11px;
  text-shadow: 0 1px 3px #001b12;
}
.self-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  pointer-events: none;
}
.self-area::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 160px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(0deg, #001e17a8, transparent);
}
.self-area > * { pointer-events: auto; }
.action-dock {
  width: min(920px, calc(100vw - 36px));
  max-width: calc(100vw - 20px);
  min-height: 54px;
  margin: 0 auto 11px;
  padding: 7px 9px 7px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, #0b392eea, #04271ff0);
  border: 1px solid #c1a16b;
  border-radius: 9px;
  box-shadow: 0 6px 18px #00150fc9, inset 0 1px #fff5cc1a;
  color: #f6ebca;
}
.dock-prompt { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.dock-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; max-width: 67%; overflow-x: auto; scrollbar-width: thin; }
.primary-button, .action-button {
  min-height: 40px;
  padding: 5px 14px;
  border: 1px solid #f6d08e;
  border-radius: 7px;
  background: linear-gradient(180deg, #f5d288, #dfaa52);
  color: #093727;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 1px #fff6d2b8, 0 2px 3px #001c1573;
}
.primary-button:hover:not(:disabled), .action-button:hover:not(:disabled) { background: #ffd27b; }
.action-button.alt { background: #205841; color: #fff1d5; border-color: #b8a06f; }
.action-button.alt:hover:not(:disabled) { background: #2e7352; }
.action-button.win { background: #f3ca78; }
.self-tiles {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  max-width: calc(100vw - 20px);
  min-width: 0;
  gap: 11px;
}
.self-hand-row { display: flex; align-items: flex-end; justify-content: center; min-width: 0; max-width: 100%; gap: 7px; }
.self-boosts {
  padding: 13px 5px 5px;
  position: relative;
  border: 1px solid #c7a66b;
  border-radius: 5px;
  background: #03291fae;
  box-shadow: 0 2px 5px #001a1280;
}
.self-boosts::before { content: "已下"; position: absolute; top: 2px; left: 5px; color: #f5d694; font-size: 9px; font-weight: 800; line-height: 1; }
.hand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  gap: 2px;
}
.hand .tile:last-child.drawn { margin-left: 8px; }
.self-melds { display: flex; align-items: flex-end; gap: 5px; }
.self-melds .meld { display: flex; align-items: flex-end; gap: 1px; }
.self-melds .tile { width: calc(var(--tile-w) * .58); height: calc(var(--tile-h) * .58); border-bottom-width: 3px; }
.self-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  margin-top: 5px;
  padding: 3px 10px;
  border: 1px solid #bda36b70;
  border-radius: 99px;
  background: #052f25e8;
  color: #fff1cb;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 3px #00160f;
}
.win-count { color: #f0c775; font-size: 11px; font-weight: 600; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  background: #00150dc9;
  backdrop-filter: blur(3px);
}
.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: min(92dvh, 630px);
  overflow: auto;
  padding: 25px 27px 21px;
  background: #f8f4e8;
  border: 1px solid #d1bd96;
  border-radius: 10px;
  box-shadow: 0 18px 45px #00130bdc;
  color: #17352c;
}
.modal h2 { margin: 0; font: 700 27px/1.2 "KaiTi", "STKaiti", serif; }
.modal-lead { margin: 5px 0 19px; color: #647269; font-size: 13px; }
.close-button {
  position: absolute;
  top: 10px;
  right: 13px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #4b6256;
  font-size: 26px;
  line-height: 1;
}
.close-button:hover { color: #0a3d2b; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px 29px; }
.rule-grid h3 { margin: 0 0 6px; color: #14553f; font-size: 15px; }
.rule-grid p { margin: 0; color: #384e43; font-size: 13px; line-height: 1.7; }
.rule-grid a { color: #14553f; font-weight: 700; text-underline-offset: 2px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.modal .top-button { background: #f8f4e8; color: #244d3a; border-color: #8f9e8b; }
.result-modal { max-width: 520px; text-align: center; }
.result-modal .modal-footer { justify-content: center; }
.result-symbol {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border: 1px solid #be994f;
  border-radius: 50%;
  background: #0f533c;
  color: #ffdf92;
  font: 700 30px/1 "KaiTi", serif;
}
.result-detail { margin: 8px 0 20px; color: #4d6657; font-size: 14px; line-height: 1.5; }
.result-hand { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px; min-height: 57px; }
.result-hand .tile { width: 34px; height: 48px; border-bottom-width: 3px; }
@media (max-height: 540px) and (min-width: 650px) {
  .seat-top { top: 4px; }
  .seat-top .back { height: calc(var(--tile-h) * .53); }
  .seat-left, .seat-right { top: 53%; }
  .action-dock { margin-bottom: 8px; }
  .river-bottom { top: 54%; }
  .river .tile { width: 22px; height: 31px; }
}
@media (max-height: 800px) and (min-width: 701px) {
  .seat-left, .seat-right { top: 56%; }
  .seat-left .back, .seat-right .back {
    width: clamp(21px, 3.9vh, 29px);
    height: clamp(10px, 2.1vh, 15px);
    margin-bottom: 0;
  }
  .seat-left .back::after, .seat-right .back::after { font-size: 9px; }
}
@media (max-height: 600px) and (min-width: 701px) {
  .seat-left, .seat-right { top: 49%; }
}
@media (max-width: 700px) {
  .brand-mark { display: none; }
  .topbar { padding-inline: 8px; gap: 5px; grid-template-columns: 1fr auto; }
  .brand h1 { font-size: 19px; }
  .round-meta { gap: 6px; font-size: 11px; }
  .round-meta strong { font-size: 12px; }
  .top-actions { gap: 4px; }
  .top-button { min-width: 45px; min-height: 44px; padding: 5px 7px; font-size: 11px; }
  .sound-settings > summary { min-width: 45px; }
  .seat-label { font-size: 11px; }
  .event-line { top: auto; bottom: 155px; left: 50%; max-width: 68%; padding: 3px 9px; transform: translateX(-50%); border-radius: 99px; background: #05281fbd; text-align: center; }
  .event-line:empty { display: none; }
  .river-left { left: 14%; width: 31%; }
  .river-right { right: 14%; width: 31%; }
  .river:empty::before { display: none; }
}
@media (max-width: 600px) and (orientation: portrait) {
  :root { --tile-w: clamp(19px, calc((100vw - 40px) / 14), 27px); --mini-w: 18px; }
  .topbar { height: 52px; flex-basis: 52px; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; padding-inline: 8px; }
  .brand { display: none; }
  .round-meta { position: static; min-width: 0; justify-content: flex-start; overflow: hidden; transform: none; font-size: 13px; }
  .round-meta span { overflow: hidden; text-overflow: ellipsis; }
  .top-actions { gap: 3px; }
  .top-button { min-width: 40px; min-height: 44px; padding: 4px 6px; font-size: 10px; }
  .sound-settings > summary { min-width: 40px; padding-inline: 4px; }
  .table { background-position: center; }
  .table::after { inset: 6px 3px 128px; border-radius: 15px; }
  .seat-top { top: 8px; width: 92%; }
  .seat-top .seat-label { min-width: 144px; }
  .seat-top .back { width: 19px; height: 29px; margin-right: 1px; }
  .seat-top .seat-boosts { gap: 2px; }
  .seat-top .seat-boosts .boost-face { width: 15px; height: 21px; }
  .seat-top .seat-boosts .boost-badge { font-size: 7px; }
  .seat-left, .seat-right { top: 27%; width: 98px; transform: none; }
  .seat-left { left: 4px; }
  .seat-right { right: 4px; }
  .seat-left .seat-label, .seat-right .seat-label { min-width: 98px; max-width: 98px; padding: 5px 6px; font-size: 11px; }
  .seat-left .seat-stats, .seat-right .seat-stats { font-size: 10px; gap: 3px; }
  .seat-left .seat-jing, .seat-right .seat-jing { font-size: 9px; }
  .seat-left .seat-tiles { align-self: flex-start; margin-left: 7px; }
  .seat-right .seat-tiles { align-self: flex-end; margin-right: 7px; }
  .seat-left .back, .seat-right .back { width: 15px; height: 18px; }
  .seat-left .seat-tiles, .seat-right .seat-tiles { gap: 2px; }
  .seat-left .seat-boosts .boost-face, .seat-right .seat-boosts .boost-face { width: 17px; height: 23px; }
  .seat-left .seat-boosts, .seat-right .seat-boosts { gap: 4px; }
  .seat-left .seat-boosts .boost-badge, .seat-right .seat-boosts .boost-badge { font-size: 7px; }
  .river .tile { width: 18px; height: 25px; }
  .river-top { top: 16%; width: 68%; }
  .river-left { top: 36%; left: 24%; width: 9%; }
  .river-right { top: 36%; right: 24%; width: 9%; }
  .river-bottom { top: auto; bottom: 29%; width: 70%; }
  .table-center { top: 44%; width: 122px; min-height: 126px; gap: 4px; padding: 8px 6px; }
  .table-center:has(.ganzhou-marker:not([hidden])) { width: 146px; }
  .center-round { font-size: 12px; }
  .center-caption { font-size: 9px; }
  .center-wall strong { font-size: 16px; }
  .center-wall small { font-size: 9px; }
  .action-dock { width: calc(100vw - 16px); min-width: 0; min-height: 58px; margin-bottom: 8px; padding: 7px 8px 7px 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .dock-prompt { font-size: 11px; line-height: 1.3; max-height: 4em; overflow-y: auto; }
  .dock-actions { max-width: 62vw; gap: 4px; }
  .action-dock .action-button, .action-dock .primary-button { min-height: 44px; padding: 4px 9px; font-size: 11px; }
  .self-tiles { flex-direction: column; align-items: center; gap: 4px; width: 100%; }
  .self-melds { max-width: calc(100vw - 20px); overflow-x: auto; }
  .self-melds .tile { width: 23px; height: 32px; }
  .self-hand-row { flex-direction: column; align-items: center; width: 100%; gap: 4px; }
  .self-boosts { display: flex; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 20px); gap: 2px; padding: 13px 4px 4px; }
  .self-boosts .boost-face { width: 20px; height: 28px; }
  .self-boosts .boost-badge { font-size: 7px; }
  .hand { width: max-content; max-width: 100%; flex-wrap: nowrap; gap: 1px; }
  .hand .tile { flex: 0 0 var(--tile-w); }
  .hand .tile:last-child.drawn { margin-left: 2px; }
  .self-label { max-width: calc(100vw - 16px); min-height: 22px; margin-top: 4px; padding: 3px 8px; font-size: 10px; flex-wrap: wrap; justify-content: center; text-align: center; }
  .win-count { font-size: 10px; }
  .self-area { bottom: max(8px, env(safe-area-inset-bottom)); }
  .self-area::before { bottom: calc(-1 * max(8px, env(safe-area-inset-bottom))); height: 140px; }
  .event-line { top: 56%; bottom: auto; max-width: 64%; font-size: 10px; }
  .rule-grid { grid-template-columns: 1fr; gap: 13px; }
  .modal { padding: 20px 18px; }
}
@media (max-width: 360px) and (orientation: portrait) {
  .seat-top .back { width: 16px; height: 25px; margin-right: 0; }
  .seat-left, .seat-right { top: 18%; }
  .seat-left .seat-label, .seat-right .seat-label { min-width: 88px; max-width: 88px; }
  .table-center { width: 110px; }
  .river-left { left: 23%; width: 8%; }
  .river-right { right: 23%; width: 8%; }
}
@media (prefers-reduced-motion: reduce) {
  .tile-button { transition: none; }
}
