/* Hand recording/replay owns its layout, including card sprite sizes. */
/* The site's sticky navigation uses 2000; recorder dialogs must cover it. */
.hand-history-app .modal { z-index: 2050; }
.hand-history-app .table-container { margin-top: 90px; margin-bottom: 80px; }
.hand-history-app .table-container .players-container { border: 0; }
.hand-navigation { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hand-navigation nav { flex: 1; min-width: 0; }
.hand-history-app .hand-navigation #breadcrumb { margin-bottom: 0; }
.hand-help-toggle { flex: 0 0 44px; width: 44px; height: 44px; color: #fff; }
.hand-help-panel { margin: 0 auto 12px; max-width: 720px; padding: 12px; border: 1px solid #52616d; border-radius: 8px; background: #192127; text-align: left; font-size: 13px; line-height: 1.5; }
.hand-help-panel [data-help-draft-status]:empty { display: none; }
.hand-help-panel p:last-child { margin-bottom: 0; }
#handDraftStatus.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.hand-history-app .table-container .player-container { width: 116px !important; height: auto !important; min-height: 108px; gap: 3px !important; padding: 6px !important; font-size: 13px; }
.hand-history-app .table-container .player-container > .hero-badge { position: static !important; transform: none !important; word-spacing: normal; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.hand-history-app .table-container .player-container .card-wrapper { width: 48px; height: 69.6px; flex: 0 0 48px; }
.hand-history-app .table-container .player-container .card-sprite { transform-origin: top left; transform: scale(.8) translateX(calc(-1 * var(--x, 0px))); }
.hand-history-app .table-container .player-container .card-img { width: 48px; height: 69.6px; object-fit: contain; }
.hand-history-app .table-container .card-sprite { height: 87px !important; width: auto !important; }
.hand-seat-cards, .hand-seat-activation {
  border: 0; padding: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit;
}
.hand-seat-cards { width: 100%; min-height: 44px; cursor: pointer; }
.hand-seat-activation { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; }
.hand-seat-activation i { font-size: .85em; }
.hand-seat-detail { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hand-history-app [data-seat-selection] .player-container { cursor: pointer; }
.hand-history-app [data-seat-selection] [data-folded="true"] .hand-seat-cards { filter: grayscale(.9) brightness(.8); }
.hand-history-app :is([data-seat-selection] button, .hand-seat-cards):focus-visible { outline: 2px solid #f3cd76; outline-offset: 2px; }
.hand-history-app[data-unified-actions] .player-container .actions { display: none; }
.hand-history-app .hand-current-player { outline: 3px solid #f3cd76; outline-offset: 3px; }
.hand-history-app .player-container .action-label { min-height: 0; font-size: 12px; line-height: 1.25; }
.hand-history-app .player-container .action-label:empty,.hand-history-app .player-container span[id^="stack-"]:empty { display: none; }
.hand-history-app .hand-street-controls { margin: 0 auto 24px; padding: 12px; max-width: 620px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; background: #192127; border: 1px solid #3c4b56; border-radius: 12px; }
.hand-action-panel { flex: 0 0 100%; min-width: 0; }
.hand-action-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.hand-action-heading [data-hand-actor] { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.hand-shortcut-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #bac6cf; }
.hand-action-buttons { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.hand-action-buttons button { min-height: 44px; font-size: 16px; font-weight: 600; }
.hand-action-buttons kbd,.hand-quick-history kbd { margin-left: 8px; background: #0003; color: inherit; font-size: 11px; }
.hand-action-panel[data-complete="true"] .hand-action-buttons { display: none; }
.hand-raise-presets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 14px 0 8px; }
.hand-raise-presets .btn { min-height: 44px; }
#raiseModal .modal-dialog { max-width: 460px; }
#raiseModal .modal-content { width: 100%; margin: 0; padding: 0; text-align: left; }
#raiseModal .modal-body { flex: none; }
#raiseModal .form-text { display: block; color: #bdcad4 !important; font-size: 12px; line-height: 1.4; margin-top: 8px; }
#raiseModal [hidden] { display: none !important; }
#raiseModal input { min-height: 44px; font-size: 18px; }
#raiseModal .modal-footer > .d-flex { flex-wrap: wrap; gap: 8px; }
#raiseModal .modal-footer .ms-auto { margin-left: 0 !important; flex: 1; }
#raiseModal #allinBtn { margin-left: 0 !important; }
@media (max-width: 920px) {
  .hand-history-app { padding-bottom: 170px; }
  .hand-history-app #breadcrumb { flex-wrap: nowrap; margin-bottom: 10px; }
  .hand-history-app #breadcrumb .btn { min-height: 36px; font-size: 12px; padding: 6px 14px; }
  .hand-history-app #breadcrumb .btn::before,.hand-history-app #breadcrumb .btn::after { display: none; }
  .hand-history-app .step-section > .position-relative > h2 { line-height: 1.4; margin: 8px 0; }
  .hand-history-app .step-section > .position-relative > .btn-group { display: flex; flex-wrap: nowrap; justify-content: center; }
  .hand-history-app .step-section > .position-relative > .btn-group .btn { min-height: 36px; font-size: 11px; padding: 4px 6px; }
  .hand-history-app > .position-relative > .btn-group { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hand-history-app > .position-relative > .btn-group .btn { min-width: 0; white-space: normal; overflow-wrap: anywhere; padding: 5px; font-size: 11px; }
  .hand-history-app.hand-history-app .table-container {
    --seat-width: clamp(76px,23vw,86px);
    display: block; width: 100%; max-width: 460px; height: 440px !important;
    padding: 0; margin: 14px auto 20px; border: 5px solid #eed09d;
    border-radius: 42% / 25%; background: radial-gradient(circle,#00a74d 60%,#007f0e 100%);
  }
  .hand-history-app .table-container .players-container { display: block; position: absolute; inset: 0; transform: none; width: 100%; height: 100%; pointer-events: none; }
  .hand-history-app .table-container .player-container {
    position: absolute; width: var(--seat-width) !important; min-height: 86px; height: auto !important;
    left: calc(4px + var(--seat-x,.5) * (100% - var(--seat-width) - 8px));
    top: calc(12px + var(--seat-y,.5) * (100% - 24px));
    transform: translateY(calc(-100% * var(--seat-y,.5)));
    padding: 3px !important; gap: 2px !important; font-size: 11px;
    background: #343a40; border: 1px solid #68737d; box-shadow: 0 2px 6px #0004;
  }
  .hand-history-app .table-container .player-container .card-wrapper { width: 28px; height: 40.6px; flex: 0 0 28px; }
  .hand-history-app .table-container .player-container .card-sprite { transform: scale(.466666667) translateX(calc(-1 * var(--x,0px))); }
  .hand-history-app .table-container .player-container .card-img { width: 28px; height: 40.6px; }
  .hand-history-app .table-container .player-container .hero-badge { font-size: 10px; padding: 1px 3px; }
  .hand-history-app .table-container .player-container .action-label { font-size: 10px; }
  .hand-history-app [data-seat-selection] .hand-seat-controls .btn { min-height: 30px; min-width: 0; padding: 3px 5px; font-size: 11px; }
  .hand-history-app [data-seat-selection] .hand-seat-controls { margin-top: 3px !important; }
  .hand-history-app .table-container .community-container,
  .hand-history-app #step-1 .table-container > .position-absolute {
    position: absolute !important; top: 50% !important; left: 50% !important;
    transform: translate(-50%,-50%) !important; inset: auto;
    width: calc(100% - 2 * var(--seat-width) - 24px); max-width: 250px;
    display: flex; flex-direction: column; align-items: center; gap: 8px !important;
  }
  .hand-history-app #step-1 .table-container > .position-absolute .btn { min-height: 44px; width: 100%; font-size: 12px; padding: 6px; }
  .hand-history-app #gameSettingsDisplay { font-size: 11px; overflow-wrap: anywhere; }
  .hand-history-app .table-container .community-container .card-wrapper { width: 30px; height: 43.5px; flex: 0 0 30px; }
  .hand-history-app .table-container .community-container .card-sprite { transform-origin: top left; transform: scale(.5) translateX(calc(-1 * var(--x,0px))); }
  .hand-history-app .table-container .community-container .card-img { width: 30px; height: 43.5px; }
  .hand-history-app .table-container .community-cards,.hand-history-app .community-container [id^="board"] { flex-wrap: wrap; gap: 3px !important; justify-content: center; width: 100%; max-width: 100%; min-width: 0; }
  .hand-history-app .community-container [id^="divPot"],.hand-history-app .community-container .bg-dark { font-size: 12px; padding: 6px !important; border: 1px solid #ffffff24; width: 100%; }
  .hand-history-app .community-container br { display: block; }
  .hand-history-app #step-1 .table-container + .container-result,
  .hand-history-app #step-2 .table-container + .container-result { margin-top: 8px; }
  .hand-history-app .hand-street-controls { position: fixed; z-index: 1020; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 500px; margin: 0; border-radius: 14px 14px 0 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px #0005; }
  .hand-action-heading { font-size: 13px; }
  .hand-shortcut-toggle,.hand-street-controls kbd { display: none; }
  .hand-action-buttons { gap: 6px; }
  .hand-action-buttons button { font-size: 15px; }
  .hand-history-app .hand-street-controls > .btn { min-height: 44px; font-size: 12px; padding: 6px 10px; margin: 0 !important; }
  .hand-history-app #controls { display: flex; justify-content: center; gap: 6px; }
  .hand-history-app #timeline { max-width: 100%; overflow-x: auto; }
  #raiseModal .modal-dialog { margin: 8px; }
  #raiseModal .modal-body { padding: 14px; }
  #raiseModal .modal-footer { padding: 12px; }
}

/* Four suits per rank, at the same readable size on desktop and phones. */
#cardSelectorModal .modal-dialog { max-width: 420px; margin: 8px auto; padding: 0 8px; }
#cardSelectorModal .modal-content { width: 100%; margin: 0; padding: 0; max-height: calc(100svh - 16px); }
#cardSelectorModal .modal-header { flex: 0 0 auto; padding: 12px; }
#cardSelectorModal .modal-title { font-size: 18px; }
#cardSelectorModal .hand-card-grid { display: grid; grid-template-columns: repeat(4,60px); justify-content: center; gap: 8px; padding: 12px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
#cardSelectorModal .hand-card-grid .card-wrapper { width: 60px; height: 87px; margin: 0; }
#cardSelectorModal .hand-card-grid .card-wrapper:hover { transform: none; }
#cardSelectorModal .hand-card-grid .card-sprite { width: auto !important; height: 87px !important; transform: translateX(calc(-1 * var(--x,0px))); }
#cardSelectorModal [data-card="reverse"] { grid-column: 1 / -1; justify-self: center; }

#cardSelectorModal .disabled-card {
  cursor: not-allowed !important;
  opacity: .3;
}

.hand-history-app .inactive-player {
  filter: grayscale(100%) brightness(0.85);
}

.hand-history-app .inactive-player:hover {
  filter: grayscale(80%) brightness(0.95);
  cursor: pointer;
}

.hand-history-app .player-visual.inactive-player {
  opacity: 0.1;
}

.range-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  grid-auto-rows: minmax(24px, auto);
  gap: 2px;
}

.range-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(8px, 2.2vw, 10px);
  background: #343a40;
  color: var(--bs-white);
  cursor: pointer;
  border-radius: 4px;
}

.range-cell.pair-cell {
  background: var(--bs-dark);
}

.range-cell.suited-cell {
  background: var(--bs-secondary);
}

.range-cell.offsuit-cell {
  background: var(--bs-dark-border-subtle);
  color: var(--bs-dark);
}

.range-cell.selected {
  background: var(--bs-primary);
  color: var(--bs-white);
}

#cardSelectorModal .hand-card-grid button {
  position: relative; padding: 0; background: #29363d; border: 0; border-radius: 6px; overflow: hidden;
}
#cardSelectorModal .card-wrapper:focus-visible { outline-offset: -2px; }
