:root {
  --bg: #0d0d0f;
  --bg-elevated: #17171b;
  --bg-card: #1b1b20;
  --bg-card-hover: #232329;
  --border: #2a2a31;
  --text: #f5f5f7;
  --text-dim: #9b9ba3;
  --text-dimmer: #6b6b74;
  --accent: #e63946;
  --accent-dark: #b3202c;
  --accent-grad: linear-gradient(135deg, #ef4444 0%, #7f1d1d 100%);
  --radius: 14px;
  --radius-sm: 8px;
  --stat-bar-bg: #2a2a31;
  --green: #4ade80;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f3;
  --border: #e2e2e7;
  --text: #17171b;
  --text-dim: #55555e;
  --text-dimmer: #8a8a93;
  --stat-bar-bg: #e2e2e7;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,13,15,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
:root[data-theme="light"] .site-header { background: rgba(255,255,255,0.9); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; white-space: nowrap; }
.brand-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='46' fill='%23fff' stroke='%23222' stroke-width='6'/%3E%3Cpath d='M4 50a46 46 0 0 1 92 0z' fill='%23e63946' stroke='%23222' stroke-width='6'/%3E%3Crect x='4' y='47' width='92' height='6' fill='%23222'/%3E%3Ccircle cx='50' cy='50' r='15' fill='%23222'/%3E%3Ccircle cx='50' cy='50' r='11' fill='%23fff' stroke='%23222' stroke-width='4'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
  flex-shrink: 0;
}
.header-actions { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px; max-width: 320px; width: 100%;
}
.search-box input {
  background: transparent; border: none; outline: none; color: var(--text);
  width: 100%; font-size: 14px;
}
.search-box input::placeholder { color: var(--text-dimmer); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-card-hover); }
.lang-btn {
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); padding: 0 14px; height: 38px; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.lang-switch {
  display: flex; align-items: center; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-card); height: 38px; padding: 3px; flex-shrink: 0;
}
.lang-switch-btn {
  border: none; background: transparent; color: var(--text-dim); font-weight: 700; font-size: 12px;
  padding: 0 12px; height: 100%; border-radius: 999px;
}
.lang-switch-btn.active { background: var(--accent); color: #fff; }

.auth-box { display: flex; align-items: center; flex-shrink: 0; }
.auth-login-btn {
  height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: transparent; color: var(--text); border: 1px solid var(--border); white-space: nowrap; cursor: pointer;
}
.auth-login-btn:hover { border-color: var(--accent); }
.auth-user { display: flex; align-items: center; gap: 6px; }
.auth-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.auth-name { font-size: 13px; font-weight: 700; max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .auth-name { display: none; }
  .auth-login-btn {
    width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 0; overflow: hidden;
  }
  .auth-login-btn::before { content: "🔐"; font-size: 16px; }

  /* the header is tight on a phone, so the search box collapses to just its
     icon until tapped, and the theme toggle moves into the hamburger menu
     (see .nav-drawer-theme-toggle) instead of taking up header space */
  #header-search-box {
    max-width: 38px; padding: 8px; overflow: hidden; cursor: pointer; flex-shrink: 0;
  }
  #header-search-box input { width: 0; }
  #header-search-box.expanded {
    max-width: none; flex: 1 1 auto; padding: 8px 16px; cursor: text;
  }
  #header-search-box.expanded input { width: 100%; }
  #theme-toggle-btn { display: none; }

  /* every remaining bit of width matters on a small phone: the brand text
     (the pokéball icon alone is still a clear home link), the side padding
     and the gaps between header icons all shrink a notch */
  .site-title-text { display: none; }
  .site-header .container { padding: 0 12px; gap: 8px; }
  .header-actions { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; font-size: 14px; }
  .auth-avatar { width: 26px; height: 26px; }
  .lang-switch-btn { padding: 0 9px; }
}

/* Nav drawer */
.nav-drawer {
  position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: var(--bg);
  height: calc(100vh - 64px);
  z-index: 40; overflow-y: auto; padding: 20px;
  display: none;
}
.nav-drawer.open { display: block; }
.nav-drawer-container { max-width: 1180px; margin: 0 auto; }
.nav-drawer .search-box { max-width: none; margin-bottom: 20px; }
.nav-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 40px;
  max-width: 640px;
}
.nav-grid a { padding: 12px 4px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--border); }
.nav-drawer-theme-toggle {
  display: block; width: 100%; max-width: 640px; margin-top: 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; text-align: left; font-size: 15px; font-weight: 700; color: var(--text); cursor: pointer;
}
.nav-drawer-theme-toggle:hover { background: var(--bg-card-hover); }

/* ---------- Hero ---------- */
.hero {
  background: var(--accent-grad);
  border-radius: var(--radius);
  padding: 48px 40px;
  margin: 24px 0 40px;
  position: relative; overflow: hidden;
  color: #fff;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.15); padding: 6px 14px; border-radius: 999px;
  font-size: 13px; margin-bottom: 16px;
}
.hero h1 { font-size: 48px; margin: 0 0 12px; font-weight: 900; }
.hero p { font-size: 16px; max-width: 480px; opacity: 0.92; margin: 0 0 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 14px;
  border: none;
}
.btn-white { background: #fff; color: #b3202c; }
.btn-ghost { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.hero-art {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  width: 220px; height: 220px; object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

/* ---------- Sections ---------- */
.section { margin: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 24px; margin: 0 0 2px; font-weight: 800; }
.section-head .sub { color: var(--text-dim); font-size: 14px; margin: 0; }
.section-head .view-all { color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap; }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.category-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; text-align: left; display: flex; flex-direction: row; align-items: center; gap: 12px;
}
.category-card:hover { background: var(--bg-card-hover); }
.category-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff;
}
.category-card .label { font-weight: 700; font-size: 14px; }

.type-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chip {
  padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: 12px;
  letter-spacing: 0.03em; color: #1b1b20;
}

/* ---------- Pokemon cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.poke-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; position: relative; transition: transform .15s ease, background .15s ease;
  display: block;
}
.poke-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); }
.poke-card .fav-btn {
  position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.3); border: none;
  width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.poke-card .fav-btn.active { color: var(--accent); }
.poke-card img { width: 100%; height: 110px; object-fit: contain; margin-bottom: 6px; }
.poke-card .num-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dimmer); margin-bottom: 2px; }
.poke-card .name { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.poke-card .types { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.poke-card .goto { font-size: 13px; color: var(--accent); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.type-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  color: #1b1b20; letter-spacing: 0.02em;
}

/* ---------- Regions ---------- */
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.region-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.region-card h3 { margin: 0 0 2px; font-size: 18px; }
.region-card .gen-tag { color: var(--accent); font-weight: 700; font-size: 13px; margin-bottom: 8px; display:block; }
.region-card p { color: var(--text-dim); font-size: 13px; margin: 0; }

/* ---------- Pokedex list page ---------- */
.page-title { font-size: 34px; font-weight: 900; margin: 24px 0 4px; }
.page-sub { color: var(--text-dim); margin: 0 0 20px; }
.search-box.wide { max-width: none; margin-bottom: 20px; }
.filters-panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 24px;
}
.filters-panel .filters-label { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip-row:last-child { margin-bottom: 0; }
.filter-chip {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
}
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-chip.type-filter.active { color: #1b1b20; }

/* ---------- Detail page ---------- */
.detail-back-row { display: flex; justify-content: space-between; align-items: center; margin: 20px 0; }
.detail-hero {
  background: linear-gradient(135deg, #24242c, #101013);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 28px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 6px;
  position: relative; overflow: hidden; margin-bottom: 20px;
  color: #f5f5f7;
}
.detail-hero .big-num {
  position: absolute; right: 24px; top: 10px; font-size: 64px; font-weight: 900;
  color: rgba(255,255,255,0.08); user-select: none;
}
.detail-hero .sprite-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0;
}
.detail-hero .sprite-wrap img { width: 160px; height: 160px; object-fit: contain; display: block; }
.shiny-toggle-btn {
  border-radius: 999px; background: #1b1b20; border: 1.5px solid #f59e0b33; color: #f5f5f7;
  font-size: 12px; font-weight: 700; padding: 5px 12px; cursor: pointer; white-space: nowrap;
}
.shiny-toggle-btn:hover { border-color: #f59e0b; }
.shiny-toggle-btn.active { background: linear-gradient(135deg, #fde047, #f59e0b); border-color: #f59e0b; color: #1b1b20; }

.detail-nav-arrow {
  position: absolute; top: 140px; z-index: 2;
  width: 44px; height: 140px; border-radius: 22px; border: none;
  background: linear-gradient(180deg, #fde047, #f59e0b);
  color: #1b1b20; font-size: 26px; font-weight: 900; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.detail-nav-arrow:hover { transform: scale(1.05); box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5); }
.detail-nav-arrow.prev { left: 10px; }
.detail-nav-arrow.next { right: 10px; }
@media (max-width: 640px) {
  .detail-nav-arrow { width: 36px; height: 110px; border-radius: 18px; font-size: 20px; top: 130px; }
  .detail-nav-arrow.prev { left: 4px; }
  .detail-nav-arrow.next { right: 4px; }
}
.detail-hero .info { max-width: 560px; width: 100%; }
.detail-hero .dex-num { color: #b8b8c0; font-weight: 700; margin-right: 8px; }
.detail-hero h1 { font-size: 32px; margin: 4px 0 10px; display:inline-flex; align-items:center; justify-content: center; gap:10px; color: #f5f5f7; }
.detail-hero .types { display: flex; gap: 8px; margin-bottom: 14px; justify-content: center; }
.detail-hero .flavor-preview { max-width: 560px; color: #c7c7cf; font-size: 14px; margin: 0 auto 10px; }
.detail-hero .meta-row { display: flex; gap: 20px; font-size: 13px; color: #c7c7cf; flex-wrap: wrap; justify-content: center; }
.heart-toggle { background: none; border: none; color: #c7c7cf; font-size: 18px; }
.heart-toggle.active { color: var(--accent); }

.forms-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.forms-row .forms-label { font-size: 12px; font-weight: 700; color: #b8b8c0; text-transform: uppercase; letter-spacing: .04em; }
.forms-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.form-chip {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text); font-size: 12px; font-weight: 600;
}
.form-chip img { width: 26px; height: 26px; object-fit: contain; }
.form-chip.active { border-color: var(--accent); background: rgba(230,57,70,0.12); }

.tab-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-btn {
  padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
}
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.tab-panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}
.tab-panel h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; }

.page-intro { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin: 0 0 16px; }
.story-box { display: flex; gap: 14px; align-items: center; background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }
.story-box img { width: 56px; height: 56px; object-fit: contain; }
.story-box .sname { font-weight: 800; }
.story-box .sgenus { font-size: 12px; color: var(--text-dim); }
.story-text { font-size: 15px; line-height: 1.6; margin-bottom: 16px; }
.notice { font-size: 12px; color: var(--text-dimmer); font-style: italic; margin-bottom: 10px; }
.story-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.voice-label { display: flex; align-items: center; gap: 6px; color: var(--text-dimmer); font-size: 12px; font-weight: 700; letter-spacing: .04em; }

.tcg-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; margin-bottom: 12px; }
.tcg-card {
  display: flex; flex-direction: column; gap: 4px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px;
  transition: transform .15s ease, border-color .15s ease;
}
.tcg-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.tcg-card[hidden] { display: none; }
.tcg-card img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; border-radius: 6px; background: #0d0d0f; }
.tcg-card-set { font-size: 11px; color: var(--text-dim); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcg-card-rarity { font-size: 10px; color: var(--text-dimmer); text-transform: uppercase; letter-spacing: .03em; }
.tcg-card-price {
  margin-top: 2px; text-align: center; font-size: 11px; font-weight: 700; color: #1b1b20;
  background: linear-gradient(135deg, #fde047, #f59e0b); border-radius: 999px; padding: 4px 8px;
}
.tcg-card-price:hover { filter: brightness(1.05); }
.tcg-card-species { font-size: 11px; font-weight: 800; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcg-credit { margin-top: 4px; margin-bottom: 0; }

.tcg-card-img-btn {
  display: block; width: 100%; border: none; background: none; padding: 0; margin: 0; cursor: zoom-in;
}

/* ---- card lightbox: click thumbnail -> full-size viewer with prev/next ---- */
.card-lightbox-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 10, 12, 0.92);
  display: flex; align-items: center; justify-content: center;
}
.card-lightbox-zone {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1; cursor: pointer;
}
.card-lightbox-zone.prev { left: 0; }
.card-lightbox-zone.next { right: 0; }
.card-lightbox-content {
  position: relative; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  max-width: min(90vw, 440px); padding: 20px;
}
.card-lightbox-img { max-width: 100%; max-height: 72vh; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,0.55); }
.card-lightbox-caption { color: #f5f5f7; font-weight: 700; font-size: 15px; text-align: center; }
.card-lightbox-collection-info { color: #fde047; font-weight: 700; font-size: 13px; text-align: center; }
.card-lightbox-counter { color: rgba(245,245,247,0.55); font-size: 12px; font-weight: 600; letter-spacing: .03em; }
.card-lightbox-close {
  position: absolute; top: 18px; right: 18px; z-index: 3; pointer-events: auto;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.12); color: #f5f5f7; font-size: 18px; font-weight: 700; cursor: pointer;
}
.card-lightbox-close:hover { background: rgba(255,255,255,0.22); }
.card-lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; pointer-events: auto;
  width: 44px; height: 140px; border-radius: 22px; border: none;
  background: linear-gradient(180deg, #fde047, #f59e0b);
  color: #1b1b20; font-size: 26px; font-weight: 900; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card-lightbox-arrow:hover { transform: translateY(-50%) scale(1.05); box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5); }
.card-lightbox-arrow.prev { left: 18px; }
.card-lightbox-arrow.next { right: 18px; }
@media (max-width: 640px) {
  .card-lightbox-arrow { width: 36px; height: 110px; border-radius: 18px; font-size: 20px; }
  .card-lightbox-arrow.prev { left: 6px; }
  .card-lightbox-arrow.next { right: 6px; }
  .card-lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 16px; }
  .card-lightbox-content { padding: 16px; gap: 8px; }
}

.tcg-card-collect-btn {
  margin-top: 2px; text-align: center; font-size: 11px; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: 4px 8px;
}
.tcg-card-collect-btn:hover { border-color: var(--accent); color: var(--text); }
.tcg-card-collect-btn.active { background: #16a34a; border-color: #16a34a; color: #fff; }

.tcg-card-wish-btn {
  margin-top: 2px; text-align: center; font-size: 11px; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: 4px 8px;
}
.tcg-card-wish-btn:hover { border-color: #f59e0b; color: var(--text); }
.tcg-card-wish-btn.active { background: linear-gradient(135deg, #fde047, #f59e0b); border-color: #f59e0b; color: #1b1b20; }

/* ---- My Collection page ---- */
.collection-summary { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.collection-stat {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; min-width: 140px; flex: 1;
}
.collection-stat .n { display: block; font-size: 22px; font-weight: 900; }
.collection-stat .l { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.collection-stat.unpriced { flex-basis: 100%; }
.collection-stat.unpriced .l { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.collection-list { display: flex; flex-direction: column; gap: 10px; }
.collection-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px;
}
.collection-row[hidden] { display: none; }
.collection-row img { width: 48px; height: 67px; object-fit: contain; border-radius: 4px; background: #0d0d0f; flex-shrink: 0; }
.collection-row-img-btn { width: auto; flex-shrink: 0; }
.collection-row-info { min-width: 0; flex: 1 1 160px; }
.collection-row-info .crn { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collection-row-info .crs { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collection-row-fields { display: flex; gap: 14px; flex-wrap: wrap; }
.collection-row-fields label {
  display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--text-dimmer);
  font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.collection-row-fields input, .collection-row-fields select {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 8px; color: var(--text); font-size: 13px; width: 92px;
}
.collection-remove-btn {
  background: none; border: none; color: var(--text-dimmer); font-size: 18px; cursor: pointer; flex-shrink: 0; padding: 6px;
}
.collection-remove-btn:hover { color: #ef4444; }
.collection-price-link {
  align-self: flex-end; white-space: nowrap; text-align: center; font-size: 11px; font-weight: 700;
  color: #1b1b20; background: linear-gradient(135deg, #fde047, #f59e0b);
  border-radius: 999px; padding: 6px 10px;
}
.collection-price-link:hover { filter: brightness(1.05); }
@media (max-width: 640px) {
  .collection-row-fields { width: 100%; }
  .collection-row-fields input, .collection-row-fields select { width: 100%; }
  .collection-price-link { align-self: stretch; }
}

.collection-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.collection-actions .btn { padding: 9px 16px; font-size: 13px; cursor: pointer; }
.collection-print-only { display: none; }

@media print {
  @page { size: portrait; margin: 14mm; }
  .site-header, .site-footer, .collection-actions, .search-box, #collection-filter-empty,
  .collection-list, .collection-summary, .card-lightbox-overlay,
  .set-progress-section, #wishlist-container { display: none !important; }
  body, .container { background: #fff !important; color: #000 !important; }
  .page-title, .page-sub { display: none; }
  .collection-print-only {
    display: block !important;
  }
  .collection-print-only h1 { font-size: 20px; margin: 0 0 12px; }
  .collection-print-only table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .collection-print-only th, .collection-print-only td {
    border: 1px solid #999; padding: 6px 8px; text-align: left;
  }
  .collection-print-only th { background: #eee; }
}

/* ---- set completeness tracker (Mijn collectie) ---- */
.set-progress-section { margin-bottom: 18px; }
.set-progress-main-toggle { padding: 9px 16px; font-size: 13px; cursor: pointer; }
.set-progress-body { margin-top: 14px; }
.set-progress-body[hidden] { display: none; }
.set-progress-title { font-size: 17px; margin: 0 0 4px; }
.set-progress-note { margin: 0 0 10px; font-size: 12px; }
.set-progress-list { display: flex; flex-direction: column; gap: 10px; }
.set-progress-row {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
}
.set-progress-info { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.set-progress-info .spn { font-weight: 700; }
.set-progress-info .spf { color: var(--text-dim); white-space: nowrap; }
.set-progress-bar { height: 8px; border-radius: 999px; background: var(--stat-bar-bg); overflow: hidden; }
.set-progress-fill { height: 100%; background: linear-gradient(135deg, #fde047, #f59e0b); border-radius: 999px; }
.set-progress-toggle {
  margin-top: 8px; background: none; border: none; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0;
}
.set-progress-missing { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.set-progress-missing[hidden] { display: none; }
.set-missing-card {
  font-size: 11px; color: var(--text-dim); background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 8px;
}

/* ---- wishlist ---- */
.wishlist-title { margin-top: 28px; }
.wishlist-list { display: flex; flex-direction: column; gap: 10px; }
.wishlist-row {
  display: flex; align-items: center; gap: 12px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px;
}
.wishlist-row-img { width: 48px; height: 67px; object-fit: contain; border-radius: 6px; background: #0d0d0f; flex-shrink: 0; }
.wishlist-row-info { flex: 1; min-width: 0; }
.wishlist-move-btn { white-space: nowrap; }
@media (max-width: 640px) {
  .wishlist-row { flex-wrap: wrap; }
  .wishlist-row-info { width: 100%; order: 1; }
  .wishlist-move-btn { order: 3; }
}

.stat-row { display: grid; grid-template-columns: 80px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.stat-row .label { color: var(--text-dim); font-weight: 700; text-transform: uppercase; font-size: 11px; }
.stat-track { height: 8px; border-radius: 999px; background: var(--stat-bar-bg); overflow: hidden; }
.stat-fill { height: 100%; border-radius: 999px; }
.stat-row .value { text-align: right; font-weight: 700; }
.stat-row.total .value, .stat-row.total .label { color: var(--text); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.info-item .l { font-size: 12px; color: var(--text-dimmer); text-transform: uppercase; margin-bottom: 4px; }
.info-item .v { font-weight: 700; }

.effect-group { margin-bottom: 18px; }
.effect-group .gt { font-weight: 700; margin-bottom: 8px; font-size: 13px; }
.effect-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.mult-badge { display:inline-flex; align-items:center; gap:6px; background: var(--bg-elevated); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700;}
.mult-badge .x { color: var(--text-dimmer); }

.ability-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.ability-item:last-child { border-bottom: none; }
.ability-item .an { font-weight: 800; display: flex; gap: 8px; align-items: center; }
.hidden-tag { font-size: 10px; background: var(--bg-elevated); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; color: var(--text-dim); }
.ability-item .ae { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.evo-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.evo-node { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 12px; text-align: center; width: 110px; }
.evo-node img { width: 72px; height: 72px; object-fit: contain; margin: 0 auto; }
.evo-node .n { font-size: 12px; font-weight: 700; margin-top: 4px; }
.evo-node.current { outline: 2px solid var(--accent); }
.evo-arrow { display: flex; flex-direction: column; align-items: center; color: var(--text-dimmer); font-size: 11px; gap: 2px; min-width: 70px; text-align:center; }

.moves-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.moves-table th { text-align: left; color: var(--text-dimmer); font-size: 11px; text-transform: uppercase; padding: 8px; border-bottom: 1px solid var(--border); }
.moves-table td { padding: 8px; border-bottom: 1px solid var(--border); }

.game-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.game-pill { background: var(--bg-elevated); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; border: 1px solid var(--border); }

/* ---------- Compare page ---------- */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-slot {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; min-height: 220px; position: relative;
}
.compare-slot img { width: 120px; height: 120px; object-fit: contain; margin: 0 auto 8px; }
.compare-slot .num { color: var(--text-dimmer); font-size: 12px; }
.compare-slot h3 { margin: 4px 0 8px; }
.compare-slot .search-toggle {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
}
.compare-slot .picker-empty { color: var(--text-dimmer); padding: 40px 0; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.compare-table td, .compare-table th { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.compare-table th { text-align: left; color: var(--text-dimmer); text-transform: uppercase; font-size: 11px; width: 30%; }
.compare-table td { text-align: center; font-weight: 700; }
.compare-table td.win { color: var(--green); }
.picker-panel {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
}
.picker-box { background: var(--bg-elevated); border-radius: var(--radius); width: 100%; max-width: 480px; max-height: 80vh; overflow: auto; padding: 16px; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); }
.picker-row:hover { background: var(--bg-card-hover); }
.picker-row img { width: 36px; height: 36px; object-fit: contain; }

/* ---------- Favorites / generic list ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }

/* ---------- Trios ---------- */
.trio-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.trio-card h3 { margin: 0 0 12px; }
.trio-members { display: flex; gap: 14px; flex-wrap: wrap; }
.trio-member { text-align: center; width: 90px; }
.trio-member img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; }
.trio-member .n { font-size: 12px; font-weight: 700; margin-top: 4px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 32px 0; text-align: center; color: var(--text-dimmer); font-size: 12px; }
.site-footer p { margin: 4px 0; }
.site-footer strong { color: var(--text-dim); }
.footer-donate-btn {
  display: inline-block; margin-top: 16px; font-size: 13px; font-weight: 700; color: #1b1b20;
  background: linear-gradient(135deg, #fde047, #f59e0b); border-radius: 999px; padding: 9px 20px;
}
.footer-donate-btn:hover { filter: brightness(1.05); }

/* ---------- Loading / misc ---------- */
.loading-spinner { text-align: center; padding: 60px 0; color: var(--text-dimmer); }

@media (max-width: 720px) {
  .hero { padding: 32px 20px; }
  .hero h1 { font-size: 32px; }
  .hero-art { display: none; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-grid { grid-template-columns: 1fr; gap: 0; }
}
