/* The poker table uses the same walnut, gold and ivory as the other tables. */
:root {
  color-scheme: dark;
  font: 16px/1.5 'Segoe UI', Arial, sans-serif;
  --ink: #f4ecd7;
  --muted: #c4b99f;
  --gold: #e9be68;
  --gold-light: #f0d494;
  --line: #bc95576b;
  --panel: linear-gradient(145deg,#24271e,#151613 65%,#10110d);
  --button: linear-gradient(150deg,#2d2c24,#141914 42%,#0d100e);
  --primary: linear-gradient(135deg,#f8d990,#efbf62 46%,#c68c35);
  --paper: radial-gradient(ellipse at 35% 25%,#fffaf0,#f7eedc 57%,#e8d8b9);
  --wood: url('/table/assets/art/walnut.webp');
  --felt: url('/table/assets/art/felt.webp');
  --ornament: url('/table/assets/art/table-ornament.svg');
  --card-back: url('/table/assets/art/card-back.svg');
  --blue-felt: linear-gradient(#366892,#366892);
  background: #090c0a;
  color: var(--ink);
}
* { box-sizing: border-box }
body { min-height: 100dvh; margin: 0; background: linear-gradient(#090c0aee,#090c0ae8),var(--wood) center/512px }
[hidden] { display: none !important }
a { color: var(--gold-light); text-decoration: none }
a:hover { color: #ffe4a6 }
button, input, select { color: inherit; font: inherit }
button, select, input { min-width: 0; min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px }
button, select { cursor: pointer; touch-action: manipulation }
button, .icon-button {
  color: #efdcba;
  background: var(--button);
  border-color: #a590665e;
  box-shadow: inset 0 1px #f2deb328,0 3px 0 #060a07,0 5px 9px #0005;
}
button:hover:not(:disabled), .icon-button:hover { color: #ffe3a6; background: linear-gradient(150deg,#413a2a,#252b20 42%,#171d16); border-color: #d5b36b99 }
button:disabled { cursor: default; color: #a69e88; background: linear-gradient(#292c24,#161e16); border-color: #82765445; box-shadow: inset 0 1px #d8c69612,0 2px 0 #10160f }
button.primary {
  font-weight: 700;
  color: #2a1c0b;
  background: var(--primary);
  border-color: #e8c77f;
  box-shadow: inset 0 1px #fff3cc,inset 0 -2px #b2802b,0 3px 0 #68471d,0 5px 10px #0006;
  text-shadow: 0 1px #ffe6ac70;
}
button.primary:hover:not(:disabled) { color: #2a1c0b; background: linear-gradient(135deg,#ffe6ab,#f5cd7c 46%,#dda849) }
button.primary:disabled { color: #a69e88; background: linear-gradient(#292c24,#161e16); border-color: #82765445; box-shadow: inset 0 1px #d8c69612,0 2px 0 #10160f; text-shadow: none }
button.danger { color: #f9dec8; background: linear-gradient(145deg,#533129,#2d1916); border-color: #b77c61; box-shadow: inset 0 1px #e6ad8a33,0 3px #140d0a }
button.danger:hover:not(:disabled) { background: linear-gradient(145deg,#6a3a30,#3e2119) }
:focus-visible { outline: 2px solid #f0c975; outline-offset: 3px }
h1, h2, h3, p { margin: 0 }
.skip { position: absolute; z-index: 10; top: -80px; left: 12px; padding: 12px; color: #2a1c0b; background: var(--gold) }
.skip:focus { top: 12px }

.game-header { background: linear-gradient(#171910,#080b09); border-bottom: 1px solid #c79b505e; box-shadow: 0 2px 7px #0008 }
.header-inner, .game { width: min(1300px,100%); margin: auto }
.header-inner { min-height: 61px; padding: 8px 24px; display: flex; align-items: center; gap: 13px }
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--gold-light); font: 700 20px/1.05 Georgia,serif; text-shadow: 0 1px 3px #000 }
.brand img { display: block; flex: 0 0 auto }
.brand small { display: block; margin-top: 3px; color: #d0ae69; text-align: center; font: 650 8px/1.1 'Segoe UI',Arial,sans-serif }
.game-label { color: #d3bc85; border-left: 1px solid #c79b5055; padding-left: 12px; font-size: 13px }
.top-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px }
.language-select { width: 49px; height: 41px; min-height: 41px; padding: 0 5px; background: #111710; color: var(--gold-light); font: 700 12px/1.2 'Segoe UI',Arial,sans-serif }
.language-select option { background: #111710; color: #f5dfb5 }
.icon-button { position: relative; display: grid; place-items: center; width: 42px; height: 41px; min-height: 41px; padding: 0; border: 1px solid #aa85465e; border-radius: 9px }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.unread { position: absolute; top: -4px; right: -4px; padding: 0 4px; border: 1px solid #efc780; border-radius: 12px; color: #24140c; background: #f0cb7b; font: 700 10px/15px 'Segoe UI',Arial,sans-serif }

.setup { max-width: 880px; margin: 35px auto; padding: 0 22px }
.back-link { display: inline-block; font-size: 14px; text-underline-offset: 4px }
.back-link:hover { text-decoration: underline }
.intro {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  padding: 27px 31px;
  overflow: hidden;
  border: 1px solid #c59d5b88;
  border-radius: 17px;
  background-image: radial-gradient(ellipse at 50% 36%,#397fb62b,#071831b8),var(--blue-felt),var(--felt);
  background-blend-mode: normal,color,normal;
  background-size: 100% 100%,100% 100%,440px 440px;
  background-color: #12335a;
  box-shadow: inset 0 1px #e6c37670,0 6px 20px #0007;
}
.intro::before { position: absolute; z-index: -1; inset: 4px; content: ''; pointer-events: none; background: var(--ornament) left top/120px no-repeat; opacity: .46 }
.intro h1 { margin-bottom: 11px; color: #f8ecd0; font: 700 clamp(34px,6vw,58px)/1.05 Georgia,serif; text-shadow: 0 2px 4px #0008 }
.intro p { color: #f0e5cb; text-shadow: 0 1px 3px #07172c }
.poker-crest { position: relative; flex: 0 0 138px; height: 111px }
.poker-crest span {
  position: absolute;
  width: 69px;
  height: 101px;
  border: 1px solid #e4d0a9;
  border-radius: 7px;
  background: url('/table/assets/art/face-spades-14.webp') center/100% 100% no-repeat,var(--paper);
  box-shadow: 0 7px 16px #0008;
  transform: rotate(-16deg);
}
.poker-crest span + span { top: 8px; left: 53px; transform: rotate(13deg); background-image: url('/table/assets/art/face-hearts-13.webp'),var(--paper) }
.panel, dialog { border: 1px solid var(--line); background: var(--panel); box-shadow: inset 0 1px #f6dfa11f,0 5px 17px #0005 }
.variants { min-width: 0; margin: 25px 0; padding: 14px; border-radius: 13px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px }
.variants legend { padding: 0 8px; color: #eeddb5; font-size: 17px; font-weight: 650 }
.variants label { display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 12px; border: 1px solid #ab8b4d45; border-radius: 9px; background: #161814 }
.variants label:has(input:checked) { color: #ffe2a3; border-color: #c9a259; background: linear-gradient(#4b4229,#29261b) }
.variants label:focus-within { outline: 2px solid #f0c975; outline-offset: 2px }
.variants input { min-height: 0; accent-color: #e9be68; margin: 0; flex: 0 0 auto }
.variants strong, .variants small { display: block }
.variants small { margin-top: 3px; color: var(--muted); font-size: 13px }
.setup-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px }
.setup-actions button { min-height: 51px }
.credits { margin-top: 15px; color: var(--muted); font-size: 13px }
.setup-rules { margin-top: 12px }

.game { padding: 15px 22px 28px }
.table-heading { margin-bottom: 12px }
.table-heading h1 { color: #f4dfaf; font: 700 clamp(24px,3vw,33px)/1.14 Georgia,serif }
.table-heading p { color: var(--muted); font-size: 13px; margin-top: 4px }
.table-frame {
  padding: 9px;
  border: 1px solid #be965a9e;
  border-radius: 19px;
  background: linear-gradient(90deg,#0005,transparent 22%,#0003 70%,#0009),var(--wood) center/512px;
  box-shadow: inset 0 1px #ebca7a,inset 0 3px #65451f,inset 0 4px #d5a85588,0 9px 25px #0008;
}
.felt {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 444px;
  padding: 15px clamp(12px,4vw,52px) 16px;
  border: 1px solid #c4974880;
  border-radius: 11px;
  background-color: #123560;
  background-image: radial-gradient(ellipse at 50% 36%,#397fb628,#071831ab),var(--blue-felt),var(--felt);
  background-blend-mode: normal,color,normal;
  background-size: 100% 100%,100% 100%,440px 440px;
  box-shadow: inset 0 0 0 1px #ad885236,inset 0 0 15px 5px #061426d9;
}
.felt::before,.felt::after { content: ''; position: absolute; z-index: -1; width: 120px; height: 120px; pointer-events: none; opacity: .63; background: var(--ornament) center/contain no-repeat }
.felt::before { top: 3px; left: 3px }
.felt::after { right: 3px; bottom: 3px; transform: rotate(180deg) }
.opponents { display: flex; align-items: flex-start; justify-content: center; flex-wrap: wrap; gap: 9px; padding: 0; margin: 0; list-style: none }
.seat { min-width: 116px; max-width: 205px; padding: 6px 9px; text-align: center; color: var(--ink); border: 1px solid #b9915077; border-radius: 9px; background: #111712ec; box-shadow: inset 0 1px #e6ce9226,0 2px 4px #0006 }
.seat.current { border-color: #f0cc7e; box-shadow: 0 0 0 1px #e7c87b80,0 3px 7px #0007 }
.seat.folded { opacity: .72 }
.seat-name { font-size: 14px; font-weight: 650; text-overflow: ellipsis; overflow: hidden; white-space: nowrap }
.seat-stack { font-variant-numeric: tabular-nums; font-size: 13px; color: #f0d494 }
.seat-detail { min-height: 16px; font-size: 11px; color: var(--muted); margin: 2px 0 }
.dealer { display: inline-grid; place-content: center; width: 18px; height: 18px; margin-left: 5px; vertical-align: 1px; border: 1px solid #e8c77f; border-radius: 50%; color: #2a1c0b; background: var(--primary); font: 700 10px/1 Arial,sans-serif }
.center-table { align-self: center; padding: 2px 0; text-align: center }
.stage { display: inline-block; padding: 4px 12px; border: 1px solid #bc95575e; border-radius: 20px; color: #f3d99c; background: #0d1511ed; box-shadow: 0 2px 6px #0005; font-size: 12px; font-weight: 650 }
.table-action { min-height: 19px; margin-top: 3px; color: #f3e6c9; font-size: 12px; text-shadow: 0 1px 3px #0008 }
.table-cards,.hand { display: flex; align-items: center; justify-content: center; gap: 7px }
.table-cards { min-height: 102px; margin: 8px 0 10px }
.table-cards:empty { display: none }
.card {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: clamp(42px,5.6vw,70px);
  min-height: 0;
  aspect-ratio: 192 / 280;
  padding: 0;
  border: 1px solid #dfcda9;
  border-radius: 6px;
  color: #131b18;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px #fff7de99,inset 0 -1px 2px #a1834c50,0 1px 0 #b7a586,0 3px 6px #0006;
  font: 700 clamp(11px,1.4vw,17px)/.92 Georgia,serif;
}
.card.red { color: #b82320 }
button.card:hover:not(:disabled) { color: #131b18; background: var(--paper); border-color: #d9b674 }
button.card.red:hover:not(:disabled) { color: #b82320 }
.card.back { background: #151a16 var(--card-back) center/100% 100% no-repeat; border-color: #ecdbb9; box-shadow: inset 0 0 0 1px #b99150,0 2px 5px #0009 }
.card-face-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: inherit }
.card-index { position: absolute; top: 6%; left: 8%; text-align: center }
.card-index.end { inset: auto 8% 6% auto; transform: rotate(180deg) }
.card-index small { display: block; margin-top: .14em; font-size: .85em }
.card-pip { position: absolute; left: var(--pip-x); top: var(--pip-y); transform: translate(-50%,-50%); font-size: 1.27em }
.card-pip.inverted { transform: translate(-50%,-50%) rotate(180deg) }
.card.slot { border: 1px dashed #d5b77a88; box-shadow: none; background: #06182c36 }
.card.selected { outline: 2px solid #f6ce77; outline-offset: 2px; transform: translateY(-3px) }
.card.dealt { animation: deal .24s ease-out both; animation-delay: calc(var(--card-index,0) * 32ms) }
@keyframes deal { from { opacity: .2; translate: 0 -11px } to { opacity: 1; translate: 0 0 } }
.opponents .hand { gap: 3px; margin-top: 4px }
.opponents .card { width: clamp(15px,2.7vw,31px); font-size: clamp(6px,1.1vw,9px); border-radius: 4px }
.your-seat { text-align: center }
.your-seat .seat { margin: 8px auto 0; max-width: 215px }
.your-seat .hand { min-height: 65px }
.pot { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 7px; border: 1px solid #bc955780; border-radius: 24px; color: #f0d494; background: #0d1511ed; box-shadow: 0 2px 6px #0005; font-size: 14px }
.chip { width: 22px; aspect-ratio: 1; border-radius: 50%; border: 3px dashed #e9c692; background: #8e3d37; box-shadow: inset 0 0 0 1px #572c23 }
.payouts { width: fit-content; max-width: 100%; margin: 9px auto 0; padding: 6px 11px 6px 28px; text-align: left; border: 1px solid #bc955760; border-radius: 8px; background: #0d1511e8; color: #eedebd; font-size: 13px }

.control-panel { display: grid; gap: 9px; margin-top: 10px; padding: 11px; border: 1px solid #d3a45366; border-radius: 11px; background: linear-gradient(#050806df,#090b08b8),var(--wood) center/512px; box-shadow: inset 0 1px #f9dc8d1f,0 3px 8px #0005 }
.status { min-height: 23px; text-align: center; color: #f3e6c9 }
.actions,.bet-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px }
.actions:empty { display: none }
.bet-form label { color: var(--muted); font-size: 13px }
.bet-form input { width: 86px }
input:not([type=radio]), dialog select { color: #f5ead0; background: #090f0c; border-color: #aa894b66 }
.error { padding: 8px 12px; color: #ffe0cf; background: #45251e; border: 1px solid #a46551; border-radius: 8px; overflow-wrap: anywhere }
main > .error { width: min(820px,94%); margin: 0 auto 15px }
dialog { width: min(490px,calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 20px; overflow: auto; color: var(--ink); border-radius: 14px; border-color: #c29c58a3; box-shadow: inset 0 1px #ffe3a529,0 12px 32px #0009 }
dialog::backdrop { background: #020704ce }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; padding-bottom: 10px; border-bottom: 1px solid #bc95574d }
.dialog-header h2 { color: #f0dfba; font: 700 clamp(20px,4vw,25px)/1.15 Georgia,serif }
.close-dialog { flex-shrink: 0; min-height: 37px; padding: 4px 9px; font-size: 13px }
dialog label { display: block; margin: 2px 0 5px; color: #e4d2ad }
dialog input,dialog select { width: 100% }
#mode-form { display: grid; gap: 12px }
#mode-submit,#copy-invite { width: 100%; margin-top: 5px }
#copy-status { margin-top: 8px; color: var(--muted) }
#public-tables { display: grid; gap: 7px; margin: 7px 0 }
#public-tables button { width: 100%; text-align: left }
.messages { min-height: 150px; max-height: 295px; overflow: auto; overflow-wrap: anywhere; display: grid; align-content: start; gap: 7px; padding: 8px; border: 1px solid #ab8b4d45; border-radius: 8px; background: #161814 }
.messages p { padding: 4px 7px; color: #e9dfc9 }
.messages strong { color: #e9c783 }
.chat-form { display: flex; gap: 7px; margin-top: 10px }
.chat-form input { flex: 1; width: 0 }
.chat-form button { flex: 0 0 auto }
.leave-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px }

@media (max-width: 620px) {
  .header-inner { min-height: 55px; gap: 7px; padding: 6px 10px }
  .brand { min-width: 0; flex: 0 1 auto; font-size: 15px; gap: 5px }
  .brand img { width: 24px; height: 24px }
  .brand small { font-size: 6px }
  .game-label { display: none }
  .top-actions { flex-shrink: 0; gap: 4px }
  .language-select { width: 46px; height: 36px; min-height: 36px; padding-inline: 3px; font-size: 11px }
  .icon-button { width: 33px; height: 36px; min-height: 36px }
  .icon-button svg { width: 19px; height: 19px }
  .setup { margin: 20px auto; padding: 0 14px }
  .intro { padding: 17px 16px; gap: 8px }
  .intro p { font-size: 14px }
  .poker-crest { flex-basis: 75px; height: 72px }
  .poker-crest span { width: 39px; height: 57px }
  .poker-crest span + span { left: 30px }
  .variants { gap: 7px; margin: 17px 0; padding: 8px }
  .variants label { padding: 8px 5px; font-size: 13px; gap: 4px }
  .variants small { font-size: 11px }
  .setup-actions { grid-template-columns: 1fr 1fr; gap: 8px }
  .setup-actions .primary { grid-column: 1 / -1 }
  .game { padding: 8px 8px calc(13px + env(safe-area-inset-bottom)) }
  .table-heading { margin-bottom: 7px }
  .table-frame { padding: 5px; border-radius: 12px }
  .felt { min-height: 290px; padding: 8px 5px; gap: 7px; border-radius: 7px }
  .felt::before,.felt::after { width: 75px; height: 75px }
  .opponents { gap: 4px }
  .opponents .seat { min-width: min(85px,30%); max-width: 32%; padding: 4px }
  .opponents .hand { gap: 2px }
  .seat-name,.seat-stack { font-size: 11px }
  .seat-detail { min-height: 12px; margin: 1px 0; font-size: 10px; line-height: 1.2 }
  .table-cards { min-height: 61px; margin: 4px 0 6px; gap: 4px }
  .your-seat .hand { min-height: 61px }
  .your-seat .seat { margin-top: 5px; padding: 3px 6px }
  .payouts { font-size: 11px }
  .control-panel { margin-top: 7px; padding: 7px; gap: 6px }
  .status { min-height: 19px; font-size: 13px }
  .actions,.bet-form { gap: 6px }
  .actions button,.bet-form button { padding: 5px 8px; font-size: 13px }
  .bet-form input { width: 61px; padding: 5px }
}
@media (max-width: 355px) {
  .header-inner { padding: 6px 7px }
  .top-actions { gap: 3px }
  .icon-button { width: 29px }
  .brand img { width: 20px; height: 20px }
  .brand { font-size: 11.5px }
  .opponents .card { width: 14px }
  .opponents .hand { gap: 1px }
}
@media (prefers-reduced-motion: reduce) { .card.dealt { animation: none } }
