/* SANJOONG · scene, typography and shared controls */
:root {
  color-scheme: dark;
  --ink: #151810;
  --paper: #f7ead2;
  --muted: #c7baa1;
  --gold: #e9bc7d;
  --gold-bright: #ffce87;
  --line: #dfb97e38;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans CJK KR", system-ui, sans-serif;
  --serif: "AppleMyungjo", "Batang", "바탕", "Noto Serif CJK KR", Georgia, serif;
  --gutter: clamp(17px, 3.7vw, 62px);
  --wood-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='220' viewBox='0 0 480 220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.023 .37' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23a97a56' filter='url(%23g)' opacity='.41' d='M0 0h480v220H0z'/%3E%3C/svg%3E");
  --felt-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath filter='url(%23g)' opacity='.34' d='M0 0h150v150H0z'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #141b16; }
body {
  isolation: isolate;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--paper);
  font: 400 16px/1.5 var(--sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -2;
  inset: 0;
  pointer-events: none;
}
body::before {
  background: #202b25 url("/lodge.jpg") center center / cover no-repeat;
}
body::after {
  z-index: -1;
  background:
    linear-gradient(90deg, #100d09a8, #10141148 44%, #100e0a06 76%),
    linear-gradient(0deg, #100e0ceF, transparent 49%, #120f0b55 100%);
}
body[data-screen="game"]::after {
  background: linear-gradient(0deg, #130e0cef 0%, #14181134 45%, #17190a05 77%, #12110e8c);
}
button, input { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
::selection { color: #24180c; background: #e9bc7d; }
#root { min-width: 0; flex: 1 0 auto; display: flex; flex-direction: column; }

.site-header, .site-footer { padding-inline: var(--gutter); }
.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 23px;
  min-height: 81px;
  padding-block: 13px;
  padding-top: max(13px, env(safe-area-inset-top));
  background: linear-gradient(180deg, #15120e65, transparent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  color: #f8e6c4;
  text-decoration: none;
  text-shadow: 0 2px 12px #110d06;
}
.brand-seal { display: block; flex: 0 0 auto; width: 43px; height: 43px; color: var(--gold); background: #18180f7d; border-radius: 11px; }
.brand-type { display: grid; gap: 2px; }
.brand-ko { font: 700 28px/.99 var(--serif); letter-spacing: -.08em; white-space: nowrap; }
.brand-en { color: var(--gold); font: 700 8px/1 var(--sans); letter-spacing: .29em; white-space: nowrap; }
.header-game { padding-left: 21px; border-left: 1px solid #f7ead24d; color: #f0e1c6; font-size: 13px; font-weight: 650; white-space: nowrap; text-shadow: 0 1px 6px #110d06; }
.header-tools { display: flex; align-items: center; gap: 13px; margin-left: auto; }
#connection { color: #f2ddba; font-size: 12px; font-weight: 650; white-space: nowrap; text-shadow: 0 1px 7px #110d06; }
#connection::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border-radius: 50%; background: #d2a767; box-shadow: 0 0 8px #f9b86b86; }
#connection.online::before, #connection[data-state="online"]::before { background: #abd09b; box-shadow: 0 0 8px #abd09b76; }

.site-footer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 57px;
  padding-bottom: env(safe-area-inset-bottom);
  color: #c9b493;
  font-size: 11px;
  text-shadow: 0 1px 6px #090704;
}
.site-footer::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; border-top: 1px solid #ead0ad2c; }
.footer-brand { font-size: 9px; font-weight: 750; letter-spacing: .24em; }
.play-only { display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: #dfc9a4; font-weight: 620; letter-spacing: .055em; }
.play-only svg { width: 16px; height: 16px; flex: 0 0 auto; }
.footer-suits { justify-self: end; letter-spacing: .19em; white-space: nowrap; }
.footer-suits span { color: #b9866f; }

.btn {
  display: inline-flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: 9px 17px;
  border: 1px solid #9a84665f;
  border-radius: 9px;
  background: #28251f;
  box-shadow: inset 0 1px #fff7dd12, 0 3px 8px #0a08062e;
  color: #faecd4;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn:not(:disabled):not([aria-disabled="true"]):hover { border-color: #dec194; background-color: #3c362a; }
.btn:not(:disabled):not([aria-disabled="true"]):active { transform: translateY(1px); }
.btn.primary {
  border-color: #ffd491;
  background: #efb668 linear-gradient(180deg, #ffce88, #ecab57);
  color: #24170d;
  box-shadow: inset 0 1px #fff4cf9c, inset 0 -1px #a7652b55, 0 4px 12px #120d0866;
}
.btn.primary:not(:disabled):not([aria-disabled="true"]):hover { border-color: #ffe7b8; background: #ffd091; box-shadow: inset 0 1px #fff4cf, 0 5px 16px #e9a04a36; }
.btn.secondary { background-color: #27241fef; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .49; cursor: not-allowed; }
.btn.invite { min-height: 41px; padding: 8px 14px; border-color: #d8b6836d; background-color: #211d17e8; white-space: nowrap; font-size: 13px; }
.invite svg { width: 18px; height: 18px; flex: 0 0 auto; color: #eab980; }

/* Arrival lobby */
.lobby {
  position: relative;
  display: grid;
  flex: 1 0 auto;
  align-items: center;
  width: min(100%, 1440px);
  margin-inline: auto;
  padding: 52px var(--gutter) 70px;
}
.lobby-card {
  position: relative;
  justify-self: start;
  width: min(100%, 524px);
  margin-left: clamp(0px, 5vw, 78px);
  padding: clamp(30px, 4.35vw, 62px);
  border: 1px solid #c3a37578;
  border-radius: 19px;
  background: linear-gradient(140deg, #263028f5, #141b17f7 72%, #151b15f4);
  box-shadow: 0 30px 88px #080a08a3, inset 0 1px #f9e0af19;
}
.lobby-card::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 7px;
  border: 1px solid #dabb7e24;
  border-radius: 13px;
}
.lobby-card::after {
  content: "♠";
  position: absolute;
  top: 27px;
  right: 31px;
  color: #d7b58483;
  font: 22px/1 Georgia, serif;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: .8em;
  margin: 0 0 20px;
  color: #e5b880;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .18em;
  line-height: 1.3;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; display: block; width: 18px; height: 1px; flex: 0 0 auto; background: currentColor; opacity: .8; }
.lobby-card :is(h1,h2) {
  margin: 0;
  color: #f9ebd3;
  font: 700 clamp(47px, 5.3vw, 76px)/1.06 var(--serif);
  letter-spacing: -.10em;
  text-shadow: 0 3px 28px #120f077a;
}
.lead { margin: 20px 0 0; color: #dacdb4; font-size: 14px; font-weight: 450; line-height: 1.78; letter-spacing: -.024em; }
.lobby form { display: grid; gap: 13px; margin: 29px 0 0; }
.field { display: grid; gap: 7px; min-width: 0; color: #e9dabf; font-size: 13px; font-weight: 700; }
.field :is(input, select), .lobby input:not([type="checkbox"]):not([type="radio"]) {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 10px 13px;
  border: 1px solid #b19b716a;
  border-radius: 8px;
  outline: none;
  background: #111812c9;
  color: var(--paper);
  font-size: 16px;
  font-weight: 510;
  box-shadow: inset 0 2px 7px #0a0d0a4d;
}
.field input::placeholder { color: #b8aa91; opacity: .84; }
.field :is(input, select):focus-visible, .lobby input:not([type="checkbox"]):not([type="radio"]):focus-visible { border-color: #e8b878; box-shadow: 0 0 0 3px #e8b87828; }
.lobby-actions { display: flex; align-items: stretch; gap: 9px; margin-top: 6px; }
.lobby-actions > .btn { flex: 1; }
.lobby-actions > .primary { flex: 1.13; }
.lobby-card .hint { margin: 25px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: #bfb59e; font-size: 12px; line-height: 1.6; letter-spacing: -.015em; }
.lobby-card form .hint { margin: 1px 0 0; padding-top: 0; border-top: 0; }
.lobby-card .hint:empty { display: none; }
.hint { color: var(--muted); font-size: 12px; }
.noscript { margin: 0 auto 20vh; padding: 20px; color: var(--paper); background: #20291e; }

/* Game scene · the rail, fabric and cards are real scalable CSS surfaces. */
.game {
  --card-width: clamp(47px, 5.10vw, 78px);
  --seat-card-width: clamp(24px, 2.52vw, 37px);
  --own-card-width: clamp(45px, 4.95vw, 73px);
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  flex: 1 0 auto;
  width: min(100%, 1536px);
  min-width: 0;
  margin-inline: auto;
  padding: 8px var(--gutter) 23px;
}
.table-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px 12px;
  flex-wrap: wrap;
  width: min(100%, 1240px);
  min-height: 29px;
  margin-bottom: 20px;
  color: #ecddc2;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px #0a0906;
}
.table-meta h1, .table-meta h2 { margin: 0; font-size: 15px; color: var(--paper); letter-spacing: -.026em; }
.table-meta :is(.room-tag,.room-code,.table-tag,.street,.phase,.meta-pill) { padding: 5px 10px; border: 1px solid #e5c38a5a; border-radius: 20px; background: #171911df; }
.table-meta :is(.room-code,code) { color: #f1cb94; font-weight: 800; letter-spacing: .055em; }
.table-meta:empty { display: none; }

.table {
  --rail: clamp(16px, 2.1vw, 34px);
  --curve: 49% / 48%;
  --stud: radial-gradient(ellipse, #fff0b3 0%, #c29449 34%, #70451b 61%, transparent 72%);
  isolation: isolate;
  position: relative;
  width: min(100%, 1240px);
  height: clamp(408px, 57svh, 565px);
  border: 1px solid #9e673e;
  border-radius: var(--curve);
  background:
    radial-gradient(ellipse at 53% 2%, #ffcc874b, transparent 40%),
    var(--wood-grain) 50% 50% / 480px 220px,
    repeating-radial-gradient(ellipse at 50% 46%, #55291537 0 1px, #28130b72 2px, #b26b3e3b 3px, transparent 5px 8px),
    linear-gradient(155deg, #754329 1%, #5a321e 24%, #57311c 41%, #3b2216 62%, #734027 79%, #382017 100%);
  background-blend-mode: screen, soft-light, normal, normal;
  box-shadow:
    inset 0 2px 2px #ffdda17a,
    inset 0 0 0 4px #3c21154d,
    inset 0 -4px 4px #1a0d09dc,
    0 6px #2f1b12,
    0 9px #1d1009,
    0 13px 0 1px #3a2115,
    0 23px 29px #090705bd,
    0 36px 64px #0907059c;
}
.table::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: var(--rail);
  border: 1px solid #7f6335;
  border-radius: var(--curve);
  background:
    var(--felt-grain) 50% 50% / 150px 150px,
    radial-gradient(ellipse at 54% -9%, #ad884b85, transparent 51%),
    radial-gradient(ellipse at 50% 38%, #455039 6%, #303e2c 61%, #1e2b20 100%);
  background-blend-mode: soft-light, normal, normal;
  box-shadow:
    0 0 0 1px #20190ed1,
    0 -2px 5px 2px #21130ec9,
    0 2px 2px #e7b3787d,
    inset 0 4px 16px #16180db3,
    inset 0 -11px 35px #15170fb0;
}
.table::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid #d998624a;
  border-radius: var(--curve);
  background:
    var(--stud) 50% 2px / 11px 7px,
    var(--stud) 50% calc(100% - 2px) / 11px 7px,
    var(--stud) 3px 50% / 11px 8px,
    var(--stud) calc(100% - 3px) 50% / 11px 8px;
  background-repeat: no-repeat;
  pointer-events: none;
}
.board {
  position: absolute;
  z-index: 1;
  inset: 47% auto auto 50%;
  display: grid;
  justify-items: center;
  gap: 13px;
  width: max-content;
  max-width: 92%;
  text-align: center;
  transform: translate(-50%, -50%);
}
.board-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 105px;
  min-height: 31px;
  margin: 0;
  padding: 3px 13px;
  border: 1px solid #d0a66c8a;
  border-radius: 28px;
  background: #302719e6;
  color: #f6d7a2;
  box-shadow: inset 0 1px 3px #16120787;
  font-size: clamp(13px, 1.4vw, 21px);
  line-height: 1.25;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.board-cards { display: flex; justify-content: center; align-items: center; gap: clamp(4px, .75vw, 10px); }
.card {
  --w: var(--card-width);
  position: relative;
  display: grid;
  width: var(--w);
  aspect-ratio: .72;
  flex: 0 0 auto;
  overflow: hidden;
  align-items: start;
  justify-items: start;
  align-content: start;
  border: 1px solid #e0c79d;
  border-radius: max(4px, calc(var(--w) * .087));
  padding: calc(var(--w) * .12);
  background: radial-gradient(ellipse at 4% 6%, #fff6e4, #f6e7ca 67%, #ebd0a4);
  color: #1d211a;
  text-align: left;
  box-shadow: 0 1px 1px #130d08cf, 0 4px 8px #13160fb3, inset 0 1px #fff8e9;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}
.card.red { color: #a12f28; }
.card-corner { z-index: 1; display: grid; justify-items: center; align-content: start; gap: 0; }
.card .rank { z-index: 1; font-size: calc(var(--w) * .30); letter-spacing: -.065em; }
.card .suit { z-index: 1; color: inherit; font-size: calc(var(--w) * .27); line-height: .9; }
.card-mark { position: absolute; inset: 51% 5% auto 45%; transform: translate(-27%, -35%); font-size: calc(var(--w) * .67); line-height: 1; opacity: .95; text-align: center; }
.card.back {
  border: max(2px, calc(var(--w) * .052)) solid #ecd4a7;
  padding: 0;
  background: #29382b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23c8a776' stroke-width='.72' opacity='.83'%3E%3Cpath d='M16 1C18 9 23 14 31 16c-8 2-13 7-15 15C14 23 9 18 1 16 9 14 14 9 16 1Z'/%3E%3Cpath d='M16 7c1 4 5 8 9 9-4 1-8 5-9 9-1-4-5-8-9-9 4-1 8-5 9-9Z'/%3E%3Ccircle cx='16' cy='16' r='3'/%3E%3Cpath d='M1 7c4 0 6-2 6-6m18 0c0 4 2 6 6 6m0 18c-4 0-6 2-6 6M7 31c0-4-2-6-6-6'/%3E%3C/g%3E%3C/svg%3E") center / max(10px, calc(var(--w) * .41)) repeat;
  color: transparent;
  box-shadow: 0 2px 4px #13110cd4, inset 0 0 0 1px #795c35, inset 0 0 6px #171e11dd;
}
.card.empty {
  border: 1px solid #c4ae7659;
  background: #121e1659;
  color: transparent;
  box-shadow: inset 0 2px 6px #11170c56;
}
.card.empty::before { content: "◇"; position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); color: #c4ae7659; font: calc(var(--w) * .27)/1 Georgia, serif; }
.card:is(.back,.empty) :is(.rank,.suit,.card-mark) { visibility: hidden; }

/* Six clockwise points start from the local player at six o'clock. */
.seat {
  --avatar-bg: #443624;
  --seat-x: 50%;
  --seat-y: 50%;
  position: absolute;
  z-index: 2;
  left: var(--seat-x);
  top: var(--seat-y);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 0;
  align-items: center;
  justify-items: center;
  width: max-content;
  max-width: clamp(105px, 15vw, 220px);
  min-width: 0;
  color: #fae9ca;
  text-align: center;
  transform: translate(-50%, -50%);
  font-variant-numeric: tabular-nums;
}
.seat.s0 { --seat-x: 50%; --seat-y: 84%; }
.seat.s1 { --seat-x: 17%; --seat-y: 68%; --avatar-bg: #423c2a; }
.seat.s2 { --seat-x: 21%; --seat-y: 23.5%; --avatar-bg: #3c4938; }
.seat.s3 { --seat-x: 50%; --seat-y: 9%; --avatar-bg: #48412f; }
.seat.s4 { --seat-x: 79%; --seat-y: 23.5%; --avatar-bg: #554030; }
.seat.s5 { --seat-x: 83%; --seat-y: 68%; --avatar-bg: #344338; }
.seat-identity {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}
.avatar {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(41px, 4.05vw, 59px);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #c9a675b5;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 23%, #b594615c, transparent 58%), var(--avatar-bg);
  color: #f6dbad;
  box-shadow: 0 3px 8px #0d0d08ab, inset 0 0 0 3px #2025198c, inset 0 0 13px #16140e5e;
  font: 750 clamp(15px, 1.72vw, 24px)/1 var(--serif);
  text-shadow: 0 1px 2px #110e08;
  object-fit: cover;
}
.avatar img, .avatar svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.plate {
  position: relative;
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 2px;
  justify-self: stretch;
  justify-items: start;
  min-height: 45px;
  margin-left: -7px;
  padding: 5px 12px 6px 15px;
  border: 1px solid #b79a6d92;
  border-radius: 7px 10px 10px 7px;
  background: linear-gradient(170deg, #302b22, #211e19 73%);
  color: #f6e5c6;
  box-shadow: 0 5px 12px #1211088a, inset 0 1px 0 #e8d8b41b;
  line-height: 1.18;
  text-align: left;
}
.player-name {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(12px, 1.12vw, 16px);
  font-weight: 780;
  letter-spacing: -.03em;
}
.stack { display: inline-flex; align-items: center; gap: 4px; color: #f2d5a8; font-size: clamp(11px, 1.02vw, 15px); font-weight: 720; white-space: nowrap; }
.stack::before { content: ""; display: inline-block; width: .74em; height: .56em; margin: -.1em 1px 0 0; flex: 0 0 auto; border: 1px solid #dbb881; border-radius: 50%; background: #c399585c; box-shadow: 0 2px 0 -.4px #352717, 0 2px 0 .15px #e4ba7e, 0 4px 0 -.6px #cda973; }
.seat-status { color: #c9b89c; font-size: 9px; font-weight: 680; line-height: 1.1; letter-spacing: .025em; white-space: nowrap; }
.seat-status:empty { display: none; }
.seat > .seat-status { grid-column: 1/-1; }
.seat.acting { z-index: 3; }
.seat.acting .avatar { border-color: #ffd18b; box-shadow: 0 0 0 2px #ae6a37, 0 0 20px #ffd18055, inset 0 0 0 3px #211a10ad; }
.seat.acting .plate { border-color: #edb76f; box-shadow: 0 0 16px #f0ac5340, inset 0 1px #ffe0a735; }
.seat.acting .seat-status { color: #ffd393; }
.seat.folded :is(.avatar,.plate,.pocket) { opacity: .66; }
.seat.empty { opacity: .68; }
.seat.empty .avatar { border-style: dashed; background: #202a21; color: #d3b98baa; box-shadow: 0 2px 6px #100f085e; }
.seat.empty .plate { background: #21281dea; }
.pocket {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  margin-top: 2px;
}
.pocket:empty { display: none; }
.pocket .card { --w: var(--seat-card-width); }
.pocket .card:nth-child(1):not(.empty) { transform: rotate(-8deg) translateY(1px); }
.pocket .card:nth-child(2):not(.empty) { transform: rotate(8deg) translateY(1px); }
.own .pocket .card { --w: var(--own-card-width); }
.own .pocket { grid-row: 1; margin-bottom: 4px; gap: 0; }
.own .pocket .card + .card { margin-left: calc(var(--own-card-width) * -.15); }
.own .seat-identity { grid-row: 2; }
.seat.own > .avatar, .seat.own > .plate { grid-row: 2; }
.own .avatar { width: clamp(33px, 3.3vw, 44px); font-size: clamp(13px, 1.35vw, 20px); }
.own .plate { min-height: 38px; }
.wager {
  position: absolute;
  top: 59%;
  left: calc(100% + 12px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid #edbb7554;
  border-radius: 20px;
  background: #1c2119ed;
  color: #fae0ac;
  box-shadow: 0 2px 5px #14110bc4;
  font-size: 11px;
  font-weight: 740;
  line-height: 1;
  white-space: nowrap;
}
.wager::before { content: ""; width: 11px; height: 10px; flex: 0 0 auto; border: 2px dashed #ffd591; border-radius: 50%; background: #a55434; box-shadow: 0 1px #58341e, 0 3px #d19a5d; }
.wager:empty { display: none; }
.seat:is(.s4,.s5) .wager { left: auto; right: calc(100% + 12px); }

.controls {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 704px);
  margin-top: 26px;
  text-align: center;
}
.controls :is(.action-row,.raise-panel,.secondary-row) { width: 100%; }
.turn-copy, .table-note, .winner {
  width: 100%;
  margin: 0;
  color: #f6deb5;
  font-size: 13px;
  font-weight: 690;
  line-height: 1.35;
  text-shadow: 0 1px 8px #110b06;
}
.turn-copy { color: #f2c580; letter-spacing: -.02em; }
.turn-copy:empty, .table-note:empty, .winner:empty, .controls:empty { display: none; }
.table-note { color: #ddcbb1; font-size: 12px; font-weight: 550; }
.winner:not(:empty) {
  width: fit-content;
  max-width: 100%;
  padding: 6px 13px;
  border: 1px solid #eab76d78;
  border-radius: 20px;
  background: #261b11ec;
  color: #ffda94;
  font-weight: 780;
}
.action-row { display: flex; gap: 11px; align-items: stretch; }
.action-row > .btn { flex: 1 1 0; min-height: 56px; padding-inline: 7px; font-size: clamp(15px, 1.65vw, 22px); white-space: nowrap; }
.action-row > .btn.primary { flex-grow: 1.07; }
.secondary-row { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.secondary-row .btn { min-height: 38px; padding: 6px 12px; font-size: 12px; }
.raise-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid #d6ad7452;
  border-radius: 10px;
  background: #211e17ed;
  color: #efdbc0;
  font-size: 13px;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
}
.raise-panel input[type="range"] { flex: 1 1 130px; min-width: 75px; accent-color: #efb66d; }
.raise-panel input[type="number"] { width: 88px; height: 34px; padding: 3px 7px; border: 1px solid #c3985d83; border-radius: 5px; background: #181911; color: var(--paper); }
.raise-panel .btn { min-height: 35px; }

#toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(17px, env(safe-area-inset-bottom));
  display: block;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border: 1px solid #f1c88d8f;
  border-radius: 10px;
  background: #252116fa;
  color: #f9e3bc;
  box-shadow: 0 5px 24px #0e0c06ad;
  font-size: 13px;
  font-weight: 690;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}
#toast:empty { display: none; }

@media (min-width: 851px) {
  body[data-screen="game"]::before { background-position: 65% 72%; background-size: max(100vw, 199svh) auto; }
}
@media (min-width: 851px) and (min-height: 795px) {
  .game { padding-top: 25px; }
  .table { height: clamp(427px, 55svh, 565px); }
}
@media (max-width: 850px) {
  .site-header { gap: 16px; min-height: 69px; }
  .header-game { padding-left: 16px; }
  .lobby-card { margin-left: 0; }
  .table { --rail: clamp(12px, 2vw, 22px); }
}
@media (max-width: 590px) {
  body::before { background-position: 67% center; }
  body::after { background: linear-gradient(0deg, #100e0cf2, #100d0970 48%, #100d0938 82%, #100d096e); }
  body[data-screen="game"]::after { background: linear-gradient(0deg, #130e0cf5, #16160d52 51%, #12110e3d 78%, #12110e8c); }
  .site-header { min-height: 64px; padding-block: 9px; padding-top: max(9px, env(safe-area-inset-top)); gap: 10px; }
  .brand { gap: 8px; }
  .brand-seal { width: 36px; height: 36px; border-radius: 10px; }
  .brand-ko { font-size: 24px; }
  .brand-en { font-size: 7px; }
  .header-game { margin-left: 1px; padding-left: 10px; font-size: 11px; }
  body[data-screen="game"] .header-game { display: none; }
  .header-tools { gap: 7px; }
  #connection { font-size: 10px; }
  .btn.invite { min-height: 38px; padding-inline: 10px; font-size: 12px; }
  .invite svg { width: 16px; height: 16px; }
  .site-footer { min-height: 43px; gap: 7px; font-size: 10px; }
  .footer-brand { font-size: 8px; letter-spacing: .14em; }
  .play-only { gap: 3px; letter-spacing: .02em; }
  .play-only svg { width: 14px; height: 14px; }
  .footer-suits { letter-spacing: .08em; }
  .lobby { justify-items: center; align-content: center; padding-block: 54px 44px; }
  .lobby-card { justify-self: center; max-width: 430px; padding: 36px 27px; border-radius: 16px; }
  .lobby-card::before { border-radius: 11px; inset: 6px; }
  .lobby-card::after { top: 22px; right: 23px; font-size: 18px; }
  .eyebrow { margin-bottom: 15px; }
  .lobby-card :is(h1,h2) { font-size: clamp(41px, 12vw, 59px); }
  .lead { margin-top: 14px; font-size: 13px; }
  .lobby form { margin-top: 25px; }
  .lobby-card .hint { margin-top: 20px; padding-top: 13px; }
  .lobby-card form .hint { margin-top: 1px; padding-top: 0; }
  .game {
    --card-width: clamp(35px, 11.2vw, 61px);
    --seat-card-width: clamp(18px, 5.4vw, 27px);
    --own-card-width: clamp(36px, 10.8vw, 57px);
    padding: 2px 10px 14px;
  }
  .table-meta { width: calc(100% - 12px); min-height: 24px; margin-bottom: 13px; font-size: 10px; }
  .table-meta :is(h1,h2) { font-size: 13px; }
  .table {
    --rail: 12px;
    --curve: 47% / 33%;
    height: clamp(400px, 58svh, 553px);
    max-width: 460px;
    box-shadow: inset 0 1px 3px #ffdda17a, inset 0 -4px 4px #1a0d09dc, 0 5px #2f1b12, 0 8px #1d1009, 0 11px #3a2115, 0 16px 25px #090705bd;
  }
  .table::after { inset: 4px; }
  .board { inset-block-start: 47%; gap: 7px; }
  .board-label { min-width: 74px; min-height: 25px; padding-inline: 9px; font-size: 13px; }
  .seat { gap: 3px 0; max-width: clamp(91px, 28vw, 125px); }
  .seat.s0 { --seat-y: 87%; }
  .seat.s1 { --seat-x: 20%; --seat-y: 68%; }
  .seat.s2 { --seat-x: 22%; --seat-y: 25%; }
  .seat.s3 { --seat-y: 12%; }
  .seat.s4 { --seat-x: 78%; --seat-y: 25%; }
  .seat.s5 { --seat-x: 80%; --seat-y: 68%; }
  .avatar, .own .avatar { width: clamp(28px, 8vw, 43px); font-size: clamp(12px, 3.6vw, 18px); }
  .plate, .own .plate { gap: 1px; min-height: 30px; margin-left: -5px; padding: 4px 6px 4px 9px; border-radius: 6px 8px 8px 6px; }
  .player-name { font-size: 11px; }
  .stack { gap: 3px; font-size: 10px; }
  .seat-status { font-size: 8px; }
  .wager { top: 100%; left: 50%; margin-top: 4px; transform: translateX(-50%); padding: 2px 5px; font-size: 9px; }
  .seat:is(.s4,.s5) .wager { right: auto; left: 50%; }
  .seat.s0 .wager { top: 44%; left: calc(100% + 8px); margin-top: 0; transform: none; }
  .wager::before { width: 8px; height: 8px; }
  .controls { gap: 8px; margin-top: 25px; padding-inline: 7px; }
  .action-row { gap: 7px; }
  .action-row > .btn { min-height: 49px; padding-inline: 5px; font-size: 15px; }
  .raise-panel { gap: 5px; padding-inline: 8px; }
}
@media (max-width: 350px) {
  .brand-ko { font-size: 21px; }
  .header-game { padding-left: 8px; }
  .lobby-card { padding-inline: 21px; }
  .lobby-actions .btn { padding-inline: 8px; }
}
@media (min-width: 591px) and (max-height: 770px) {
  .site-header { min-height: 64px; }
  .site-footer { min-height: 45px; }
  .table-meta { margin-bottom: 13px; }
  .controls { gap: 8px; margin-top: 23px; }
  .action-row > .btn { min-height: 47px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Runtime details: room state, action clock, dealer chip and unoccupied seats. */
.lobby-card > .lobby-actions { margin-top: 25px; }
.table-meta-left { display: flex; align-items: center; gap: 10px; }
.table-meta .eyebrow { margin: 0; font-size: 10px; font-weight: 780; letter-spacing: .06em; }
.meta-blinds, .meta-count {
  padding: 4px 9px;
  border: 1px solid #ddbc855c;
  border-radius: 20px;
  background: #1d2119df;
  color: #f1d9b2;
  white-space: nowrap;
}
.board:has(.pot) { gap: 8px; }
.board:has(.pot) .board-label {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #e8d9b9;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: .015em;
  text-shadow: 0 1px 5px #1c2115;
}
.pot {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: .32em;
  min-width: 105px;
  margin-bottom: 3px;
  padding: 4px 15px;
  border: 1px solid #d0a66c99;
  border-radius: 28px;
  background: #322719eb;
  color: #f4d8aa;
  box-shadow: inset 0 1px 4px #1612078f;
  font-size: clamp(14px, 1.4vw, 20px);
  line-height: 1.22;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pot strong { font-size: 1.09em; font-weight: 790; }
.seat-identity { position: relative; }
.seat:not(.own) .seat-identity { grid-row: 1; }
.seat:not(.own) .pocket { grid-row: 2; }
.seat-badge {
  position: absolute;
  z-index: 2;
  top: -6px;
  left: -4px;
  display: grid;
  min-width: 17px;
  min-height: 17px;
  padding: 1px 3px;
  place-items: center;
  border: 1px solid #ffeea8;
  border-radius: 50%;
  background: #e9ce9e;
  color: #35281c;
  box-shadow: 0 2px 6px #17130ec4;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}
.seat-badge.own-tag { display: none; }
.last-action {
  grid-column: 1/-1;
  grid-row: 3;
  color: #e5c699;
  font-size: 10px;
  font-weight: 670;
  line-height: 1.06;
  text-shadow: 0 2px 5px #0b100a;
}
.last-action:empty { display: none; }
.seat.own .last-action { margin-top: 1px; }
.seat.vacant {
  gap: 6px;
  padding: 2px 11px 2px 3px;
  border: 1px dashed #b6b87b70;
  border-radius: 28px;
  background: #162018b0;
  color: #cfbe98;
  box-shadow: 0 2px 8px #0a130b59;
  font-size: 11px;
  font-weight: 650;
}
.vacant .avatar {
  width: 26px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #c9bd91;
  font: 500 16px/1 var(--sans);
}
.turn-copy { display: flex; align-items: center; justify-content: center; gap: 8px; }
.clock {
  min-width: 37px;
  padding: 2px 5px;
  border: 1px solid #edba7780;
  border-radius: 12px;
  background: #2b2115eb;
  color: #ffdaa1;
  font-size: 10px;
  font-weight: 730;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.clock:empty { display: none; }
.clock.urgent { border-color: #df9788; color: #ffd1bc; background: #4f2c23ee; }
.btn.quiet { border-color: transparent; background: transparent; box-shadow: none; color: #d4bc99; }
.btn.quiet:not(:disabled):hover { border-color: #b392657a; background: #1e211be0; }
.secondary-row .table-note { width: auto; }
@media (max-width: 590px) {
  .table-meta-left { gap: 6px; }
  .table-meta .eyebrow { font-size: 9px; gap: 4px; }
  .table-meta .eyebrow::before { width: 9px; }
  .meta-blinds, .meta-count { padding: 3px 6px; }
  .board:has(.pot) { gap: 5px; }
  .board:has(.pot) .board-label { font-size: 9px; }
  .pot { min-width: 73px; margin-bottom: 2px; padding: 3px 10px; font-size: 13px; }
  .seat-badge { min-width: 13px; min-height: 13px; top: -4px; font-size: 8px; }
  .last-action, .seat.vacant { font-size: 9px; }
  .seat.vacant { gap: 3px; padding-right: 8px; }
  .vacant .avatar { width: 20px; font-size: 13px; }
}
