:root {
  color-scheme: light;
  --ink: #eef4f8;
  --muted: #aeb7c2;
  --panel: rgba(8, 14, 24, 0.78);
  --panel-soft: rgba(16, 27, 43, 0.58);
  --line: rgba(255, 255, 255, 0.14);
  --tile-w: 28px;
  --tile-h: 42px;
  --discard-gap: 0px;
  --flat-tile-overlap: -2px;
  --flat-row-overlap: -14px;
  --side-row-overlap: -10px;
  --side-tile-trim: -10px;
  --side-river-overlap: -10px;
  --center-size: 126px;
  --center-height: 108px;
  --river-center-gap: 12px;
  --good: #5bd18b;
  --bad: #ff6b7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #0d1523;
  color: var(--ink);
  overflow-x: hidden;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.94);
  color: #17202a;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.55);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.selected {
  border-color: #f6c94c;
  box-shadow: 0 0 0 2px rgba(246, 201, 76, 0.38);
}

.app {
  width: min(1240px, calc(100vw - 12px));
  margin: 6px auto 14px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 4px;
}

h1 {
  font-size: 19px;
  margin: 0 0 2px;
}

p {
  margin: 0;
  color: var(--muted);
}

.status {
  display: none;
}

.hidden {
  display: none !important;
}

.menu-button {
  min-height: 28px;
  padding: 0 12px;
  font-size: 14px;
}

.controls,
.mark-controls,
.answer-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.controls button,
.mark-controls button,
.answer-actions button {
  min-width: 0;
  width: 100%;
}

.menu-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px;
}

.menu-title {
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 18px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.menu-filter {
  min-height: 42px;
}

.menu-favorite {
  grid-column: 1 / -1;
}

.menu-message {
  min-height: 22px;
  margin-top: 8px;
  color: var(--muted);
}

.question-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.meta-item,
.answer-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.meta-item {
  padding: 5px 8px;
}

.meta-item strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.meta-dora {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  line-height: 0;
}

.meta-dora .tile {
  width: 20px;
  height: 30px;
  margin-left: -1px;
}

.tenhou-table {
  position: relative;
  height: min(560px, calc(100vh - 170px));
  min-height: 500px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 50% 50%, rgba(68, 118, 174, 0.28), transparent 38%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.035), transparent 18%),
    repeating-linear-gradient(160deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 8px),
    #132845;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.45), 0 14px 28px rgba(0, 0, 0, 0.28);
}

.seat-area,
.center-info {
  position: absolute;
}

.seat-area {
  color: var(--ink);
  z-index: 2;
}

.center-info {
  z-index: 1;
}

.seat-bottom {
  left: 50%;
  bottom: 8px;
  width: min(650px, calc(100% - 260px));
  height: 146px;
  transform: translateX(-50%);
}

.seat-top {
  left: 50%;
  top: 8px;
  width: min(590px, calc(100% - 300px));
  height: 150px;
  transform: translateX(-50%);
}

.seat-left {
  left: 0;
  top: 50%;
  width: 50%;
  height: 500px;
  transform: translateY(-50%);
}

.seat-right {
  right: 0;
  top: 50%;
  width: 50%;
  height: 500px;
  transform: translateY(-50%);
}

.player-label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 3px 6px;
  color: rgba(238, 244, 248, 0.9);
  background: rgba(5, 11, 20, 0.45);
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.seat-top .player-label {
  position: absolute;
  right: 0;
  top: 0;
}

.seat-left .player-label {
  position: absolute;
  left: 0;
  top: 0;
}

.seat-right .player-label {
  position: absolute;
  right: 0;
  top: 0;
}

.player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  font-weight: 700;
}

.riichi-badge {
  display: inline-block;
  color: #fff;
  background: #bd2d3b;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 4px;
  font-size: 12px;
}

.seat-hand,
.seat-pond,
.seat-melds {
  position: absolute;
}

.player-label {
  z-index: 5;
}

.seat-hand {
  z-index: 2;
}

.seat-pond {
  z-index: 3;
}

.seat-melds {
  z-index: 4;
}

.seat-bottom .seat-hand {
  left: calc(50% - (var(--tile-w) * 7 + 4px));
  bottom: 0;
}

.seat-bottom.has-melds .seat-hand {
  left: calc(50% - (var(--tile-w) * 7 + 4px) - var(--meld-shift, 0px));
}

.seat-bottom .player-label {
  position: absolute;
  left: 0;
  bottom: 48px;
}

.seat-bottom .seat-pond {
  left: calc(50% - var(--center-size) / 2);
  top: -40px;
  transform: none;
}

.seat-bottom .seat-melds {
  right: -18px;
  bottom: 0;
  flex-direction: row-reverse;
  flex-wrap: nowrap;
  width: max-content;
  max-width: none;
}

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

.seat-top.has-melds .seat-hand {
  left: calc(50% + 46px + var(--meld-shift, 0px));
}

.seat-top .seat-pond {
  left: calc(50% + var(--center-size) / 2 - (var(--tile-w) * 5 + var(--tile-h) + var(--discard-gap) * 5));
  bottom: -26px;
  transform: none;
}

.seat-top .seat-melds {
  left: 0;
  top: 12px;
  flex-wrap: nowrap;
  width: max-content;
  max-width: none;
}

.seat-left .seat-hand {
  left: 0;
  top: 52%;
  transform: translateY(-50%);
}

.seat-left.has-melds .seat-hand {
  top: 46%;
}

.seat-left .seat-pond {
  right: calc(var(--center-size) / 2 + var(--river-center-gap));
  top: calc(50% - var(--center-height) / 2);
  transform: none;
}

.seat-left .seat-melds {
  left: 0;
  bottom: 8px;
  flex-direction: column-reverse;
}

.seat-right .seat-hand {
  right: 0;
  top: 52%;
  transform: translateY(-50%);
}

.seat-right.has-melds .seat-hand {
  top: 58%;
}

.seat-right .seat-pond {
  left: calc(var(--center-size) / 2 + var(--river-center-gap));
  top: calc(50% - var(--center-height) / 2);
  transform: none;
}

.seat-right .seat-melds {
  right: 0;
  top: 8px;
  flex-direction: column;
}

.hand-row,
.seat-melds {
  display: flex;
  align-items: flex-end;
  gap: 0;
}

.self-hand {
  width: calc(var(--tile-w) * 14 + 8px);
  justify-content: flex-start;
}

.seat-left .hand-row,
.seat-right .hand-row {
  flex-direction: column;
}

.draw-gap {
  display: inline-block;
  width: 8px;
  height: 1px;
}

.seat-left .draw-gap,
.seat-right .draw-gap {
  width: 1px;
  height: 8px;
}

.seat-pond {
  display: flex;
  gap: var(--discard-gap);
  line-height: 0;
}

.pond-bottom,
.pond-top {
  width: calc(var(--tile-w) * 5 + var(--tile-h) + var(--discard-gap) * 5);
  height: calc(var(--tile-h) * 3 + var(--discard-gap) * 2);
  flex-direction: column;
}

.pond-top {
  flex-direction: column-reverse;
}

.pond-top .pond-row {
  display: block;
}

.pond-left,
.pond-right {
  width: calc(var(--tile-h) * 3 + var(--discard-gap) * 2);
  height: calc(var(--tile-w) * 5 + var(--tile-h) + var(--discard-gap) * 5);
  flex-direction: row;
}

.pond-left {
  flex-direction: row-reverse;
}

.pond-row {
  display: flex;
  flex: 0 0 auto;
  gap: var(--discard-gap);
  position: relative;
  z-index: var(--row-stack, 1);
}

.pond-bottom .pond-row,
.pond-top .pond-row {
  width: calc(var(--tile-w) * 5 + var(--tile-h) + var(--discard-gap) * 5);
  height: var(--tile-h);
}

.pond-left .pond-row,
.pond-right .pond-row {
  flex-direction: column;
  gap: 0;
  height: calc(var(--tile-h) + var(--tile-w) * 5 + var(--side-river-overlap) * 5);
}

.pond-left .pond-row + .pond-row {
  margin-right: var(--side-row-overlap);
}

.pond-right .pond-row {
  flex-direction: column-reverse;
}

.pond-right .pond-row + .pond-row {
  margin-left: var(--side-row-overlap);
}

.pond-left .pond-row + .riichi-row {
  margin-right: var(--side-row-overlap);
}

.pond-right .pond-row + .riichi-row {
  margin-left: var(--side-row-overlap);
}

.discard-slot {
  position: relative;
  flex: 0 0 auto;
  width: var(--tile-w);
  height: var(--tile-h);
}

.pond-left .discard-slot,
.pond-right .discard-slot {
  width: var(--tile-h);
  height: var(--tile-w);
  z-index: var(--stack-index, 1);
}

.pond-left .discard-slot + .discard-slot {
  margin-top: var(--side-river-overlap);
}

.pond-right .discard-slot + .discard-slot {
  margin-bottom: var(--side-river-overlap);
}

.pond-bottom .discard-slot + .discard-slot {
  margin-left: var(--flat-tile-overlap);
}

.pond-top .discard-slot + .discard-slot {
  margin-right: 0;
}

.pond-bottom .pond-row + .pond-row {
  margin-top: var(--flat-row-overlap);
}

.pond-top .pond-row + .pond-row {
  margin-bottom: var(--flat-row-overlap);
}

.pond-bottom .pond-row + .riichi-row {
  margin-top: var(--flat-row-overlap);
}

.pond-top .pond-row + .riichi-row {
  margin-bottom: var(--flat-row-overlap);
}

.pond-bottom .riichi-slot,
.pond-top .riichi-slot {
  width: var(--tile-h);
  height: var(--tile-w);
}

.pond-top .discard-slot {
  position: absolute;
  left: var(--pond-x);
  top: 0;
}

.pond-left .riichi-slot {
  width: var(--tile-h);
  height: var(--tile-w);
}

.pond-right .riichi-slot {
  width: var(--tile-h);
  height: var(--tile-w);
}

.pond-left .pond-row-0 .riichi-slot,
.pond-right .pond-row-0 .riichi-slot {
  transform: none;
}

.pond-left .discard-slot + .riichi-slot {
  margin-top: var(--side-river-overlap);
}

.pond-right .discard-slot + .riichi-slot {
  margin-bottom: var(--side-river-overlap);
}

.pond-left .riichi-slot + .discard-slot {
  margin-top: 0;
}

.pond-right .riichi-slot + .discard-slot {
  margin-bottom: 0;
}

.pond-left .after-riichi-discard {
  transform: none;
}

.pond-right .after-riichi-discard {
  transform: none;
}

.tile {
  --dir-rot: 0deg;
  width: var(--tile-w);
  height: var(--tile-h);
  display: inline-block;
  object-fit: contain;
  user-select: none;
  vertical-align: bottom;
  transform: rotate(var(--dir-rot));
  transform-origin: center center;
}

.dir-bottom {
  --dir-rot: 0deg;
}

.dir-top {
  --dir-rot: 180deg;
}

.dir-left {
  --dir-rot: -90deg;
}

.dir-right {
  --dir-rot: 90deg;
}

.face-tile {
  --dir-rot: 0deg;
}

.face-tile.material-left,
.face-tile.material-right {
  width: var(--tile-h);
  height: var(--tile-w);
}

.face-tile.surface-river-riichi.material-bottom,
.face-tile.surface-river-riichi.material-top {
  width: var(--tile-h);
  height: var(--tile-w);
}

.face-tile.surface-river-riichi.material-left,
.face-tile.surface-river-riichi.material-right {
  width: var(--tile-w);
  height: var(--tile-h);
  object-position: center top;
}

.face-tile.surface-river-riichi.material-bottom {
  object-position: left center;
}

.face-tile.surface-river-riichi.material-top {
  object-position: right center;
}

.tile.tsumogiri {
  opacity: 1;
  filter: grayscale(0.45) saturate(0.7) brightness(0.78) contrast(1.03);
}

.tile.last {
  outline: 3px solid #f6c94c;
  outline-offset: 1px;
  z-index: 3;
}

.tile.riichi-discard {
  transform: rotate(calc(var(--dir-rot) + 90deg));
}

.discard-slot .tile {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--dir-rot));
}

.discard-slot .tile.riichi-discard {
  transform: translate(-50%, -50%) rotate(calc(var(--dir-rot) + 90deg));
}

.discard-slot .face-tile.surface-river-riichi.riichi-discard {
  transform: translate(-50%, -50%) rotate(0deg);
}

.answer-tile {
  cursor: pointer;
}

.answer-tile:hover,
.tile.selected,
.tile.revealed-answer {
  outline: 3px solid #2c84ff;
  outline-offset: 1px;
}

.tile.revealed-answer {
  outline-color: #f6c94c;
}

.drawn-tile {
  filter: drop-shadow(0 0 3px rgba(246, 201, 76, 0.95));
}

.tile.ron-tile {
  border-radius: 4px;
  filter: sepia(0.8) saturate(1.7) hue-rotate(312deg) brightness(1.08) contrast(0.92);
  box-shadow:
    inset 0 0 0 999px rgba(226, 78, 70, 0.18),
    0 0 0 1px rgba(155, 28, 28, 0.28);
}

.tile-back {
  width: var(--tile-w);
  height: var(--tile-h);
  display: inline-block;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 18%),
    linear-gradient(145deg, #070707, #161616 54%, #020202);
  border-bottom: 5px solid #aeb0a4;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -5px 8px rgba(255, 255, 255, 0.06);
  transform: rotate(var(--dir-rot));
}

.seat-left .tile-back,
.seat-right .tile-back {
  margin-top: var(--side-tile-trim);
  margin-bottom: var(--side-tile-trim);
}

.seat-left .face-tile.hand-tile,
.seat-right .face-tile.hand-tile {
  margin-top: 0;
  margin-bottom: 0;
}

.seat-bottom .face-tile.hand-tile + .face-tile.hand-tile,
.seat-top .face-tile.hand-tile + .face-tile.hand-tile {
  margin-left: var(--flat-tile-overlap);
}

.seat-left .face-tile.hand-tile + .face-tile.hand-tile,
.seat-right .face-tile.hand-tile + .face-tile.hand-tile {
  margin-top: var(--side-river-overlap);
}

.meld {
  display: inline-flex;
  align-items: flex-end;
  gap: 0;
  position: relative;
  padding: 0;
  border-radius: 5px;
  background: transparent;
  line-height: 0;
}

.seat-melds {
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}

.seat-left .seat-melds,
.seat-right .seat-melds {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.meld-tiles,
.meld-main {
  display: inline-flex;
  align-items: flex-end;
  gap: 0;
}

.meld-left .meld-tiles,
.meld-left .meld-main,
.meld-right .meld-tiles,
.meld-right .meld-main {
  flex-direction: column;
  align-items: center;
}

.meld-tile-slot {
  position: relative;
  flex: 0 0 auto;
  width: var(--tile-w);
  height: var(--tile-h);
}

.meld-left .meld-tile-slot,
.meld-right .meld-tile-slot {
  width: var(--tile-h);
  height: var(--tile-w);
}

.meld-tile-slot .tile {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--dir-rot));
}

.meld-main .meld-tile-slot + .meld-tile-slot {
  margin-left: var(--flat-tile-overlap);
}

.meld-left .meld-main .meld-tile-slot + .meld-tile-slot,
.meld-right .meld-main .meld-tile-slot + .meld-tile-slot {
  margin-left: 0;
  margin-top: var(--side-river-overlap);
}

.meld-bottom .meld-tiles .called-meld-slot,
.meld-top .meld-tiles .called-meld-slot {
  margin-left: 4px;
  margin-right: 0;
}

.called-meld-tile {
  z-index: 2;
}

.meld-left .meld-tiles .called-meld-slot,
.meld-right .meld-tiles .called-meld-slot {
  margin: -2px 0 0;
}

.meld-from {
  position: absolute;
  right: calc(100% + 3px);
  bottom: 4px;
  min-width: 58px;
  color: rgba(238, 244, 248, 0.75);
  font-size: 11px;
  line-height: 1.1;
  margin: 0;
  text-align: right;
  pointer-events: none;
  white-space: nowrap;
  z-index: 4;
}

.meld-bottom .meld-from {
  left: 0;
  right: auto;
  bottom: calc(100% + 2px);
  text-align: left;
}

.meld-left .meld-from,
.meld-right .meld-from {
  top: 2px;
  bottom: auto;
}

.meld-left .meld-from,
.meld-top .meld-from {
  left: calc(100% + 3px);
  right: auto;
  text-align: left;
}

.center-info {
  left: 50%;
  top: 50%;
  width: var(--center-size);
  height: var(--center-height);
  min-height: 0;
  transform: translate(-50%, -50%);
  padding: 20px 22px;
  text-align: center;
  color: #fff;
  background: rgba(10, 12, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.34);
}

.center-round {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 1px;
}

.center-score {
  font-size: 21px;
  line-height: 1;
  margin-bottom: 1px;
}

.center-detail {
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 1px;
}

.center-player {
  position: absolute;
  color: rgba(238, 244, 248, 0.82);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.center-riichi-marker {
  display: inline-block;
  width: 5px;
  height: 10px;
  margin-right: 3px;
  border-radius: 2px;
  vertical-align: -1px;
  background: #e23d4a;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.32),
    0 0 6px rgba(226, 61, 74, 0.75);
}

.center-player-top {
  top: 6px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
}

.center-player-right {
  right: 6px;
  top: 50%;
  transform: translate(40%, -50%) rotate(-90deg);
}

.center-player-bottom {
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.center-player-left {
  left: 6px;
  top: 50%;
  transform: translate(-40%, -50%) rotate(90deg);
}

.answer-panel {
  margin-top: 6px;
  padding: 8px 10px;
}

#prompt {
  font-weight: 700;
  margin-bottom: 6px;
  min-height: 36px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#prompt:empty::before {
  content: "\00a0";
}

#answerHand {
  display: none;
}

.call-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 30px;
  visibility: hidden;
  pointer-events: none;
}

.call-choice.show {
  visibility: visible;
  pointer-events: auto;
}

.result {
  margin-top: 6px;
  min-height: 22px;
  color: var(--muted);
}

.result.good {
  color: var(--good);
}

.result.bad {
  color: var(--bad);
}

.empty {
  display: inline-block;
  color: rgba(238, 244, 248, 0.45);
  font-size: 13px;
  min-width: 28px;
}

@media (max-width: 900px) {
  .app {
    width: calc(100vw - 8px);
    margin: 6px auto 18px;
  }

  .question-meta {
    grid-template-columns: 1fr 1fr;
  }

  .tenhou-table {
    min-height: 500px;
    height: 500px;
  }

  .seat-bottom {
    width: calc(100% - 130px);
  }

  .seat-left,
  .seat-right {
    width: 50%;
  }

  .center-info {
    width: var(--center-size);
    height: var(--center-height);
  }
}

@media (max-width: 560px) {
  :root {
    --tile-w: 20px;
    --tile-h: 30px;
    --flat-row-overlap: -11px;
    --side-row-overlap: -8px;
    --side-tile-trim: -8px;
    --side-river-overlap: -8px;
    --center-size: 112px;
    --center-height: 94px;
    --river-center-gap: 10px;
  }

  button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 15px;
  }

  .app {
    width: 100%;
    max-width: 430px;
    margin: 0;
    padding: 4px;
  }

  .topbar {
    margin-bottom: 4px;
  }

  h1 {
    font-size: 18px;
    line-height: 1.1;
  }

  .question-meta {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.78fr) minmax(0, 1.42fr);
    gap: 4px;
    margin-bottom: 4px;
  }

  .meta-item {
    min-width: 0;
    overflow: hidden;
    min-height: 45px;
    padding: 4px 6px;
    font-size: 14px;
    line-height: 1.2;
  }

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

  .meta-dora {
    min-height: 45px;
    padding: 3px 5px;
  }

  .meta-dora .tile {
    width: 18px;
    height: 27px;
  }

  .tenhou-table {
    height: 500px;
    min-height: 500px;
    border-radius: 8px;
  }

  .seat-bottom {
    bottom: 6px;
    width: calc(100% - 36px);
    height: 138px;
  }

  .seat-bottom.has-melds .seat-hand {
    left: calc(50% - (var(--tile-w) * 7 + 4px) - var(--meld-shift, 0px));
  }

  .seat-bottom .player-label {
    left: 0;
    bottom: 38px;
  }

  .seat-bottom .seat-pond {
    top: -48px;
  }

  .seat-bottom .seat-melds {
    right: -12px;
    bottom: 0;
    width: max-content;
    max-width: none;
    flex-direction: row-reverse;
    flex-wrap: nowrap;
  }

  .seat-top {
    top: 0;
    width: calc(100% - 44px);
    height: 150px;
  }

  .seat-top .player-label {
    left: 50%;
    right: auto;
    top: 4px;
    transform: translateX(-50%);
  }

  .seat-top .seat-hand {
    top: 32px;
  }

  .seat-top.has-melds .seat-hand {
    left: calc(50% + 22px + var(--meld-shift, 0px));
  }

  .seat-top .seat-pond {
    bottom: -42px;
  }

  .seat-top .seat-melds {
    left: 0;
    top: 32px;
    width: max-content;
    max-width: none;
    flex-wrap: nowrap;
  }

  .seat-left,
  .seat-right {
    height: 470px;
  }

  .seat-left .player-label {
    left: 2px;
    top: 54px;
    width: 126px;
    max-width: none;
  }

  .seat-right .player-label {
    right: 2px;
    top: 54px;
    width: 126px;
    max-width: none;
    align-items: flex-end;
  }

  .seat-left .seat-hand {
    left: 0;
    top: 53%;
  }

  .seat-right .seat-hand {
    right: 0;
    top: 53%;
  }

  .seat-left.has-melds .seat-hand {
    top: 47%;
  }

  .seat-right.has-melds .seat-hand {
    top: 59%;
  }

  .seat-left .seat-pond {
    right: calc(var(--center-size) / 2 + var(--river-center-gap));
    top: calc(50% - var(--center-height) / 2);
  }

  .seat-right .seat-pond {
    left: calc(var(--center-size) / 2 + var(--river-center-gap));
    top: calc(50% - var(--center-height) / 2);
  }

  .seat-left .seat-melds {
    left: 0;
    bottom: 2px;
    flex-direction: column-reverse;
  }

  .seat-right .seat-melds {
    right: 0;
    top: 2px;
    flex-direction: column;
  }

  .player-label {
    max-width: 170px;
    padding: 2px 5px;
    font-size: 12px;
  }

  .seat-left .player-label,
  .seat-right .player-label {
    flex-direction: column;
    gap: 0;
    line-height: 1.1;
    white-space: normal;
  }

  .seat-left .player-label {
    align-items: flex-start;
  }

  .player-name {
    flex: 1 1 auto;
    max-width: none;
  }

  .seat-left .player-name,
  .seat-right .player-name {
    flex: 0 1 auto;
    max-width: 100%;
  }

  .player-label > span:last-child {
    flex: 0 0 auto;
  }

  .center-info {
    width: var(--center-size);
    height: var(--center-height);
    min-height: 0;
    padding: 16px 18px;
  }

  .center-round {
    font-size: 11px;
  }

  .center-score {
    font-size: 18px;
  }

  .center-detail {
    font-size: 8px;
  }

  .center-player {
    font-size: 8px;
  }

  .center-player-top {
    top: 5px;
  }

  .center-player-right {
    right: 5px;
  }

  .center-player-bottom {
    bottom: 5px;
  }

  .center-player-left {
    left: 5px;
  }

  .meld {
    padding: 1px;
  }

  .meld-from {
    font-size: 10px;
  }

  .answer-panel {
    margin-top: 5px;
    padding: 6px;
    border-radius: 7px;
  }

  #prompt {
    margin-bottom: 5px;
    font-size: 14px;
    min-height: 34px;
    line-height: 1.25;
  }

  #prompt:empty {
    display: flex;
  }

  .result {
    min-height: 20px;
    font-size: 14px;
    line-height: 1.25;
  }
}
