/* Pokemonster: Bubbly Playful (Fredoka + Nunito) */

:root {
  --lime: #9DF215;
  --lime-soft: #C8F76A;
  --lime-ring: rgba(157, 242, 21, 0.35);

  --mat: #F4F2EE;
  --paper: #FDFCFA;
  --ink: #1C1B19;
  --ink-soft: #4A4843;
  --ink-faint: #8A8680;
  --rule: #E2DFD8;
  --rule-dark: #C9C5BC;

  --shadow-card: 0 2px 0 var(--rule), 0 10px 28px rgba(28, 27, 25, 0.07);
  --shadow-lift: 0 4px 0 var(--rule), 0 18px 40px rgba(28, 27, 25, 0.1);

  --display: "Fredoka", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  --mono: "Nunito", system-ui, sans-serif;

  --wrap: 1040px;
  --pad: 20px;
  --section-y: 80px;
  --section-y-sm: 56px;
  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 48px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-depth: cubic-bezier(0.16, 1, 0.3, 1);

  --green: #2D6A3E;
  --text-faint: var(--ink-faint);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--mat);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; border: none; background: none; }

::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

.wrap,
.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin: 0;
}

/* Scroll reveal (translate only, content always visible) */
.reveal {
  transition: transform 0.8s var(--ease-depth);
}

.reveal--up    { transform: translateY(40px); }
.reveal--left  { transform: translateX(-32px); }
.reveal--right { transform: translateX(32px); }
.reveal--depth { transform: translateY(48px); }

.reveal.is-visible {
  transform: translate(0, 0);
}

.reveal-stagger .reveal-child {
  transform: translateY(28px);
  transition: transform 0.7s var(--ease-depth);
}

.reveal-stagger.is-visible .reveal-child {
  transform: translateY(0);
}

.reveal-stagger.is-visible .reveal-child:nth-child(1) { transition-delay: 0.06s; }
.reveal-stagger.is-visible .reveal-child:nth-child(2) { transition-delay: 0.14s; }
.reveal-stagger.is-visible .reveal-child:nth-child(3) { transition-delay: 0.22s; }
.reveal-stagger.is-visible .reveal-child:nth-child(4) { transition-delay: 0.30s; }
.reveal-stagger.is-visible .reveal-child:nth-child(5) { transition-delay: 0.38s; }
.reveal-stagger.is-visible .reveal-child:nth-child(6) { transition-delay: 0.46s; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.15s;
}

.btn:hover { transform: translateY(-1px); }

.btn-lime {
  background: var(--lime);
  color: var(--ink);
  border-color: #8AD80F;
  box-shadow: 0 2px 0 #7BC40E;
}

.btn-lime:hover { background: var(--lime-soft); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-outline {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule-dark);
}

.btn-sm { font-size: 14px; padding: 8px 16px; }
.btn-lg { font-size: 17px; padding: 14px 28px; }
.btn-block { width: 100%; }

/* ── Site header (landing) ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 242, 238, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.site-header .logo { margin-right: auto; }

.logo img { border-radius: var(--radius-sm); }

.header-nav {
  display: flex;
  gap: var(--gap-lg);
}

.header-nav a {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
}

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

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 10px;
}

.menu-btn span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

.mobile-nav[hidden] { display: none !important; }

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
  padding: var(--gap-md) var(--pad) var(--gap-lg);
  border-top: 1px solid var(--rule);
  background: var(--mat);
}

.mobile-nav a {
  padding: 14px 0;
  font-family: var(--display);
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
}

.mobile-nav .btn { margin-top: var(--gap-sm); }

@media (max-width: 720px) {
  .header-nav,
  .header-inner > .btn.btn-lime { display: none; }
  .menu-btn { display: flex; }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--section-y) 0 calc(var(--section-y) - 16px);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-grid-lines {
  position: absolute;
  inset: -10% -5%;
  background-image:
    linear-gradient(rgba(157, 242, 21, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 242, 21, 0.14) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 85% 75% at 45% 40%, #000 15%, transparent 72%);
  animation: hero-grid-drift 24s linear infinite;
}

.hero-particle,
.hero-spark {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}

.hero-particle--lime {
  background: var(--lime);
  box-shadow: 0 0 12px rgba(157, 242, 21, 0.55);
}

.hero-particle--fire {
  background: #FF6B2C;
  box-shadow: 0 0 14px rgba(255, 107, 44, 0.65), 0 0 28px rgba(255, 149, 0, 0.25);
}

.hero-particle--1 { width: 8px; height: 8px; top: 18%; left: 8%; animation: hero-float-a 7s ease-in-out infinite; }
.hero-particle--2 { width: 5px; height: 5px; top: 62%; left: 14%; animation: hero-float-b 9s ease-in-out infinite 0.4s; }
.hero-particle--3 { width: 6px; height: 6px; top: 34%; left: 72%; animation: hero-float-c 8s ease-in-out infinite 0.8s; }
.hero-particle--4 { width: 4px; height: 4px; top: 78%; left: 58%; animation: hero-float-a 6.5s ease-in-out infinite 1.2s; }
.hero-particle--5 { width: 7px; height: 7px; top: 22%; left: 48%; animation: hero-flicker 4s ease-in-out infinite; }
.hero-particle--6 { width: 5px; height: 5px; top: 55%; left: 82%; animation: hero-flicker 5.5s ease-in-out infinite 0.6s; }
.hero-particle--7 { width: 6px; height: 6px; top: 70%; left: 28%; animation: hero-flicker 4.8s ease-in-out infinite 1s; }

.hero-spark {
  width: 3px;
  height: 3px;
  background: #FFB347;
  box-shadow: 0 0 8px #FF6B2C, 0 0 16px rgba(255, 107, 44, 0.4);
}

.hero-spark--1 { top: 28%; left: 22%; animation: hero-sparkle 3s ease-in-out infinite; }
.hero-spark--2 { top: 48%; left: 88%; animation: hero-sparkle 2.6s ease-in-out infinite 0.5s; }
.hero-spark--3 { top: 12%; left: 65%; animation: hero-sparkle 3.4s ease-in-out infinite 1s; }
.hero-spark--4 { top: 82%; left: 42%; animation: hero-sparkle 2.8s ease-in-out infinite 1.4s; }

@keyframes hero-grid-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(20px, 20px); }
}

@keyframes hero-float-a {
  0%, 100% { transform: translate(0, 0); opacity: 0.7; }
  50% { transform: translate(10px, -18px); opacity: 1; }
}

@keyframes hero-float-b {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.55; }
  50% { transform: translate(-14px, 12px) scale(1.2); opacity: 0.95; }
}

@keyframes hero-float-c {
  0%, 100% { transform: translate(0, 0); opacity: 0.6; }
  50% { transform: translate(8px, 16px); opacity: 1; }
}

@keyframes hero-flicker {
  0%, 100% { transform: scale(1); opacity: 0.45; filter: brightness(1); }
  25% { transform: scale(1.35); opacity: 1; filter: brightness(1.4); }
  50% { transform: scale(0.9); opacity: 0.65; filter: brightness(1.1); }
  75% { transform: scale(1.2); opacity: 0.9; filter: brightness(1.3); }
}

@keyframes hero-sparkle {
  0%, 100% { transform: scale(0.6); opacity: 0; }
  45% { transform: scale(1.4); opacity: 1; }
  55% { transform: scale(1); opacity: 0.8; }
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: var(--gap-xl);
  align-items: center;
}

.kicker {
  display: inline-block;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--mat);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin: 0 0 var(--gap-md);
}

.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  margin-bottom: var(--gap-md);
}

.hero-desc {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0 0 var(--gap-lg);
}

.hero-search {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  max-width: 460px;
  background: var(--mat);
  border: 2px solid var(--rule-dark);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 18px;
  margin-bottom: var(--gap-sm);
  box-shadow: var(--shadow-card);
}

.hero-search svg {
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 15px;
  padding: 10px 10px;
  color: var(--ink);
}

.hero-search input:focus { outline: none; }
.hero-search input::placeholder { color: var(--ink-faint); }

.hero-x-btn {
  margin-top: var(--gap-md);
}

.hero-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.holo-card {
  position: relative;
  margin: 0;
  padding: 14px;
  width: 100%;
  max-width: 272px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  border: 2px solid var(--rule);
  box-shadow: var(--shadow-lift);
  transform: rotate(2deg);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.holo-card:hover {
  transform: rotate(0deg);
  box-shadow: 0 8px 0 var(--rule), 0 28px 56px rgba(28, 27, 25, 0.14);
}

.holo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(125deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
  background-size: 200% 200%;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.holo-card:hover::after {
  opacity: 1;
  animation: holo 2s ease infinite;
}

@keyframes holo {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.holo-card img {
  width: 100%;
  border-radius: 4px;
  aspect-ratio: 5/7;
  object-fit: cover;
}

.price-tag {
  position: absolute;
  bottom: 18px;
  right: 10px;
  background: var(--lime);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 0 #7BC40E;
  transform: rotate(-3deg);
}

.price-tag-label {
  display: block;
  font-family: var(--display);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3D5A00;
}

.price-tag-value {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.card-caption {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  margin: var(--gap-md) 0 0;
  text-align: center;
}

@media (max-width: 840px) {
  .hero {
    padding-top: var(--section-y-sm);
    padding-bottom: var(--section-y-sm);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
    text-align: center;
  }
  .hero-card-wrap { order: -1; }
  .hero-desc,
  .hero-search,
  .hero-x-btn { margin-left: auto; margin-right: auto; }
  .holo-card { transform: none; max-width: 240px; margin: 0 auto; }
}

/* Strip stats */
.strip {
  padding: var(--gap-md) 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.strip-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 560px;
  margin: 0 auto;
  background: var(--mat);
  border: 2px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.strip-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--gap-md) var(--gap-sm);
  text-align: center;
  border-right: 2px solid var(--rule);
}

.strip-stat:last-child {
  border-right: none;
}

.strip-num {
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.strip-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.3;
}

@media (max-width: 480px) {
  .strip-inner {
    max-width: none;
  }

  .strip-stat {
    padding: var(--gap-sm) 6px;
  }

  .strip-label {
    font-size: 10px;
  }
}

/* ── Content blocks ── */
.block {
  padding: var(--section-y) 0;
}

.block--paper { background: var(--paper); }
.block--mat { background: var(--mat); }

.block-head {
  max-width: 540px;
  margin: 0 auto var(--gap-xl);
  text-align: center;
}

.block-head--left {
  max-width: 480px;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.block-head h2 {
  font-size: clamp(26px, 3.8vw, 34px);
  margin-bottom: var(--gap-sm);
}

.block-head p {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.65;
}

/* Tools */
.tool-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-md);
}

.tool-slot {
  padding: var(--gap-lg) var(--gap-md);
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.tool-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gap-md);
  color: var(--ink);
  background: var(--mat);
  border-radius: var(--radius-sm);
}

.tool-icon svg { width: 24px; height: 24px; }

.tool-slot h3 { font-size: 20px; margin-bottom: var(--gap-xs); }
.tool-slot p { font-size: 15px; color: var(--ink-soft); margin: 0; line-height: 1.6; }

/* Flow */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-md);
  counter-reset: step;
}

.flow li {
  counter-increment: step;
  padding: var(--gap-lg) var(--gap-md);
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.flow li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--lime);
  border-radius: 50%;
  margin-bottom: var(--gap-md);
}

.flow h3 { font-size: 18px; margin-bottom: var(--gap-xs); }
.flow p { font-size: 15px; color: var(--ink-soft); margin: 0; line-height: 1.6; }

/* Binder */
.binder-scroll {
  display: flex;
  gap: var(--gap-md);
  overflow-x: auto;
  padding: 4px 4px var(--gap-md);
  margin: 0 calc(var(--pad) * -1);
  padding-left: var(--pad);
  padding-right: var(--pad);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.binder-card {
  flex: 0 0 216px;
  scroll-snap-align: start;
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s var(--ease), border-color 0.2s;
}

.binder-card:hover {
  box-shadow: var(--shadow-lift);
  border-color: var(--rule-dark);
}

.binder-card img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center top;
  background: var(--rule);
}

.binder-info { padding: var(--gap-md) var(--gap-md) 18px; }
.binder-info h3 { font-size: 16px; margin-bottom: 6px; }

.binder-meta {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
}

.tag {
  display: inline-block;
  margin-top: var(--gap-xs);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--mat);
  color: var(--ink-soft);
}

.tag-new { background: var(--lime); color: var(--ink); }
.tag-classic { background: var(--ink); color: var(--paper); }

/* FAQ */
.faq-wrap {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: var(--gap-xl);
  align-items: start;
}

.faq-side h2 { font-size: 30px; margin-bottom: var(--gap-sm); }
.faq-side p { font-size: 15px; color: var(--ink-soft); margin: 0; line-height: 1.65; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.faq {
  border: 2px solid var(--rule);
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq summary {
  padding: var(--gap-md) var(--gap-md);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

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

.faq p {
  padding: 0 var(--gap-md) var(--gap-md);
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* CTA */
.cta {
  padding: var(--section-y) 0;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.cta-inner {
  max-width: 480px;
  margin: 0 auto;
}

.cta h2 { font-size: 32px; margin-bottom: var(--gap-sm); }
.cta p { color: var(--ink-soft); margin: 0 0 var(--gap-lg); line-height: 1.65; }

/* Footer */
.site-footer {
  padding: var(--gap-xl) 0 var(--gap-lg);
  background: var(--mat);
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--gap-lg) var(--gap-xl);
}

.footer-brand p {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 10px 0 0;
  max-width: 28ch;
}

.footer-links {
  display: flex;
  gap: 56px;
}

.footer-links h4 {
  font-family: var(--display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 0 0 var(--gap-sm);
}

.footer-links a {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.footer-copy {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0;
  padding-top: var(--gap-lg);
  border-top: 1px solid var(--rule);
}

/* Badges (app modal) */
.badge {
  display: inline-block;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--mat);
  color: var(--ink-soft);
}

.badge-new { background: var(--lime); color: var(--ink); }
.badge-classic { background: var(--ink); color: var(--paper); }

@media (min-width: 768px) {
  :root { --pad: 32px; }
}

@media (max-width: 720px) {
  .tool-row,
  .flow { grid-template-columns: 1fr; }
  .faq-wrap { grid-template-columns: 1fr; gap: var(--gap-lg); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { gap: var(--gap-xl); }
  .block { padding: var(--section-y-sm) 0; }
  .cta { padding: var(--section-y-sm) 0; }
}

/* ── 404 ── */
.notfound {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px var(--pad) 48px;
  background: var(--paper);
}

.notfound .code {
  font-family: var(--display);
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: var(--gap-md);
}

.notfound h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 12px; }
.notfound p { color: var(--ink-soft); margin-bottom: 28px; }

/* ══════════════════════════════════════
   APP (scoped, no landing conflicts)
   ══════════════════════════════════════ */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--mat);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 242, 238, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.app-topbar .container {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  height: 68px;
}

.app-topbar .logo { margin-right: 0; }

.app-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.app-search input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  font-size: 15px;
  border: 2px solid var(--rule-dark);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
}

.app-search input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-ring);
}

.app-search input::placeholder { color: var(--ink-faint); }

.app-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
  pointer-events: none;
}

.app-tabs {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.app-tabs .container {
  display: flex;
  gap: 4px;
}

.tab-btn {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-faint);
  padding: 16px 20px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--ink);
  border-bottom-color: var(--lime);
}

.app-main { flex: 1; padding: var(--gap-lg) 0 var(--section-y); }

.app-panel { display: none; }
.app-panel.active { display: block; }

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-md);
}

.filters-row select {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border: 2px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.filters-row select:focus {
  outline: none;
  border-color: var(--lime);
}

.results-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  margin-bottom: var(--gap-md);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: var(--gap-md);
}

.poke-card {
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}

.poke-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.poke-card img {
  width: 100%;
  aspect-ratio: 5/7;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 8px;
  background: var(--mat);
}

.poke-card .name {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poke-card .meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap-md);
}

.pack-card {
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--gap-lg) var(--gap-md);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pack-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.pack-card-top {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.pack-card-top img { max-height: 36px; object-fit: contain; }

.pack-card-top .fallback-mark {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  color: var(--ink-faint);
}

.pack-card h3 { font-size: 15px; text-align: center; margin-bottom: 4px; }

.pack-card .series {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: var(--gap-sm);
}

.pack-card .pack-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  border-top: 2px solid var(--rule);
  padding-top: var(--gap-sm);
}

.pack-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.pack-detail-header img { height: 32px; object-fit: contain; }
.pack-detail-header h2 { font-size: 18px; margin-bottom: 2px; }
.pack-detail-header .meta { font-size: 13px; font-weight: 600; color: var(--ink-faint); }

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-md);
}

.section-toolbar h2 {
  font-family: var(--display);
  font-size: 26px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--paper);
  border: 1px dashed var(--rule-dark);
  border-radius: var(--radius);
}

.empty-state h3 { font-size: 18px; margin-bottom: 6px; }
.empty-state p { color: var(--ink-soft); font-size: 15px; margin: 0 0 16px; }

.scanner-box {
  max-width: 480px;
  margin: 0 auto var(--gap-lg);
  padding: var(--gap-lg);
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.scanner-drop {
  border: 1.5px dashed var(--rule-dark);
  border-radius: var(--radius-sm);
  padding: 36px 20px;
  margin-bottom: 16px;
  cursor: pointer;
}

.scanner-drop:hover {
  border-color: var(--lime);
  background: rgba(157, 242, 21, 0.06);
}

.scanner-drop svg { width: 28px; height: 28px; color: var(--ink-faint); margin: 0 auto 10px; }
.scanner-drop p { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.scanner-drop span { font-size: 13px; color: var(--ink-faint); }

.scanner-preview { display: none; margin-bottom: 16px; }
.scanner-preview.show { display: block; }
.scanner-preview img { max-height: 200px; margin: 0 auto; border-radius: var(--radius-sm); }

.scanner-form { display: flex; gap: 8px; }

.scanner-form input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--rule-dark);
  border-radius: var(--radius-pill);
  background: var(--mat);
}

.scanner-form input:focus {
  outline: none;
  border-color: var(--lime);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(28, 27, 25, 0.5);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  width: 100%;
  max-width: 600px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  margin-top: 16px;
}

.modal-head { display: flex; justify-content: flex-end; padding: 12px 12px 0; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--mat);
  color: var(--ink-soft);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 4px 28px 28px;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
}

.modal-body img { border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }

.modal-name {
  font-family: var(--display);
  font-size: 24px;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  margin-bottom: var(--gap-md);
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-field .label {
  font-family: var(--display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

.modal-field .value { font-size: 15px; font-weight: 600; }

.price-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }

.price-table th,
.price-table td {
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.price-table th {
  font-family: var(--display);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

.price-table td.price {
  font-family: var(--display);
  font-weight: 600;
  color: var(--green);
  text-align: right;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--rule);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 32px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Loading states */
.loading-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink-soft);
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  animation: dot-bounce 1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.meta-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
}

.sk-line,
.sk-card-img,
.sk-logo {
  position: relative;
  overflow: hidden;
  background: var(--mat);
  border-radius: var(--radius-sm);
}

.sk-line::after,
.sk-card-img::after,
.sk-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.pack-skeleton {
  pointer-events: none;
  border-style: dashed;
}

.pack-skeleton .sk-logo {
  width: 48px;
  height: 36px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.pack-skeleton .sk-title {
  height: 16px;
  width: 72%;
  margin: 0 auto 10px;
}

.pack-skeleton .sk-series {
  height: 12px;
  width: 55%;
  margin: 0 auto 14px;
}

.pack-skeleton .sk-meta {
  height: 12px;
  width: 42%;
}

.card-skeleton {
  pointer-events: none;
  border-style: dashed;
}

.card-skeleton .sk-card-img {
  width: 100%;
  aspect-ratio: 5/7;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
}

.card-skeleton .sk-card-name {
  height: 14px;
  width: 82%;
  margin-bottom: 8px;
}

.card-skeleton .sk-card-meta {
  height: 10px;
  width: 58%;
}

@media (max-width: 520px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-body img { max-width: 150px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .hero-grid-lines,
  .hero-particle,
  .hero-spark {
    animation: none !important;
  }
  .sk-line::after,
  .sk-card-img::after,
  .sk-logo::after {
    animation: none !important;
  }
  .reveal,
  .reveal-stagger .reveal-child {
    opacity: 1 !important;
    transform: none !important;
  }
}