/* Pokemon directory and research-tool surfaces. Calculator pages use pokemon-trainer-layout.css. */

body.pokemon-tools-page {
  --pokemon-tool-bg: #020716;
  --pokemon-tool-panel: #07152f;
  --pokemon-tool-panel-deep: #040c1d;
  --pokemon-tool-blue: #277dff;
  --pokemon-tool-cyan: #21d4ff;
  --pokemon-tool-yellow: #ffdc19;
  --pokemon-tool-yellow-soft: #fff08a;
  --pokemon-tool-green: #79df67;
  --pokemon-tool-text: #f7f9ff;
  --pokemon-tool-muted: #9fb3d7;
  --pokemon-tool-border: rgba(48, 139, 255, 0.58);
  --pokemon-tool-border-soft: rgba(69, 143, 255, 0.3);

  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(
      circle at 14% 8%,
      rgba(56, 78, 218, 0.24),
      transparent 29rem
    ),
    radial-gradient(
      circle at 88% 16%,
      rgba(0, 164, 255, 0.17),
      transparent 34rem
    ),
    linear-gradient(180deg, #020713 0%, #03091a 48%, #020611 100%);
  color: var(--pokemon-tool-text);
  font-family:
    Exo,
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

html:has(body.pokemon-tools-page) {
  overflow-x: hidden;
}

body.pokemon-tools-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(rgba(37, 111, 214, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 111, 214, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 1;
}

body.pokemon-tools-page .site-header,
body.pokemon-tools-page .site-footer {
  border: 0;
  border-radius: 0;
  background: rgba(2, 7, 22, 0.96);
  box-shadow:
    0 2px 0 var(--pokemon-tool-yellow),
    0 18px 40px rgba(0, 4, 20, 0.42);
}

body.pokemon-tools-page .site-header .nav-link,
body.pokemon-tools-page .site-header .site-nav-toggle {
  border-color: transparent;
  background: transparent;
  color: #dfeaff;
  text-shadow: none;
}

body.pokemon-tools-page .site-header .nav-link:hover,
body.pokemon-tools-page .site-header .nav-link:focus-visible,
body.pokemon-tools-page .site-header .site-nav-toggle:hover,
body.pokemon-tools-page .site-header .site-nav-toggle:focus-visible {
  border-color: var(--pokemon-tool-cyan);
  background: rgba(31, 115, 222, 0.12);
  color: #fff;
}

body.pokemon-tools-page main,
body.pokemon-tools-page main.wrap {
  display: grid;
  width: min(1380px, calc(100% - 32px));
  max-width: none;
  gap: 14px;
  margin-inline: auto;
  padding: 24px 0 44px;
}

body.pokemon-tools-page main > * {
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

body.pokemon-tools-page .card {
  border: 1px solid var(--pokemon-tool-border);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(8, 22, 49, 0.97), rgba(3, 10, 26, 0.98)),
    radial-gradient(
      circle at top right,
      rgba(35, 123, 255, 0.12),
      transparent 38%
    );
  box-shadow:
    0 18px 44px rgba(0, 3, 15, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.pokemon-tools-page .card h2,
body.pokemon-tools-page .card h3 {
  color: #fff;
  text-shadow: none;
}

body.pokemon-tools-page .page-intro {
  position: relative;
  isolation: isolate;
  min-height: 310px;
  overflow: hidden;
  padding: clamp(32px, 5vw, 68px);
  border-top-color: rgba(93, 159, 255, 0.92);
  border-radius: 18px;
  background:
    linear-gradient(
      118deg,
      rgba(4, 12, 35, 0.98) 0 52%,
      rgba(9, 15, 53, 0.96) 75%,
      rgba(3, 12, 31, 0.98)
    ),
    radial-gradient(
      circle at 12% 18%,
      rgba(55, 89, 255, 0.24),
      transparent 28rem
    );
}

body.pokemon-tools-page .page-intro::before {
  position: absolute;
  top: 32px;
  left: -58px;
  z-index: -1;
  width: 240px;
  aspect-ratio: 1;
  content: "";
  border: 2px solid rgba(67, 132, 255, 0.2);
  border-radius: 50%;
  background:
    linear-gradient(
      transparent 47%,
      rgba(45, 113, 244, 0.32) 47% 53%,
      transparent 53%
    ),
    radial-gradient(
      circle,
      rgba(44, 122, 255, 0.35) 0 8%,
      #071631 9% 13%,
      rgba(55, 125, 255, 0.58) 14% 16%,
      transparent 17% 40%,
      rgba(58, 120, 236, 0.34) 41% 43%,
      transparent 44%
    );
  opacity: 0.72;
}

body.pokemon-tools-page .page-intro::after {
  position: absolute;
  inset: -35% -6% -35% 42%;
  z-index: -2;
  content: "";
  transform: skewX(-21deg);
  background: linear-gradient(
    90deg,
    transparent 0 28%,
    rgba(74, 51, 211, 0.48) 28% 31%,
    transparent 31% 39%,
    rgba(39, 125, 255, 0.2) 39% 45%,
    transparent 45% 68%,
    rgba(98, 52, 224, 0.24) 68% 71%,
    transparent 71%
  );
}

body.pokemon-tools-page .pokemon-tools-eyebrow {
  margin: 0 0 10px;
  color: var(--pokemon-tool-cyan);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.pokemon-tools-page .page-intro .site-title {
  display: grid;
  gap: 7px;
  max-width: 900px;
  margin: 0;
  background: none;
  color: var(--pokemon-tool-cyan);
  font-family: Exo, sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 750;
  line-height: 1.1;
  -webkit-text-fill-color: currentColor;
}

body.pokemon-tools-page .page-intro .site-title-primary {
  background: none;
  color: #fff;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-shadow: 0 12px 28px rgba(0, 0, 0, 0.44);
  -webkit-text-fill-color: currentColor;
}

body.pokemon-tools-page .page-intro .site-title-secondary {
  background: none;
  color: var(--pokemon-tool-cyan);
  font-size: inherit;
  -webkit-text-fill-color: currentColor;
}

body.pokemon-tools-page .page-intro > p:not(.pokemon-tools-eyebrow) {
  max-width: 78ch;
  margin: 18px 0 0;
  color: #c3d2ec;
  line-height: 1.58;
}

body.pokemon-tools-page .pokemon-tools-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

body.pokemon-tools-page .pokemon-tools-hero-stats > span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(55, 132, 255, 0.5);
  border-radius: 7px;
  background: linear-gradient(
    145deg,
    rgba(10, 34, 79, 0.92),
    rgba(5, 17, 43, 0.96)
  );
  color: #e8efff;
  font-size: 0.78rem;
  font-weight: 650;
}

body.pokemon-tools-page .pokemon-tools-hero-stats b {
  color: var(--pokemon-tool-yellow);
}

/* Directory */
body.pokemon-directory-page .tracker-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 28px;
  align-items: center;
  padding: 22px 24px;
  border-color: rgba(255, 220, 25, 0.58);
  text-align: left;
}

body.pokemon-directory-page .tracker-cta h2,
body.pokemon-directory-page .tracker-cta p {
  grid-column: 1;
  margin: 0;
  max-width: 86ch;
}

body.pokemon-directory-page .tracker-cta h2 {
  color: var(--pokemon-tool-yellow);
  font-size: 1.15rem;
}

body.pokemon-directory-page .tracker-cta p {
  color: #aebfdd;
  line-height: 1.5;
}

body.pokemon-directory-page .tracker-cta-button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 54px;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid rgba(255, 220, 25, 0.76);
  border-radius: 6px;
  background: linear-gradient(155deg, #fff45f, #ffcb05);
  color: #091024;
  font-weight: 900;
  text-shadow: none;
}

body.pokemon-directory-page .era-filter-panel,
body.pokemon-directory-page .set-navigator {
  padding: 22px;
}

body.pokemon-directory-page .era-filter-kicker {
  color: var(--pokemon-tool-cyan);
}

body.pokemon-directory-page .era-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 9px;
}

body.pokemon-directory-page .era-filter-btn {
  min-height: 72px;
  border: 1px solid rgba(54, 137, 255, 0.48);
  border-radius: 7px;
  background: linear-gradient(
    145deg,
    rgba(12, 38, 84, 0.96),
    rgba(5, 17, 42, 0.98)
  );
  box-shadow: none;
}

body.pokemon-directory-page .era-filter-btn:hover,
body.pokemon-directory-page .era-filter-btn:focus-visible {
  border-color: var(--pokemon-tool-cyan);
  background: linear-gradient(
    145deg,
    rgba(16, 56, 112, 0.98),
    rgba(7, 27, 61, 0.98)
  );
}

body.pokemon-directory-page .era-filter-btn.is-active {
  border-color: var(--pokemon-tool-yellow-soft);
  background: linear-gradient(155deg, #fff08a, #ffcb05);
  box-shadow: 0 10px 26px rgba(255, 198, 0, 0.16);
}

body.pokemon-directory-page .set-controls {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(160px, 0.7fr) minmax(
      260px,
      1.6fr
    );
  gap: 10px;
  margin-bottom: 14px;
}

body.pokemon-directory-page .set-control {
  min-width: 0;
  color: #cbd8ee;
}

body.pokemon-directory-page .set-control input,
body.pokemon-directory-page .set-control select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(76, 139, 233, 0.58);
  border-radius: 6px;
  background: #06132d;
  color: #fff;
}

body.pokemon-directory-page .set-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

body.pokemon-directory-page .set-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  min-height: 94px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(62, 137, 236, 0.34);
  border-radius: 7px;
  background: linear-gradient(
    145deg,
    rgba(8, 27, 62, 0.94),
    rgba(4, 14, 34, 0.98)
  );
  box-shadow: inset 3px 0 0 rgba(45, 126, 255, 0.64);
}

body.pokemon-directory-page .set-row:hover,
body.pokemon-directory-page .set-row:focus-within {
  border-color: rgba(33, 212, 255, 0.66);
  background: linear-gradient(
    145deg,
    rgba(12, 42, 88, 0.96),
    rgba(5, 19, 44, 0.98)
  );
  transform: translateY(-1px);
}

body.pokemon-directory-page .set-row[hidden] {
  display: none !important;
}

body.pokemon-directory-page .set-meta,
body.pokemon-directory-page .set-text {
  min-width: 0;
}

body.pokemon-directory-page .set-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

body.pokemon-directory-page .set-date {
  margin-top: 5px;
  color: var(--pokemon-tool-muted);
  font-size: 0.76rem;
}

body.pokemon-directory-page .set-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

body.pokemon-directory-page .set-tools .btn {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(45, 168, 255, 0.55);
  border-radius: 5px;
  background: linear-gradient(145deg, #123c80, #0a275a);
  color: #dff5ff;
  font-size: 0.7rem;
  font-weight: 750;
  text-shadow: none;
}

/* Pack destruction research tool */
body.pokemon-pack-tracker-page main.wrap {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

body.pokemon-pack-tracker-page .page-intro,
body.pokemon-pack-tracker-page #results-section,
body.pokemon-pack-tracker-page main > section:last-of-type {
  grid-column: 1 / -1;
}

body.pokemon-pack-tracker-page
  main
  > section[aria-labelledby="assumptions-title"] {
  grid-column: span 8;
}

body.pokemon-pack-tracker-page
  main
  > section[aria-labelledby="data-source-title"] {
  grid-column: span 4;
}

body.pokemon-pack-tracker-page main > section:not(.page-intro) {
  padding: 20px;
}

body.pokemon-pack-tracker-page .section-title {
  margin: 0 0 14px;
  color: #fff;
  font-size: 1.08rem;
}

body.pokemon-pack-tracker-page .section {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.pokemon-pack-tracker-page .section::before {
  content: none;
}

body.pokemon-pack-tracker-page .assumption-field {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(65, 139, 237, 0.34);
  border-radius: 7px;
  background: rgba(5, 18, 43, 0.82);
}

body.pokemon-pack-tracker-page .assumption-field label,
body.pokemon-pack-tracker-page .combined-rate-display .label {
  color: #dbe7fb;
  font-size: 0.71rem;
}

body.pokemon-pack-tracker-page .assumption-field .helper,
body.pokemon-pack-tracker-page .methodology-list li,
body.pokemon-pack-tracker-page .small,
body.pokemon-pack-tracker-page .muted {
  color: var(--pokemon-tool-muted);
}

body.pokemon-pack-tracker-page .assumption-row input[type="range"] {
  min-width: 0;
  accent-color: var(--pokemon-tool-cyan);
}

body.pokemon-pack-tracker-page .assumption-row .pct-display {
  color: var(--pokemon-tool-cyan);
}

body.pokemon-pack-tracker-page .combined-rate-display {
  border: 1px solid rgba(255, 220, 25, 0.45);
  border-radius: 7px;
  background: linear-gradient(
    145deg,
    rgba(56, 48, 14, 0.52),
    rgba(7, 18, 40, 0.94)
  );
}

body.pokemon-pack-tracker-page .combined-rate-display .rate-value {
  color: var(--pokemon-tool-yellow);
}

body.pokemon-pack-tracker-page .data-status {
  border-radius: 999px;
}

body.pokemon-pack-tracker-page .detail-table-wrap {
  max-width: 100%;
  overflow-x: hidden;
  border: 1px solid rgba(62, 136, 234, 0.32);
  border-radius: 7px;
}

body.pokemon-pack-tracker-page .detail-table-wrap table,
body.pokemon-pack-tracker-page #all-sets-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

body.pokemon-pack-tracker-page #all-sets-table th,
body.pokemon-pack-tracker-page #all-sets-table td {
  padding: 10px 9px;
  border-color: rgba(71, 123, 198, 0.2);
  overflow-wrap: anywhere;
  color: #dce7f7;
}

body.pokemon-pack-tracker-page #all-sets-table thead th {
  background: linear-gradient(180deg, #0b2858, #071a3c);
  color: #dff1ff;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

body.pokemon-pack-tracker-page #all-sets-table tbody tr {
  background: rgba(4, 14, 35, 0.72);
}

body.pokemon-pack-tracker-page #all-sets-table tbody tr:nth-child(even) {
  background: rgba(7, 23, 53, 0.74);
}

body.pokemon-pack-tracker-page .pd-set-row:hover {
  background: rgba(15, 50, 101, 0.84) !important;
}

body.pokemon-pack-tracker-page .era-header-row td {
  color: var(--pokemon-tool-cyan);
  background: rgba(10, 39, 81, 0.94) !important;
  border-top-color: rgba(33, 212, 255, 0.35);
}

body.pokemon-pack-tracker-page .pd-set-row .chevron,
body.pokemon-pack-tracker-page .methodology-list li::before {
  color: var(--pokemon-tool-cyan);
}

body.pokemon-pack-tracker-page .formula-block {
  overflow-wrap: anywhere;
  border: 1px solid rgba(255, 220, 25, 0.34);
  border-radius: 7px;
  background: rgba(5, 18, 43, 0.86);
  color: #e6edff;
}

@media (max-width: 980px) {
  body.pokemon-directory-page .set-rows {
    grid-template-columns: minmax(0, 1fr);
  }

  body.pokemon-pack-tracker-page
    main
    > section[aria-labelledby="assumptions-title"],
  body.pokemon-pack-tracker-page
    main
    > section[aria-labelledby="data-source-title"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body.pokemon-tools-page main,
  body.pokemon-tools-page main.wrap {
    width: min(100% - 20px, 1380px);
    padding-top: 12px;
  }

  body.pokemon-tools-page .page-intro {
    min-height: 0;
    padding: 26px 18px;
    border-radius: 12px;
  }

  body.pokemon-tools-page .page-intro .site-title-primary {
    font-size: clamp(2.35rem, 12vw, 3.6rem);
  }

  body.pokemon-directory-page .tracker-cta {
    grid-template-columns: minmax(0, 1fr);
  }

  body.pokemon-directory-page .tracker-cta h2,
  body.pokemon-directory-page .tracker-cta p,
  body.pokemon-directory-page .tracker-cta-button {
    grid-column: 1;
    grid-row: auto;
  }

  body.pokemon-directory-page .set-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  body.pokemon-directory-page .set-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body.pokemon-directory-page .set-tools {
    justify-content: flex-start;
  }

  body.pokemon-pack-tracker-page .assumptions-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.pokemon-pack-tracker-page #all-sets-table {
    display: block;
    table-layout: auto;
  }

  body.pokemon-pack-tracker-page #all-sets-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body.pokemon-pack-tracker-page #all-sets-table tbody {
    display: grid;
    gap: 9px;
    padding: 10px;
  }

  body.pokemon-pack-tracker-page #all-sets-table tbody tr.pd-set-row,
  body.pokemon-pack-tracker-page
    #all-sets-table
    tbody
    tr.card-detail-row.visible,
  body.pokemon-pack-tracker-page #all-sets-table tbody tr.card-avg-row.visible,
  body.pokemon-pack-tracker-page #all-sets-table tbody tr.no-data-row {
    display: grid;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(64, 137, 237, 0.34);
    border-radius: 7px;
    background: linear-gradient(
      145deg,
      rgba(9, 28, 63, 0.96),
      rgba(4, 14, 34, 0.98)
    );
  }

  body.pokemon-pack-tracker-page #all-sets-table tbody tr.era-header-row {
    display: block;
    overflow: hidden;
    border-radius: 6px;
  }

  body.pokemon-pack-tracker-page
    #all-sets-table
    tbody
    tr.card-subheader.visible {
    display: none;
  }

  body.pokemon-pack-tracker-page #all-sets-table tbody tr > th,
  body.pokemon-pack-tracker-page #all-sets-table tbody tr > td {
    display: grid;
    grid-template-columns: minmax(104px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: auto !important;
    min-width: 0;
    padding: 7px 10px !important;
    border-bottom: 1px solid rgba(73, 129, 205, 0.17);
    text-align: left !important;
    white-space: normal;
  }

  body.pokemon-pack-tracker-page #all-sets-table tbody tr > th::before,
  body.pokemon-pack-tracker-page #all-sets-table tbody tr > td::before {
    color: #8fa8cf;
    content: attr(data-label);
    font-size: 0.61rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  body.pokemon-pack-tracker-page #all-sets-table tbody .expand-col {
    grid-template-columns: minmax(0, 1fr);
  }

  body.pokemon-pack-tracker-page #all-sets-table tbody .expand-col::before {
    display: none;
  }

  body.pokemon-pack-tracker-page #all-sets-table tbody tr.era-header-row > td,
  body.pokemon-pack-tracker-page #all-sets-table tbody tr.no-data-row > td {
    display: block;
  }

  body.pokemon-pack-tracker-page
    #all-sets-table
    tbody
    tr.era-header-row
    > td::before,
  body.pokemon-pack-tracker-page
    #all-sets-table
    tbody
    tr.no-data-row
    > td::before {
    display: none;
  }
}

@media (max-width: 520px) {
  body.pokemon-tools-page main,
  body.pokemon-tools-page main.wrap {
    width: min(100% - 12px, 1380px);
    gap: 8px;
  }

  body.pokemon-directory-page .era-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.pokemon-directory-page .era-filter-btn {
    min-width: 0;
    padding: 10px;
  }

  body.pokemon-pack-tracker-page main > section:not(.page-intro),
  body.pokemon-directory-page .era-filter-panel,
  body.pokemon-directory-page .set-navigator,
  body.pokemon-directory-page .tracker-cta {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.pokemon-tools-page *,
  body.pokemon-tools-page *::before,
  body.pokemon-tools-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
