/* ═══════════════════════════════════════════════════════════════
   Hand History Replayer — replayer.css
   All styles are namespaced under .hhr-* or .profile-hhr-*
   to avoid conflicts with existing game CSS.
   ═══════════════════════════════════════════════════════════════ */

/* ── Modal shell ────────────────────────────────────────────── */
.hhr-modal {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
}
.hhr-modal.hidden { display: none; }

.hhr-overlay {
  display: none; /* Full-screen — no dimmed backdrop needed */
}

.hhr-dialog {
  position: relative;
  z-index: 1;
  background: #0e1118;
  border: none;
  border-radius: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
}

/* ── Header ─────────────────────────────────────────────────── */
.hhr-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem 0.6rem 1.1rem;
  background: #080a0e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.hhr-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.hhr-title-text {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  flex-shrink: 0;
}

.hhr-hand-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-light, #e8c87a);
  background: rgba(200, 148, 74, 0.12);
  border: 1px solid rgba(200, 148, 74, 0.28);
  border-radius: 20px;
  padding: 0.1rem 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.hhr-meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.28);
  font-family: var(--font-mono, 'Courier New', monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.hhr-hand-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.hhr-hand-nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, color 0.12s;
}
.hhr-hand-nav-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.85);
}
.hhr-hand-nav-btn:disabled { opacity: 0.3; cursor: default; }

.hhr-hand-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  font-feature-settings: 'tnum';
  min-width: 52px;
  text-align: center;
}

.hhr-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.hhr-close:hover { color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.07); }

/* ── Body: log panel + felt ─────────────────────────────────── */
.hhr-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* ── Action log ─────────────────────────────────────────────── */
.hhr-log-panel {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  background: #0a0c10;
}

.hhr-log-title {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  padding: 0.5rem 0.75rem 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hhr-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.4rem 0;
  scrollbar-width: thin;
  scrollbar-color: #1a2440 transparent;
}
.hhr-log::-webkit-scrollbar { width: 4px; }
.hhr-log::-webkit-scrollbar-thumb { background: #252c3e; border-radius: 4px; }

.hhr-log-item {
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.38);
  padding: 0.2rem 0.75rem;
  transition: background 0.1s;
}

.hhr-log-item--current {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(200, 148, 74, 0.1);
  border-left: 2px solid rgba(200, 148, 74, 0.7);
  padding-left: calc(0.75rem - 2px);
}

.hhr-log-item--street {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(200, 148, 74, 0.65);
  margin-top: 0.3rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hhr-log-item--result {
  color: #4ade80;
  font-weight: 700;
  margin-top: 0.3rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Felt / table area ──────────────────────────────────────── */
.hhr-felt {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  /* minmax(0,1fr) allows rows to shrink below min-content when space is tight.
     Player content packs away from center so labels are always visible. */
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  padding: 0.5rem 1.5rem 0.65rem;
  position: relative;
  background: radial-gradient(ellipse at center, #1a1c22 0%, #0c0e11 80%);
  overflow: hidden; /* contain chip towers — never bleed into nav bar */
}

/* ── Player seats ───────────────────────────────────────────── */
.hhr-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* opp: pack toward top; me (reverse): pack toward bottom */
  gap: 6px;
  width: 100%;
}

.hhr-seat--opp {
  flex-direction: column;
  /* content packs toward top: seat-info → cards → bet (bet nearest center) */
}

.hhr-seat--me {
  flex-direction: column;
  /* DOM order is [bet, cards, seat-info].
     flex-end pushes them to the bottom: bet stays at top (nearest center),
     cards in middle, seat-info locked to bottom above nav bar. */
  justify-content: flex-end;
}

.hhr-seat--folded {
  opacity: 0.42;
  filter: saturate(0.25);
}

.hhr-seat-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(160deg, rgba(22, 24, 30, 0.97) 0%, rgba(14, 16, 22, 0.97) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
  min-width: 160px;
  transition: border-color 0.15s;
}

.hhr-dealer-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fff 0%, #d8d8d8 60%, #bbb 100%);
  color: #111;
  font-size: 0.68rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 0 2px #c8944a, 0 0 0 4px rgba(200, 148, 74, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.6);
  user-select: none;
}

.hhr-dealer-btn.hidden {
  display: none;
}

.hhr-seat-info--active {
  border-color: rgba(200, 148, 74, 0.85) !important;
  animation: hhrActiveBreathe 2s ease-in-out infinite;
}

@keyframes hhrActiveBreathe {
  0%, 100% {
    background: linear-gradient(160deg, rgba(22, 30, 44, 0.98) 0%, rgba(14, 19, 30, 0.98) 100%);
    box-shadow:
      0 0 0 1px rgba(200, 148, 74, 0.25),
      0 0 10px rgba(200, 148, 74, 0.20),
      0 0 24px rgba(200, 148, 74, 0.08),
      0 4px 18px rgba(0, 0, 0, 0.6);
  }
  50% {
    background: linear-gradient(160deg, rgba(36, 26, 14, 0.98) 0%, rgba(26, 18, 8, 0.98) 100%);
    box-shadow:
      0 0 0 1px rgba(200, 148, 74, 0.70),
      0 0 16px rgba(200, 148, 74, 0.55),
      0 0 40px rgba(200, 148, 74, 0.22),
      0 0 64px rgba(200, 148, 74, 0.08),
      0 4px 18px rgba(0, 0, 0, 0.6);
  }
}

.hhr-seat-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary, #c9d1d9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.hhr-seat-stack {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--gold-light, #e8c87a);
  font-family: var(--font-mono, 'Courier New', monospace);
  letter-spacing: 0.3px;
  white-space: nowrap;
  margin-left: auto;
}

.hhr-seat-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
  line-height: 1.5;
}

.hhr-seat-badge.sb {
  background: #3a3010;
  border: 1px solid #a07020;
  color: #d4a030;
}

.hhr-seat-badge.bb {
  background: #102030;
  border: 1px solid #206890;
  color: #40a0d0;
}

.hhr-seat-badge.btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
}

.hhr-seat-badge.winner {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

/* ── Hole card rows ─────────────────────────────────────────── */
.hhr-seat-cards {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 98px; /* matches overridden card height below */
}

/* Hole cards — portrait orientation with proper 5:7 ratio */
.hhr-seat-cards .card {
  width: 70px;
  height: 98px;
}

/* Community cards — same portrait ratio, slightly wider */
.hhr-community .card,
.hhr-community .card.lg {
  width: 80px;
  height: 112px;
}

/* ── Bet amounts ────────────────────────────────────────────── */
.hhr-bet {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 26px;
}

.hhr-bet-amount {
  font-size: 1rem;
  font-weight: 900;
  color: var(--gold-light, #e8c87a);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 0.25rem 0.9rem;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 4px rgba(0,0,0,1);
  white-space: nowrap;
  font-feature-settings: 'tnum';
}

@keyframes hhrBetSlam {
  0%   { transform: scale(1.22); }
  48%  { transform: scale(0.96); }
  74%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.hhr-bet-amount--flash {
  animation: hhrBetSlam 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Check action label — same pill shape, muted style */
.hhr-bet-check {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  text-shadow: none;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── Center area: community + pot ───────────────────────────── */
.hhr-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.4rem 0;
}

.hhr-community {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hhr-pot-area {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  min-height: 26px;
}

.hhr-pot-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

.hhr-pot-amount {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--gold-light, #e8c87a);
  font-feature-settings: 'tnum';
}

.hhr-pot-area.hhr-pot-area--empty {
  opacity: 0;
  pointer-events: none;
}

.hhr-street-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

/* ── Result overlay ─────────────────────────────────────────── */
.hhr-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);  /* centered over the community card area */
  background: rgba(10, 18, 10, 0.92);
  border: 1px solid rgba(74, 222, 128, 0.45);
  border-radius: 10px;
  padding: 0.45rem 1.1rem;
  white-space: nowrap;
  z-index: 5;
  pointer-events: none;
}
.hhr-result.hidden { display: none; }

.hhr-result-text {
  font-size: 0.88rem;
  font-weight: 800;
  color: #4ade80;
  letter-spacing: 0.02em;
}

/* ── Navigation bar ─────────────────────────────────────────── */
.hhr-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: #080a0e;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Street jump buttons */
.hhr-street-btns {
  display: flex;
  gap: 4px;
}

.hhr-street-btn {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.38);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  white-space: nowrap;
}
.hhr-street-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.75);
}
.hhr-street-btn.active {
  border-color: rgba(200, 148, 74, 0.55);
  color: var(--gold-light, #e8c87a);
  background: rgba(200, 148, 74, 0.1);
}
.hhr-street-btn:disabled { opacity: 0.25; cursor: default; }

/* Step navigation */
.hhr-step-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hhr-step-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, color 0.12s;
}
.hhr-step-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.9);
}
.hhr-step-btn:disabled { opacity: 0.25; cursor: default; }

.hhr-step-counter {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.38);
  font-feature-settings: 'tnum';
  min-width: 54px;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── Keyboard hint ──────────────────────────────────────────── */
.hhr-kbd-hint {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.03em;
}

/* ── Profile: upload entry point ────────────────────────────── */
.profile-hhr-section {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-hhr-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hhr-upload-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.hhr-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  background: rgba(200, 148, 74, 0.08);
  border: 1px solid rgba(200, 148, 74, 0.28);
  border-radius: 8px;
  color: var(--gold-light, #e8c87a);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
  white-space: nowrap;
}
.hhr-upload-label:hover {
  background: rgba(200, 148, 74, 0.15);
  border-color: rgba(200, 148, 74, 0.5);
}
.hhr-upload-label .material-symbols-rounded {
  font-size: 1rem;
  line-height: 1;
}
/* Smaller secondary variant used in the profile section */
.hhr-upload-label--sm {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.32rem 0.65rem;
  background: rgba(200, 148, 74, 0.05);
  border-color: rgba(200, 148, 74, 0.18);
  color: var(--text-muted, #8aa0b4);
  border-radius: 6px;
}
.hhr-upload-label--sm .material-symbols-rounded { font-size: 0.85rem; }

.hhr-upload-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.hhr-upload-info.hidden { display: none; }

.hhr-upload-filename {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.btn-hhr-open {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, var(--gold, #c8944a) 0%, #e8a040 100%);
  border: none;
  border-radius: 7px;
  color: #1a0e00;
  cursor: pointer;
  transition: filter 0.14s, transform 0.1s;
  white-space: nowrap;
}
.btn-hhr-open:hover { filter: brightness(1.1); }
.btn-hhr-open:active { transform: translateY(1px); filter: brightness(0.95); }
.btn-hhr-open:disabled { opacity: 0.4; cursor: default; filter: none; transform: none; }

.hhr-upload-hint {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.28);
  line-height: 1.4;
}

/* ── Panel views (inside log panel) ─────────────────────────── */
.hhr-panel-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.hhr-panel-view--hidden {
  display: none;
}

/* ── Session hands list ─────────────────────────────────────── */
.hhr-hand-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.3rem 0;
  scrollbar-width: thin;
  scrollbar-color: #1a2440 transparent;
}
.hhr-hand-list::-webkit-scrollbar { width: 4px; }
.hhr-hand-list::-webkit-scrollbar-thumb { background: #252c3e; border-radius: 4px; }

.hhr-hand-list-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.hhr-hand-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.hhr-hand-list-item.hhr-hli--active {
  background: rgba(200, 148, 74, 0.1);
  border-left-color: rgba(200, 148, 74, 0.7);
  padding-left: calc(0.75rem - 2px);
}

.hhr-hli-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  font-feature-settings: 'tnum';
  white-space: nowrap;
  min-width: 30px;
}
.hhr-hli-blind {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono, 'Courier New', monospace);
  flex: 1;
  white-space: nowrap;
}
.hhr-hli-street {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.28);
  min-width: 18px;
  text-align: right;
}

.hhr-hli-result {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  min-width: 14px;
  text-align: right;
}
.hhr-hli-result--win  { color: #4ade80; }
.hhr-hli-result--lose { color: rgba(255, 88, 88, 0.75); }

/* ── Log view header (back btn + hand title) ─────────────────── */
.hhr-log-view-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: #080a0e;
}

.hhr-back-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.45);
  border-radius: 5px;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, color 0.12s;
}
.hhr-back-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.85);
}

.hhr-log-view-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-light, #e8c87a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Play / pause button ─────────────────────────────────────── */
.hhr-play-btn {
  margin-left: 4px;
  border-color: rgba(200, 148, 74, 0.25) !important;
  color: rgba(200, 148, 74, 0.65) !important;
}
.hhr-play-btn:hover:not(:disabled) {
  border-color: rgba(200, 148, 74, 0.6) !important;
  color: var(--gold-light, #e8c87a) !important;
}
.hhr-play-active {
  border-color: rgba(200, 148, 74, 0.5) !important;
  color: var(--gold-light, #e8c87a) !important;
  background: rgba(200, 148, 74, 0.1) !important;
}

/* ── Responsive: narrow screens ─────────────────────────────── */
@media (max-width: 640px) {
  .hhr-log-panel {
    display: none; /* hide log on very small screens to save space */
  }
  .hhr-meta { display: none; }
  .hhr-felt { padding: 0.75rem 0.5rem 0.5rem; }
  .hhr-nav { padding: 0.4rem 0.6rem; }
  .hhr-seat-info { min-width: auto; }
}

/* ── Responsive: large / wide screens ───────────────────────── */
/* Tier 1: tall viewport (laptop/desktop browser, not maximised) */
@media (min-height: 700px) and (min-width: 900px) {
  .hhr-seat-cards .card        { width: 82px;  height: 115px; }
  .hhr-community .card,
  .hhr-community .card.lg      { width: 96px;  height: 134px; }
  .hhr-seat-cards              { gap: 8px; min-height: 115px; }
  .hhr-community               { gap: 8px; }
  .hhr-seat-info               { min-width: 180px; padding: 0.45rem 0.9rem; }
  .hhr-seat-name               { font-size: 0.9rem; max-width: 150px; }
  .hhr-seat-stack              { font-size: 0.96rem; }
  .hhr-felt                    { padding: 0.8rem 2rem 0.9rem; }
  .hhr-center                  { gap: 0.7rem; }
  .hhr-pot-amount              { font-size: 1rem; }
}

/* Tier 2: full-screen / maximised desktop */
@media (min-height: 860px) and (min-width: 1200px) {
  .hhr-seat-cards .card        { width: 100px; height: 140px; }
  .hhr-community .card,
  .hhr-community .card.lg      { width: 116px; height: 162px; }
  .hhr-seat-cards              { gap: 10px; min-height: 140px; }
  .hhr-community               { gap: 10px; }
  .hhr-seat-info               { min-width: 210px; padding: 0.5rem 1rem; }
  .hhr-seat-name               { font-size: 1rem; max-width: 170px; }
  .hhr-seat-stack              { font-size: 1.1rem; }
  .hhr-felt                    { padding: 1rem 2.5rem 1.1rem; }
  .hhr-center                  { gap: 0.85rem; }
  .hhr-pot-amount              { font-size: 1.15rem; }
}

/* ── Stats button in replayer header ──────────────────────────── */
.hhr-stats-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.80);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  margin-right: 6px;
}
.hhr-stats-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ── Stats button in profile section ──────────────────────────── */
.btn-hhr-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.65rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.80);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  justify-content: center;
}
.btn-hhr-stats .material-symbols-rounded { font-size: 1.1rem; }
.btn-hhr-stats:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

/* ── Stats Modal ────────────────────────────────────────────────── */
.czs-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.czs-modal.hidden { display: none; }

.czs-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.czs-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(14, 16, 22, 0.99) 0%, rgba(8, 10, 16, 0.99) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.czs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.czs-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.czs-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}
.czs-close:hover { color: #fff; }

.czs-body {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 0.5rem;
}

/* ── Panel 1: KPI strip ─────────────────────────────────────────── */
.czs-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.czs-kpi-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 0.5rem 0.9rem;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  gap: 0.2rem;
}
.czs-kpi-card:last-child { border-right: none; }

.czs-kpi-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: #fff;
  font-feature-settings: 'tnum';
  line-height: 1;
  letter-spacing: -0.02em;
}

.czs-kpi-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.czs-kpi--pos .czs-kpi-value { color: #4ade80; }
.czs-kpi--neg .czs-kpi-value { color: #f87171; }

/* ── Panel 2: Equity curve ──────────────────────────────────────── */
.czs-chart-wrap {
  padding: 0.9rem 1.2rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.czs-chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.czs-chart-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.40);
}

.czs-chart-sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  font-feature-settings: 'tnum';
}

.czs-pos { color: #4ade80; }
.czs-neg { color: #f87171; }

.czs-svg {
  display: block;
  width: 100%;
  height: 88px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.czs-chart-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.30);
  font-size: 0.78rem;
  padding: 1rem 0 0.2rem;
}

/* ── Panel 3: Stats grid ────────────────────────────────────────── */
.czs-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.czs-stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 0.15rem;
}
.czs-stat-cell:nth-child(3n) { border-right: none; }
.czs-stat-cell:nth-child(n+4) { border-bottom: none; }

.czs-stat-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  font-feature-settings: 'tnum';
}

.czs-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Footer elements ────────────────────────────────────────────── */
.czs-cap-msg {
  margin: 0.75rem 1.2rem 0.6rem;
  padding: 0.65rem 0.9rem;
  background: rgba(200, 148, 74, 0.10);
  border: 1px solid rgba(200, 148, 74, 0.30);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.80);
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.4;
}
.czs-cap-msg strong { color: #c8944a; }

.czs-hint {
  margin: 0.55rem 1.2rem 0.5rem;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.72rem;
  text-align: center;
}

.czs-empty {
  padding: 2.5rem 1.5rem;
  color: rgba(255, 255, 255, 0.40);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.6;
}

.czs-load-more-btn {
  display: block;
  width: calc(100% - 2.4rem);
  margin: 0.75rem 1.2rem 0.6rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.60);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.czs-load-more-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

/* Narrow screens: 2-col KPI + 2-col stat grid */
@media (max-width: 420px) {
  .czs-kpi-row      { grid-template-columns: repeat(2, 1fr); }
  .czs-kpi-card:nth-child(2n) { border-right: none; }
  .czs-kpi-card:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.07); }
  .czs-kpi-value    { font-size: 1.35rem; }
  .czs-stat-grid    { grid-template-columns: repeat(2, 1fr); }
  .czs-stat-cell:nth-child(3n)   { border-right: 1px solid rgba(255,255,255,0.06); }
  .czs-stat-cell:nth-child(2n)   { border-right: none; }
  .czs-stat-cell:nth-child(n+4)  { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .czs-stat-cell:nth-child(n+5)  { border-bottom: none; }
}
