/* Shared layout for PokePop Tracker — dark theme */
:root {
  --ink: #f4efe6;
  --ink-muted: rgba(244, 239, 230, 0.68);
  --paper: #16131c;
  --paper-dim: #1e1a26;
  --ember: #ff8a3d;
  --volt: #f4a261;
  --logo-yellow: #ffd400;
  --logo-orange: #ff9a3c;
  --moss: #2a9d8f;
  --night: #0b0910;
  --line: rgba(244, 239, 230, 0.12);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --font-display: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-body: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-ko: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --radius: 18px;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body), var(--font-ko);
  background:
    radial-gradient(ellipse 70% 45% at 8% -5%, rgba(255, 138, 61, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 92% 0%, rgba(42, 157, 143, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 35% at 50% 100%, rgba(88, 60, 140, 0.16), transparent 55%),
    linear-gradient(165deg, #100e16 0%, #0b0910 45%, #12101a 100%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(11, 9, 16, 0.78);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-nav:has(.nav-search) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  min-width: 0;
}

.nav-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-nav:has(.nav-search) .nav-actions {
  margin-left: 0;
  justify-self: end;
}

.nav-search {
  position: relative;
  width: min(420px, 100%);
  justify-self: center;
}

.nav-search__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-search__input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

/* iOS Safari zooms focused inputs under 16px; keep mobile search at 16px. */
@media (max-width: 820px) {
  .nav-search__input {
    font-size: 16px;
  }
}

.nav-search__input::placeholder {
  color: var(--ink-muted);
}

.nav-search__input:focus {
  border-color: rgba(255, 138, 61, 0.55);
  background: rgba(255, 255, 255, 0.09);
}

.search-panel {
  margin: 0 0 1.75rem;
  padding: 1.1rem 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.search-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.search-panel__title {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 700;
}

.search-panel__clear {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.search-panel__clear:hover {
  border-color: rgba(255, 138, 61, 0.45);
  color: #ffd2b0;
}

.packs-section__head {
  margin: 0 0 1rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.packs-section__title {
  margin: 0.85rem 0 0;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 700;
}

@media (max-width: 720px) {
  .site-nav:has(.nav-search) {
    grid-template-columns: auto auto;
    grid-template-areas:
      "brand actions"
      "search search";
  }

  .site-nav:has(.nav-search) .nav-brand {
    grid-area: brand;
  }

  .site-nav:has(.nav-search) .nav-actions {
    grid-area: actions;
  }

  .site-nav:has(.nav-search) .nav-search {
    grid-area: search;
    width: 100%;
    justify-self: stretch;
  }
}

.nav-lang {
  display: none;
}

.nav-menu-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.nav-menu-btn:hover {
  border-color: rgba(255, 212, 0, 0.45);
  background: rgba(255, 212, 0, 0.08);
}

.nav-menu-btn__bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 1.05rem;
}

.nav-menu-btn__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 40;
}

.nav-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(360px, 88vw);
  background: #14111a;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.45);
  transform: translateX(104%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.nav-drawer.is-open {
  transform: translateX(0);
}

body.nav-drawer-open {
  overflow: hidden;
}

.nav-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.85rem 0.85rem 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.nav-drawer__search-slot {
  flex: 1;
  min-width: 0;
}

.nav-drawer__pack-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-drawer__pack-search {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.5rem 0.9rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

@media (max-width: 820px) {
  .nav-drawer__pack-search {
    font-size: 16px;
  }
}

.nav-drawer__pack-search::placeholder {
  color: var(--ink-muted);
}

.nav-drawer__pack-search:focus {
  border-color: rgba(255, 138, 61, 0.55);
  background: rgba(255, 255, 255, 0.09);
}

.nav-drawer__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.nav-drawer__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  flex-shrink: 0;
}

.nav-drawer__close:hover {
  color: var(--ink);
}

.nav-drawer__body {
  overflow: auto;
  padding: 0.85rem 1.1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.nav-drawer__section-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.nav-drawer__langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nav-drawer__lang-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-drawer__lang-btn.is-active {
  border-color: rgba(255, 212, 0, 0.55);
  background: rgba(255, 212, 0, 0.16);
  color: var(--logo-yellow);
}

.nav-drawer__links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-drawer__link {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Author display:block beats UA [hidden]{display:none}; keep filter working. */
.nav-drawer__link[hidden],
.nav-drawer__section[hidden],
.nav-drawer__pack-filter-empty[hidden] {
  display: none !important;
}

.nav-drawer__link:hover {
  background: rgba(255, 212, 0, 0.1);
  color: var(--logo-yellow);
}

.nav-drawer__empty {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.nav-brand__logo {
  height: clamp(34px, 6vw, 44px);
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.nav-brand__text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-back {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.7;
  transition: opacity 0.2s;
  min-width: 0;
}

.nav-back:hover {
  opacity: 1;
  color: var(--ember);
}


.slide-full {
  width: 100%;
  margin: 0;
  padding: 0 0 1.5rem;
}

.infiniteslide_wrap {
  overflow: hidden;
  background: transparent;
  line-height: 0;
}

.infinity-slide {
  display: flex;
  flex-flow: row;
  align-items: center;
  width: max-content;
  animation: infiniteslide 5.5s linear 0s infinite normal none running;
  will-change: transform;
}

.infinity-slide-item {
  flex: 0 0 auto;
  display: block;
  margin-right: 0.5rem;
}

.infinity-slide-item img {
  display: block;
  height: clamp(76px, 11.06vw, 114px);
  width: auto;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

@keyframes infiniteslide {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(-100% / 15), 0, 0); /* one item width of 15 */
  }
}

@media (prefers-reduced-motion: reduce) {
  .infinity-slide {
    animation: none;
  }
}

.page {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem;
}

.hero-block {
  margin: 0 auto 2.5rem;
  max-width: 40rem;
  text-align: center;
}

.hero-logo {
  width: min(340px, 78vw);
  height: auto;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.4));
}

.hero-block h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pack-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 auto 1.15rem;
  padding: 0.28rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pack-tabs__pill {
  position: absolute;
  top: 0.28rem;
  left: 0;
  height: calc(100% - 0.56rem);
  border-radius: 999px;
  background: var(--logo-yellow);
  box-shadow: 0 6px 18px rgba(255, 212, 0, 0.28);
  pointer-events: none;
  z-index: 0;
  transition:
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.45s ease;
}

.pack-tabs__pill.is-moving {
  background: var(--logo-orange);
  box-shadow: 0 8px 22px rgba(255, 154, 60, 0.35);
}

.pack-tabs__btn {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  background: transparent;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  transition: color 0.25s ease;
}

.pack-tabs__btn:hover {
  color: var(--ink);
}

.pack-tabs__btn.is-active {
  color: #1a1408;
}

.hero-block p {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.site-updated {
  margin: 2.75rem 0 1.25rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  text-align: center;
}

.set-head .site-updated {
  text-align: left;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.set-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-top: 0.65rem;
}

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

.pack-grid--boosters {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2.5rem 1.75rem;
  justify-items: center;
}

.pack-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  width: 100%;
  max-width: 320px;
  transition: transform 0.3s ease;
}

.pack-entry:hover {
  transform: translateY(-4px);
}

.pack-entry__meta {
  text-align: center;
  width: 100%;
}

.pack-entry__code {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.pack-entry__name {
  font-family: var(--font-body), var(--font-ko);
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.pack-entry__name--long {
  font-size: clamp(0.92rem, 2vw, 1.1rem);
  letter-spacing: -0.01em;
}

.pack-entry__blurb {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-muted);
  margin-bottom: 0.85rem;
}

.pack-entry__cta {
  display: inline-block;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.4rem 0.95rem;
  border: 2px solid rgba(244, 239, 230, 0.85);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pack-entry:hover .pack-entry__cta {
  background: var(--ember);
  border-color: var(--ember);
  color: #120e08;
}

/* BOX tile — mockup footprint (no pack 3D / holo tilt) */
.pack-entry--box .pack-entry__art-wrap {
  position: relative;
  width: min(100%, 300px);
  max-width: 300px;
  aspect-ratio: 0.515;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1510;
  border: 1px solid rgba(244, 239, 230, 0.12);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.45);
}

.pack-entry--box .pack-entry__art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.35rem;
}

.pack-entry--box .pack-entry__badge {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.5rem;
  border-radius: 5px;
  background: var(--logo-yellow, #ffd400);
  color: #1a1408;
  line-height: 1;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin-bottom: 1.75rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 140px;
}

.field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}

.field select {
  appearance: none;
  border: 1.5px solid rgba(244, 239, 230, 0.28);
  color: var(--ink);
  background: var(--paper-dim) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23f4efe6' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.field select option {
  background: #1e1a26;
  color: #f4efe6;
}

.set-head {
  margin-bottom: 1.5rem;
}

.set-head h1 {
  font-family: var(--font-body), var(--font-ko);
  font-weight: 800;
  font-size: clamp(1.45rem, 4.5vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.set-head p:not(.site-updated) {
  margin-top: 0.5rem;
  color: var(--ink-muted);
}

.set-ext-links {
  margin-top: 0.65rem;
  font-size: 0.9rem;
}

.set-ext-links a {
  color: #ffb087;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.set-ext-links a:hover {
  color: #ffd2b0;
}

.set-actions {
  margin: 0;
  margin-left: auto;
  flex: 0 0 auto;
}

.set-pack-open {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.55rem 1.15rem;
  border: 2px solid rgba(244, 239, 230, 0.85);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.set-pack-open:hover {
  background: var(--ember);
  border-color: var(--ember);
  color: #120e08;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .set-head__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .set-actions {
    margin-left: 0;
  }
}

.pack-entry__blurb--warn {
  color: #ffb087;
  opacity: 0.95;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.15rem 0.9rem;
  overflow: visible;
}

.card-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: z-index 0s linear 0.28s;
}

.card-link:hover,
.card-link:focus-visible {
  z-index: 40;
  transition: z-index 0s;
}

.card-link .holo-card {
  /* Allow pointer-driven 3D tilt once the card pops on hover. */
  pointer-events: auto;
  transform-origin: center center;
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s ease-out;
  will-change: transform;
}

/* Official card-search pops to ~190% width; keep ours a bit smaller (~1.5x). */
@media (hover: hover) and (pointer: fine) {
  .card-link:hover .holo-card,
  .card-link:focus-visible .holo-card {
    transform: translate3d(0, 0, 0.1px) scale(1.5);
    box-shadow: 0 36px 32px -10px rgba(0, 0, 0, 0.55);
  }

  /* Slightly stronger tilt read while enlarged. */
  .card-link:hover .holo-card.interacting,
  .card-link:focus-visible .holo-card.interacting {
    filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.28));
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-link .holo-card {
    transition: none;
  }

  .card-link:hover .holo-card,
  .card-link:focus-visible .holo-card {
    transform: none;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }
}

.card-meta {
  padding: 0 0.15rem;
}

.card-meta__name {
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.25;
}

.card-meta__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--fire { background: rgba(232, 93, 4, 0.22); color: #ffb088; }
.badge--psychic { background: rgba(168, 85, 247, 0.22); color: #e9d5ff; }
.badge--lightning { background: rgba(250, 204, 21, 0.2); color: #fde68a; }
.badge--grass { background: rgba(34, 197, 94, 0.2); color: #bbf7d0; }
.badge--water { background: rgba(59, 130, 246, 0.22); color: #bfdbfe; }
.badge--fairy { background: rgba(244, 114, 182, 0.22); color: #fbcfe8; }
.badge--metal { background: rgba(148, 163, 184, 0.25); color: #e2e8f0; }
.badge--colorless { background: rgba(255, 255, 255, 0.12); color: #f5f5f4; }
.badge--trainer { background: rgba(251, 146, 60, 0.2); color: #fed7aa; }

.badge--tier {
  /* Internal ranking only — keep styles but hide from UI */
  display: none !important;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.badge--tier-a { background: rgba(250, 204, 21, 0.22); color: #fde68a; }
.badge--tier-b { background: rgba(96, 165, 250, 0.2); color: #bfdbfe; }
.badge--tier-c { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

.badge--pack {
  max-width: min(100%, 18rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.pop-empty--message {
  text-align: center;
  padding: 1.25rem 0.75rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.image-lang-note {
  margin: -0.35rem 0 1rem;
  font-size: 0.82rem;
  color: #fbbf24;
  line-height: 1.4;
}

.lang-tab {
  appearance: none;
  border: 1.5px solid rgba(244, 239, 230, 0.28);
  background: var(--surface);
  color: var(--ink-muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.lang-tab:hover {
  color: var(--ink);
  border-color: rgba(244, 239, 230, 0.5);
}

.lang-tab.is-active {
  background: var(--ember);
  border-color: var(--ember);
  color: #120e08;
}

.detail {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

.detail__visual {
  width: min(320px, 100%);
  max-width: 100%;
  margin-inline: auto;
  display: flex;
  justify-content: center;
  justify-self: center;
}

.detail__info {
  width: 100%;
  min-width: 0;
}

.detail__info h1 {
  font-family: var(--font-ko);
  font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.detail__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  margin-bottom: 1.4rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.price-panel {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #241c14, #151018);
  border: 1px solid rgba(255, 138, 61, 0.28);
  color: #fff;
  margin-bottom: 1.75rem;
}

.price-panel__label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.65rem;
}

.price-grades {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.price-grade {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.price-grade:not(:disabled):hover {
  border-color: rgba(255, 168, 90, 0.55);
  transform: translateY(-1px);
}

.price-grade.is-selected {
  border-color: rgba(255, 168, 90, 0.85);
  background: rgba(255, 138, 61, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 168, 90, 0.25);
}

.price-grade.is-disabled,
.price-grade:disabled {
  cursor: default;
  opacity: 0.45;
}

.price-chart {
  margin-top: 0.95rem;
  padding: 0.55rem 0.35rem 0.35rem;
  border-radius: 12px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 138, 61, 0.12), transparent 55%),
    rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.price-chart__svg {
  display: block;
  width: 100%;
  height: auto;
}

.price-chart__grid {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.price-chart__area {
  fill: url(#priceAreaFill);
  opacity: 0.95;
}

.price-chart__line {
  fill: none;
  stroke: #ffb06a;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255, 138, 61, 0.35));
}

.price-chart__dot-ring {
  fill: rgba(18, 14, 12, 0.9);
  stroke: #ffb06a;
  stroke-width: 1.6;
}

.price-chart__dot {
  fill: #fff4e8;
}

.price-chart__point--low .price-chart__dot-ring {
  stroke: #8eb7ef;
}

.price-chart__point--high .price-chart__dot-ring {
  stroke: #ff8f73;
}

.price-chart__value {
  fill: rgba(255, 244, 232, 0.95);
  font-size: 11px;
  font-weight: 650;
  text-anchor: middle;
}

.price-chart__xlabel {
  fill: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-anchor: middle;
}

.price-panel__meta-line + .price-panel__meta-line {
  margin-top: 0.25rem;
}

.price-panel__meta-line--muted {
  opacity: 0.72;
  font-size: 0.86em;
  line-height: 1.45;
}

@media (max-width: 800px) {
  .detail {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1.35rem;
  }

  .detail__visual {
    width: min(280px, 100%);
    padding: 0.85rem 0.5rem 1.1rem;
    overflow: visible;
  }

  .detail__info {
    justify-self: stretch;
  }

  .detail__info h1 {
    font-size: clamp(1.45rem, 7vw, 2rem);
    word-break: keep-all;
  }

  .detail__sub {
    margin-bottom: 1rem;
  }

  .badge--pack {
    max-width: 100%;
    flex: 1 1 100%;
  }

  .price-panel {
    padding: 0.95rem 0.85rem;
    margin-bottom: 1.35rem;
  }

  .price-grades {
    gap: 0.45rem;
  }

  .price-grade {
    padding: 0.45rem 0.35rem;
    min-width: 0;
  }

  .price-grade__label {
    font-size: 0.65rem;
  }

  .price-grade__value {
    font-size: clamp(1rem, 4.8vw, 1.3rem);
  }

  .price-panel__meta,
  .price-panel__seed {
    font-size: 0.78rem;
    line-height: 1.45;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .section-title {
    font-size: 1.15rem;
  }

  .pop-table-wrap {
    max-width: 100%;
    overflow: hidden;
  }

  .pop-table {
    width: 100%;
    min-width: 0;
    font-size: 0.7rem;
    table-layout: fixed;
  }

  .pop-table th,
  .pop-table td {
    padding: 0.5rem 0.18rem;
    word-break: normal;
    font-variant-numeric: tabular-nums;
  }

  .pop-num--md {
    font-size: 0.88em;
  }

  .pop-num--sm {
    font-size: 0.76em;
  }

  .pop-num--xs {
    font-size: 0.66em;
  }

  .pop-table th:first-child,
  .pop-table td:first-child {
    width: 4.2rem;
    padding-left: 0.4rem;
    padding-right: 0.12rem;
    font-size: 0.65rem;
    line-height: 1.25;
  }

  .pop-brg-hint {
    display: inline;
    margin-top: 0;
    margin-left: 0.05rem;
    font-size: 0.58rem;
    line-height: 1.1;
  }

  .footnote {
    font-size: 0.74rem;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: clip;
  }

  .site-nav {
    gap: 0.5rem 0.65rem;
    padding: 0.7rem 0.75rem;
  }

  .nav-brand__logo {
    height: 30px;
  }

  .nav-actions {
    min-width: 0;
    gap: 0.45rem;
    max-width: none;
  }

  .nav-back {
    display: none;
  }

  .page {
    padding: 1.15rem 0.85rem calc(3.25rem + env(safe-area-inset-bottom, 0px));
    overflow-x: clip;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.95rem 0.7rem;
  }

  .toolbar {
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .field {
    min-width: min(100%, 140px);
    flex: 1 1 140px;
  }
}

@media (max-width: 380px) {
  .pop-table {
    font-size: 0.7rem;
  }

  .detail__visual {
    width: min(240px, 100%);
  }
}

.price-grade {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.price-grade__label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

.price-grade__value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--ember);
}

.price-panel__meta {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.price-panel__seed {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
}

.price-panel__seed a {
  color: #ffb087;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.price-panel__seed a:hover {
  color: #ffd2b0;
}

.section-title {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
}

.pop-table-wrap {
  overflow-x: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.pop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
}

.pop-table th,
.pop-table td {
  padding: 0.7rem 0.85rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.pop-num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pop-num--md {
  font-size: 0.92em;
}

.pop-num--sm {
  font-size: 0.8em;
  letter-spacing: -0.02em;
}

.pop-num--xs {
  font-size: 0.7em;
  letter-spacing: -0.03em;
}

.pop-table th:first-child,
.pop-table td:first-child {
  text-align: left;
  font-weight: 800;
}

.pop-table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.04);
}

.pop-table tbody tr:last-child td {
  border-bottom: 0;
}

.pop-table tbody tr.pop-total-row td {
  background: rgba(255, 138, 61, 0.1);
  font-weight: 800;
  border-top: 1px solid rgba(255, 138, 61, 0.28);
}

.pop-empty {
  opacity: 0.4;
}

.pop-brg-hint {
  opacity: 0.55;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.footnote {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-muted);
  font-weight: 600;
}

.credit {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.credit a:hover {
  color: var(--ember);
}

/* Mouse cursor follower — above content, below drawers/modals */
.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  will-change: transform;
  user-select: none;
}

.cursor-follower.is-visible {
  opacity: 1;
}

/* Evolved follower (Raichu / Venusaur / Charizard / Mega X / Blastoise / Master Ball) ~30% larger */
.cursor-follower.is-evolved {
  width: 52px;
  max-height: 62px;
}

/* Venusaur / Charizard / Blastoise: 40% larger than .is-evolved (~1.82× base) */
.cursor-follower.is-evolved-xl {
  width: 73px;
  max-height: 87px;
}

/* Mega Charizard X only: 30% larger than .is-evolved-xl */
.cursor-follower.is-evolved-xxl {
  width: 95px;
  max-height: 113px;
}

/* Pikachu hold-to-evolve: bright white charge pulses (starts at ready hold) */
.cursor-follower.is-charging {
  animation: cursor-follower-charge 0.55s ease-in-out infinite;
}

@keyframes cursor-follower-charge {
  0%,
  100% {
    filter: brightness(1) contrast(1);
  }
  45%,
  55% {
    filter: brightness(2.6) contrast(1.35) saturate(0.35);
  }
}

.cursor-burst {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  transform: translate3d(0, 0, 0);
  transform-origin: center center;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  z-index: 31;
  opacity: 1;
  will-change: transform, opacity;
  user-select: none;
}

/* Mega X continuous breath stream — no white flash; grow+fade via JS */
.cursor-burst.cursor-burst--breath {
  z-index: 30;
  transform-origin: center center;
}

/* Breath hit: exact unit flickers; flame sprites live on a fixed overlay */
.is-breath-burning {
  will-change: filter;
}

.is-breath-burning--fire {
  animation: breath-burn-flicker-fire 0.14s ease-in-out infinite;
}

.is-breath-burning--blue {
  animation: breath-burn-flicker-blue 0.14s ease-in-out infinite;
}

.breath-burn-overlay {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Flame sprites are appended in JS from burstSrc (fire / bluefire). */
  mix-blend-mode: screen;
  opacity: 0.92;
  animation: breath-burn-flames 0.18s ease-in-out infinite alternate;
}

@keyframes breath-burn-flicker-fire {
  0%,
  100% {
    filter: brightness(1.06) saturate(1.3)
      drop-shadow(0 0 3px rgba(255, 140, 40, 0.8))
      drop-shadow(0 0 10px rgba(255, 90, 20, 0.55));
  }
  50% {
    filter: brightness(1.32) saturate(1.55)
      drop-shadow(0 0 7px rgba(255, 180, 60, 0.95))
      drop-shadow(0 0 16px rgba(255, 110, 30, 0.85));
  }
}

@keyframes breath-burn-flicker-blue {
  0%,
  100% {
    filter: brightness(1.06) saturate(1.25)
      drop-shadow(0 0 3px rgba(70, 170, 255, 0.75))
      drop-shadow(0 0 10px rgba(40, 110, 255, 0.55));
  }
  50% {
    filter: brightness(1.28) saturate(1.5)
      drop-shadow(0 0 7px rgba(130, 210, 255, 0.95))
      drop-shadow(0 0 16px rgba(50, 140, 255, 0.8));
  }
}

@keyframes breath-burn-flames {
  0% {
    transform: translateY(0) scaleY(1);
    opacity: 0.82;
  }
  100% {
    transform: translateY(-6%) scaleY(1.12);
    opacity: 1;
  }
}

.breath-burn-flame {
  position: absolute;
  margin: 0;
  height: auto;
  pointer-events: none;
  z-index: 51;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  mix-blend-mode: screen;
  opacity: 0.9;
  animation: breath-burn-flames 0.16s ease-in-out infinite alternate;
  user-select: none;
}

.lightning-zap-overlay {
  position: fixed;
  pointer-events: none;
  z-index: 56;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  mix-blend-mode: screen;
  opacity: 0.95;
}

.lightning-zap-flash {
  position: absolute;
  margin: 0;
  height: auto;
  pointer-events: none;
  z-index: 57;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  mix-blend-mode: screen;
  opacity: 0.92;
  animation: cursor-burst-element-flash 0.1s ease-in-out infinite;
  user-select: none;
}

/* Venusaur leaf-vine: connected stem + multiple leaves overlay */
.venusaur-vine-overlay {
  position: fixed;
  pointer-events: none;
  z-index: 54;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  mix-blend-mode: screen;
  opacity: 0.92;
  will-change: opacity;
}

.venusaur-vine-stem {
  position: absolute;
  height: 3px;
  border-radius: 3px;
  background: rgba(60, 180, 85, 0.85);
  opacity: 0.75;
  transform-origin: 0% 50%;
  box-shadow: 0 0 10px rgba(60, 180, 85, 0.25);
}

.venusaur-vine-leaf {
  position: absolute;
  margin: 0;
  height: auto;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  mix-blend-mode: screen;
  opacity: 0;
  transform-origin: 50% 50%;
  animation: venusaur-vine-leaf-pop 0.35s ease-out forwards;
  user-select: none;
}

@keyframes venusaur-vine-leaf-pop {
  from {
    opacity: 0;
    transform: scale(0.25) rotate(var(--rot, 0deg));
    filter: brightness(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(var(--rot, 0deg));
    filter: brightness(1.15);
  }
}

/* Blastoise water blob: large clustered droplet imgs (same as other bursts) */
.cursor-burst.cursor-burst--water-blob {
  z-index: 55;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(40, 150, 230, 0.7))
    drop-shadow(0 0 14px rgba(30, 120, 210, 0.45));
}

.cursor-burst.cursor-burst--water-core {
  filter: brightness(1.15) saturate(1.2)
    drop-shadow(0 0 8px rgba(50, 170, 255, 0.85))
    drop-shadow(0 0 18px rgba(30, 130, 230, 0.55));
}

/* Master Ball catch projectile + catch FX */
.cursor-burst.cursor-burst--masterball {
  z-index: 60;
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(80, 20, 120, 0.45));
}

.cursor-burst.cursor-burst--masterball.is-masterball-floor {
  z-index: 62;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

.is-masterball-whitened {
  filter: brightness(12) saturate(0) contrast(1.2) !important;
}

.cursor-burst.cursor-burst--masterball.is-masterball-vibrating {
  animation: masterball-vibrate 0.16s ease-in-out 3;
}

@keyframes masterball-vibrate {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-4px, 1px) rotate(-8deg);
  }
  50% {
    transform: translate(4px, -1px) rotate(8deg);
  }
  75% {
    transform: translate(-3px, 2px) rotate(-5deg);
  }
}

.masterball-white-burst {
  position: fixed;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 61;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 18px 10px rgba(255, 255, 255, 0.85),
    0 0 40px 18px rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%) scale(0.4);
  animation: masterball-white-burst-pop 0.42s ease-out forwards;
}

@keyframes masterball-white-burst-pop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4.2);
  }
}

.is-masterball-caught {
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  opacity: 0 !important;
}

/* Blastoise water hit: soaked HTML shakes like it got blasted */
.is-water-pushed {
  will-change: transform, translate;
}

.is-water-soaked {
  will-change: transform, translate;
  animation: water-blast-shake 0.12s linear infinite;
  filter: brightness(1.05) saturate(1.15)
    drop-shadow(0 0 4px rgba(60, 160, 240, 0.45));
}

.is-water-returning {
  filter: none;
}

@keyframes water-blast-shake {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(-3px, 2px) rotate(-1.2deg);
  }
  40% {
    transform: translate(4px, -2px) rotate(1.4deg);
  }
  60% {
    transform: translate(-2px, -3px) rotate(-0.8deg);
  }
  80% {
    transform: translate(3px, 1px) rotate(1deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

/* Evolved elemental burst flash (leaf / fire / bluefire / lightning / water): ~0.1s white pulse */
.cursor-burst.cursor-burst--element,
.cursor-burst.cursor-burst--raichu,
.cursor-burst.cursor-burst--charizard {
  animation: cursor-burst-element-flash 0.1s ease-in-out infinite;
}

@keyframes cursor-burst-element-flash {
  0%,
  100% {
    filter: brightness(1) contrast(1) saturate(1);
  }
  50% {
    filter: brightness(8) contrast(1.15) saturate(0)
      drop-shadow(0 0 2px rgba(255, 255, 255, 1))
      drop-shadow(0 0 5px rgba(255, 255, 255, 0.85));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-follower,
  .cursor-burst,
  .breath-burn-flame,
  .breath-burn-overlay {
    display: none;
  }

  .is-breath-burning {
    animation: none;
  }

  .is-water-soaked {
    animation: none;
    filter: none;
  }

  .is-water-pushed,
  .is-water-returning {
    translate: none;
    transition: none;
  }
}

@media (pointer: coarse) {
  .cursor-follower,
  .cursor-burst {
    display: none;
  }
}
