/* Load after eluvk.css + style.css. Keep the existing renderer/AI target IDs. */
.reserved-market-area { container: reserved-market / inline-size; }
.reserved-market-layout {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 84px;
  grid-template-rows: auto repeat(3, auto);
  gap: 6px 10px;
  align-items: stretch;
  min-width: 0;
}
.reserved-market-layout > #market,
body.mode-play .reserved-market-layout > #market {
  grid-column: 2; grid-row: 2 / 5;
  display: grid; grid-template-rows: subgrid;
  min-width: 0; height: auto; container-type: normal; gap: 6px;
  --market-gap: 4px;
  --market-card-width: min(clamp(76px, 9.5vh, 104px), calc((100% - 24px) / 6));
}
.reserved-market-layout #market .tier-row,
body.mode-play .reserved-market-layout #market .tier-row { display: grid; align-items: center; min-width: 0; margin: 0; padding: 0; }
.reserved-market-layout #market .cards-flex,
body.mode-play .reserved-market-layout #market .cards-flex { height: auto; min-width: 0; padding-block: 0; }
.reserved-zone {
  grid-row: 1 / 5; grid-column: 1;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid;
  row-gap: 6px; min-width: 0; padding: 0 5px;
  border: 0; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--border-color);
  background: var(--bg-inner);
}
.reserved-zone[data-reserved-seat="1"] { grid-column: 3; }
.reserved-zone-heading { grid-row: 1; grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 5px; min-width: 0; margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-body); }
.reserved-zone-count { white-space: nowrap; color: var(--text-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.reserved-market-layout .reserved-zone > #p0ReservedCards,
.reserved-market-layout .reserved-zone > #p1ReservedCards {
  grid-column: 1; grid-row: 2 / 5;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid;
  gap: 6px 4px; align-items: center; width: 100%; min-width: 0; min-height: 0;
}
.reserved-market-layout .reserved-zone .reserved-zone-cards > .card-item { width: min(100%, 72px); min-width: 0; height: auto; aspect-ratio: 100 / 152; margin: 0; justify-self: center; align-self: center; }
.reserved-market-layout .reserved-zone .reserved-zone-cards > .card-item:hover { transform: none; }
.reserved-zone-cards > .empty-cards-placeholder { grid-column: 1; grid-row: 1; text-align: center; padding: 2px; margin: 0; background: var(--bg-inner); color: var(--text-muted); font-size: 12px; z-index: 1; }
.reserved-zone-cards .card-item > span[style*="font-size"] { font-size: 12px !important; }
.reserved-zone-cards [role="button"]:focus-visible { outline: 3px solid var(--accent-gold); outline-offset: 2px; }
/* Empty is a compact status, not three rows of fictitious reserved slots.
   Keep its real count/container mounted for the next render and privacy hooks. */
.reserved-zone:has(.empty-cards-placeholder) { align-self: start; display: flex; flex-direction: column; gap: 4px; padding-block: 6px; }
.reserved-market-layout .reserved-zone > .reserved-zone-cards:has(.empty-cards-placeholder) { display: block; }
/* Small in visual weight and width, never small as a touch/keyboard target. */
.player-card .player-header { display: flex; align-items: center; gap: 5px; min-width: 0; }
.player-card .player-header .player-name { flex: 1 1 auto; min-width: 0; margin: 0; }
.player-card .player-header .player-details-toggle { flex: 0 0 auto; width: auto; min-width: 44px; min-height: 44px; margin: 0; padding: 3px 6px; font-size: 12px; line-height: 1.2; white-space: nowrap; box-shadow: none; }
/* Ten card widths cannot remain readable/tappable on a phone. Keep the two
   reservations side by side below a full-width pyramid instead of shrinking. */
@container reserved-market (max-width: 559px) {
  .reserved-market-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto repeat(3, auto); gap: 8px; }
  .reserved-market-layout > #market,
  body.mode-play .reserved-market-layout > #market { grid-column: 1 / -1; grid-row: 1; grid-template-rows: repeat(3, auto); }
  .reserved-market-layout > .reserved-zone { grid-column: 1; grid-row: 2 / 6; }
  .reserved-market-layout > .reserved-zone[data-reserved-seat="1"] { grid-column: 2; }
}
/* Graceful fallback only; supported modern browsers use the shared row tracks. */
@supports not (grid-template-rows: subgrid) {
  .reserved-market-layout { grid-template-rows: auto; }
  .reserved-market-layout > #market,
  body.mode-play .reserved-market-layout > #market { grid-row: 1; grid-template-rows: repeat(3, 1fr); padding-top: 32px; }
  .reserved-market-layout .reserved-zone { grid-row: 1; grid-template-rows: 26px repeat(3, 1fr); }
    .reserved-market-layout .reserved-zone > #p0ReservedCards,
  .reserved-market-layout .reserved-zone > #p1ReservedCards { grid-template-rows: repeat(3, 1fr); }
}
