.pgsc-catalog {
  --pgsc-panel: var(--wp--preset--color--base, #ffffff);
  --pgsc-text: var(--wp--preset--color--contrast, #172033);
  --pgsc-muted: var(--wp--preset--color--contrast-2, #667085);
  --pgsc-line: var(--wp--preset--color--contrast-3, #e4e7ec);
  --pgsc-accent: var(
    --wp--preset--color--primary,
    var(
      --wp--preset--color--accent-1,
      var(--wp--preset--color--accent, var(--wp--preset--color--contrast, #5b47d6))
    )
  );
  --pgsc-accent-text: var(--wp--preset--color--base, #ffffff);
  --pgsc-value-color: #FDB732;
  width: 100%;
  color: var(--pgsc-text);
  font-family: Arial, "Noto Sans Thai", sans-serif;
}
.pgsc-catalog *, .pgsc-catalog *::before, .pgsc-catalog *::after { box-sizing: border-box; }
.pgsc-catalog .is-hidden { display: none !important; }
.pgsc-controls {
  max-width: 1440px; margin: 0 auto; padding: 0 24px 18px;
  display: grid; grid-template-columns: minmax(220px, 1fr) 260px auto;
  gap: 12px; align-items: end;
}
.pgsc-controls label, .pgsc-control-label {
  display: block; margin: 0 0 6px; color: var(--pgsc-muted); font-size: 13px;
}
.pgsc-controls input, .pgsc-controls select, .pgsc-controls button { font: inherit; }
.pgsc-controls input, .pgsc-controls select {
  width: 100%; min-height: 44px; margin: 0; border: 1px solid var(--pgsc-line);
  border-radius: 11px; background: var(--pgsc-panel); color: var(--pgsc-text); padding: 10px 12px;
}
.pgsc-view-buttons { display: flex; gap: 8px; }
.pgsc-view-buttons button {
  min-height: 44px; margin: 0; border: 1px solid var(--pgsc-line); border-radius: 11px;
  background: var(--pgsc-panel); color: var(--pgsc-text); padding: 10px 14px; cursor: pointer;
}
.pgsc-view-buttons button.is-active { border-color: var(--pgsc-accent); background: var(--pgsc-accent); color: var(--pgsc-accent-text); }
.pgsc-main { max-width: 1440px; margin: 0 auto; padding: 0 24px 32px; }
.pgsc-status { margin-bottom: 12px; color: var(--pgsc-muted); font-size: 14px; }
.pgsc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pgsc-card {
  min-width: 0; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--pgsc-accent); border-radius: 15px; background: var(--pgsc-panel);
}
.pgsc-poster { position: relative; overflow: hidden; aspect-ratio: 1.45 / 1; background: #e9ecf3; }
.pgsc-poster img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pgsc-fallback {
  position: absolute; inset: 0; display: none; place-items: center; padding: 16px;
  color: var(--pgsc-muted); text-align: center; font-weight: 700;
}
.pgsc-badge {
  position: absolute; top: 10px; left: 10px; border-radius: 999px;
  background: var(--pgsc-accent); color: var(--pgsc-accent-text); padding: 5px 8px; font-size: 12px;
}
.pgsc-card-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.pgsc-game-title { font-size: 17px; font-weight: 700; line-height: 1.25; }
.pgsc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pgsc-stat { min-width: 0; border: 1px solid var(--pgsc-line); border-radius: 10px; background: var(--pgsc-panel); padding: 8px; }
.pgsc-stat small { display: block; margin-bottom: 4px; color: var(--pgsc-muted); font-size: 12px; }
.pgsc-stat b { font-size: 13px; overflow-wrap: anywhere; }
.pgsc-meta { color: var(--pgsc-muted); font-size: 12px; line-height: 1.45; }
.pgsc-actions { display: flex; gap: 8px; margin-top: auto; }
.pgsc-action-link {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; width: 100%;
  border-radius: 10px; background: var(--pgsc-accent); color: var(--pgsc-accent-text) !important;
  padding: 10px; text-decoration: none !important; font-size: 13px; font-weight: 600;
}
.pgsc-table-wrap {
  width: 100%; overflow-x: hidden; border: 2px solid var(--pgsc-accent);
  border-radius: 14px; background: var(--pgsc-panel);
}
.pgsc-table-wrap table {
  width: 100%; min-width: 0; margin: 0; border-collapse: collapse;
  table-layout: fixed; border: 0;
}
.pgsc-table-wrap th, .pgsc-table-wrap td {
  min-width: 0; padding: 8px 7px; border: 0;
  border-bottom: 1px solid var(--pgsc-line); background: transparent;
  color: var(--pgsc-text); text-align: left; vertical-align: middle;
  font-size: 12px; line-height: 1.3; overflow-wrap: anywhere;
}
.pgsc-table-wrap th {
  position: sticky; top: 0; z-index: 1; background: var(--pgsc-panel); color: var(--pgsc-accent); box-shadow: inset 0 -3px 0 var(--pgsc-accent);
  font-size: 11px; white-space: normal;
}
.pgsc-table-wrap th:nth-child(1), .pgsc-table-wrap td:nth-child(1) { width: 72px; }
.pgsc-table-wrap th:nth-child(2), .pgsc-table-wrap td:nth-child(2) { width: 25%; }
.pgsc-table-wrap th:nth-child(3), .pgsc-table-wrap td:nth-child(3) { width: 112px; }
.pgsc-table-wrap th:nth-child(4), .pgsc-table-wrap td:nth-child(4) { width: 82px; text-align: center; }
.pgsc-table-wrap th:nth-child(5), .pgsc-table-wrap td:nth-child(5) { width: 88px; text-align: center; }
.pgsc-table-wrap th:nth-child(6), .pgsc-table-wrap td:nth-child(6) { width: 66px; text-align: center; }
.pgsc-table-wrap th:nth-child(7), .pgsc-table-wrap td:nth-child(7) { width: 94px; text-align: center; }
.pgsc-thumb {
  width: 58px; height: 42px; display: block; border-radius: 7px;
  background: #eee; object-fit: cover;
}
.pgsc-table-action {
  display: inline-flex; align-items: center; justify-content: center;
  max-width: 100%; border: 1px solid currentColor; border-radius: 8px;
  color: var(--pgsc-accent) !important; padding: 7px 9px;
  font-size: 11px; font-weight: 700; line-height: 1.15;
  text-align: center; text-decoration: none !important;
}

@media (max-width: 760px) {
  .pgsc-table-wrap { border: 0; border-radius: 0; background: transparent; }
  .pgsc-table-wrap table, .pgsc-table-wrap tbody { display: block; width: 100%; }
  .pgsc-table-wrap thead { display: none; }
  .pgsc-table-wrap tr {
    display: grid; grid-template-columns: 78px minmax(0, 1fr) auto;
    gap: 7px 10px; align-items: center; margin-bottom: 10px; padding: 10px;
    border: 1px solid var(--pgsc-accent); border-radius: 12px; background: var(--pgsc-panel);
  }
  .pgsc-table-wrap td {
    width: auto !important; padding: 0; border: 0; text-align: left !important;
    font-size: 12px;
  }
  .pgsc-table-wrap .pgsc-list-image { grid-column: 1; grid-row: 1 / span 3; }
  .pgsc-table-wrap .pgsc-list-name { grid-column: 2; grid-row: 1; font-size: 14px; }
  .pgsc-table-wrap .pgsc-list-action { grid-column: 3; grid-row: 1; }
  .pgsc-table-wrap td:nth-child(4),
  .pgsc-table-wrap td:nth-child(5),
  .pgsc-table-wrap td:nth-child(6),
  .pgsc-table-wrap td:nth-child(7) {
    grid-column: 2 / -1; display: grid; grid-template-columns: 105px minmax(0,1fr);
    gap: 8px; color: var(--pgsc-text);
  }
  .pgsc-table-wrap td:nth-child(n+4)::before {
    content: attr(data-label); color: var(--pgsc-muted); font-size: 11px;
  }
  .pgsc-thumb { width: 78px; height: 56px; }
  .pgsc-table-action { white-space: nowrap; padding: 7px 8px; }
}

.pgsc-load-more-wrap { display: flex; justify-content: center; padding: 24px 0 4px; }
.pgsc-load-more-button {
  min-width: 190px; margin: 0; border: 1px solid var(--pgsc-accent); border-radius: 999px;
  background: var(--pgsc-accent); color: var(--pgsc-accent-text); padding: 12px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; cursor: pointer;
}
.pgsc-load-more-button small { font-size: 11px; font-weight: 400; opacity: .86; }
.pgsc-load-more-icon { font-size: 18px; line-height: 1; }
html.pgsc-lightbox-open, body.pgsc-lightbox-open { overflow: hidden; }
.pgsc-lightbox-overlay {
  position: fixed; inset: 0; z-index: 999999; display: none;
  align-items: stretch; justify-content: stretch; padding: 0;
  background: rgba(15, 23, 42, .92);
}
.pgsc-lightbox-overlay.is-open { display: flex; }
.pgsc-lightbox-panel {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  overflow: hidden; display: flex; flex-direction: column;
  border: 0; border-radius: 0; background: var(--pgsc-panel);
}
.pgsc-lightbox-header {
  min-height: 58px; padding: 10px 12px 10px 18px; display: flex;
  align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--pgsc-line); background: var(--pgsc-panel);
}
.pgsc-lightbox-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
.pgsc-lightbox-tools { flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
.pgsc-lightbox-tools a, .pgsc-lightbox-close {
  min-height: 38px; margin: 0; border: 2px solid var(--pgsc-accent) !important;
  border-radius: var(--wp--custom--button--border--radius, 10px);
  background: var(--pgsc-panel) !important; color: var(--pgsc-accent) !important;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 13px; text-decoration: none !important; font: inherit;
  font-size: 13px; font-weight: 800; line-height: 1; cursor: pointer;
  box-shadow: 0 0 0 2px var(--pgsc-panel), 0 0 0 4px var(--pgsc-accent);
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.pgsc-lightbox-tools a:hover,
.pgsc-lightbox-tools a:focus-visible,
.pgsc-lightbox-close:hover,
.pgsc-lightbox-close:focus-visible {
  background: var(--pgsc-accent) !important;
  color: var(--pgsc-accent-text) !important;
  transform: translateY(-1px);
}
.pgsc-lightbox-close {
  width: 38px; min-width: 38px; padding: 0; font-size: 22px; line-height: 1;
}
.pgsc-lightbox-body {
  flex: 1 1 auto; min-height: 0; overflow: hidden; background: #000;
}
.pgsc-lightbox-player {
  width: 100%; height: 100%; min-height: 0; background: #000;
}
.pgsc-lightbox-player iframe {
  width: 100%; height: 100%; min-height: 0; display: block;
  border: 0; background: #fff;
}
.pgsc-register-bar {
  --pgsc-theme-accent: var(
    --wp--preset--color--primary,
    var(
      --wp--preset--color--accent-1,
      var(--wp--preset--color--contrast, var(--pgsc-accent))
    )
  );
  --pgsc-theme-base: var(--wp--preset--color--base, #ffffff);
  flex: 0 0 auto;
  padding: 20px 18px;
  border-top: 3px solid var(--pgsc-theme-accent);
  background: var(--pgsc-panel);
  display: flex;
  justify-content: center;
  align-items: center;
}
.pgsc-register-button.wp-element-button {
  width: min(460px, 100%);
  min-height: 54px;
  margin: 0;
  padding: 14px 24px;
  border: 3px solid var(--pgsc-theme-base) !important;
  border-radius: var(--wp--custom--button--border--radius, 14px);
  outline: 3px solid var(--pgsc-theme-accent);
  outline-offset: 0;
  background: var(--pgsc-theme-accent);
  color: var(--pgsc-theme-base) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.pgsc-register-button.wp-element-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 11px 24px rgba(0, 0, 0, .24);
}
.pgsc-register-button.wp-element-button:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .18);
}
.pgsc-register-button.wp-element-button:focus-visible {
  outline-width: 4px;
  outline-offset: 3px;
}
.pgsc-register-button[data-no-url="1"] {
  cursor: default;
  opacity: .78;
}
@media (max-width: 1100px) { .pgsc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .pgsc-controls { grid-template-columns: 1fr; padding-right: 14px; padding-left: 14px; }
  .pgsc-main { padding-right: 14px; padding-left: 14px; }
  .pgsc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pgsc-stats { grid-template-columns: 1fr; }
  .pgsc-lightbox-overlay { padding: 0; }
  .pgsc-lightbox-panel {
    width: 100vw; height: 100vh; height: 100dvh; max-height: none;
    border: 0; border-radius: 0; overflow: hidden;
  }
  .pgsc-lightbox-header { min-height: 52px; padding: 8px 9px 8px 12px; }
  .pgsc-lightbox-title { font-size: 14px; }
  .pgsc-lightbox-tools { gap: 7px; }
  .pgsc-lightbox-tools a, .pgsc-lightbox-close {
    min-height: 34px; box-shadow: none; border-width: 2px !important;
  }
  .pgsc-lightbox-tools a { display: inline-flex; padding: 7px 9px; font-size: 11px; }
  .pgsc-lightbox-close { width: 34px; min-width: 34px; font-size: 20px; }
  .pgsc-register-bar { padding: 12px 10px 14px; }
  .pgsc-register-button.wp-element-button {
    width: 100%; min-height: 48px; padding: 11px 16px; font-size: 16px;
  }
}
@media (max-width: 440px) { .pgsc-grid { grid-template-columns: 1fr; } }

/* Requested value color: game names and values only; labels/headings remain theme colors. */
.pgsc-catalog .pgsc-game-title,
.pgsc-catalog .pgsc-list-name b,
.pgsc-catalog .pgsc-stat b,
.pgsc-catalog .pgsc-table-wrap td:nth-child(5),
.pgsc-catalog .pgsc-table-wrap td:nth-child(6),
.pgsc-catalog .pgsc-table-wrap td:nth-child(7) {
  color: var(--pgsc-value-color) !important;
  font-weight: 800;
}
