:root {
  color-scheme: light;
  --paper: #f6f5ee;
  --ink: #233e36;
  --muted: #5e7063;
  --green: #285d49;
  --green-dark: #194735;
  --line: #dfe3d7;
  --sage: #eaf0e5;
  --orange: #b96e45;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
body.playing { height: 100dvh; overflow: clip; }
body.playing #app { height: 100%; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, [role="button"]:focus-visible { outline: 3px solid #a16a2e; outline-offset: 2px; }
button { color: inherit; }
h1, h2, p { margin: 0; }
.muted { color: var(--muted); }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.app-header { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto; max-width: 980px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 29px; height: 35px; display: grid; place-items: center; border: 1px solid #b6c4b5; border-bottom: 3px solid #9cad9a; border-radius: 5px; background: #fffcf2; color: var(--green); font: 700 23px Georgia, serif; }
.brand-name { font-size: 17px; font-weight: 650; letter-spacing: -.7px; }
.header-note { font-size: 11px; color: var(--muted); }
.icon-button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); background: transparent; border-radius: 50%; font-size: 22px; }
.primary, .secondary, .quiet { min-height: 46px; padding: 12px 18px; border-radius: 9px; border: 1px solid transparent; font-size: 13px; font-weight: 650; }
.primary { background: var(--green); color: white; box-shadow: 0 2px 0 #1c4132; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.primary:disabled { background: #dce3d7; color: #7b8d7c; box-shadow: none; }
.secondary { background: transparent; border-color: #ccd5c6; }
.secondary:hover:not(:disabled) { background: var(--sage); }
.secondary:disabled { opacity: .45; }
.quiet { border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.home { min-height: 100svh; background: radial-gradient(ellipse at 50% 37%, #e8edde 0, transparent 57%); padding-bottom: 32px; }
.home-hero { text-align: center; margin: 39px auto 10px; padding: 0 24px; }
.home-hero > .eyebrow { color: #758a70; }
.home-hero h1 { margin-top: 17px; font: 400 clamp(43px, 8vw, 63px)/1.1 "Iowan Old Style", Palatino, Georgia, serif; letter-spacing: -2.5px; }
.hero-copy { max-width: 310px; margin: 15px auto 0; color: #6d7d70; font-size: 14px; line-height: 1.7; }
.tile { display: inline-grid; flex: 0 0 auto; place-items: center; width: 25px; aspect-ratio: 40/54; position: relative; border: 1px solid #d6d7c5; border-bottom: 3px solid #bfc7b4; border-radius: 4px; background: linear-gradient(145deg, #fffef7, #f6f3e4); vertical-align: middle; overflow: hidden; box-shadow: 0 1px 1px #213f2810; }
.tile svg { width: 100%; height: 100%; display: block; }
.tile-back { background: repeating-linear-gradient(45deg, #426b55, #426b55 2px, #4b765d 2px, #4b765d 5px); color: #c8d7bd; border-color: #315641; }
.tile-back > span { font-size: 14px; }
.hero-tiles { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 26px auto 29px; height: 98px; }
.hero-tile { width: 58px; border-radius: 7px; border-bottom-width: 5px; box-shadow: 2px 7px 12px #34572c17; }
.hero-tile:nth-child(1) { transform: rotate(-12deg) translateY(8px); }
.hero-tile:nth-child(2) { transform: rotate(-3deg); }
.hero-tile:nth-child(3) { transform: rotate(4deg); }
.hero-tile:nth-child(4) { transform: rotate(12deg) translateY(8px); }
.entry-card { width: min(100% - 40px, 396px); margin: 0 auto; padding: 7px 23px 24px; background: #fffef9; border: 1px solid #e0e4d5; border-radius: 16px; box-shadow: 0 12px 35px #2f4c2010; }
.entry-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-bottom: 1px solid var(--line); margin: 0 -8px 22px; }
.entry-tab { min-height: 49px; border: 0; border-bottom: 2px solid transparent; background: none; color: #82907f; font-size: 13px; font-weight: 600; }
.entry-tab.active { color: var(--green); border-bottom-color: var(--green); }
.entry-form { display: flex; flex-direction: column; }
.field-label { font-size: 11px; font-weight: 650; margin-bottom: 9px; }
.text-input { width: 100%; min-height: 48px; padding: 12px; font-size: 16px; color: var(--ink); background: #f9faf4; border: 1px solid #d9dfcf; border-radius: 7px; margin-bottom: 21px; }
.text-input::placeholder { color: #9aa295; font-size: 13px; }
.minimum-options { display: flex; gap: 7px; }
.minimum { flex: 1; min-height: 44px; border-radius: 7px; border: 1px solid #dfe4d7; background: none; font-size: 13px; color: #738270; }
.minimum.active { border-color: #829b7b; background: #edf2e6; color: var(--green); font-weight: 700; box-shadow: inset 0 0 0 1px #829b7b; }
.field-help { font-size: 11px; color: #7f897a; margin-top: 10px; line-height: 1.5; }
.entry-submit { margin-top: 23px; width: 100%; }
.code-input { letter-spacing: .18em; font-family: ui-monospace, monospace; }
.home-footer { text-align: center; margin: 25px 16px 0; color: #86917e; font-size: 10px; letter-spacing: .03em; }
.recent-tables { width: min(100% - 40px, 396px); margin: 25px auto; }
.recent-tables .eyebrow { color: var(--muted); margin-bottom: 7px; }
.resume-button { display: block; text-align: left; width: 100%; padding: 11px 0; min-height: 44px; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 12px; }
.lobby-page { padding-bottom: 32px; min-height: 100svh; background: radial-gradient(ellipse at 50% 30%, #e9eee0 0, transparent 60%); }
.lobby { max-width: 460px; padding: 0 24px; margin: 34px auto 0; }
.lobby > .eyebrow { color: #879478; }
.lobby h1 { font: 400 39px/1.13 "Iowan Old Style", Georgia, serif; letter-spacing: -1.5px; margin-top: 16px; max-width: 310px; }
.lobby-copy { color: var(--muted); line-height: 1.7; font-size: 13px; margin: 14px 0 21px; }
.invite-code { display: block; background: transparent; border: 1px dashed #9dac8e; padding: 15px 18px; border-radius: 9px; width: 100%; font: 500 24px ui-monospace, monospace; letter-spacing: .12em; }
.lobby-seats { display: grid; gap: 10px; margin: 24px 0; }
.lobby-seat { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 13px 12px; background: #fffef9; border-radius: 10px; border: 1px solid var(--line); min-height: 73px; }
.order-help { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 16px; }
.seat-order-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-basis: 100%; padding-left: 47px; font-size: 10px; color: var(--muted); }
.seat-order { min-height: 44px; min-width: 142px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--paper); font: inherit; font-size: 12px; }
.seat-order:focus-visible { outline: 3px solid #bf9468; outline-offset: 3px; }
.lobby-seat.vacant { border-style: dashed; background: #ffffff50; }
.wind-avatar { display: grid; place-items: center; flex: 0 0 35px; height: 35px; border-radius: 50%; background: var(--sage); color: #748267; font-size: 13px; font-family: Georgia, serif; }
.lobby-seat-copy { flex: 1; min-width: 0; }
.lobby-seat-copy strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-seat-copy > span { display: block; margin-top: 5px; font-size: 10px; }
.ready-pill, .waiting-pill { font-size: 9px; color: #58774a; border-radius: 30px; background: #edf3e5; padding: 5px 7px; white-space: nowrap; }
.waiting-pill { background: #f1efe6; color: #90836d; }
.remove-bot { min-width: 44px; min-height: 44px; font-size: 18px; border: 0; margin: -5px; }
.lobby-controls { display: flex; flex-direction: column; gap: 10px; }
.lobby-rules { color: #86917e; font-size: 10px; text-align: center; line-height: 1.8; margin-top: 20px; }
.table-page { width: 100%; height: 100%; max-width: 1440px; margin: 0 auto; padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 5px; }
.table-page > * { flex-shrink: 0; }
.table-page > .app-header { padding: 0; height: 44px; width: 100%; max-width: none; }
.table-page .brand-name { font-size: 16px; }
.table-page .brand-mark { width: 23px; height: 29px; font-size: 19px; }
.table-page .icon-button { min-height: 44px; min-width: 44px; }
.table-strip { border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; min-height: 24px; padding: 2px; color: #586d5b; font-size: 11px; font-variant-numeric: tabular-nums; }
.table-strip > :first-child { margin-right: auto; }
.minimum-pill { padding: 3px 6px; border: 1px solid #d9dece; border-radius: 5px; color: var(--green); font-size: 9px; white-space: nowrap; }
.turn-status { display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 3px 7px; border-radius: 7px; background: #e9ede3; }
.turn-status.your-move { background: #e0ecda; box-shadow: inset 3px 0 #356744; }
.turn-status.offline { background: #f8ead0; }
.turn-indicator { display: flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 10px; font-weight: 750; color: #4b604c; }
.turn-indicator::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #83947d; }
.your-move .turn-indicator::before { background: #2b653f; box-shadow: 0 0 0 3px #bdd2b0; }
.offline .turn-indicator::before { background: #a66d28; }
.turn-copy { min-width: 0; flex: 1; }
.turn-copy .eyebrow { display: none; }
.turn-copy > p { font-size: 11px; font-weight: 500; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.last-discard { display: flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 125px; }
.last-discard .tile { width: 18px; }
.last-discard > span:last-child { color: #839076; font-size: 9px; line-height: 1.4; max-width: 66px; }
.board-area { flex: 1 1 0; min-height: 0; min-width: 0; overflow: clip; container: arena / size; }
.players-board { display: grid; height: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; }
.board-area .seat-panel { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: clip; padding: 6px; cursor: pointer; }
.board-area .seat-heading { flex-shrink: 0; padding-bottom: 3px; margin-bottom: 3px; gap: 4px; }
.board-area .seat-label h2 { font-size: 12px; }
.board-area .seat-wind { width: 18px; height: 21px; font-size: 14px; }
.board-area .seat-identity { gap: 4px; }
.board-area .seat-position, .board-area .hand-count { font-size: 9px; }
.board-area .score { font-size: 10px; }
.public-viewport { flex: 1 1 0; min-height: 0; position: relative; overflow: clip; }
.public-tiles { position: absolute; top: 0; left: 0; transform-origin: top left; }
.seat-panel { background: #fffef9; border: 1px solid #e0e4d8; border-radius: 10px; padding: 12px; min-width: 0; }
.seat-panel.current { border-color: #7f9b74; box-shadow: inset 3px 0 0 #71946c; background: #fafff3; }
.seat-panel.own-public { background: #eef2e7; }
.seat-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid #edf0e6; }
.seat-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dealer-badge { display: grid; place-items: center; flex-shrink: 0; width: 17px; height: 17px; background: #e5cf98; color: #654711; border-radius: 4px; font-size: 10px; font-weight: 700; }
.seat-wind { display: grid; place-items: center; width: 28px; height: 31px; flex-shrink: 0; border: 1px solid #dce3d1; border-radius: 5px; background: #f1f5e9; font: 18px Georgia, serif; color: #54714c; }
.seat-label { min-width: 0; }
.seat-label h2 { font-size: 12px; font-weight: 650; max-width: 175px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-position { display: block; font-size: 8px; color: #5f7156; margin-top: 3px; }
.seat-meta { display: flex; align-items: flex-end; flex-direction: column; flex-shrink: 0; gap: 3px; }
.score { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hand-count { font-size: 8px; color: #607153; }
.public-row { display: flex; align-items: flex-start; gap: 7px; margin: 6px 0; }
.row-label { font-size: 8px; font-weight: 650; letter-spacing: .1em; color: #607153; }
.public-row > .row-label { flex: 0 0 45px; padding-top: 5px; }
.sets { display: flex; flex-wrap: wrap; gap: 5px; min-height: 16px; min-width: 0; }
.empty-state { color: #6c7e61; font-size: 9px; line-height: 20px; }
.meld { display: flex; align-items: center; gap: 1px; position: relative; padding: 3px 3px 12px; background: #eef1e5; border: 1px solid #dfe5d4; border-radius: 5px; }
.meld .tile { width: 22px; }
.meld-kind { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 6px; line-height: 9px; color: #5d7250; letter-spacing: .03em; }
.flowers { display: flex; gap: 4px; align-items: center; min-height: 20px; flex-wrap: wrap; }
.flower { display: inline-flex; align-items: center; color: #a26865; font-size: 10px; gap: 2px; padding: 2px 4px; background: #f8ece7; border-radius: 4px; }
.flower-icon { font-size: 13px; line-height: 1; }
.flower.season { color: #9b8654; background: #f6f0de; }
.river-label { display: flex; align-items: center; gap: 5px; margin: 10px 0 5px; }
.river-count { font-size: 8px; background: #eef1e7; padding: 1px 4px; border-radius: 3px; color: #5d7250; }
.river { display: flex; flex-wrap: wrap; gap: 3px; }
.river .tile { width: 22px; border-bottom-width: 2px; }
.river .last-tile { outline: 2px solid #bd8f5c; outline-offset: 1px; z-index: 1; }
.river .claimed-tile { opacity: .36; border-style: dashed; }
.claimed-mark { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: #45573d; background: #ffffff80; }
.hand-dock { background: #fffef8; border: 1px solid #d3dcca; border-radius: 12px; min-width: 0; box-shadow: 0 3px 12px #233e3609; }
.hand-dock.interactive-hand, .hand-dock.claim-hand { border-color: #88a073; box-shadow: inset 0 3px #62814c; }
.dock-inner { width: min(100%, 1050px); margin: 0 auto; padding: 5px; }
.dock-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.dock-heading .eyebrow { font-size: 9px; color: var(--green); }
.hand-instruction { font-size: 10px; color: #596d51; max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.your-hand { display: grid; justify-content: center; grid-template-columns: repeat(auto-fit, minmax(44px, clamp(44px, 4vw, 54px))); gap: 2px; padding-top: 3px; }
.hand-tile { display: grid; place-items: center; position: relative; border: 0; background: none; min-width: 44px; min-height: 44px; padding: 0; border-radius: 5px; transition: transform .14s ease; }
.hand-tile .tile { width: 100%; max-height: 60px; border-radius: 5px; }
.compact-hand .hand-tile .tile { max-height: 44px; max-width: 33px; }
.hand-tile:disabled { opacity: 1; }
.hand-tile.selected { transform: translateY(-3px); outline: 2px solid #315e42; outline-offset: 0; }
.hand-tile.selected .tile { background: #e6efd9; border-color: #719257; box-shadow: 0 3px 0 #42623a; }
.hand-tile:hover:not(:disabled) .tile { border-color: #5d7e46; }
.hand-tile.drawn .tile { border-color: #bc9657; box-shadow: inset 0 0 0 1px #d8b57f; }
.drawn-marker { position: absolute; bottom: 2px; right: 1px; padding: 1px 3px; border-radius: 3px; background: #8f5b23; color: #fffdf1; font-size: 7px; font-weight: 750; line-height: 1.15; pointer-events: none; }
.action-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.action-bar .primary, .action-bar .secondary { flex: 1; min-width: 72px; padding: 5px 8px; min-height: 44px; white-space: normal; font-size: 11px; }
.action-bar .win-action { background: #aa7047; box-shadow: 0 2px 0 #875632; }
.sort-toggle[aria-pressed="true"] { background: var(--sage); border-color: #829b7b; color: var(--green); }
.game-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.view-options { display: flex; gap: 0; margin-right: auto; padding: 2px; background: #e8ece1; border: 1px solid #dce2d3; border-radius: 9px; }
.view-choice { min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 7px; font-size: 10px; }
.view-choice[aria-pressed="true"] { color: var(--green); background: var(--sage); border-color: #829b7b; font-weight: 650; }
.view-options .view-choice { border-color: transparent; }
.view-options .view-choice[aria-pressed="true"] { background: #fffef8; box-shadow: 0 1px 3px #233e3619; }
.view-choice:hover { color: #234b37; border-color: #8da07e; }
.mahjong-table { height: 100%; min-height: 0; border: 5px solid #8c6944; border-radius: 18px; background: #214f3b; box-shadow: inset 0 0 0 1px #cba67d, 0 2px 4px #233e361a; padding: 5px; }
.felt-board { display: grid; height: 100%; grid-template-areas: "across across across" "previous center next" "you you you"; grid-template-columns: minmax(0, 1fr) minmax(48px, .4fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 6px; border: 1px solid #a9c1a530; border-radius: 10px; padding: 4px; background: radial-gradient(ellipse at center, #316d50, #194b36); }
.table-seat { min-height: 0; border-color: #9ab89650; background: #103728a6; color: #f7f5df; border-radius: 9px; box-shadow: inset 0 1px #ffffff08; }
.table-seat.own-public { background: #123e2bcc; }
.board-area .seat-panel:hover { border-color: #9daf87; }
.table-seat:focus-visible { outline: 3px solid #f5d496; outline-offset: 3px; }
.table-seat.position-previous .seat-heading, .table-seat.position-next .seat-heading { flex-wrap: nowrap; }
.table-seat .seat-meta { flex-direction: row; align-items: center; gap: 5px; }
.table-seat.current { background: #294b2d; border-color: #e7c879; box-shadow: inset 3px 0 #e7c879, 0 0 0 1px #b79c5f66; }
.position-across { grid-area: across; justify-self: center; width: 88%; max-width: 760px; }
.position-previous { grid-area: previous; }
.position-next { grid-area: next; }
.position-you { grid-area: you; justify-self: center; width: 88%; max-width: 760px; }
.table-seat .seat-heading { gap: 3px; padding-bottom: 3px; margin-bottom: 3px; }
.table-seat .seat-heading { border-bottom-color: #a9c1a530; }
.table-seat .seat-identity { gap: 4px; }
.table-seat .seat-wind { width: 20px; height: 22px; font-size: 15px; background: #f4f2de; color: #244e36; border-color: #c8d0ad; }
.table-seat .seat-label h2 { font-size: 12px; }
.table-seat .seat-position { display: none; }
.table-seat .hand-count { color: #ccdac3; font-size: 8px; }
.table-seat .score { font-size: 11px; }
.table-seat .public-tiles { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 5px 9px; }
.table-seat .public-row { margin: 0; gap: 4px; display: block; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.table-seat .discards-row { flex: 1 1 100px; min-width: 0; }
.table-seat .public-row > .row-label { display: block; padding: 0; margin-bottom: 3px; }
.table-seat .public-row:has(.empty-state) { display: none; }
.table-seat .row-label { color: #cad9bd; font-size: 8px; letter-spacing: .08em; }
.table-seat .empty-state { color: #b5cbb0; font-size: 10px; }
.table-seat .sets { gap: 4px; min-height: 0; }
.table-seat .meld { padding: 2px 2px 10px; gap: 1px; background: #89ac7550; border-color: #9db78360; }
.table-seat .meld-kind { color: #f1eed1; font-size: 7px; }
.table-seat .meld .tile, .table-seat .river .tile { width: 23px; }
.table-seat .river { gap: 2px; }
.table-seat .flower { font-size: 10px; padding: 3px 4px; }
.table-seat .flower-icon { font-size: 10px; }
.table-seat .river-label { margin: 0 0 3px; gap: 4px; }
.table-seat .river-count { color: #e5ecd7; background: #ffffff18; }
.table-seat .river .claimed-tile { opacity: .55; }
.table-center { grid-area: center; display: flex; flex-direction: column; align-items: center; text-align: center; color: #f1edcf; min-width: 0; gap: 2px; }
.center-round { display: none; }
.discard-well { width: 42px; height: 48px; display: grid; place-items: center; border: 1px solid #b8bf8270; border-radius: 9px; background: #1c473e55; }
.discard-well .tile { width: 27px; }
.center-mark { font: 32px Georgia, serif; color: #e4d7a599; }
.center-caption { font-size: 8px; color: #e2e8ce; }
.center-player { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; color: #f1edcf; }
.center-wall { font-size: 20px; font-weight: 650; margin-top: 5px; line-height: 1; font-variant-numeric: tabular-nums; }
.center-wall-label { font-size: 8px; color: #d2dfc4; }
.seat-dialog .seat-detail { margin: 15px 0; }
.seat-dialog .river .tile, .seat-dialog .meld .tile { width: 29px; }
@media (max-width: 699px) {
  .table-seat .hand-count { display: none; }
}
@media (min-width: 700px) {
  .mahjong-table { padding: 8px; border-width: 8px; border-radius: 28px; }
  .felt-board { padding: 8px; gap: 8px; }
  .table-seat .seat-label h2 { font-size: 14px; }
  .table-seat .row-label { font-size: 9px; }
  .table-seat .score { font-size: 13px; }
  .table-seat .meld .tile, .table-seat .river .tile { width: 30px; }
  .table-seat .flower { font-size: 12px; }
  .discard-well { width: 64px; height: 74px; }
  .discard-well .tile { width: 40px; }
  .center-wall { font-size: 26px; }
  .center-caption, .center-player, .center-wall-label { font-size: 10px; }
}
.waiting-message { text-align: center; width: 100%; color: #839276; font-size: 10px; line-height: 1.5; min-height: 25px; margin: 1px 0; }
.connection-banner { text-align: center; background: #fff1da; color: #9c733d; font-size: 11px; line-height: 1.6; padding: 9px 12px; margin: 8px 0; border-radius: 6px; }
.result-card { border: 1px solid #bfd0aa; background: #f0f5e5; border-radius: 12px; padding: 20px; margin-bottom: 15px; }
.result-card h2 { font: 400 29px "Iowan Old Style", Georgia, serif; margin: 10px 0; letter-spacing: -.6px; }
.result-card .eyebrow { color: #83936b; }
.result-description { font-size: 12px; color: #758763; }
.winning-hand { display: flex; gap: 2px; flex-wrap: wrap; margin: 15px 0 8px; }
.result-patterns { font-size: 10px; line-height: 1.7; color: #879773; }
.result-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 18px 0; }
.result-score { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.positive { color: #48733d; }
.result-card > .primary { width: 100%; }
.rules-dialog { background: var(--paper); color: var(--ink); border: 1px solid #ccd5bd; border-radius: 16px; width: min(100% - 30px, 460px); padding: 25px; max-height: 85svh; overscroll-behavior: contain; }
.rules-dialog::backdrop { background: #122e2699; backdrop-filter: blur(3px); }
.rules-dialog h2 { font: 400 30px Georgia, serif; margin: 14px 0; }
.rules-list { padding-left: 19px; font-size: 12px; line-height: 1.75; color: #75816a; }
.rules-list li { margin-bottom: 12px; }
.rules-dialog > button { width: 100%; }
.loading-page { text-align: center; }
.loading-page h1 { font: 400 36px Georgia, serif; margin: 70px 20px 20px; }
.loading-page > .secondary { margin-top: 30px; }
#toast { position: fixed; z-index: 50; left: 50%; bottom: max(25px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; width: max-content; max-width: calc(100% - 32px); padding: 13px 18px; background: #244c3e; color: #fffef2; border-radius: 9px; font-size: 12px; line-height: 1.5; box-shadow: 0 4px 18px #0002; transition: opacity .2s ease, transform .2s ease; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 359px) {
  .table-page { padding-inline: 0; }
  .dock-inner { padding: 2px; }
  .your-hand { gap: 1px; }
  .header-note { display: none; }
  .seat-panel { padding: 10px; }
  .public-row > .row-label { flex-basis: 40px; font-size: 7px; }
  .meld .tile { width: 20px; }
  .turn-copy > p { font-size: 11px; }
  .last-discard { max-width: 100px; }
}
@media (min-width: 700px) {
  .home-hero { margin-top: 52px; }
  .entry-card { padding: 10px 28px 28px; }
  .seat-panel { padding: 17px; }
  .seat-label h2 { font-size: 14px; }
  .seat-position, .hand-count { font-size: 10px; }
  .row-label { font-size: 9px; }
  .river .tile { width: 27px; }
  .meld .tile { width: 26px; }
  .hand-tile .tile { max-height: 72px; }
  .compact-hand .hand-tile .tile { max-height: 44px; }
  .action-bar { justify-content: flex-end; }
  .action-bar > .primary, .action-bar > .secondary { flex: 0 1 240px; }
  .lobby { margin-top: 45px; }
}
@container arena (max-height: 500px) {
  .discard-well { width: 42px; height: 48px; }
  .discard-well .tile { width: 30px; }
  .center-caption, .center-player { font-size: 9px; }
  .center-wall { font-size: 22px; margin-top: 2px; }
  .center-wall-label { display: none; }
}
@container arena (max-height: 300px) {
  .discard-well { width: 32px; height: 36px; }
  .discard-well .tile { width: 22px; }
  .center-mark { font-size: 22px; }
  .center-caption, .center-player, .center-wall-label { display: none; }
  .center-wall { font-size: 13px; margin-top: 0; }
}
@container arena (max-height: 260px) {
  .board-area .position-across, .board-area .position-you { display: grid; grid-template-columns: minmax(0, .55fr) minmax(0, 1.45fr); grid-template-rows: minmax(0, 1fr); gap: 4px; }
  .board-area .position-across .seat-heading, .board-area .position-you .seat-heading { margin: 0; padding: 0; border: 0; }
  .table-seat .hand-count { display: none; }
}
@container arena (max-height: 200px) {
  .board-area .table-seat { padding: 3px; }
  .board-area .table-seat .seat-heading { padding-bottom: 2px; margin-bottom: 2px; }
  .table-seat .seat-wind { width: 16px; height: 18px; font-size: 12px; }
  .table-seat .seat-label h2 { font-size: 10px; }
  .table-seat .dealer-badge { width: 14px; height: 14px; font-size: 9px; }
  .table-seat .public-tiles { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 3px; }
  .table-seat .public-row, .table-seat .sets, .table-seat .flowers, .table-seat .river, .table-seat .discards-row { display: contents; }
  .table-seat .public-row > .row-label, .table-seat .river-label, .table-seat .empty-state { display: none; }
  .table-center { flex-direction: row; flex-wrap: nowrap; justify-content: center; }
  .discard-well { width: 26px; height: 30px; flex-shrink: 0; }
  .discard-well .tile { width: 19px; }
  .center-wall { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .table-page { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 36vw, 300px); grid-template-rows: 44px 24px 44px auto minmax(0, 1fr); }
  .table-page > .app-header { grid-column: 1; grid-row: 1; }
  .table-strip { grid-column: 1; grid-row: 2; }
  .game-toolbar { grid-column: 1; grid-row: 3; }
  .turn-status { grid-column: 1; grid-row: 4; }
  .board-area { grid-column: 1; grid-row: 5; }
  .hand-dock { grid-column: 2; grid-row: 1 / -1; min-height: 0; }
  .dock-inner { display: flex; flex-direction: column; height: 100%; padding: 4px; }
  .dock-heading { flex-direction: column; align-items: flex-start; gap: 2px; }
  .hand-instruction { display: none; }
  .your-hand { flex: 1; min-height: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(44px, 1fr); }
  .hand-tile .tile { max-height: 44px; max-width: 33px; }
  .compact-hand .your-hand { flex: 0 1 auto; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 22px; }
  .compact-hand .hand-tile { min-height: 22px; min-width: 0; }
  .compact-hand .hand-tile .tile { max-height: 22px; max-width: 17px; }
  .action-bar { margin-top: auto; padding-top: 4px; }
  .action-bar .primary, .action-bar .secondary { flex: 1 1 60px; min-width: 60px; font-size: 10px; padding-inline: 3px; }
  .mahjong-table { border-width: 4px; padding: 3px; }
  .felt-board { gap: 4px; padding: 3px; }
  .board-area .seat-panel { padding: 4px; }
  .table-seat .seat-label h2 { font-size: 9px; }
  .board-area .seat-heading { padding-bottom: 1px; margin-bottom: 1px; }
  .table-seat .seat-wind { width: 15px; height: 17px; font-size: 12px; }
  .table-seat .hand-count, .table-seat .dealer-badge { display: none; }
  .table-seat .public-tiles { gap: 2px; }
  .table-seat .public-row > .row-label, .table-seat .river-label { display: none; }
  .table-seat .meld .tile, .table-seat .river .tile { width: 20px; }
  .turn-status { min-height: 24px; padding: 2px 4px; gap: 4px; }
  .turn-indicator { font-size: 9px; }
  .turn-copy > p { font-size: 10px; }
  .table-center { gap: 1px; }
  .center-caption, .center-wall-label { display: none; }
  .discard-well { width: 32px; height: 36px; }
  .discard-well .tile { width: 22px; }
  .center-wall { font-size: 12px; margin-top: 0; }
  .drawn-marker { font-size: 6px; }
}
@media (orientation: landscape) and (max-height: 360px) {
  .compact-hand .your-hand { flex-shrink: 0; grid-auto-rows: 18px; gap: 1px; padding-top: 0; }
  .compact-hand .hand-tile { min-height: 18px; }
  .compact-hand .hand-tile .tile { max-height: 18px; max-width: 14px; }
  .table-center { flex-direction: row; flex-wrap: nowrap; justify-content: center; }
  .discard-well { width: 26px; height: 30px; }
  .discard-well .tile { width: 19px; }
  .center-wall { font-size: 10px; }
  .center-player { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
