/* Material, type and interaction shared by the lobby and both tables. */
:root {
  --ground: #151b19;
  --surface: #202923;
  --raised: #2b342e;
  --ink: #f4eedf;
  --dim: #bbc2b6;
  --line: #414b41;
  --gold: #edce91;
  --brass: #af905f;
  --wood: #dfb57c;
  --woodline: #785936;
}
body { font-variant-numeric: tabular-nums; }
.mast { background: #131916; border-color: #384037; }
.topbar { height: 64px; }
.topbar .toplink + .toplink { border-inline-start: 1px solid var(--line); padding-inline-start: 18px; }
.toplink { font-size: 14px; }
.eyeline,.step,.kind,.round-heading { font-weight: 650; }
h1,h2,.game-choice strong,.round-limit strong { text-wrap: balance; }
h1 { font-size: clamp(36px,4vw,58px); }
.btn { border-radius: 4px; padding-inline: 18px; }
.btn.primary { background: #e7c88e; border-color: #eed5a4; box-shadow: inset 0 -2px #b79861; }
.btn.primary:not(:disabled):hover { background: #f1d8a8; }
.btn:disabled { opacity: .52; }
.btn:not(.primary):not(:disabled):hover { border-color: var(--brass); }
.btn:focus-visible,.toplink:focus-visible,.game-choice:focus-visible,.room-row:focus-visible { outline-offset: 3px; }
.pagehead { margin-bottom: 22px; }
.pagehead .sub { font-size: 15px; line-height: 1.6; }
.game-choices { gap: 16px; }
.game-choice {
  min-height: clamp(170px,16.6vw,236px);
  padding: clamp(18px,2.8vw,38px); border-radius: 5px;
  background: #251f18; border-color: #685336;
}
.game-choice.hit { background: #14241d; border-color: #405447; }
.game-art {
  position: absolute; right: 0; top: 0; height: 100%; width: 78%;
  object-fit: cover; object-position: 64% 48%; pointer-events: none;
  mask-image: linear-gradient(90deg,transparent,black 48%);
  transition: scale 360ms ease-out; transform-origin: 84% 52%;
}
.game-choice.hit .game-art { width: 71%; object-position: 64% 48%; }
.game-choice strong { color: #fff4de; font-size: clamp(32px,3.35vw,49px); line-height: 1.14; margin: 11px 0 16px; }
.game-choice .kind { color: #ebd9b7; letter-spacing: .02em; }
.game-choice .intent { color: #f3e8cd; gap: 10px; }
.game-choice[aria-pressed="true"] { outline-width: 2px; }
.game-choice[aria-pressed="true"] .intent { color: white; font-weight: 650; }
.roomlist { margin-top: clamp(24px,3vw,42px); }
.roomlist .section-top { gap: 8px; }
.room-tools { display: flex; align-items: center; gap: clamp(10px,2vw,26px); }
.room-tools .link { white-space: nowrap; }
.room-tools .btn.link { padding: 0; border: 0; }
.refreshbtn[aria-disabled="true"] { color: var(--dim); cursor: progress; }
.count { font: 540 20px/1.1 Georgia,serif; }
.section-top { border-color: #807d66; }
.list-head { color: #aeb6a9; }
.room-row { min-height: 65px; }
.room-row .n { color: #dedccf; }
.room-row:disabled strong,.room-row:disabled .game-txt { color: #a5ad9e; }
.empty { background: var(--surface); border-color: var(--line); }
.empty p { color: var(--dim); }
.foot { font-size: 12px; }
dialog { background: #202822; border-color: #776e55; border-radius: 7px; box-shadow: 0 16px 65px #0007; }
dialog::backdrop { background: rgb(9 14 11 / 82%); }
.field input,.coord input,.stake input,.amount-card input,.field select,.coord select {
  background: #141c17; border-color: #65705f; border-radius: 4px;
}
.choice-set label:has(input:checked) { background: #343427; color: #fae1ad; }
.tabs { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.rulescopy li { padding-inline-start: .3em; margin-block: 10px; line-height: 1.65; }
.rulescopy li::marker { color: var(--gold); font-weight: 600; }
.sound-option { display: flex; min-height: 74px; gap: 16px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); cursor: pointer; }
.sound-option strong,.sound-option small { display: block; }
.sound-option small { color: var(--dim); margin-top: 3px; font-size: 13px; }
.sound-option input {
  appearance: none; cursor: pointer; flex: 0 0 42px; height: 24px; border-radius: 14px;
  padding: 3px; border: 1px solid #768274; background: #141b17;
}
.sound-option input::before { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: #c1c3b4; }
.sound-option input:checked { background: var(--gold); border-color: var(--gold); }
.sound-option input:checked::before { transform: translateX(17px); background: #312a1e; }
.sound-option input:focus-visible { outline-offset: 4px; }
.wait-seats li { grid-template-columns: minmax(0,1fr); background: #232d26; border-color: #586052; }
.wait-seats li.empty-seat { border: 1px dashed #515b4e; }
.wait-seats li img { width: 56px; height: 56px; }
.wait-seats li b { max-width: 100%; padding-inline: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-seats li:has(small) { border-color: var(--brass); }
.code-display,#room-code { letter-spacing: .13em; font-family: var(--num); }
#room-code { text-transform: uppercase; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.code-display { font-size: 25px; color: var(--gold); }
.scoreline { font-variant-numeric: tabular-nums; }
.scoreline:first-of-type,.result .scoreline:first-of-type b { color: var(--gold); }

/* Keep the board nearly square and the identity/control column aligned to its edge. */
.omok-grid,.poker-layout { max-width: 1130px; margin-inline: auto; }
.omok-grid { grid-template-columns: minmax(0,1.46fr) minmax(280px,1fr); gap: clamp(26px,4vw,70px); }
.omok-grid .paper-table {
  width: min(100%, max(460px,calc(100svh - 218px))); justify-self: center;
  padding: 12px clamp(15px,2vw,28px) 20px;
  background: var(--wood) url('../../assets/materials/timber.webp') repeat;
  background-blend-mode: soft-light; border-color: #e9c38b;
  border-bottom: 4px solid #a67b4b; box-shadow: 0 4px 10px #0a0d0938;
}
.board-toolbar { margin-bottom: 7px; }
.board-coordinates { width: calc(100% - 22px); max-width: none; }
.board { background: transparent; outline: none; }
.grid-row:is(:nth-child(4),:nth-child(10),:nth-child(16)) .cell:is(:nth-child(4),:nth-child(10),:nth-child(16)) {
  background-image: radial-gradient(circle,#5e452c 0 1.9px,transparent 2.4px);
}
.cell.landed { outline: 1px solid #6e4323; outline-offset: -1px; }
.cell img { filter: drop-shadow(0 1px 1px #5b411d55); }
.cell.winning { z-index: 2; }
.cell.winning:not(:focus-visible) { outline: 0; }
.cell .win-halo {
  inset: -40%; z-index: 0; border: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle,#fff5d5 28%,#fff0b3 41%,#ffd063d9 53%,#ffc35000 72%);
}
.cell.winning img { filter: drop-shadow(0 0 1px #fff8d9) drop-shadow(0 0 3px #ffe486); }
.point-side,.move-panel { border-top-color: #a4895d; }
.point-action>p:not(.field-error) { color: var(--dim); font-size: 15px; line-height: 1.6; }
.point-player.is-selector .player-id strong { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.point-player.is-selector .player-avatar { filter: drop-shadow(0 0 3px #f4d391); }
.bid-budget { margin: 0 0 12px; background: #343327; padding: 12px 14px; }
.stake { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); gap: 5px; }
.stake label { gap: 5px; font-size: 14px; }
.stake input { width: 100%; padding: 9px 11px; font: 650 21px var(--num); }
.bid-tab {
  align-self: end; margin-bottom: 3px; padding: 3px 4px;
  border: 1px solid #869082; border-bottom-width: 2px; border-radius: 3px;
  background: #26302c; color: var(--dim); font: 600 10px/1 var(--sans);
}
html:has(.omok-grid) { scrollbar-gutter: stable; }
.point-action>.btn.primary { margin-top: 12px; }
.point-keyguide { padding-block: 12px 3px; }
.point-action .fact b { text-align: end; }

/* Table centre, hand and action choices each have their own reading distance. */
.poker-layout { grid-template-columns: minmax(0,1.65fr) minmax(262px,1fr); gap: clamp(24px,4vw,64px); }
.poker-stage { max-width: min(690px,max(430px,calc(100svh - 186px))); }
.felt-ring {
  inset: 5.8%; background: #284438 url('../../assets/materials/baize.webp') repeat;
  background-blend-mode: soft-light; border-color: #544333;
  box-shadow: inset 0 0 0 1px #ad936b, inset 0 2px 9px #141e1770,0 3px 7px #0b100d66;
}
.poker-seat .identity-name b { font-weight: 650; }
.first-mark { line-height: 1.4; padding: 0 5px; background: #252721; color: #ffa392; }
.hc { color: #28291e; background-color: #f1e6c9; font-family: Georgia,var(--serif); font-size: clamp(14px,3.55cqw,24px); }
.hc.card-back {
  background-color: #34463d; border-color: #ad9975; color: #d4c59f;
  background-image: repeating-linear-gradient(44deg,transparent 0 3px,#b0a3822a 3px 4px),repeating-linear-gradient(-44deg,transparent 0 3px,#b0a3822a 3px 4px);
  box-shadow: inset 0 0 0 2px #344239; font-size: 10px;
}
.hc.private { background-color: #cbd3c4; }
.hc.public { border-bottom: 3px solid #41624c; }
.seat-money { gap: 10px; }
.seat-money>.chip-value { font-family: var(--num); }
.chip-value i,.flying-chip { background: #976844; border-color: #f3dab1; box-shadow: inset 0 0 0 1px #59442c,0 1px 0 #684525; }
.pot-label { display: inline-flex; align-items: center; gap: 7px; color: #ebe6d6; }
.round-limit strong { font-family: Georgia,var(--serif); font-size: clamp(32px,9.7cqw,74px); font-weight: 650; }
.table-clock { font: 550 clamp(17px,4.1cqw,29px)/1.2 var(--num); color: #f0eedf; }
.table-clock.urgent { color: #ffc2a3; }
.round-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; color: var(--gold); font-size: 13px; }
.move-panel p { line-height: 1.6; font-size: 15px; }
.own-sum { align-items: baseline; justify-content: start; gap: 9px; margin-top: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.own-sum b { font: 600 27px/1.15 Georgia,var(--serif); }
.own-sum small { margin-inline-start: auto; color: #e3d6b6; font-size: 13px; }
.own-sum .over { color: #f4b49f; }
.move-options { gap: 8px; }
.move-card,.amount-card { flex: 1 1 0; background: #253029; min-height: 76px; padding-inline: 9px; }
.move-card small { font: 500 13px/1.2 var(--sans); }
.draw-options .move-card { align-items: start; padding-left: 17px; font: 650 26px/1.1 Georgia,var(--serif); }
.move-card.hit { border-color: #a27060; }.move-card.stay { border-color: #658d72; }
.move-card.pick-card { background: #efe3c6; color: #302c22; border: 1px solid #ccb68e; box-shadow: inset 0 -3px #cbb793; }
.move-card.pick-card:enabled:hover { background: #fff2d6; }
.pick-card b { font: 600 29px/1 Georgia,var(--serif); }
.amount-card { flex: 1.35 1 0; min-width: 86px; }
.amount-card label { display: flex; align-items: center; gap: 4px; }
.amount-card input { min-height: 44px; width: 47px; padding-inline: 4px; color: var(--ink); }
.amount-card .move-card { min-height: 44px; background: #39412f; }
.rankings { background: #23372d; border-radius: 3px; font-variant-numeric: tabular-nums; }
.rankings .round-limit strong { font-size: clamp(28px,7.25cqw,52px); }
.rankings .rank-row { align-items: baseline; font-variant-numeric: tabular-nums; }
.rank-row>span { flex: 1; text-align: start; }
.rank-row>b,.rank-row>small { min-width: 2.4ch; text-align: end; }
.rank-row .gain { color: #b6dcba; }.rank-row .loss { color: #e9b7a6; }.rank-row .even { color: var(--dim); }
.rank-row.my-rank>span { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.show-seat.winner { background: #36382a; box-shadow: inset 3px 0 var(--gold); }
.show-seat:not(.winner) { border-bottom-color: var(--line); }
.show-seat .prize { white-space: nowrap; }
.bag-button:focus-visible { outline: 0; }
.bag-button:enabled:is(:hover,:focus-visible) .bag-shape { filter: drop-shadow(0 0 4px #eed6a4af) brightness(1.1); }
.bag-claim { display: grid; justify-items: center; grid-template-rows: auto 16px; width: 100%; gap: 2px; }
.bag-claim .identity,.bag-claim .identity-text,.bag-claim .identity-name { min-width: 0; max-width: 100%; }
.bag-claim .identity { flex-wrap: nowrap; }
.bag-claim .identity-name b { overflow: hidden; text-overflow: ellipsis; }
.bag-accepted { color: var(--gold); font-size: clamp(9px,1.7vw,12px); white-space: nowrap; }
.bag-preview { opacity: 0; pointer-events: none; }
.bag-button:enabled:focus-visible + .bag-preview { opacity: .42; }
@media (hover:hover) {
  .bag-button:enabled:hover + .bag-preview { opacity: .42; }
}
.lottery { max-width: 920px; margin-inline: auto; }
.lot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.bag-clock { display: inline-flex; gap: 8px; align-items: baseline; color: var(--dim); font-size: 13px; }
.bag-clock .table-clock { font-size: 22px; color: var(--gold); }
.bag-clock .urgent { color: #ffc2a3; }
.bag-station { gap: 6px; }
.bag-row { min-height: clamp(144px,20vw,230px); }
#connection-state:not(:empty) { margin: 0; padding: 8px 12px; text-align: center; color: var(--ink); background: #604532; }
#connection-state:empty { display: none; }
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .game-choice:hover .game-art { scale: 1.025; }
  .room-row:not(:disabled):hover .go { transform: translateX(3px); }
  .room-row .go { transition: transform .15s ease; }
}
@media (prefers-reduced-motion:no-preference) {
  .bag-preview { transition: opacity .18s ease; }
  .bag-claim.just-claimed { animation: bag-claim-in .24s ease-out both; }
  @keyframes bag-claim-in { from { opacity: .42; } to { opacity: 1; } }
  .cell .win-halo { animation: win-halo-in .5s ease-out both; }
  @keyframes win-halo-in { from { opacity: .2; scale: .75; } to { opacity: 1; scale: 1; } }
  .refreshbtn[aria-disabled="true"] .refresh { animation: room-update .7s ease; }
  @keyframes room-update { to { transform: rotate(360deg); } }
  dialog[open] #sheet-body { animation: sheet-arrive .16s ease-out both; }
  .cell.landed img { animation: stone-seat .23s cubic-bezier(.16,.8,.25,1) both; }
  @keyframes sheet-arrive { from { opacity: 0; translate: 0 4px; } to { opacity: 1; translate: none; } }
  @keyframes stone-seat { from { transform: translateY(-16%) scale(1.14); } 70% { transform: scale(.96); } to { transform: none; } }
}
@media (max-width:900px) {
  .omok-grid { grid-template-columns: minmax(0,1.35fr) minmax(235px,1fr); gap: 22px; }
}
@media (max-width:800px) {
  .poker-layout { display: block; }
  .poker-stage { max-width: 520px; }
  .move-panel { margin: 12px auto 0; max-width: 520px; }
}
@media (max-width:680px) {
  .topbar { height: 54px; gap: 12px; }
  .topbar .toplink + .toplink { padding-inline-start: 10px; }
  .toplink { font-size: 13px; }
  .game-choices { gap: 9px; }
  .game-choice { min-height: 122px; padding: 14px 18px; }
  .game-choice strong { font-size: 29px; margin: 5px 0; }
  .game-art { width: 71%; }.game-choice.hit .game-art { width: 66%; }
  .game-choice .intent { font-size: 12px; }
  .play-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .play-head h1 { font-size: 32px; }.play-head .btn { flex-shrink: 0; }
  .play-head .sub { font-size: 13px; }
  .omok-grid { grid-template-columns: minmax(0,1fr); gap: 15px; }
  .point-head .sub { min-block-size: 3.2em; }
  .omok-grid .board-toolbar { min-height: 43px; }
  .omok-grid .paper-table { width: 100%; max-width: 520px; padding: 8px 9px 12px; }
  .board-toolbar { min-height: 36px; }
  .room-row { min-height: 62px; }
  .point-action { padding-bottom: 12px; }
  .point-players { margin-bottom: 12px; }
  .move-card { min-height: 62px; }
  .move-panel { padding-block: 10px; }
  .seat-money { gap: 4px; }
  .round-heading { margin-bottom: 4px; }
  .own-sum { margin-top: 9px; padding-block: 6px; }
  .rankings { padding-inline: 2px; }
}
@media (max-width:360px) {
  .topbar { gap: 8px; }.brand { font-size: 17px; gap: 6px; }
  .game-choice { padding-left: 14px; }
  .amount-card { min-width: 80px; }
  .omok-grid .board-toolbar { min-height: 50px; }
  .omok-grid .board-meta { display: grid; gap: 3px; }
}
@media (prefers-reduced-motion:reduce) {
  .game-choice:hover,.game-choice:active { transform: none; }
}
