.poker-lobby { max-width: 700px; }
.poker-lobby .poker-heading { margin: 0 0 11px; }
.poker-lobby .poker-heading h2 { font-size: clamp(24px, 5.7vw, 37px); }
.poker-lobby .poker-heading p { margin-top: 5px; font-size: 12px; }
.poker-create {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px;
  padding: clamp(10px, 2.4vw, 17px);
  border: 1px solid #d5b57850;
  border-radius: 15px;
  background: radial-gradient(ellipse at 68% 0, #235043, transparent 80%), #111f1c;
}
.poker-create label { display: grid; gap: 4px; font-size: 11px; font-weight: 700; color: #e9eee2; }
.poker-create select {
  width: 100%;
  min-width: 0;
  min-height: 41px;
  padding: 6px;
  font: inherit;
  font-size: 13px;
  color: #f7f4ec;
  color-scheme: dark;
  background: #0c211c;
  border: 1px solid #9db8a251;
  border-radius: 8px;
}
.poker-create .poker-primary { min-height: 41px; padding: 8px 14px; white-space: nowrap; }
.poker-lobby-status { margin: 12px 0 7px; color: #cbd9cf; font-size: 13px; }
.poker-room-list { display: grid; gap: 6px; }
.poker-room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 54px;
  padding: 6px 9px;
  border: 1px solid var(--poker-line);
  border-radius: 10px;
  background: #101c1b;
}
.poker-room-row strong { display: block; font-size: 14px; }
.poker-room-row small { display: block; margin-top: 3px; color: #bacbc2; font-size: 11px; }
.poker-room-row button { min-height: 38px; padding-inline: 9px; color: #ffe2aa; }
.poker-room-row button:disabled { opacity: .48; }
.poker-practice { margin-top: 10px; min-height: 40px; }
.poker-auto { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 7px; color: #cbd9cf; font-size: 12px; }
.poker-auto input { accent-color: var(--poker-brass); }

body[data-casino-screen="poker-online"] { overflow: hidden; }
body[data-casino-screen="poker-online"] .top,
body[data-casino-screen="poker-online"] .bottom-nav { display: none; }
.poker-online {
  --poker-card-width: clamp(35px, 11vw, 57px);
  --poker-safe-top: env(safe-area-inset-top, 0px);
  --poker-safe-right: env(safe-area-inset-right, 0px);
  --poker-safe-bottom: env(safe-area-inset-bottom, 0px);
  --poker-safe-left: env(safe-area-inset-left, 0px);
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(var(--poker-shell-angle, 180deg), var(--casino-chrome), transparent 70px),
    radial-gradient(ellipse at 50% 49%, #173631, #0b1420 63%, #080c17);
  animation: none;
}
.poker-online[data-rotated] {
  --poker-shell-angle: 90deg;
  --poker-safe-top: env(safe-area-inset-right, 0px);
  --poker-safe-right: env(safe-area-inset-bottom, 0px);
  --poker-safe-bottom: env(safe-area-inset-left, 0px);
  --poker-safe-left: env(safe-area-inset-top, 0px);
  width: 100vh;
  width: 100dvh;
  height: 100vw;
  transform: translateX(100vw) rotate(90deg);
  transform-origin: top left;
}
.poker-surface {
  display: grid;
  grid-template-rows: minmax(285px, 1fr) auto;
  gap: 5px;
  width: min(100%, 480px);
  height: 100%;
  max-height: 880px;
  margin: 0 auto;
  padding: max(8px, var(--poker-safe-top)) max(10px, var(--poker-safe-right))
    max(9px, var(--poker-safe-bottom)) max(10px, var(--poker-safe-left));
}
.poker-table-entry, .poker-table-tools {
  position: absolute;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
}
.poker-table-entry { left: 0; }
.poker-table-tools { right: 0; }
.poker-table-back, .poker-table-sound { width: 34px; height: 34px; }
.poker-table-sound { font-size: 15px; }
.poker-table-sound[aria-pressed="true"] { border-color: #e6bc6c80; }
.poker-table-tools > .ghost-btn { min-height: 34px; padding: 4px 8px; color: #e9dac1; }
.poker-orientation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--poker-line);
  border-radius: 9px;
  background: #0a161c;
}
.poker-orientation button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b7c8bf;
}
.poker-orientation [aria-pressed="true"] { color: #1b221a; background: var(--poker-brass); }
.poker-device { display: block; width: 11px; height: 16px; border: 1.5px solid currentColor; border-radius: 3px; }
.poker-device.landscape { transform: rotate(90deg); }
.poker-online :focus-visible { outline: 2px solid #fff4d8; outline-offset: 2px; }
.poker-online-table { position: relative; isolation: isolate; min-height: 0; }
.poker-online-felt {
  position: absolute;
  z-index: -1;
  inset: 6% 6% 4%;
  padding: 0;
  border-radius: 45% / 30%;
}
.poker-online .poker-center {
  position: absolute;
  top: 48%;
  left: 50%;
  width: min(100%, 365px);
  gap: 7px;
  transform: translate(-50%, -50%);
}
.poker-online .poker-bank { min-width: 82px; padding: 3px 11px 3px 6px; gap: 7px; }
.poker-online .poker-bank-total > span { white-space: nowrap; }
.poker-online .poker-shoe { right: 22%; width: clamp(18px, 5vw, 26px); }
.poker-opponents { position: absolute; inset: 0; }
.poker-opponent {
  position: absolute;
  left: var(--seat-x);
  top: var(--seat-y);
  display: grid;
  justify-items: center;
  gap: 2px;
  width: clamp(52px, 16vw, 78px);
  padding: 4px 1px 5px;
  min-width: 0;
  border: 1px solid #aeb79953;
  border-radius: 9px;
  background: linear-gradient(160deg, #163129, #071c19);
  box-shadow: inset 0 1px 0 #c6e7c01d, 0 5px 8px #0007;
  color: #d3ddc2;
  font-size: clamp(9px, 2.6vw, 12px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  transform: translate(-50%, -50%);
}
.poker-opponent strong { color: #f3eedb; white-space: nowrap; letter-spacing: -.025em; }
.poker-opponent:nth-child(1) { --seat-x: 12%; --seat-y: 66%; --avatar-ink: #384967; }
.poker-opponent:nth-child(2) { --seat-x: 13%; --seat-y: 29%; --avatar-ink: #684035; }
.poker-opponent:nth-child(3) { --seat-x: 50%; --seat-y: 10%; --avatar-ink: #3c5a48; }
.poker-opponent:nth-child(4) { --seat-x: 87%; --seat-y: 29%; --avatar-ink: #624160; }
.poker-opponent:nth-child(5) { --seat-x: 88%; --seat-y: 66%; --avatar-ink: #67424e; }
.poker-avatar {
  display: grid;
  place-items: center;
  width: clamp(19px, 5.6vw, 26px);
  aspect-ratio: 1;
  border: 1px solid #f4d18e88;
  border-radius: 50%;
  color: #ffe4a8;
  background: radial-gradient(circle at 30% 20%, #ffffff33, transparent 66%), var(--avatar-ink, #3c5a48);
  font: 700 clamp(11px, 3vw, 14px)/1 Georgia, serif;
}
.poker-avatar-own { --avatar-ink: #6a532d; grid-row: 1 / span 3; align-self: center; }
.poker-online .poker-seat-own {
  position: absolute;
  top: 87%;
  left: 50%;
  width: min(100%, 370px);
  transform: translate(-50%, -50%);
}
.poker-seat-own .poker-seat-info {
  grid-template-columns: auto auto;
  gap: 2px 4px;
  align-items: center;
  padding: 4px;
}
.poker-opponent-turn, .poker-online-self-active { border-color: #e6bc6c; box-shadow: 0 0 12px #f4ce7338; }
.poker-opponent-win, .poker-online-self-win { border-color: #fbdb98; box-shadow: 0 0 15px #f9d38263; }
.poker-opponent-fold { opacity: .63; }
.poker-opponent-empty { opacity: .66; }
.poker-opponent .poker-cards { --poker-card-width: clamp(13px, 4.2vw, 23px); gap: 2px; }
.poker-opponent .poker-card { border-radius: 3px; }
.poker-opponent .poker-card-corner { font-size: clamp(6px, 1.7vw, 9px); }
.poker-opponent .poker-card-pip { font-size: clamp(8px, 2.4vw, 15px); }
.poker-opponent .poker-card-back { font-size: clamp(9px, 2.5vw, 14px); box-shadow: inset 0 0 0 1px #e7c68665; }
.poker-opponent .poker-card-best { outline-width: 1px; outline-offset: 0; }
.poker-online .poker-controls {
  position: relative;
  width: min(100%, 410px);
  margin: 0 auto;
  padding: 3px 5px 4px;
  border-radius: 10px;
  background: #0c2020;
}
.poker-online .poker-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  margin: 0 1px 3px;
}
.poker-turn-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 6px; min-width: 0; }
.poker-online #online-status { font-size: 12px; }
.poker-online #online-timer { font-size: 11px; white-space: nowrap; }
.poker-online .poker-actions { gap: 4px; grid-template-columns: .72fr 1fr 1.05fr .95fr; }
.poker-online .poker-actions button { min-height: 34px; padding: 3px; border-radius: 7px; font-size: 11px; }
.poker-online [data-poker-move="fold"] { color: #ecc3bd; background: #452c31; }
.poker-online [data-poker-move="call"], .poker-online [data-poker-move="check"] { color: #d7eddf; background: #235041; }
.poker-online .poker-all-in { color: #f7ded1; background: #792d38; border-color: #d1717b89; font-weight: 800; }
.poker-online .poker-your-turn { border-color: #e6bc6ca8; box-shadow: 0 0 15px #e6bc6c28; }
.poker-online .poker-time-low #online-timer { color: #ffb1a2; font-weight: 800; }
.poker-sizing {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
  padding: 5px;
  border: 1px solid #d5b57850;
  border-radius: 7px;
  background: #122a26;
}
.poker-size-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.poker-size-presets button {
  min-height: 25px;
  padding: 2px;
  border: 1px solid #9db8a251;
  border-radius: 5px;
  color: #f9e6be;
  background: #0c211c;
  font-size: 10px;
}
.poker-size-inputs { display: grid; grid-template-columns: minmax(0, 1fr) clamp(47px, 16%, 64px) auto; align-items: center; gap: 4px; }
.poker-size-inputs input { margin: 0; min-width: 0; width: 100%; font: inherit; }
.poker-size-inputs input[type="range"] { accent-color: var(--poker-brass); }
.poker-size-inputs input[type="number"] {
  min-height: 29px;
  padding: 2px 3px;
  border: 1px solid #9db8a251;
  border-radius: 5px;
  background: #0a1c17;
  color: white;
  text-align: center;
  font-size: 12px;
}
.poker-size-inputs .poker-primary { min-height: 29px; padding: 3px 6px; border-radius: 6px; font-size: 11px; letter-spacing: 0; }
.poker-turn-info .poker-last-move { color: #b7c8bf; font-size: 10px; font-weight: 500; }
.poker-last-move:empty { display: none; }
.poker-online-notice, .poker-online-rules > div {
  position: absolute;
  right: 5px;
  bottom: calc(100% + 6px);
  z-index: 6;
  width: min(94%, 340px);
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #d5b57882;
  border-radius: 10px;
  color: #f7eedc;
  background: #152524;
  box-shadow: 0 8px 18px #0008;
  font-size: 12px;
}
.poker-online-rules > div p + p { margin-top: 7px; }
.poker-online-rules .poker-online-meta { color: var(--poker-brass); }
.poker-online-rules summary {
  display: grid;
  place-items: center;
  list-style: none;
  width: 21px;
  height: 21px;
  border: 1px solid var(--poker-line);
  border-radius: 50%;
  color: var(--poker-brass);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.poker-online-rules summary::-webkit-details-marker { display: none; }

.poker-online[data-layout="landscape"] {
  --poker-card-width: clamp(30px, 11vh, 60px);
}
.poker-online[data-rotated] { --poker-card-width: clamp(30px, 11vw, 60px); }
.poker-online[data-layout="landscape"] .poker-surface {
  width: min(100%, 930px);
  max-height: 720px;
  grid-template-rows: minmax(150px, 1fr) auto;
  gap: 3px;
  container-type: inline-size;
}
.poker-online[data-layout="landscape"] .poker-online-felt { inset: 7% 9% 5%; border-radius: 28% / 48%; }
.poker-online[data-layout="landscape"] .poker-center {
  top: 48%;
  width: min(77%, 520px);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
}
.poker-online[data-layout="landscape"] .poker-bank { grid-column: 1; grid-row: 1; justify-self: end; min-width: 0; }
.poker-online[data-layout="landscape"] .poker-board { grid-column: 2; grid-row: 1; }
.poker-online[data-layout="landscape"] .poker-shoe {
  position: relative;
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  inset: auto;
  margin-left: 6px;
}
.poker-online[data-layout="landscape"] .poker-card-corner { font-size: max(6px, calc(var(--poker-card-width) * .32)); }
.poker-online[data-layout="landscape"] .poker-card-pip { font-size: max(8px, calc(var(--poker-card-width) * .57)); }
.poker-online[data-layout="landscape"] .poker-cards .poker-card-back { font-size: max(8px, calc(var(--poker-card-width) * .45)); }
.poker-online[data-layout="landscape"] .poker-opponent {
  width: 106px;
  padding: 4px;
  gap: 1px 3px;
  grid-template-areas: "avatar name cards" "avatar stack cards";
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-items: start;
  align-items: center;
  font-size: 10px;
}
.poker-online[data-layout="landscape"] .poker-opponent .poker-avatar { grid-area: avatar; }
.poker-online[data-layout="landscape"] .poker-opponent strong { grid-area: name; }
.poker-online[data-layout="landscape"] .poker-opponent > span:not(.poker-avatar) { grid-area: stack; }
.poker-online[data-layout="landscape"] .poker-opponent .poker-cards { grid-area: cards; }
.poker-online[data-layout="landscape"] .poker-avatar { width: 18px; font-size: 11px; }
.poker-online[data-layout="landscape"] .poker-opponent .poker-cards { --poker-card-width: 14px; }
.poker-online[data-layout="landscape"] .poker-opponent:nth-child(1) { --seat-x: 23%; --seat-y: 79%; }
.poker-online[data-layout="landscape"] .poker-opponent:nth-child(2) { --seat-x: 13%; --seat-y: 42%; }
.poker-online[data-layout="landscape"] .poker-opponent:nth-child(3) { --seat-x: 50%; --seat-y: 14%; }
.poker-online[data-layout="landscape"] .poker-opponent:nth-child(4) { --seat-x: 87%; --seat-y: 42%; }
.poker-online[data-layout="landscape"] .poker-opponent:nth-child(5) { --seat-x: 77%; --seat-y: 79%; }
.poker-online[data-layout="landscape"] .poker-seat-own { top: 84%; width: min(46%, 340px); }
@container (max-width: 700px) {
  .poker-online[data-layout="landscape"] .poker-opponent:nth-child(2),
  .poker-online[data-layout="landscape"] .poker-opponent:nth-child(4) { --seat-y: 31%; }
  .poker-online[data-layout="landscape"] .poker-opponent:nth-child(2) { --seat-x: 11%; }
  .poker-online[data-layout="landscape"] .poker-opponent:nth-child(4) { --seat-x: 89%; }
}

@media (min-width: 800px) and (min-height: 520px) {
  .poker-online[data-layout="landscape"] .poker-online-table {
    container-type: size;
  }
  .poker-online[data-layout="landscape"] .poker-center,
  .poker-online[data-layout="landscape"] .poker-seat-own {
    --poker-card-width: clamp(72px, min(10.3cqw, 19cqh), 104px);
  }
  .poker-online[data-layout="landscape"] .poker-center { width: min(84%, 730px); }
  .poker-online[data-layout="landscape"] .poker-seat-own { top: 82%; }
  .poker-online[data-layout="landscape"] .poker-opponent { width: 116px; }
  .poker-online[data-layout="landscape"] .poker-opponent .poker-cards { --poker-card-width: 18px; }
  .poker-online[data-layout="landscape"] .poker-opponent:nth-child(1) { --seat-x: 20%; }
  .poker-online[data-layout="landscape"] .poker-opponent:nth-child(2),
  .poker-online[data-layout="landscape"] .poker-opponent:nth-child(4) { --seat-y: 32%; }
  .poker-online[data-layout="landscape"] .poker-opponent:nth-child(5) { --seat-x: 80%; }
}

@media (max-width: 520px) {
  .poker-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .poker-create button { grid-column: 1 / -1; }
  body[data-casino-screen^="poker"] main { padding-inline: 12px; }
}
