/* C-05: apply these classes to the C-02 table; no global overrides. */
.panda-chess {
  --chess-paper: #F5F3ED;
  --chess-ink: #0B0B0C;
  min-width: 0;
  max-width: 100%;
  color: var(--chess-ink);
  font-family: Onest, system-ui, sans-serif;
}
.panda-chess *, .panda-chess *::before, .panda-chess *::after { box-sizing: border-box; }
.panda-chess__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-block: 12px;
  font-size: 14px;
}
.panda-chess__legend span { display: inline-flex; align-items: center; gap: 6px; }
.panda-chess__legend i { width: 12px; height: 12px; border-radius: 3px; background: #2E7D32; }
.panda-chess__legend [data-status="reserved"] i { background: #C9A96E; }
.panda-chess__legend [data-status="sold"] i { background: #999; }
.panda-chess__legend [data-status="promo"] i { background: #73529a; }
.panda-chess__hint { margin-block: 8px; font-size: 14px; }
.panda-chess__scroll {
  max-width: 100%;
  overflow-x: auto;
  position: relative;
  isolation: isolate;
  border: 1px solid #bcb9b1;
  border-radius: 8px;
  background: var(--chess-paper);
  /* Keep native touch scrolling, pinch zoom and vertical page gestures. */
  overscroll-behavior-x: contain;
  scroll-padding-inline: 64px 8px;
}
.panda-chess__table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.panda-chess__table th, .panda-chess__table td { padding: 4px; text-align: center; }
.panda-chess__table thead th { height: 40px; font-weight: 500; white-space: nowrap; }
.panda-chess__table .panda-chess__floor {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 56px;
  width: 56px;
  background: var(--chess-paper);
  box-shadow: 2px 0 0 #bcb9b1;
}
.panda-chess__cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 88px;
  min-height: 64px;
  padding: 8px;
  border: 1px solid #246428;
  border-radius: 6px;
  background: #2E7D32;
  color: white;
  font: inherit;
  cursor: pointer;
  scroll-margin-inline: 64px 8px;
}
.panda-chess__cell strong { font-size: 16px; }
.panda-chess__cell[data-status="reserved"] { background: #C9A96E; border-color: #8c713f; color: #0B0B0C; }
.panda-chess__cell[data-status="sold"] { background: #dedcd6; border-color: #aaa79e; color: #55534e; }
.panda-chess__cell[data-status="promo"] { background: #73529a; border-color: #573a78; }
.panda-chess__cell:focus-visible, .panda-chess__scroll:focus-visible { outline: 3px solid #0B0B0C; outline-offset: -3px; }
@media (max-width: 480px) {
  .panda-chess__table th, .panda-chess__table td { padding: 3px; }
  .panda-chess__legend { gap: 8px 12px; }
}
