:root {
  --bg: #050714;
  --sidebar: rgba(8, 12, 30, 0.88);
  --panel: rgba(13, 18, 38, 0.9);
  --panel-strong: rgba(18, 25, 50, 0.95);
  --paper: rgba(10, 14, 32, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f4ff;
  --muted: #a6b0d7;
  --accent: #ff7b4a;
  --accent-soft: #facc15;
  --ad-bg: rgba(255, 255, 255, 0.04);
  --success: #5eead4;
  --warning: #fcd34d;
  --card: rgba(14, 18, 40, 0.92);
  --card-strong: rgba(20, 24, 52, 0.92);
  --card-highlight: rgba(255, 123, 74, 0.14);
  --pill: rgba(255, 196, 135, 0.2);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #0f172a 0%, #050714 55%, #02030b 100%);
  line-height: 1.7;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  margin-top: 0;
  font-weight: 600;
  color: var(--text);
}

p {
  margin-top: 0;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem 3rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand h1 {
  font-size: 1.55rem;
  margin-bottom: 0.4rem;
}

.sidebar__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 0.2rem;
}

.sidebar__tagline {
  font-size: 0.95rem;
}

.sidebar__search {
  margin: 1.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar__search input {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sidebar__search label {
  font-size: 0.85rem;
  color: var(--muted);
}

.sidebar__search p {
  font-size: 0.75rem;
  margin: 0;
}

.toc h2 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.toc ol {
  list-style: decimal-leading-zero;
  padding-left: 1.1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.toc a:hover {
  text-decoration: underline;
}

.sidebar__callouts {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ad-block {
  background: var(--ad-bg);
  border: 1px dashed var(--border-strong);
  border-radius: 0.65rem;
  padding: 0.9rem;
  text-align: center;
}

.affiliate-pill {
  display: inline-flex;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
}

.content {
  padding: 2.5rem clamp(1.5rem, 4vw, 4rem) 3rem;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.75rem;
  position: sticky;
  top: 0;
  background: var(--paper);
  padding: 0.5rem 0;
  z-index: 9;
}
.tab-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1.25rem;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 25px rgba(242, 96, 39, 0.2);
}
[data-tab-panel][hidden] {
  display: none !important;
}
.section-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}
.section-filter input {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.95rem;
}
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.screenshot-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: 0 15px 40px rgba(3, 6, 15, 0.45);
  overflow: hidden;
}
.screenshot-card img {
  width: 100%;
  display: block;
}
.screenshot-card figcaption {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.screenshot-card figcaption span {
  font-size: 0.8rem;
  color: var(--muted);
}
.walkthrough-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.walkthrough-card {
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  overflow: hidden;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 12px 30px rgba(3, 6, 15, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.walkthrough-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(20, 20, 20, 0.08);
}
.walkthrough-card img {
  width: 100%;
  display: block;
}
.walkthrough-card div {
  padding: 0.75rem 1rem 1rem;
}
.walkthrough-card .step-index {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.walkthrough-card h4 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}
.walkthrough-card span {
  font-size: 0.85rem;
  color: var(--muted);
}
.step-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.step-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  overflow: hidden;
}
.step-card summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  background: var(--panel);
}
.step-card summary::-webkit-details-marker {
  display: none;
}
.step-card[open] summary {
  border-bottom: 1px solid var(--border);
}
.step-list {
  list-style: none;
  counter-reset: walkthrough-step;
  padding: 1.1rem 1.4rem 1.4rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.step-list li {
  position: relative;
  counter-increment: walkthrough-step;
  padding: 1rem 0 1rem 3rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px solid rgba(18, 18, 18, 0.08);
}
.step-list li:last-child {
  border-bottom: none;
}
.step-list li::before {
  content: counter(walkthrough-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}

.step-list--media {
  list-style: none;
  padding: 1rem 0 1.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.step-list--media li {
  display: grid;
  grid-template-columns: minmax(90px, 150px) 1fr;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.step-list--media img {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.step-list--media strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.step-list--media p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.optional-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--pill);
  color: var(--accent);
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}
@media (max-width: 640px) {
  .step-list--media li {
    grid-template-columns: 1fr;
  }
}

.wiki-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: clamp(1.5rem, 2vw, 2.5rem);
  margin-bottom: 2rem;
  box-shadow: 0 20px 60px rgba(31, 30, 24, 0.05);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.toc-chip {
  background: var(--ad-bg);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.grid.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.hero-section .grid {
  align-items: start;
}

.hero-panel {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
  background: var(--card-strong);
}

.hero-panel dl {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.75rem;
}

.hero-panel dt {
  font-weight: 600;
}

.hero-panel dd {
  margin: 0;
  color: var(--muted);
}

.link-list {
  padding-left: 1.1rem;
  color: var(--accent);
}

.link-list a {
  color: var(--accent);
  text-decoration: none;
}

.table-wrap table,
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-wrap th,
.table-wrap td,
table th,
table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  padding: 0.45rem 0.25rem;
  text-align: left;
}

.table-wrap th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ordered-steps {
  margin: 0;
  padding-left: 1.25rem;
}

.ordered-steps li {
  margin-bottom: 0.5rem;
}

.note,
.note-list li {
  color: var(--muted);
}

.note-list {
  padding-left: 1rem;
  margin: 0;
}

.note-list li {
  margin-bottom: 0.4rem;
}

.tips-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
  background: var(--card);
}

.tool-card.wide {
  grid-column: span 2;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn {
  border: none;
  border-radius: 0.65rem;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.text {
  background: transparent;
  color: var(--muted);
}

.btn.stripe-btn {
  width: 100%;
  background: #231f20;
  color: #fff;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.team-card {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.6rem;
  background: var(--card);
}

.badge {
  display: inline-block;
  background: var(--ad-bg);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  margin-right: 0.3rem;
}

.weaknesses {
  color: var(--warning);
}

.suggested {
  color: var(--success);
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
}

.coverage-cell {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.45rem;
  text-align: center;
  font-size: 0.85rem;
}

.coverage-cell--weak {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.65);
}

.coverage-cell--ok {
  background: var(--card-highlight);
}

.premium-teaser {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(43, 108, 176, 0.1), rgba(71, 126, 188, 0.2));
}

.nuz-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.death-counter {
  font-weight: 600;
}

.tips-grid article {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
  background: var(--card);
}

.dex-range-grid {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dex-range {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--card);
  padding: 0.85rem 1rem;
}

.dex-range summary {
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  padding-right: 2rem;
  list-style: none;
}

.dex-range summary::marker {
  content: "";
}

.dex-range summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--accent);
}

.dex-range[open] summary::after {
  content: "–";
}

.dex-range ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dex-range li {
  font-size: 0.92rem;
  color: var(--muted);
}

.dex-range strong {
  color: var(--text);
}

.affiliate-grid {
  display: grid;
  gap: 0.75rem;
}

.affiliate-card {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--accent);
  background: var(--card);
  font-weight: 600;
}

.table-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn.table-btn {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.btn.table-btn.danger {
  color: #b42318;
  border-color: #f2a39a;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 1rem;
}

@media (max-width: 960px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .tool-card.wide {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .section-head {
    flex-direction: column;
  }

  .toc ol {
    columns: 2;
  }
}

.route-catalog {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.route-panel {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--card);
  padding: 0.75rem 1rem;
}

.route-panel summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  gap: 0.5rem;
}

.route-panel summary::-webkit-details-marker {
  display: none;
}

.route-name {
  font-size: 1rem;
}

.route-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.route-columns {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.route-columns article h4 {
  margin-bottom: 0.4rem;
}

.data-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.data-list li {
  margin-bottom: 0.35rem;
}

.gym-grid,
.location-grid,
.sevii-grid,
.postgame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.gym-card,
.location-card,
.sevii-card,
.postgame-card {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
  background: var(--card);
}

.gym-card h3,
.location-card h3,
.sevii-card h3,
.postgame-card h3 {
  margin-bottom: 0.4rem;
}

.gym-card ul,
.location-card ul,
.sevii-card ul,
.postgame-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.gym-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* Game8Builder additions */
.accent {
  border: 1px solid var(--accent);
  box-shadow: 0 25px 80px rgba(43, 108, 176, 0.08);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.guide-card {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.guide-card ul {
  padding-left: 1.1rem;
  margin: 0;
  color: var(--muted);
}
.guide-card .btn.link {
  align-self: flex-start;
}
.pokedex-search {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pokedex-search input {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}
.pokedex-table-wrapper {
  overflow-x: auto;
}
.pokedex-table {
  width: 100%;
  border-collapse: collapse;
}
.pokedex-table th, .pokedex-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem;
  text-align: left;
}
.type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  margin-right: 0.25rem;
}
.type-chip.grass { background: #3ba559; }
.type-chip.poison { background: #9141a9; }
.type-chip.fire { background: #ee8130; }
.type-chip.flying { background: #7f9ad3; }
.type-chip.water { background: #4592c4; }
.type-chip.electric { background: #f7d02c; }
.type-chip.dragon { background: #6f35fc; }
.type-chip.psychic { background: #f95587; }
.type-chip.normal { background: #a8a77a; }
.type-chip.bug { background: #a6b91a; }
.type-chip.ground { background: #e2bf65; }
.type-chip.rock { background: #b6a136; }
.type-chip.ghost { background: #735797; }
.type-chip.fighting { background: #c22e28; }
.type-chip.steel { background: #b7b7ce; }
.type-chip.ice { background: #96d9d6; }
.type-chip.dark { background: #705746; }
.type-chip.fairy { background: #d685ad; }

.pokedex-table td:last-child {
  min-width: 200px;
}
.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.affiliate-card {
  border: 1px dashed var(--border-strong);
  border-radius: 0.9rem;
  padding: 0.85rem;
  background: var(--card);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.hm-grid, .nature-grid, .related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.hm-grid article, .nature-grid article, .related-grid article {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
  background: var(--panel);
}
.ability-table {
  width: 100%;
  border-collapse: collapse;
}
.ability-table th, .ability-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem;
}
.news-feed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.news-feed li {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
}

/* --- Aesthetic refresh + tool pages --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 123, 74, 0.25), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(92, 225, 230, 0.18), transparent 40%);
  z-index: -2;
}

.site-shell {
  background: linear-gradient(135deg, rgba(6, 8, 21, 0.85), rgba(4, 5, 15, 0.95));
}

.sidebar {
  background: var(--sidebar);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  color: var(--muted);
}
.sidebar__brand h1 {
  color: var(--text);
}
.sidebar__search input,
.section-filter input,
.dex-controls input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
}
.sidebar__search label,
.sidebar__search p,
.section-filter label {
  color: var(--muted);
}
.toc a {
  color: var(--accent);
}
.toc a:hover {
  color: #ffffff;
}

.content {
  background: transparent;
  color: var(--text);
}

.tab-nav {
  background: rgba(5, 8, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}
.tab-button {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}
.tab-button.is-active {
  background: linear-gradient(120deg, #ff7b4a, #facc15);
  color: #050505;
}

.wiki-section {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 25px 80px rgba(3, 6, 15, 0.45);
}
.wiki-section.accent {
  background: var(--panel-strong);
}

.global-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(7, 10, 25, 0.9);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}
.brand-mark {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
}
.global-links {
  display: flex;
  gap: 1rem;
}
.global-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.global-links a:hover,
.global-links a.is-current {
  background: rgba(255, 123, 74, 0.18);
  color: #fff;
}
.nav-toggle {
  display: none;
}

@media (max-width: 900px) {
  .global-links {
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background: rgba(5, 8, 20, 0.95);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
    display: none;
  }
  .global-links.nav-links--open,
  .global-links.nav-links--open {
    display: flex;
  }
  .nav-toggle {
    display: flex;
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    padding: 0.25rem 0.9rem;
    cursor: pointer;
  }
}

.tool-portal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.tool-portal__card,
.tool-portal__preview {
  padding: 1.5rem;
  border-radius: 1.2rem;
  border: 1px solid var(--border);
  background: rgba(12, 16, 38, 0.85);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.03);
}
.tool-portal__preview {
  background: linear-gradient(135deg, rgba(255, 123, 74, 0.2), rgba(92, 225, 230, 0.18));
}
.tool-feature-list {
  padding-left: 1rem;
  margin: 0 0 1rem;
  color: var(--muted);
}

.tool-page {
  min-height: 100vh;
  padding: 2rem clamp(1rem, 3vw, 3rem);
}
.tool-main {
  max-width: 1200px;
  margin: 0 auto;
}
.tool-hero {
  background: rgba(5, 8, 20, 0.9);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: clamp(1.5rem, 2vw, 2.75rem);
  margin-bottom: 1.5rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.tool-module {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: rgba(9, 12, 30, 0.9);
  padding: clamp(1.25rem, 2vw, 2rem);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}
.dex-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.pokedex-table {
  overflow-x: auto;
}
.pokedex-table table {
  width: 100%;
  border-collapse: collapse;
}
.pokedex-table th,
.pokedex-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
  color: var(--text);
}

.btn.primary {
  background: linear-gradient(120deg, #ff7b4a, #facc15);
  border: none;
  color: #050505;
}
.btn.secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn.text {
  color: var(--accent-soft);
}

.tool-card {
  background: rgba(15, 19, 42, 0.9);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.03);
}

.table-actions .btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.death-counter {
  color: #f87171;
  font-weight: 700;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.tool-card.wide {
  grid-column: span 2;
}
@media (max-width: 900px) {
  .tool-card.wide {
    grid-column: span 1;
  }
}
body.search-open {
  overflow: hidden;
}

.global-search-trigger {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.global-search-trigger:hover,
.global-search-trigger:focus-visible {
  background: rgba(255, 123, 74, 0.18);
  border-color: var(--accent);
  color: #fff;
}

.global-search-trigger kbd {
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.05rem 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
}

.search-overlay[hidden] {
  display: none !important;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 15, 0.85);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  z-index: 999;
}

.search-panel {
  width: min(720px, 100%);
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.search-input-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  background: rgba(10, 12, 30, 0.85);
  color: var(--text);
}

.search-hint {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--muted);
}

.search-results {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.search-result {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  background: rgba(10, 12, 28, 0.85);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.search-result strong {
  font-size: 0.95rem;
  color: #fff;
}

.search-result span {
  font-size: 0.8rem;
  color: var(--muted);
}

.search-result small {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--accent);
}

.search-result.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 123, 74, 0.25);
}

@media (max-width: 640px) {
  .global-search-trigger {
    width: 100%;
    justify-content: center;
  }

  .search-hint {
    display: none;
  }
}
