/* ===== Fonts ===== */
@font-face {
  font-family: 'Fredoka One';
  src: url('../fonts/FredokaOne-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;700;800;900&display=swap');

/* ===== Variables ===== */
:root {
  --bg: #f8f9fd;
  --bg-secondary: #f8f9fa;
  --text: #111111;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --color-tx: #22c55e;
  --color-promo: #8b5cf6;
  --color-purple: #7c3aed;
  --overlay: rgba(0, 0, 0, 0.85);
  --radius: 8px;
  --transition: 150ms ease;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.15);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.50);
  --font-sans: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-display: 'Fredoka One', 'Nunito', system-ui, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body { font-family: var(--font-sans); color: var(--text); background: var(--bg); line-height: 1.5; zoom: 1.1; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ===== Ad gate modal ===== */
.adgate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 15, 30, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.adgate-overlay.adgate-open {
  display: flex !important;
}
.adgate-card {
  background: #1a2236;
  border-radius: 20px;
  padding: 36px 32px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.adgate-icon { margin-bottom: 4px; }
.adgate-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.35;
}
.adgate-body {
  font-size: 0.88rem;
  color: #a8b8d8;
  line-height: 1.6;
  margin: 0;
}
.adgate-warning {
  background: #2a1f0a;
  border: 1.5px solid #d97706;
  border-radius: 12px;
  padding: 16px 20px;
  width: 100%;
  text-align: left;
}
.adgate-warning-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.adgate-warning-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.adgate-warning-list li {
  font-size: 0.85rem;
  color: #f87171;
  line-height: 1.4;
}
.adgate-warning-list li strong {
  color: #fca5a5;
}
.adgate-btn {
  margin-top: 4px;
  width: 100%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px 24px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: filter 0.15s, transform 0.15s;
  box-shadow: 0 4px 20px rgba(37,99,235,0.4);
}
.adgate-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.adgate-btn:active {
  transform: translateY(1px);
}
.adgate-tip {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { font-weight: 700; font-size: 18px; }
.nav-logo-img { height: 72px; width: auto; display: block; }

/* ===== Search header ===== */
.search-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  position: relative;
  z-index: 10;
}
.search-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 11px 0 10px;
  position: relative;
  z-index: 1;
}
.header-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.header-logo-img { height: 78px; width: auto; display: block; }
.header-buttons { display: flex; align-items: center; gap: 12px; }
.header-btn-wrap {
  cursor: pointer;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.header-btn-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  -webkit-mask-image: url('../images/request-button.svg');
  mask-image: url('../images/request-button.svg');
  -webkit-mask-size: auto 44px;
  mask-size: auto 44px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background: linear-gradient(90deg, #ff0000 0%, #ff8c00 15%, #00ff00 45%, #00ccff 65%, #8800ff 85%, #ff0000 100%);
  background-size: 200% 100%;
  animation: rainbow-slide 1s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease-in-out;
}
.header-btn-wrap:hover::after {
  opacity: 1;
}
@keyframes rainbow-slide {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.header-btn-img { height: 44px; width: auto; display: block; transition: opacity 0.45s ease-in-out; }
.header-btn-wrap:hover .header-btn-img { opacity: 0; }
#fan-gallery-btn {
  overflow: visible;
  height: 44px;
}
#fan-gallery-btn::after { display: none; }
#auth-btn { overflow: visible; position: relative; z-index: 9999; }
#auth-btn::after { display: none; }
#fan-gallery-btn::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 1px;
  width: 174px;
  height: 42px;
  border-radius: 21px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='120'%3E%3Cpath d='M0 30 Q50 2 100 30 Q150 58 200 30 Q250 2 300 30 Q350 58 400 30 L400 120 L0 120 Z' fill='%23C060C8'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 0 48px;
  transition: background-position 1.8s ease-out;
  pointer-events: none;
  z-index: 0;
}
#fan-gallery-btn:hover::before {
  background-position: 60% -80px;
}
#fan-gallery-btn .header-btn-img {
  height: 71px;
  margin-top: -21px;
  transition: none;
  position: relative;
  z-index: 1;
}
#fan-gallery-btn:hover .header-btn-img { opacity: 1; }
.search-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--chip-color, #888);
  flex-shrink: 0;
  display: inline-block;
}
.search-header-bottom { padding-bottom: 14px; }
.search-header .search-wrapper { width: 100%; }
.search-badge-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== Search ===== */
.search-wrapper { position: relative; }
.search-input {
  width: 100%;
  padding: 10px 200px 10px 14px;
  font-size: 15px;
  font-family: var(--font-sans);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: #ffffff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  border-color: var(--color-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
@media (max-width: 600px) {
  .search-header-top { flex-direction: column; align-items: center; }
  .search-chips { display: none; }
  .search-badge-hint { display: none; }
  .search-input { padding-right: 14px; }
  .navbar-inner { justify-content: center; }
  .navbar-inner .header-buttons { display: none; }
}
/* Below ~440px: column layout, official top / textless below */
@media (max-width: 440px) {
  .lightbox-overlay {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-top: calc(env(safe-area-inset-top, 0px) + 56px) !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .lightbox-content {
    position: relative;
    max-width: 100%;
    width: 100%;
    overflow: visible;
    max-height: none;
    padding: 0;
  }
  .lightbox-close {
    position: fixed;
    top: max(env(safe-area-inset-top, 0px), 12px);
    right: 12px;
  }
  .lightbox-compare {
    flex-direction: column;
    align-items: center;
    gap: 36px;
  }
  .lb-compare-divider {
    display: block !important;
    width: 65vw;
    height: 1.5px;
    background: rgba(255,255,255,0.35);
    border-radius: 2px;
    flex-shrink: 0;
    align-self: center;
  }
  .lightbox-compare-card {
    align-items: center;
    width: 65vw;
  }
  .lightbox-compare .lb-img-clip,
  .lightbox-compare-card.textless .lb-img-clip {
    width: 65vw;
    aspect-ratio: 5 / 7;
    border-radius: calc(65vw * 0.0476);
  }
  .lightbox-compare .lightbox-compare-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    box-shadow: none;
  }
}
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-secondary); }
.result-thumb { height: 44px; width: auto; border-radius: 4px; flex-shrink: 0; object-fit: cover; }
.result-name { font-weight: 500; flex: 1; }
.result-set { font-size: 12px; color: var(--text-muted); }
.result-num { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.search-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 14px; }
.search-result .badge-tx { position: static; display: inline-block; vertical-align: middle; }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

/* ===== Series sections ===== */
.series-section { margin-bottom: 48px; }
.series-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 4px solid var(--series-color, #888);
  color: var(--series-color, #888);
}

/* ===== Set tiles grid ===== */
.sets-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .sets-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .sets-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .sets-grid { grid-template-columns: repeat(2, 1fr); } }
.set-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  height: 96px;
  transition: box-shadow var(--transition), transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.set-tile:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.set-tile-logo {
  display: block;
  width: 100%;
  height: 54px;
  object-fit: contain;
  object-position: center;
}
.set-tile-name { font-size: 10px; font-weight: 500; color: var(--text); line-height: 1.3; text-align: center; }
.set-tile .badge-promo { display: flex; align-items: center; justify-content: center; margin-top: 6px; }
.badge-promo {
  display: inline-block;
  margin-top: 5px;
  font-size: 9px;
  font-weight: 700;
  background: var(--color-promo);
  color: white;
  border-radius: 4px;
  padding: 1px 4px;
  letter-spacing: 0.5px;
}

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

/* ===== Set header ===== */
.set-header { margin-bottom: 20px; display: flex; flex-direction: column; align-items: center; gap: 40px; padding: 24px 0 8px; }
.set-logo-large { max-height: 160px; width: auto; object-fit: contain; }
.set-counter { color: var(--text); font-size: 18px; font-weight: 700; background: #f0f2f7; border: 2px solid var(--border); border-radius: 12px; padding: 8px 20px; }

/* ===== Tabs ===== */
.tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
  font-family: var(--font-sans);
}
.tab-btn.active { color: var(--color-purple); border-bottom-color: var(--color-purple); }
.tab-btn:hover:not(.active) { color: var(--text); }

/* ===== Card grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 860px)  { .card-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px)  { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
.card-item {
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}
.card-item.no-textless { cursor: default; }
.card-item.has-textless:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  z-index: 1;
}
.card-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transform: translateZ(0);
  will-change: transform;
  aspect-ratio: 5 / 7;
}
.card-img-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-img-real {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
@keyframes cardFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.card-img-real.card-loaded { animation: cardFadeIn 0.5s ease forwards; }
.card-item.no-textless .card-img-wrap img {
  filter: brightness(0.7) saturate(0.5);
  transition: filter 200ms ease;
}
.card-unavailable {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 150ms ease;
}
.card-item.no-textless:hover .card-unavailable { opacity: 1; }
.card-unavailable img {
  width: 70%;
  height: auto;
  display: block;
  object-fit: contain;
}
.badge-tx {
  position: absolute;
  top: 11px; right: 11px;
  width: 27px;
  height: 18px;
  display: block;
}
.badge-tx-img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== Lightbox ===== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-overlay.active { display: flex; }
.lightbox-content {
  position: relative;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.lightbox-mode-toggle {
  display: flex;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.lightbox-mode-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.lightbox-mode-btn.active {
  background: #fff;
  color: #111;
}
.lightbox-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox-single img {
  max-height: 65vh;
  max-width: 80vw;
  width: auto;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.lightbox-compare {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 85vw;
}
.lightbox-compare-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.lb-img-clip {
  border-radius: 22px;
  overflow: hidden;
  line-height: 0;
}
.lightbox-compare-card img {
  /* On large screens: capped at 63vh (full-screen ratio preserved).
     On smaller screens: capped by available width — two 5:7 cards + gap = (85vw-14px)*7/10 max height. */
  height: min(63vh, calc((85vw - 14px) * 0.7));
  width: auto;
  display: block;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}
.lightbox-compare-card.textless .lb-img-clip { outline: 2px solid var(--color-tx); outline-offset: 3px; border-radius: 22px; }
.lb-compare-divider { display: none; }
/* ===== Download button ===== */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #86efac;
  color: #14532d;
  font-weight: 800;
  font-size: 13px;
  font-family: var(--font-sans);
  border: 2.5px solid #166534;
  border-radius: 999px;
  padding: 8px 22px;
  margin-top: 10px;
  cursor: pointer;
  box-shadow: 0 5px 0 #166534, 0 7px 16px rgba(0,0,0,0.25);
  transition: transform 100ms ease, box-shadow 100ms ease;
  letter-spacing: 0.3px;
  user-select: none;
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #166534, 0 10px 20px rgba(0,0,0,0.3);
}
.btn-download:hover::before {
  animation: pokeball-wiggle 1s ease-in-out infinite;
  transform-origin: center bottom;
}
@keyframes pokeball-wiggle {
  0%   { transform: rotate(0deg);   }
  12%  { transform: rotate(-16deg); }
  25%  { transform: rotate(16deg);  }
  38%  { transform: rotate(-16deg); }
  50%  { transform: rotate(0deg);   }
  100% { transform: rotate(0deg);   }
}
.btn-download:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #166534, 0 4px 8px rgba(0,0,0,0.2);
}
.btn-download::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #111;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 50% 50%,
      white 0%, white 22%,
      #111 22%, #111 36%,
      transparent 36%),
    linear-gradient(to bottom,
      transparent calc(50% - 1.5px),
      #111 calc(50% - 1.5px),
      #111 calc(50% + 1.5px),
      transparent calc(50% + 1.5px)),
    linear-gradient(to bottom, #ff3333 50%, white 50%);
}

.lightbox-close {
  position: fixed;
  top: 16px; right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  font-family: inherit;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-info { color: white; text-align: center; }
#lightbox-card-name { display: block; font-weight: 700; font-size: 16px; }
#lightbox-card-number { display: block; font-size: 13px; opacity: 0.5; margin-top: 2px; }

/* ===== Pokeball lightbox loader ===== */
@keyframes pokeballSpin { to { transform: rotate(360deg); } }
.pokeball-spin {
  width: 48px; height: 48px;
  background: linear-gradient(to bottom, #ff3333 50%, #ffffff 50%);
  border-radius: 50%;
  border: 4px solid #222;
  position: relative;
  animation: pokeballSpin 0.75s linear infinite;
  flex-shrink: 0;
}
.pokeball-spin::before {
  content: '';
  position: absolute;
  height: 4px; width: 100%;
  background: #222;
  top: 50%; transform: translateY(-50%);
}
.pokeball-spin::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border: 4px solid #222;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px #fff;
}
.lb-global-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lb-global-loader.hidden { display: none; }
.lightbox-content {
  opacity: 0;
  transition: opacity 1s ease;
}
.lightbox-content.lb-ready { opacity: 1; }

/* ===== Card grid empty state ===== */
.card-grid-empty { color: var(--text-muted); grid-column: 1 / -1; }


/* ===== Auth button crossfade ===== */
#auth-btn .auth-img-default { transition: opacity 0.1s ease-in-out; }
#auth-btn:hover .auth-img-default { opacity: 1; } /* annule la règle générique header-btn-wrap */
#auth-btn .auth-img-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.1s ease-in-out;
}
#auth-btn:hover:not(:has(#account-dropdown:not([hidden]))) .auth-img-default { opacity: 0; transition: opacity 0.4s ease-in-out; }
#auth-btn:hover:not(:has(#account-dropdown:not([hidden]))) .auth-img-hover   { opacity: 1; transition: opacity 0.4s ease-in-out; }

/* ===== Home button crossfade ===== */
.nav-home-btn {
  cursor: pointer;
  position: relative;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
}
.nav-home-btn .home-img-default,
.nav-home-btn .home-img-hover {
  height: 44px;
  width: auto;
  display: block;
  transition: opacity 0.45s ease-in-out;
}
.nav-home-btn .home-img-hover {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: contain;
  opacity: 0;
}
.nav-home-btn:hover .home-img-default { opacity: 0; }
.nav-home-btn:hover .home-img-hover   { opacity: 1; }

/* ===== Auth modal ===== */
.auth-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 600;
}
.auth-modal-overlay[hidden] { display: none; }
.auth-modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 380px; max-width: 90vw;
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.auth-modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 26px;
  cursor: pointer; color: var(--text-muted); line-height: 1;
}
.auth-modal-close:hover { color: var(--text); }
.auth-modal-title { font-size: 20px; font-weight: 800; color: var(--text); }
.auth-input {
  width: 100%; padding: 11px 14px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
  font-family: var(--font-sans); outline: none;
  transition: border-color 150ms;
}
.auth-input:focus { border-color: #111; }
.auth-input::placeholder { color: var(--text-muted); }
.auth-submit {
  background: #2BD55E; color: #fff;
  border: none; border-radius: 8px;
  padding: 11px; font-size: 14px; font-weight: 700;
  font-family: var(--font-sans); cursor: pointer;
  transition: background 150ms;
}
.auth-submit:hover { background: #22b84f; }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-feedback { font-size: 13px; font-weight: 600; }
.auth-ok  { color: var(--color-tx); }
.auth-err { color: #ef4444; }
.auth-toggle { font-size: 13px; color: var(--text-muted); text-align: center; }
.auth-toggle-btn {
  background: none; border: none; color: #2BD55E;
  font-weight: 700; cursor: pointer; font-size: 13px;
  font-family: var(--font-sans); text-decoration: underline;
}
.auth-toggle-btn:hover { text-decoration: underline; }
.auth-forgot { margin: -4px 0; text-align: right; }
.auth-forgot-btn { background: none; border: none; color: var(--text-muted); font-size: 12px; font-family: var(--font-sans); cursor: pointer; text-decoration: underline; padding: 0; }
.auth-forgot-btn:hover { color: #111; }
.auth-social-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: .05em;
}
.auth-social-divider::before,
.auth-social-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-social-btns { display: flex; flex-direction: column; gap: 8px; }
.auth-social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; cursor: pointer; font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; color: var(--text); width: 100%;
  transition: background 150ms, border-color 150ms;
}
.auth-social-btn:hover { background: #f5f5f5; border-color: #bbb; }
.auth-social-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ===== Account Dropdown ===== */
.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  min-width: 210px;
  padding: 6px;
  z-index: 700;
  border: 1px solid rgba(0,0,0,0.06);
}
.account-dropdown[hidden] { display: none; }
.acct-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: #111;
  text-decoration: none; cursor: pointer;
  border: none; background: none; width: 100%;
  font-family: var(--font-sans); text-align: left;
  transition: background 120ms;
}
.acct-dd-item:hover { background: #f4f4f5; }
.acct-dd-icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acct-dd-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }
.acct-dd-logout { color: #ef4444; }

/* ===== Favorite button on cards ===== */
.fav-btn {
  position: absolute; top: 6px; left: 6px;
  background: rgba(255,255,255,0.88);
  border: none; border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0;
  transition: opacity 150ms, transform 150ms;
  z-index: 10; padding: 0;
}
.fav-btn svg { width: 14px; height: 14px; fill: #ccc; transition: fill 150ms; }
.fav-btn.is-fav svg { fill: #ef4444; }
.fav-btn.is-fav { opacity: 1; }
.card-item:hover .fav-btn { opacity: 1; }
.fav-btn:hover { transform: scale(1.15); }

/* ===== Account pages ===== */
.account-page { max-width: 700px; margin: 48px auto; padding: 0 24px; }
.account-page-title { font-size: 26px; font-weight: 800; color: var(--text); margin: 0 0 32px; }
.account-section { background: #fff; border-radius: 16px; padding: 28px; margin-bottom: 20px; box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
.account-section-title { font-size: 15px; font-weight: 800; color: var(--text); margin: 0 0 16px; }
.account-field-label { font-size: 13px; font-weight: 700; color: var(--text-muted); margin: 0 0 6px; display: block; }
.account-input { width: 100%; padding: 10px 14px; background: #fff; border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; font-family: var(--font-sans); outline: none; transition: border-color 150ms; box-sizing: border-box; }
.account-input:focus { border-color: #111; }
.account-btn { background: #111; color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; font-weight: 700; font-family: var(--font-sans); cursor: pointer; transition: background 150ms; margin-top: 12px; }
.account-btn:hover { background: #333; }
.account-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.account-feedback { font-size: 13px; margin-top: 10px; }
.account-ok  { color: #2BD55E; }
.account-err { color: #ef4444; }
.fav-grid-empty { color: var(--text-muted); font-size: 15px; text-align: center; padding: 60px 0; grid-column: 1 / -1; }
.page-placeholder { text-align: center; padding: 80px 24px; color: var(--text-muted); }
.page-placeholder-icon { font-size: 48px; margin-bottom: 16px; }
.page-placeholder-title { font-size: 20px; font-weight: 800; color: var(--text); margin: 0 0 8px; }
.page-placeholder-body { font-size: 15px; line-height: 1.6; }

/* ===== Request modal ===== */
.req-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.req-modal-overlay[hidden] { display: none; }
.req-modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 420px; max-width: 90vw;
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.req-modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 26px;
  cursor: pointer; color: var(--text-muted); line-height: 1;
}
.req-modal-title { font-size: 20px; font-weight: 800; color: var(--text); }
.req-modal-sub   { font-size: 14px; color: var(--text-muted); margin-top: -4px; }
.req-textarea {
  width: 100%; height: 80px;
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: var(--font-sans);
  resize: none; outline: none;
  transition: border-color 150ms;
}
.req-textarea:focus { border-color: var(--color-purple); }
.req-chars { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: -6px; }
.req-submit {
  background: #111; color: #fff;
  border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 14px; font-weight: 700;
  font-family: var(--font-sans); cursor: pointer;
  transition: background 150ms;
}
.req-submit:hover { background: #333; }
.req-feedback { font-size: 13px; font-weight: 600; }
.req-ok  { color: var(--color-tx); }
.req-err { color: #ef4444; }

/* ===== Page enter animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Index */
.search-header-top    { animation: fadeUp 0.38s ease both; }
.explainer-banner     { animation: fadeUp 0.38s ease both; animation-delay: 0.07s; }
.search-header-bottom { animation: fadeUp 0.38s ease both; animation-delay: 0.14s; }

.series-section                { animation: fadeUp 0.38s ease both; }
.series-section:nth-child(1)   { animation-delay: 0.2s; }
.series-section:nth-child(2)   { animation-delay: 0.27s; }
.series-section:nth-child(3)   { animation-delay: 0.34s; }

/* Set page */
.set-header { animation: fadeUp 0.38s ease both; animation-delay: 0.04s; }
.tabs       { animation: fadeUp 0.38s ease both; animation-delay: 0.15s; }
.card-grid  { animation: fadeUp 0.38s ease both; animation-delay: 0.21s; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 22px 24px;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.7;
  border-top: 1px solid var(--border);
  margin-top: 48px;
  background: #e8edf5;
  color: #111;
}

/* ===== Fan Gallery ===== */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.gallery-title { font-size: 28px; font-weight: 900; color: var(--text); }
.gallery-sort {
  position: relative;
  display: flex;
  background: #f0f0f0;
  border-radius: 12px;
  padding: 4px;
}
.sort-slider-bg {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: left 0.25s cubic-bezier(.4,0,.2,1), width 0.25s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.sort-pill {
  position: relative;
  z-index: 1;
  padding: 8px 20px;
  border: none;
  background: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  white-space: nowrap;
}
.sort-pill.active { color: var(--text); }
.fanart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px;
  padding-bottom: 48px;
}
.fanart-empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
  font-size: 15px;
}
.fanart-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.fanart-card:hover { }
.fanart-img-wrap { aspect-ratio: 3/4; overflow: hidden; background: #f5f5f5; cursor: pointer; }
.fanart-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fanart-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 10px;
}
.fanart-details { min-width: 0; }
.fanart-pokemon { font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fanart-author  { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fanart-upvote-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 2.5px solid #111;
  border-radius: 20px;
  background: #2BD55E;
  color: #111;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #111;
  transition: transform 0.1s, box-shadow 0.1s;
  flex-shrink: 0;
  line-height: 1;
}
.fanart-upvote-btn:hover  { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #111; }
.fanart-upvote-btn:active { transform: translate(2px,2px);   box-shadow: 1px 1px 0 #111; }
.fanart-upvote-btn.is-upvoted { background: #22c152; }
.fanart-upvote-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 #111; }

.upvote-count {
  display: inline-block;
  overflow: hidden;
  position: relative;
  vertical-align: middle;
  min-width: 1ch;
}
.upvote-val { display: block; }

/* ===== Gallery header actions ===== */
.gallery-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Submit fan art button ===== */
.submit-fanart-btn {
  background: #2BD55E;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 20px 9px 16px;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.submit-fanart-btn svg { display: block; flex-shrink: 0; }
.submit-fanart-btn:hover  { background: #22c152; }
.submit-fanart-btn:active { transform: scale(0.97); }

/* ===== Submit modal ===== */
.submit-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.submit-modal-overlay[hidden] { display: none !important; }
.submit-modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.submit-modal-title { font-size: 20px; font-weight: 800; color: #111; margin: 0; }
.submit-modal-sub   { font-size: 13px; color: #9ca3af; margin: 0; }
.submit-modal-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none; font-size: 26px;
  cursor: pointer; color: #6b7280; line-height: 1; padding: 0;
}
.submit-modal-close:hover { color: #111; }

/* Drop zone — 5:7 Pokemon card ratio */
.submit-drop-zone {
  position: relative;
  aspect-ratio: 5 / 7;
  border: 2.5px dashed #d1d5db;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #f9fafb;
  display: flex; align-items: center; justify-content: center;
}
.submit-drop-zone:hover,
.submit-drop-zone.drag-over { border-color: #2BD55E; background: #f0fdf4; }
.submit-drop-zone.has-image  { border-color: #2BD55E; border-style: solid; }
.drop-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #9ca3af; font-size: 14px; font-weight: 600; text-align: center; padding: 20px;
  pointer-events: none;
}
.drop-hint { font-size: 11px; font-weight: 400; }
.submit-drop-zone.has-image .drop-placeholder { display: none; }
.submit-drop-zone #submit-preview-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.submit-drop-zone.has-image #submit-preview-img { display: block; }
.submit-drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* ===== Status badges ===== */
.fanart-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ===== My fan art (account page) ===== */
.account-fanart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.my-fanart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
}
.my-fanart-item { display: flex; flex-direction: column; gap: 8px; }
.my-fanart-img-wrap {
  aspect-ratio: 5 / 7;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
}
.my-fanart-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.my-fanart-meta { display: flex; flex-direction: column; gap: 5px; }
.my-fanart-pokemon { font-size: 13px; font-weight: 800; color: #111; }
.my-fanart-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.my-fanart-delete-btn {
  background: #fee2e2; color: #991b1b;
  border: none; border-radius: 6px;
  padding: 3px 9px; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: var(--font-sans);
}
.my-fanart-delete-btn:hover { background: #fecaca; }

/* ===== Admin page ===== */
.admin-page { max-width: 960px; margin: 0 auto; padding: 40px 20px; }
.admin-title { font-size: 26px; font-weight: 900; color: #111; margin: 0 0 24px; display: flex; align-items: center; gap: 12px; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.admin-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.admin-card-img { aspect-ratio: 5 / 7; overflow: hidden; }
.admin-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-card-info { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.admin-card-pokemon { font-size: 15px; font-weight: 800; color: #111; }
.admin-card-author  { font-size: 13px; color: #6b7280; }
.admin-card-date    { font-size: 11px; color: #9ca3af; }
.admin-card-btns    { display: flex; gap: 8px; margin-top: 4px; }
.admin-approve-btn {
  flex: 1; background: #2BD55E; color: #fff;
  border: none; border-radius: 8px; padding: 8px 4px;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: var(--font-sans);
  transition: background 0.15s;
}
.admin-approve-btn:hover:not(:disabled) { background: #22c152; }
.admin-reject-btn {
  flex: 1; background: #fee2e2; color: #991b1b;
  border: none; border-radius: 8px; padding: 8px 4px;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: var(--font-sans);
  transition: background 0.15s;
}
.admin-reject-btn:hover:not(:disabled) { background: #fecaca; }
.admin-approve-btn:disabled,
.admin-reject-btn:disabled  { opacity: 0.5; cursor: not-allowed; }
.fanart-upvote-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
