/* The card room at 1400 E. 57th: door prompt, buy-in and the seated table HUD. */
.poker-door,
.poker-hud {
  --poker-paper: #f5f0e3;
  --poker-ink: #20302a;
  --poker-secondary: #56625a;
  --poker-line: #c7c9b9;
  --poker-wine: #6e3541;
  --poker-felt: #1f5a40;
  color-scheme: light;
  font: 14px/1.35 var(--sans);
  text-align: left;
}
.poker-door[hidden],
.poker-hud[hidden] {
  display: none;
}
body:has(#dialog[open]) :is(.poker-door, .poker-hud) {
  visibility: hidden;
}

/* Door prompt on the terrace */
.poker-door {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 20px;
  width: fit-content;
  max-width: min(550px, calc(100% - 24px));
  padding: 10px 13px 10px 16px;
  transform: translateX(-50%);
  border: 1px solid #677264;
  border-radius: 5px;
  box-shadow: 0 4px 18px #11221940;
  background: var(--poker-paper);
  color: var(--poker-ink);
}
.poker-door[data-view='buy'] {
  display: block;
  width: min(420px, calc(100% - 24px));
  padding: 16px 18px 14px;
}
.poker-door h2 {
  font: 400 24px/1.05 var(--serif);
}
.poker-door[data-view='buy'] h2 {
  font-size: 30px;
}
.poker-door-copy p {
  margin-top: 2px;
  color: var(--poker-secondary);
  font-size: 13px;
}
.poker-buyin {
  margin-top: 13px;
}
.poker-buyin-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
}
.poker-buyin-label strong {
  color: var(--poker-wine);
  font-size: 20px;
}
.poker-door input[type='range'],
.poker-hud input[type='range'] {
  width: 100%;
  margin: 8px 0 4px;
  accent-color: var(--poker-wine);
}
.poker-note {
  margin-top: 8px;
  color: var(--poker-secondary);
  font-size: 12.5px;
}

/* Buttons and chips */
.poker-actions,
.poker-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.poker-actions {
  margin-top: 12px;
}
.poker-presets {
  gap: 6px;
}
.poker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #8a9286;
  border-radius: 4px;
  background: #fffdf6;
  color: var(--poker-ink);
  font: 600 14px/1.1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.poker-button:hover {
  background: #fff;
  border-color: #56625a;
}
.poker-button:disabled {
  opacity: 0.55;
  cursor: default;
}
.poker-button.poker-primary {
  border-color: #233c2f;
  background: var(--poker-felt);
  color: #f6f1e3;
}
.poker-button.poker-primary:hover {
  background: #184b35;
}
.poker-button.poker-raise {
  border-color: #4f2530;
  background: var(--poker-wine);
  color: #f6f1e3;
}
.poker-button.poker-raise:hover {
  background: #5c2a35;
}
.poker-button kbd {
  padding: 1px 4px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.7;
  font: 600 11px/1.2 var(--sans);
}
.poker-chip {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--poker-line);
  border-radius: 14px;
  background: #fffdf6;
  color: var(--poker-ink);
  font: 600 12.5px/1 var(--sans);
  cursor: pointer;
}
.poker-chip:hover {
  border-color: var(--poker-wine);
  color: var(--poker-wine);
}
:is(.poker-button, .poker-chip):focus-visible {
  outline: 2px solid #c9ab6a;
  outline-offset: 2px;
}

/* Playing cards */
.poker-card {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 53px;
  border: 1px solid #c9c0ad;
  border-radius: 4px;
  background: #fbf8f0;
  box-shadow: 0 1px 3px #0003;
  color: #1b1d1f;
  font-family: Georgia, serif;
  line-height: 1;
}
.poker-card b {
  font-size: 19px;
}
.poker-card i {
  font-style: normal;
  font-size: 17px;
}
.poker-card.poker-red {
  color: #b3192d;
}
.poker-card-large {
  width: 50px;
  height: 70px;
}
.poker-card-large b {
  font-size: 25px;
}
.poker-card-large i {
  font-size: 22px;
}
.poker-card-back {
  border: 3px solid #f2ead6;
  background: repeating-linear-gradient(45deg, #7a2633 0 5px, #8d3a46 5px 8px);
}
.poker-card-slot {
  border: 1px dashed #f2ead655;
  background: #0000001f;
  box-shadow: none;
}

/* Seated HUD over the first-person table */
.poker-hud {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
  color: #f4efe0;
}
.poker-hud > * {
  pointer-events: auto;
}
.poker-top {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}
.poker-top > * {
  pointer-events: auto;
}
.poker-place {
  display: grid;
  padding: 8px 12px;
  border-radius: 4px;
  background: #142019d9;
}
.poker-place strong {
  font: 400 21px/1.05 var(--serif);
}
.poker-place span {
  color: #c9ccbd;
  font-size: 12px;
}
.poker-leave {
  min-height: 34px;
}
.poker-center {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 7px;
  transform: translateX(-50%);
  pointer-events: none;
}
.poker-pot {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 5px 12px;
  border-radius: 14px;
  background: #142019d9;
  white-space: nowrap;
}
.poker-pot span {
  color: #c9ccbd;
  font-size: 12px;
}
.poker-pot strong {
  font-size: 15px;
}
.poker-board {
  display: flex;
  gap: 5px;
}
.poker-result {
  flex-basis: 100%;
  padding-top: 9px;
  border-top: 1px solid var(--poker-line);
  color: var(--poker-wine);
  font-weight: 700;
}
.poker-seats {
  position: absolute;
  top: calc(78px + env(safe-area-inset-top));
  left: 16px;
  display: grid;
  gap: 5px;
  width: 236px;
  list-style: none;
}
.poker-seat {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 8px;
  padding: 6px 10px;
  border-left: 3px solid transparent;
  border-radius: 3px;
  background: #142019c7;
  font-size: 13px;
}
.poker-seat.poker-self {
  border-left-color: #c9ab6a;
}
.poker-seat.poker-active {
  border-left-color: #8fd3a3;
  background: #1c3527e6;
}
.poker-seat.poker-folded {
  opacity: 0.58;
}
.poker-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poker-dealer {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f6f2e6;
  color: #1b1d1f;
  font: 700 10px/1 var(--sans);
  font-style: normal;
}
.poker-stack {
  color: #e3d7b4;
  font-variant-numeric: tabular-nums;
}
.poker-bet,
.poker-status,
.poker-clock {
  color: #c9ccbd;
  font-size: 12px;
}
.poker-clock {
  grid-column: 2;
  justify-self: end;
  color: #8fd3a3;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.poker-clock.poker-short {
  color: #ff9d8a;
}
.poker-me {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 12px 16px;
  transform: translateX(-50%);
  border: 1px solid #677264;
  border-radius: 5px;
  box-shadow: 0 4px 18px #11221940;
  background: var(--poker-paper);
  color: var(--poker-ink);
}
.poker-hud[data-turn='self'] .poker-me {
  border-color: var(--poker-felt);
  box-shadow: 0 0 0 2px #1f5a4055, 0 4px 18px #11221940;
}
.poker-hole {
  display: flex;
  gap: 5px;
}
.poker-hole .poker-card-slot {
  border-color: var(--poker-line);
  background: #e7e1d0;
}
.poker-info {
  display: grid;
  min-width: 110px;
}
.poker-info strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.poker-info span,
.poker-wait {
  color: var(--poker-secondary);
  font-size: 13px;
}
.poker-controls {
  display: grid;
  gap: 8px;
}
.poker-controls .poker-actions {
  margin-top: 0;
}
.poker-sizing {
  display: flex;
  align-items: center;
  gap: 10px;
}
.poker-sizing input[type='range'] {
  width: 150px;
  margin: 0;
}
.poker-feedback {
  flex-basis: 100%;
  color: #8c2a2a;
  font-size: 13px;
  font-weight: 600;
}
.poker-result p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.poker-shown {
  display: inline-flex;
  gap: 3px;
}
.poker-card-small {
  width: 24px;
  height: 33px;
}
.poker-card-small b {
  font-size: 12px;
}
.poker-card-small i {
  font-size: 11px;
}
.poker-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Seated: the table replaces the walking HUD. */
#playScreen:has(.poker-hud:not([hidden]))
  :is(.play-top, .player-hud, #discoveryCard, .play-bottom, .mini-wrap, #nearTower, #targetChip, #coffeeHud, .sim-touch-controls) {
  display: none;
}
body.playing:has(.poker-hud:not([hidden])) #toast {
  top: calc(70px + env(safe-area-inset-top));
  bottom: auto;
}

@media (any-pointer: coarse), (max-width: 700px) {
  .poker-door {
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .poker-button {
    min-height: 44px;
  }
  .poker-button kbd {
    display: none;
  }
  .poker-chip {
    min-height: 36px;
  }
  .poker-top {
    top: calc(8px + env(safe-area-inset-top));
    left: 8px;
    right: 8px;
  }
  .poker-place span {
    display: none;
  }
  .poker-center {
    top: calc(64px + env(safe-area-inset-top));
  }
  .poker-card {
    width: 32px;
    height: 45px;
  }
  .poker-card b {
    font-size: 16px;
  }
  .poker-card i {
    font-size: 14px;
  }
  .poker-card-large {
    width: 42px;
    height: 59px;
  }
  .poker-seats {
    top: calc(146px + env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    width: auto;
    gap: 4px;
  }
  .poker-seat {
    flex: 1 1 140px;
    padding: 4px 8px;
    font-size: 12px;
  }
  .poker-me {
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: calc(100% - 16px);
    max-width: none;
    padding: 10px 12px;
    gap: 10px 12px;
  }
  .poker-controls {
    flex-basis: 100%;
  }
  .poker-controls .poker-actions .poker-button {
    flex: 1 1 0;
    padding: 0 8px;
  }
  .poker-sizing {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .poker-sizing input[type='range'] {
    width: 100%;
  }
  .poker-presets .poker-chip {
    flex: 1 1 0;
  }
}
