/* Toxic Drip SVG Bar */
.toxic-drip {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 108px;
  margin: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  border-radius: 0;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.28) 16%,
    rgba(0, 0, 0, 0.72) 36%,
    #000 56%,
    #000 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.28) 16%,
    rgba(0, 0, 0, 0.72) 36%,
    #000 56%,
    #000 100%
  );
}

.toxic-drip-svg {
  width: 100%;
  height: 108px;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(187, 255, 61, 0.52)) blur(0.4px);
  animation: toxicSlimePulse 4.4s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.toxic-drip-path {
  transition: d 0.8s cubic-bezier(.7,0,.3,1);
}

@keyframes toxicSlimePulse {
  0% {
    transform: scaleY(1) scaleX(1);
    filter: drop-shadow(0 10px 24px rgba(187, 255, 61, 0.50)) blur(0.4px);
  }
  35% {
    transform: scaleY(0.91) scaleX(1.01);
    filter: drop-shadow(0 8px 18px rgba(187, 255, 61, 0.44)) blur(0.35px);
  }
  65% {
    transform: scaleY(0.86) scaleX(0.99);
    filter: drop-shadow(0 7px 16px rgba(187, 255, 61, 0.40)) blur(0.3px);
  }
  100% {
    transform: scaleY(1) scaleX(1);
    filter: drop-shadow(0 10px 24px rgba(187, 255, 61, 0.50)) blur(0.4px);
  }
}
/* ============================================================
   NEMESIS - TOXIC COLLECTION
   Radioactive / Poison Lab UI
   ============================================================ */

:root {
  --shell-light: #2d2037;
  --shell-mid: #23182c;
  --shell-shadow: #140d19;
  --bezel: #8d46c7;
  --ink: #f1eefe;
  --ink-soft: #c9b9df;

  --lcd-0: #e5ff9b;
  --lcd-1: #d7ff65;
  --lcd-2: #a9f03c;
  --lcd-3: #78c91f;
  --lcd-4: #5a971e;
  --lcd-5: #395f16;

  --accent-magenta: #d14cff;
  --accent-magenta-dark: #7a1e98;
  --accent-blue: #8d46c7;
  --accent-violet: #ba68ff;
  --accent-toxic: #bbff3d;
  --accent-toxic-soft: #d8ff7a;
  --accent-sludge: #7af12c;

  --stroke: #120c18;
  --stroke-soft: rgba(16, 10, 22, 0.72);

  --card-bg: rgba(155, 74, 204, 0.18);
  --card-border: rgba(183, 109, 255, 0.48);
  --toxic-glow: rgba(182, 255, 73, 0.35);
  --toxic-glow-strong: rgba(187, 255, 61, 0.55);
  --venom-shadow: rgba(98, 17, 136, 0.42);
  --venom-shadow-dark: rgba(33, 4, 48, 0.72);
  --screen-dark: #161f0d;
  --screen-mid: #243313;
  --screen-light: #496f1b;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition-fast: 0.18s ease;
  --transition-mid: 0.26s ease;
  --content-max: 1120px;
}

/* ============================================================
   Reset / Base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "VT323", "Courier New", monospace;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(186, 91, 255, 0.22), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(176, 255, 71, 0.10), transparent 22%),
    radial-gradient(circle at 50% 120%, rgba(115, 255, 43, 0.08), transparent 38%),
    linear-gradient(180deg, #130d18 0%, #1b1024 45%, #0e0912 100%);
  position: relative;
  overflow-x: hidden;
  padding: 26px 14px 120px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(203, 255, 92, 0.035) 0,
      rgba(203, 255, 92, 0.035) 2px,
      transparent 2px,
      transparent 5px
    );
  mix-blend-mode: screen;
  opacity: 0.5;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(187, 255, 61, 0.16), transparent 18%),
    radial-gradient(circle at 90% 10%, rgba(209, 76, 255, 0.14), transparent 16%),
    radial-gradient(circle at 40% 100%, rgba(155, 74, 204, 0.1), transparent 24%);
  filter: blur(18px);
  z-index: 0;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-toxic-soft);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

/* ============================================================
   Layout shell
   ============================================================ */

.lab-shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--content-max));
  margin: 0 auto 32px auto;
  padding-bottom: 24px;
}

/* ============================================================
   Title
   ============================================================ */

h1,
.glitch-title {
  max-width: var(--content-max);
  margin: 10px auto 14px;
  padding: 16px 20px 14px;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1rem, 2.3vw, 1.55rem);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.45;
  color: #f6f0ff;
  background:
    linear-gradient(180deg, rgba(62, 28, 84, 0.98), rgba(31, 15, 40, 0.98));
  border: 3px solid #b76dff;
  border-radius: 14px;
  box-shadow:
    0 0 0 2px rgba(178, 255, 76, 0.15) inset,
    0 0 18px rgba(183, 109, 255, 0.28),
    0 0 36px rgba(182, 255, 73, 0.08),
    6px 6px 0 rgba(8, 5, 11, 0.65);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.glitch-title::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0%, rgba(215, 255, 101, 0.08) 45%, transparent 55%);
  transform: translateX(-120%);
  animation: toxic-title-sheen 7s linear infinite;
  pointer-events: none;
}

@keyframes toxic-title-sheen {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

.title-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(182, 255, 73, 0.18))
    drop-shadow(0 0 14px rgba(209, 76, 255, 0.12));
}

.glitch-text {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  color: #f6f0ff;
  text-shadow:
    0 0 6px rgba(209, 76, 255, 0.18),
    0 0 10px rgba(187, 255, 61, 0.1);
}

.glitch-char {
  position: relative;
  display: inline-block;
  transition: transform 0.12s ease, text-shadow 0.12s ease, color 0.12s ease;
}

.glitch-char.is-glitching {
  color: var(--accent-toxic-soft);
  text-shadow:
    1px 0 0 rgba(255, 77, 214, 0.7),
    -1px 0 0 rgba(187, 255, 61, 0.7),
    0 0 10px rgba(187, 255, 61, 0.22);
  transform: translateY(-1px) skewX(-8deg);
}

.glitch-text.old-school-flash {
  animation: oldschoolFlash 0.18s steps(2, end) 1;
}

@keyframes oldschoolFlash {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.35) contrast(1.2); }
  100% { filter: brightness(1); }
}

/* ============================================================
   Intro text
   ============================================================ */

.desc,
.preview-behavior-note {
  width: min(100%, var(--content-max));
  margin: 0 auto 18px;
  padding: 16px 20px;
  color: #ece4ff;
  background:
    linear-gradient(180deg, rgba(41, 24, 54, 0.92), rgba(26, 14, 34, 0.98));
  border: 2px dashed rgba(190, 126, 255, 0.48);
  border-radius: 16px;
  font-size: clamp(1.35rem, 1.6vw, 1.7rem);
  line-height: 1.18;
  box-shadow:
    0 0 18px rgba(157, 73, 236, 0.13);
  position: relative;
  z-index: 1;
}

.total-pokemon-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

#total-pokemon-btn,
.clear-btn {
  color: #120d18;
  background:
    linear-gradient(180deg, #d7ff65 0%, #9be026 55%, #79bf17 100%);
  border: 3px solid #20310f;
  border-radius: 12px;
  box-shadow:
    0 4px 0 #4d7b10,
    0 8px 20px rgba(141, 219, 34, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-family: "Press Start 2P", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#total-pokemon-btn {
  padding: 14px 18px 12px;
  min-height: 50px;
  font-size: 10px;
}

#total-pokemon-btn:hover,
#total-pokemon-btn:focus-visible,
.clear-btn:hover,
.clear-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

#total-pokemon-btn:active,
.clear-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #4d7b10,
    0 5px 10px rgba(141, 219, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.search-bar-container {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  align-items: stretch;
}

.search-input {
  width: 100%;
  min-height: 48px;
  border: 2px solid #7f58a8;
  border-radius: 12px;
  color: #d7ff65;
  background:
    linear-gradient(180deg, rgba(43, 23, 54, 0.98), rgba(23, 13, 31, 1));
  box-shadow:
    inset 0 0 0 1px rgba(183, 109, 255, 0.18),
    0 0 8px rgba(182, 255, 73, 0.04),
    0 4px 10px rgba(0, 0, 0, 0.18);
  padding: 10px 14px;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1;
  caret-color: var(--accent-toxic-soft);
}

.search-input::placeholder {
  color: rgba(215, 255, 101, 0.55);
}

.search-input:hover,
.search-input:focus {
  border-color: rgba(197, 255, 90, 0.75);
  box-shadow:
    inset 0 0 0 2px rgba(183, 109, 255, 0.28),
    0 0 0 1px rgba(197, 255, 90, 0.2),
    0 0 18px rgba(182, 255, 73, 0.12);
}

.clear-btn {
  min-height: 48px;
  padding: 10px 14px 9px;
  font-size: 10px;
  white-space: nowrap;
}

/* ============================================================
   Preview capsule
   ============================================================ */

.pokemon-hover-preview,
#last-pokemon-section,
.collection-section {
  background:
    linear-gradient(180deg, rgba(48, 24, 64, 0.96), rgba(24, 10, 31, 0.98));
  border: 4px solid #8d46c7;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 2px rgba(195, 123, 255, 0.16),
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(157, 73, 236, 0.18);
  position: relative;
  overflow: hidden;
}

.pokemon-hover-preview {
  position: fixed;
  right: max(16px, calc(50% - 760px));
  top: 250px;
  width: min(88vw, 260px);
  padding: 10px 10px 12px;
  z-index: 6;
}

/* (Removed old block style, now only floating style remains) */

.pokemon-hover-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(187, 255, 61, 0.09), transparent 26%),
    radial-gradient(circle at 0% 100%, rgba(209, 76, 255, 0.08), transparent 22%),
    radial-gradient(circle at 100% 20%, rgba(187, 255, 61, 0.08), transparent 20%);
  z-index: 0;
}

.pokemon-hover-preview::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px solid rgba(215, 255, 101, 0.08);
  pointer-events: none;
  z-index: 0;
}

.preview-shell-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  padding: 8px 12px 7px;
  border-radius: 999px;
  border: 2px solid rgba(197, 255, 90, 0.38);
  background: rgba(182, 255, 73, 0.08);
  color: #dcff90;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.04em;
  box-shadow: 0 0 18px rgba(182, 255, 73, 0.12);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.pokemon-hover-preview.dragging {
  box-shadow:
    inset 0 0 0 2px rgba(195, 123, 255, 0.16),
    0 16px 36px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(157, 73, 236, 0.24);
}

.pokemon-hover-preview.dragging .preview-shell-label {
  cursor: grabbing;
}

.preview-status-row {
  position: relative;
  z-index: 1;
}

.status-chip {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 14px rgba(182, 255, 73, 0.08);
}

.preview-screen-frame {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  margin: 4px auto 8px;
  padding: 10px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(50, 25, 67, 0.96), rgba(17, 8, 24, 1));
  border: 3px solid rgba(183, 109, 255, 0.45);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.04),
    inset 0 0 18px rgba(182, 255, 73, 0.07),
    0 14px 30px rgba(0, 0, 0, 0.35);
}

.preview-screen,
.mini-monitor-screen {
  background:
    radial-gradient(circle at 50% 35%, rgba(195, 255, 76, 0.28), rgba(116, 191, 32, 0.22) 35%, rgba(31, 58, 32, 0.18) 100%),
    linear-gradient(180deg, #263812 0%, #19230d 100%);
  border: 2px solid #7dbd29;
  box-shadow:
    0 0 16px rgba(182, 255, 73, 0.22),
    inset 0 0 18px rgba(182, 255, 73, 0.12);
  color: #d7ff65;
}

.preview-screen {
  position: relative;
  width: 100%;
  min-height: 180px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.preview-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(215, 255, 101, 0.08) 0,
      rgba(215, 255, 101, 0.08) 2px,
      rgba(16, 31, 10, 0.05) 2px,
      rgba(16, 31, 10, 0.05) 4px
    );
  opacity: 0.7;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: scanlineShift 4s linear infinite;
  z-index: 1;
}

.preview-screen::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle, rgba(215, 255, 101, 0.18), transparent 38%);
  opacity: 0.25;
  pointer-events: none;
  z-index: 1;
  animation: scannerSweep 3.2s linear infinite;
}

@keyframes scanlineShift {
  0% { transform: translateY(0); }
  100% { transform: translateY(8px); }
}

@keyframes scannerSweep {
  0% {
    transform: translateX(-38%) translateY(-10%);
    opacity: 0.12;
  }
  50% {
    transform: translateX(10%) translateY(6%);
    opacity: 0.35;
  }
  100% {
    transform: translateX(46%) translateY(-8%);
    opacity: 0.12;
  }
}

#preview-pokemon-img {
  position: relative;
  z-index: 2;
  width: min(70%, 150px);
  min-height: 90px;
  object-fit: contain;
  image-rendering: pixelated;
  filter:
    drop-shadow(0 0 14px rgba(215, 255, 101, 0.22))
    drop-shadow(0 0 18px rgba(95, 180, 21, 0.14));
}

.preview-pokemon-name {
  position: relative;
  z-index: 1;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.72rem, 1.3vw, 0.84rem);
  line-height: 1.3;
  text-align: center;
  color: #f9f5ff;
  margin-top: 4px;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.preview-pokemon-meta {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: clamp(1.24rem, 1.5vw, 1.5rem);
  line-height: 1.05;
  color: #c8b6df;
  margin-bottom: 6px;
}

.preview-pokeball-container {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 3px auto 6px;
  background:
    radial-gradient(circle at 50% 40%, rgba(187, 255, 61, 0.18), rgba(187, 255, 61, 0.04) 58%, transparent 70%);
}

.preview-pokeball-container::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px dashed rgba(187, 255, 61, 0.25);
  animation: rotateRing 10s linear infinite;
}

.preview-pokeball-container::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(187, 255, 61, 0.18);
  opacity: 0.8;
}

.preview-pokeball-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 0 10px rgba(187, 255, 61, 0.16))
    drop-shadow(0 0 8px rgba(209, 76, 255, 0.14));
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.preview-data-grid {
  position: relative;
  z-index: 1;
}

.preview-data-box {
  box-shadow:
    inset 0 0 0 1px rgba(215, 255, 101, 0.03),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

.preview-data-box .label {
  opacity: 0.95;
}

.preview-data-box .value {
  text-shadow: 0 0 8px rgba(182, 255, 73, 0.1);
}

.preview-empty-hint {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 8px rgba(209, 76, 255, 0.08);
}

/* ============================================================
   Sections / Cards
   ============================================================ */

.collection-section {
  width: min(100%, var(--content-max));
  margin: 0 auto 18px;
  z-index: 1;
}

.collection-section::before,
.collection-section::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.collection-section::before {
  top: -6px;
  right: 26px;
  width: 96px;
  height: 88px;
  background:
    radial-gradient(circle at 22% 18%, rgba(187, 255, 61, 0.94) 0 12px, transparent 13px),
    radial-gradient(circle at 48% 0%, rgba(187, 255, 61, 0.92) 0 18px, transparent 19px),
    radial-gradient(circle at 74% 16%, rgba(166, 241, 46, 0.88) 0 14px, transparent 15px),
    linear-gradient(180deg, rgba(192, 255, 79, 0.82), rgba(110, 186, 20, 0.7));
  clip-path: polygon(
    0 0, 100% 0, 100% 18%, 82% 18%, 80% 52%, 74% 90%, 67% 52%, 65% 18%,
    44% 18%, 43% 64%, 37% 100%, 31% 56%, 29% 18%, 0 18%
  );
  filter: blur(0.3px) drop-shadow(0 10px 12px rgba(187, 255, 61, 0.22));
  opacity: 0.82;
}

.collection-section::after {
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(209, 76, 255, 0.06), transparent 16%),
    radial-gradient(circle at 100% 100%, rgba(187, 255, 61, 0.05), transparent 18%);
  mix-blend-mode: screen;
}

.collapsible-header {
  width: 100%;
  background: linear-gradient(180deg, #4f2670, #34164a);
  color: #f4ebff;
  border: 0;
  border-bottom: 3px solid rgba(190, 126, 255, 0.35);
  padding: 14px 14px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
  text-align: left;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  line-height: 1.35;
  text-transform: uppercase;
}

.collapsible-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(187, 255, 61, 0.04), transparent 22%, transparent 78%, rgba(209, 76, 255, 0.06));
  pointer-events: none;
}

.collapsible-header:hover,
.collapsible-header:focus-visible {
  background: linear-gradient(180deg, #5b2d7d, #391950);
}

.collapsible-header.is-collapsed .arrow {
  transform: rotate(-90deg);
}

.header-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.arrow {
  flex: 0 0 auto;
  transition: transform var(--transition-mid);
  color: var(--accent-toxic-soft);
  text-shadow: 0 0 8px rgba(187, 255, 61, 0.12);
  margin-left: 8px;
}

.poke-count {
  margin-left: auto;
  margin-right: 8px;
  padding: 7px 10px 6px;
  border-radius: 999px;
  background: rgba(182, 255, 73, 0.12);
  border: 2px solid rgba(182, 255, 73, 0.4);
  color: #d7ff65;
  font-size: 9px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.collapsible-content {
  background: linear-gradient(180deg, rgba(73, 34, 97, 0.52), rgba(28, 12, 39, 0.7));
  padding: 16px;
  position: relative;
  z-index: 1;
}

.collapsible-content[hidden] {
  display: none;
}

.pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.pokemon-card {
  position: relative;
  border: 2px solid rgba(182, 117, 255, 0.32);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(92, 42, 122, 0.88), rgba(42, 18, 58, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(214, 179, 255, 0.08),
    0 0 0 1px rgba(170, 255, 90, 0.03),
    0 6px 14px rgba(0, 0, 0, 0.3);
  padding: 12px 10px 10px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
  overflow: hidden;
}

.pokemon-card::before {
  content: "";
  position: absolute;
  top: -2px;
  right: 14px;
  width: 52px;
  height: 56px;
  background:
    radial-gradient(circle at 32% 14%, rgba(187, 255, 61, 0.9) 0 8px, transparent 9px),
    radial-gradient(circle at 62% 0%, rgba(187, 255, 61, 0.85) 0 12px, transparent 13px),
    linear-gradient(180deg, rgba(187, 255, 61, 0.8), rgba(104, 173, 24, 0.62));
  clip-path: polygon(0 0, 100% 0, 100% 12%, 84% 12%, 82% 44%, 74% 84%, 65% 44%, 63% 12%, 0 12%);
  opacity: 0.48;
  filter: blur(0.2px) drop-shadow(0 6px 6px rgba(187, 255, 61, 0.16));
  pointer-events: none;
}

.pokemon-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(187, 255, 61, 0.06), transparent 28%),
    linear-gradient(180deg, transparent, rgba(209, 76, 255, 0.04));
  pointer-events: none;
}

.pokemon-card:hover,
.pokemon-card.is-preview-selected,
.pokemon-card:focus-visible {
  transform: translateY(-3px) scale(1.015);
  border-color: rgba(197, 255, 90, 0.75);
  box-shadow:
    inset 0 0 0 1px rgba(214, 179, 255, 0.14),
    0 0 18px rgba(182, 255, 73, 0.16),
    0 10px 20px rgba(0, 0, 0, 0.38);
  background:
    linear-gradient(180deg, rgba(104, 48, 138, 0.95), rgba(44, 18, 61, 0.98));
}

.ball-icon,
.pokeball-img {
  image-rendering: pixelated;
}

.ball-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  position: relative;
  filter:
    drop-shadow(0 0 10px rgba(182, 255, 73, 0.18))
    drop-shadow(0 0 8px rgba(209, 76, 255, 0.16));
}

.pokeball-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(182, 255, 73, 0.18))
    drop-shadow(0 0 8px rgba(209, 76, 255, 0.12));
}

.pokemon-img {
  width: min(100%, 104px);
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
  filter:
    drop-shadow(0 0 12px rgba(182, 255, 73, 0.14))
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
  margin-top: 2px;
}

.pokemon-name {
  color: #f3ecff;
  font-size: clamp(1.45rem, 1.5vw, 1.7rem);
  line-height: 1;
  word-break: break-word;
}

.pokemon-card .pokemon-name + .pokemon-name,
.pokemon-serial,
.preview-pokemon-meta {
  color: #c8b6df;
}

.pokemon-card .pokemon-name + .pokemon-name {
  font-size: clamp(1.05rem, 1.2vw, 1.18rem);
  margin-top: -2px;
}

.pokemon-serial {
  font-size: clamp(1.12rem, 1.1vw, 1.3rem);
  color: #d8ff7a;
  text-shadow: 0 0 8px rgba(182, 255, 73, 0.06);
}

/* ============================================================
   Section color personality
   ============================================================ */

.collection-section.poison-main {
  border-color: #a44dff;
  box-shadow:
    inset 0 0 0 2px rgba(195, 123, 255, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(164, 77, 255, 0.18);
}

.collection-section.toxic-lime {
  border-color: #bbff3d;
  box-shadow:
    inset 0 0 0 2px rgba(195, 255, 123, 0.14),
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(187, 255, 61, 0.16);
}

.collection-section.gengar-dark {
  border-color: #5c2b86;
  box-shadow:
    inset 0 0 0 2px rgba(170, 102, 230, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(92, 43, 134, 0.2);
}

.collection-section.sludge-pink {
  border-color: #ff68c8;
  box-shadow:
    inset 0 0 0 2px rgba(255, 164, 227, 0.14),
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(255, 104, 200, 0.18);
}

.collection-section.nidoking {
  border-color: #6d63ff;
  box-shadow:
    inset 0 0 0 2px rgba(139, 131, 255, 0.16),
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(109, 99, 255, 0.18);
}

.collection-section.crobat {
  border-color: #7e3fd8;
  box-shadow:
    inset 0 0 0 2px rgba(162, 111, 238, 0.16),
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(126, 63, 216, 0.18);
}

/* ============================================================
   Mini monitor fallback
   ============================================================ */

.mini-monitor-screen {
  border-radius: 12px;
  padding: 10px;
  min-height: 100px;
}

/* ============================================================
   Scroll button
   ============================================================ */

.back-to-top-toxic {
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(182, 255, 73, 0.55);
  background:
    radial-gradient(circle at 50% 35%, rgba(195, 255, 76, 0.28), rgba(116, 191, 32, 0.2) 35%, rgba(31, 58, 32, 0.28) 100%),
    linear-gradient(180deg, #2b3e16 0%, #18220e 100%);
  box-shadow:
    0 0 16px rgba(182, 255, 73, 0.2),
    0 8px 22px rgba(0, 0, 0, 0.42);
  color: #d7ff65;
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity var(--transition-fast), transform var(--transition-fast), filter var(--transition-fast);
}

.back-to-top-toxic::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(215, 255, 101, 0.26);
  animation: rotateRing 8s linear infinite;
}

.back-to-top-toxic::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(187, 255, 61, 0.16);
  opacity: 0.72;
}

.back-to-top-toxic:hover,
.back-to-top-toxic:focus-visible {
  transform: translateY(-2px) scale(1.05);
  filter: brightness(1.06);
}

/* ============================================================
   Hidden helpers / defaults
   ============================================================ */

[aria-pressed="true"] {
  box-shadow:
    inset 0 0 0 1px rgba(214, 179, 255, 0.14),
    0 0 18px rgba(182, 255, 73, 0.16),
    0 10px 20px rgba(0, 0, 0, 0.38);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  body {
    padding: 22px 12px 56px;
  }

  .glitch-title {
    gap: 8px;
    padding-inline: 14px;
  }

  .title-icon {
    width: 30px;
    height: 30px;
  }

  .collapsible-header {
    padding: 14px 14px;
  }

  .collapsible-content {
    padding: 14px;
  }

  .pokemon-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .pokemon-card {
    min-height: 228px;
  }

  .pokemon-hover-preview {
    top: 210px;
    right: 12px;
    width: min(88vw, 240px);
  }
}

@media (max-width: 700px) {
  .search-bar-container {
    flex-direction: column;
    gap: 8px;
  }

  .clear-btn,
  #total-pokemon-btn {
    width: 100%;
  }

  .preview-screen {
    min-height: 168px;
  }

  .preview-pokeball-container {
    width: 60px;
    height: 60px;
  }

  .pokeball-img {
    width: 32px;
    height: 32px;
  }

  .ball-icon {
    width: 20px;
    height: 20px;
  }

  .collapsible-header {
    flex-wrap: wrap;
    font-size: 0.7rem;
  }

  .poke-count {
    order: 3;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 520px) {
  body {
    padding-top: 18px;
  }

  .glitch-title,
  h1 {
    padding: 14px 12px 13px;
    gap: 6px;
  }

  .title-icon {
    display: none;
  }

  .desc,
  .preview-behavior-note {
    padding: 12px 12px;
    font-size: 1.38rem;
  }

  .search-input {
    min-height: 52px;
    font-size: 1.65rem;
    padding: 11px 12px;
  }

  .clear-btn,
  #total-pokemon-btn {
    min-height: 52px;
    font-size: 8px;
  }

  .pokemon-hover-preview {
    top: 194px;
    right: 10px;
    width: min(90vw, 228px);
    padding: 10px 10px 12px;
  }

  .preview-shell-label {
    font-size: 7px;
    padding: 7px 10px 6px;
  }

  .preview-screen-frame {
    padding: 8px;
    border-radius: 14px;
  }

  .preview-screen {
    min-height: 150px;
    border-radius: 10px;
  }

  .pokemon-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .pokemon-card {
    min-height: 216px;
    padding: 12px 10px 10px;
  }

  .pokemon-img {
    height: 82px;
  }

  .pokemon-name {
    font-size: 1.18rem;
  }

  .pokemon-card .pokemon-name + .pokemon-name,
  .pokemon-serial {
    font-size: 1rem;
  }

  .collapsible-header {
    font-size: 0.62rem;
  }
}

@media (max-width: 400px) {
  .pokemon-grid {
    grid-template-columns: 1fr;
  }

  .preview-data-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .pokemon-card:hover,
  .pokemon-card.is-preview-selected,
  .pokemon-card:focus-visible,
  #total-pokemon-btn:hover,
  .clear-btn:hover {
    transform: none;
  }
}