#stickyControls {
  position: sticky;
  top: 50px;
  z-index: 20;
  padding: 10px 0;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-wrapper {
  position: relative;
  flex: 1;
}

#tableSearch {
  width: 100%;
  padding: 14px 44px 14px 42px;
  border: none;
  border-radius: 999px;
  outline: none;
  font-size: 16px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 2px 10px rgba(0,0,0,0.08),
    0 10px 24px rgba(0,0,0,0.06);
  transition:
    box-shadow 0.2s ease,
    background 0.2s ease;
  -webkit-appearance: none;
}

#tableSearch:focus {
  box-shadow:
    0 4px 12px rgba(0,0,0,0.10),
    0 12px 28px rgba(0,0,0,0.10);
}

#tableSearch::-webkit-search-cancel-button,
#mobileTableSearch::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

#tableSearch::placeholder,
#mobileTableSearch::placeholder {
  color: rgba(0,0,0,0.5);
}

.search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  pointer-events: none;
  z-index: 2;
}

#clearSearchBtn,
#mobileClearSearchBtn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  color: #555;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

#clearSearchBtn {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
}

#clearSearchBtn:hover,
#mobileClearSearchBtn:hover {
  background: rgba(0,0,0,0.14);
}

.filter-wrapper {
  position: relative;
}

.search-action-btn,
#mobileFilterToggle {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.06),
    0 8px 20px rgba(0,0,0,0.06);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.search-action-btn:hover,
#mobileFilterToggle:hover {
  transform: scale(1.05);
}

.search-action-btn.active,
#mobileFilterToggle.active {
  background: #A8B842;
  color: #fff;
}

.filter-panel {
  position: absolute;
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  max-height: 70vh;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  overflow-y: auto;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.08),
    0 12px 28px rgba(0,0,0,0.08);
  z-index: 30;
}

.filter-panel.open {
  display: flex;
}

#filterPanel {
  top: 110%;
  right: 0;
}

#mobileFilterPanel {
  right: 0;
  bottom: 54px;
}

.filter-panel button {
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-panel button > span {
  width: 14px;
  color: transparent;
  font-weight: 800;
}

.filter-panel button:hover {
  background: #f5f5f5;
}

.filter-panel button.active {
  background: #A8B842;
  color: #fff;
}

.filter-panel button.active > span {
  color: currentColor;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 18px;
}

.master-set-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: auto;
}

.master-set-table th,
.master-set-table td {
  border: 1px solid #ddd;
  padding: 10px 8px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
}

.master-set-table thead th {
  background: #fafafa;
  font-weight: 600;
  font-size: 13px;
}

.master-set-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.master-set-table tbody tr:hover {
  background: #f2f2f2;
}

.master-set-table th:nth-child(1),
.master-set-table td:nth-child(1) {
  width: 90px;
  text-align: center;
}

.master-set-table th:nth-child(2),
.master-set-table td:nth-child(2) {
  width: 74px;
  text-align: center;
}

.master-set-table th:nth-child(3),
.master-set-table td:nth-child(3) {
  width: 150px;
  font-weight: 600;
}

.master-set-table th:nth-child(4),
.master-set-table td:nth-child(4) {
  width: 220px;
}

.master-set-table th:nth-child(5),
.master-set-table td:nth-child(5) {
  width: 180px;
}

.master-set-table th:nth-child(6),
.master-set-table td:nth-child(6) {
  width: 100px;
}

.master-set-table th:nth-child(7),
.master-set-table td:nth-child(7) {
  width: 120px;
}

.master-set-market-price {
  color: #A8B842;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.master-set-market-price a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.master-set-market-price a:hover {
  text-decoration: underline;
}

.master-set-table a {
 color: #A8B842;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.master-set-table a:hover {
  opacity: 0.8;
}

.empty-message {
  text-align: center;
  padding: 40px 20px;
  font-size: 15px;
  color: #666;
  background: #fafafa;
}

#mobileSearchFab,
#mobileFilterFab {
  display: none;
}

@media (max-width: 640px) {
  html,
  body {
    overflow-anchor: none;
  }

  .search-container {
    display: none;
  }

  #stickyControls {
    position: static;
    padding: 0;
  }

  #mobileSearchFab,
  #mobileFilterFab {
    display: flex;
    position: fixed;
    right: 16px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease;
  }

  #mobileSearchFab {
    bottom: 80px;
  }

  #mobileFilterFab {
    bottom: 146px;
  }

  #mobileSearchFab.visible,
  #mobileFilterFab.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  #mobileSearchToggle {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
      0 4px 14px rgba(0,0,0,0.12),
      0 10px 28px rgba(0,0,0,0.10);
    overflow: hidden;
    transition:
      width 0.25s ease,
      box-shadow 0.2s ease;
  }

  #mobileSearchFab.active #mobileSearchToggle {
    width: calc(100vw - 32px);
  }

  .mobile-search-icon {
    min-width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
  }

  #mobileTableSearch {
    display: none;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    padding-right: 12px;
    -webkit-appearance: none;
  }

  #mobileSearchFab.active #mobileTableSearch {
    display: block;
  }

  #mobileClearSearchBtn {
    min-width: 24px;
    margin-right: 12px;
  }

  #mobileSearchFab.active #mobileClearSearchBtn.has-value {
    display: flex;
  }

  .master-set-table th,
  .master-set-table td {
    font-size: 14px;
    padding: 10px 6px;
  }

  .master-set-table th:nth-child(1),
  .master-set-table td:nth-child(1) {
    min-width: 86px;
  }

  .master-set-table th:nth-child(2),
  .master-set-table td:nth-child(2) {
    min-width: 72px;
  }

  .master-set-table th:nth-child(3),
  .master-set-table td:nth-child(3) {
    min-width: 130px;
  }

  .master-set-table th:nth-child(4),
  .master-set-table td:nth-child(4) {
    min-width: 150px;
  }

  .master-set-table th:nth-child(5),
  .master-set-table td:nth-child(5),
  .master-set-table th:nth-child(6),
  .master-set-table td:nth-child(6),
  .master-set-table th:nth-child(7),
  .master-set-table td:nth-child(7) {
    min-width: 105px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mobileSearchFab,
  #mobileFilterFab,
  #mobileSearchToggle,
  .search-action-btn,
  #mobileFilterToggle {
    transition: none;
  }
}

/* Dark forest table theme */
.table-wrapper,
.master-set-table,
.empty-message {
  background: transparent;
  color: #fff;
}

.master-set-table th,
.master-set-table td,
.master-set-table tbody tr {
  background: transparent;
  color: #fff;
}

.master-set-table thead th {
  background: #07110c;
  color: #fff;
}

.master-set-table th,
.master-set-table td {
  border-color: #2b4035;
}

.master-set-table a,
.master-set-table a:visited {
  color: #caef7d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Transparent control area with white search and filter controls */
#stickyControls,
.search-container,
.search-wrapper,
.filter-wrapper {
  background: transparent;
}

#tableSearch,
.search-action-btn,
#mobileFilterToggle,
#mobileSearchToggle,
.filter-panel,
.search-action-btn.active,
#mobileFilterToggle.active {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#tableSearch:focus {
  background: #fff;
}

#tableSearch,
#mobileTableSearch,
.filter-panel button {
  color: #000;
}

.filter-panel button:hover,
.filter-panel button.active,
.search-action-btn.active,
#mobileFilterToggle.active {
  background: #e4e0d5;
  color: #000;
}

.filter-panel button.active > span {
  color: #000;
}

/* Compact and align utility columns */
.master-set-table th:nth-child(1),
.master-set-table td:nth-child(1) {
  width: 88px;
  min-width: 88px;
  text-align: center;
}

.master-set-table th:nth-child(2),
.master-set-table td:nth-child(2) {
  width: 68px;
  min-width: 68px;
  text-align: center;
}

.master-set-table th:nth-child(4),
.master-set-table td:nth-child(4),
.master-set-table th:nth-child(5),
.master-set-table td:nth-child(5),
.master-set-table th:nth-child(6),
.master-set-table td:nth-child(6),
.master-set-table th:nth-child(7),
.master-set-table td:nth-child(7) {
  text-align: center;
}

/* Quiet alternating rows */
.master-set-table tbody#tableBody tr:nth-child(odd),
.master-set-table tbody#tableBody tr:nth-child(odd) td {
  background: transparent;
  color: #fff;
}

.master-set-table tbody#tableBody tr:nth-child(even),
.master-set-table tbody#tableBody tr:nth-child(even) td {
  background: rgba(24, 43, 33, 0.72);
  color: #fff;
}

.master-set-table tbody#tableBody tr:nth-child(odd):hover td,
.master-set-table tbody#tableBody tr:nth-child(even):hover td {
  background: rgba(34, 58, 45, 0.84);
}

.master-set-table tbody#tableBody td.master-set-market-price {
  color: #A8B842;
  font-weight: 700;
  text-align: center;
}

/* Pokemon-specific showcase table */
.table-wrapper {
  border: 1px solid rgba(154, 181, 155, 0.22);
  border-radius: 18px;
  background: rgba(10, 30, 17, 0.9);
  overflow: auto;
}

.master-set-table {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  color: #e8f0e7;
  font-family: 'Instrument Sans', Arial, sans-serif;
}

.master-set-table th,
.master-set-table td {
  border: 0;
  border-bottom: 1px solid rgba(154, 181, 155, 0.2);
  padding: 8px 14px;
  vertical-align: middle;
}

.master-set-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #17281b;
  color: rgba(232, 240, 231, 0.68);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-align: left;
  text-transform: uppercase;
}

.master-set-table thead th:first-child {
  border-top-left-radius: 18px;
}

.master-set-table thead th:last-child {
  border-top-right-radius: 18px;
}

.master-set-table tbody#tableBody tr:nth-child(odd) td,
.master-set-table tbody#tableBody tr:nth-child(even) td {
  background: rgba(10, 30, 17, 0.88);
  color: #dce8dc;
}

.master-set-table tbody#tableBody tr:hover td {
  background: rgba(23, 52, 31, 0.96);
}

.master-set-table th.master-set-language-heading,
.master-set-table th.master-set-price-heading {
  text-align: center;
}

.master-set-card-image-cell {
  width: 104px;
  min-width: 104px;
  text-align: center;
}

.master-set-card-art {
  width: 82px;
  height: 54px;
  display: inline-block;
  border-radius: 5px;
  overflow: hidden;
  background: #26392d;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.master-set-card-art,
.master-set-card-art:visited,
.master-set-card-art:hover {
  color: inherit;
  text-decoration: none;
}

.master-set-card-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 15%;
  transform: scale(1.3);
}

.master-set-card-name {
  min-width: 150px;
  font-size: 16px;
  font-weight: 800;
}

.master-set-table td:nth-child(3) {
  color: rgba(232, 240, 231, 0.58);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.master-set-table td:nth-child(4) {
  min-width: 190px;
  font-weight: 800;
}

.master-set-table td:nth-child(5) {
  min-width: 150px;
  color: rgba(232, 240, 231, 0.58);
  font-weight: 500;
}

.master-set-table td:nth-child(6),
.master-set-table td:nth-child(7),
.master-set-table th:nth-child(6),
.master-set-table th:nth-child(7) {
  text-align: center;
}

.language-pill {
  min-width: 42px;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(214, 188, 255, 0.22);
  color: #d8c3ff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.language-pill--en {
  background: rgba(255, 176, 203, 0.22);
  color: #ffb4ce;
}

.language-pill--jp {
  background: rgba(129, 170, 127, 0.24);
  color: #a7cda3;
}

.language-pill--cn {
  background: rgba(174, 193, 255, 0.24);
  color: #bdc9ff;
}

.master-set-market-price {
  min-width: 104px;
  color: rgba(232, 240, 231, 0.58);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.master-set-market-price a,
.master-set-market-price a:visited {
  color: rgba(232, 240, 231, 0.68);
  font-weight: 500;
  text-decoration: none;
}

.master-set-card-name a,
.master-set-card-name a:visited {
  color: #e8f0e7;
  text-decoration: none;
}

.master-set-row--en .master-set-card-name,
.master-set-row--en .master-set-card-name a,
.master-set-row--en .master-set-card-name a:visited {
  color: #ffb4ce;
}

.master-set-row--jp .master-set-card-name,
.master-set-row--jp .master-set-card-name a,
.master-set-row--jp .master-set-card-name a:visited {
  color: #a7cda3;
}

.master-set-row--cn .master-set-card-name,
.master-set-row--cn .master-set-card-name a,
.master-set-row--cn .master-set-card-name a:visited {
  color: #bdc9ff;
}

.master-set-card-name a:hover,
.master-set-market-price a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.empty-message {
  background: rgba(10, 30, 17, 0.88);
  color: rgba(232, 240, 231, 0.7);
}

@media (max-width: 640px) {
  .table-wrapper {
    border-radius: 14px;
  }

  .master-set-table {
    min-width: 820px;
  }

  .master-set-table th,
  .master-set-table td {
    padding: 7px 10px;
    font-size: 13px;
  }

  .master-set-card-image-cell {
    min-width: 84px;
  }

  .master-set-card-art {
    width: 68px;
    height: 46px;
  }
}

.master-set-table th:nth-child(1),
.master-set-table td:nth-child(1) {
  width: 104px;
  min-width: 104px;
  text-align: center;
}

.master-set-table th:nth-child(2),
.master-set-table td:nth-child(2) {
  width: 170px;
  min-width: 170px;
  text-align: left;
}

.master-set-table th:nth-child(3),
.master-set-table td:nth-child(3) {
  width: 112px;
  min-width: 112px;
  text-align: left;
}

.master-set-table th:nth-child(4),
.master-set-table td:nth-child(4) {
  width: 210px;
  min-width: 210px;
  text-align: left;
}

.master-set-table th:nth-child(5),
.master-set-table td:nth-child(5) {
  width: 165px;
  min-width: 165px;
  text-align: left;
}

.master-set-table th:nth-child(6),
.master-set-table td:nth-child(6) {
  width: 92px;
  min-width: 92px;
  text-align: center;
}

.master-set-table th:nth-child(7),
.master-set-table td:nth-child(7) {
  width: 116px;
  min-width: 116px;
  text-align: center;
}

.master-set-table tbody#tableBody td.master-set-market-price,
.master-set-table tbody#tableBody td.master-set-market-price a,
.master-set-table tbody#tableBody td.master-set-market-price a:visited {
  color: rgba(232, 240, 231, 0.62);
  font-weight: 500;
}

.master-set-table tbody#tableBody td:nth-child(3),
.master-set-table tbody#tableBody td:nth-child(5),
.master-set-table tbody#tableBody td.master-set-market-price,
.master-set-table tbody#tableBody td.master-set-market-price a,
.master-set-table tbody#tableBody td.master-set-market-price a:visited {
  color: rgba(232, 240, 231, 0.56) !important;
  font-weight: 400 !important;
}

.master-set-table tbody#tableBody td:nth-child(3),
.master-set-table tbody#tableBody td.master-set-market-price {
  font-variant-numeric: tabular-nums;
}

.master-set-table tbody#tableBody td.master-set-market-price,
.master-set-table tbody#tableBody td.master-set-market-price a,
.master-set-table tbody#tableBody td.master-set-market-price a:visited {
  color: rgba(232, 240, 231, 0.72) !important;
  font-weight: 800 !important;
}

.master-set-card-art[href],
.master-set-card-name a {
  cursor: pointer;
}
