:root {
  --neon-pink: #ff69b4;
  --neon-green: #39ff14;
  --neon-cyan: #00ffff;
  --slop-brown: #8b4513;
  --void-black: #0a0a0a;
  --panel-bg: rgba(0, 0, 0, 0.55);
  --text-primary: #ffffff;
  --text-muted: #c8c8c8;
  --thumb-size: 256px;
}

/* SIMPLE MODE TOGGLE BUTTON */
#simple-mode-toggle {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 200;
  background: #000;
  color: var(--neon-cyan);
  border: 2px solid var(--neon-cyan);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  opacity: 0.6;
  transition: opacity 0.15s;
}
#simple-mode-toggle:hover,
#simple-mode-toggle:focus-visible {
  opacity: 1;
  background: var(--neon-cyan);
  color: #000;
  outline: 2px solid #fff;
  outline-offset: 2px;
}
#simple-mode-toggle[aria-pressed="true"] {
  background: #fff;
  color: #000;
  border-color: #fff;
  opacity: 1;
}

/* ============================================================
   SIMPLE MODE — high contrast, no animation, plain rendering
   Activated by adding `simple-mode` class to <body>
   ============================================================ */
body.simple-mode {
  --neon-pink: #ff66cc;
  --neon-green: #66ff66;
  --neon-cyan: #66ffff;
  --panel-bg: #000;
  --text-primary: #ffffff;
  --text-muted: #cccccc;
}

/* Kill all the motion */
body.simple-mode *,
body.simple-mode *::before,
body.simple-mode *::after {
  animation: none !important;
  transition: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}

/* Solid background, no scrolling tile */
body.simple-mode #bg-layer {
  background-image: none !important;
  background-color: #000 !important;
  animation: none !important;
}

/* Solid panels, thicker borders */
body.simple-mode .panel {
  background: #000 !important;
  border: 2px solid #fff !important;
}
body.simple-mode #hero,
body.simple-mode footer {
  background: #000 !important;
  border: 2px solid #fff !important;
}

/* Rainbow trait names → plain readable text with rare/common indicator */
body.simple-mode .trait-row .name,
body.simple-mode #lightbox-info .trait-tag.rainbowed {
  background: #000 !important;
  background-image: none !important;
  color: #fff !important;
  text-shadow: none !important;
  animation: none !important;
}
/* For rare traits (rarity > 0), add a star prefix instead of color */
body.simple-mode .trait-row .name[style*="--rarity:0.0"]:not([style*="--rarity:0.00"])::before,
body.simple-mode .trait-row .name:not([style*="--rarity:0.000"])::before {
  content: "★ ";
  color: #ffff00;
}

/* Active filters need clear borders, not just color */
body.simple-mode .filter-chip {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  outline: 2px solid #fff;
}
body.simple-mode .trait-row.active {
  background: #fff !important;
  color: #000 !important;
  outline: 2px solid #000 !important;
}
body.simple-mode .trait-row.active .name { color: #000 !important; }

/* Mint button: keep distinct, no pulse */
body.simple-mode #mint-live {
  background: #ffff00 !important;
  color: #000 !important;
  border: 3px solid #000 !important;
  outline: 2px solid #fff;
}

/* Manifesto plain readable */
body.simple-mode #manifesto {
  color: #fff !important;
  font-weight: 400 !important;
  text-shadow: none !important;
}

/* Mint counter — green text, no glow */
body.simple-mode #mint-status { text-shadow: none !important; color: #66ff66 !important; }
body.simple-mode .status-dot { animation: none !important; }

/* Thumb hover: just outline, no scale */
body.simple-mode .thumb:hover {
  transform: none !important;
  outline: 3px solid #ffff00;
  outline-offset: -3px;
}
body.simple-mode .thumb { border: 2px solid #fff !important; }
body.simple-mode .thumb .id-tag {
  background: #000 !important;
  color: #fff !important;
  border-top: 1px solid #fff;
}

/* Skeleton placeholder — solid grey, no shimmer */
body.simple-mode .thumb-img-wrap::before {
  background: #333 !important;
  animation: none !important;
}

/* Combo border rave → solid yellow */
body.simple-mode .panel.rare-combo {
  animation: none !important;
  border-color: #ffff00 !important;
}

/* Big buttons — solid contrast */
body.simple-mode .big-btn {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}
body.simple-mode .big-btn:hover,
body.simple-mode .big-btn:focus-visible {
  background: #fff !important;
  color: #000 !important;
  transform: none !important;
}

/* Easter eggs disabled */
body.simple-mode .slop-drop,
body.simple-mode.evil-mode,
body.simple-mode.rainbow-mode {
  display: none !important;
  filter: none !important;
  animation: none !important;
}

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

img, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

html, body {
  color: var(--text-primary);
  font-family: "Comic Neue", "Comic Sans MS", "Chalkboard SE", sans-serif;
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
}

#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--void-black);
  background-size: 512px 512px;
  background-repeat: repeat;
  image-rendering: pixelated;
  opacity: 1;
  animation: bgscroll 60s linear infinite;
}
@keyframes bgscroll {
  from { background-position: 0 0; }
  to   { background-position: 1024px 1024px; }
}

#app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  padding: 6px;
  gap: 6px;
}

a { color: var(--neon-cyan); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--neon-pink); text-shadow: 0 0 8px var(--neon-pink); }
}

.muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* HERO */
#hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 6px 14px;
  background: var(--panel-bg);
  border: 2px solid var(--neon-green);
  border-radius: 4px;
  backdrop-filter: blur(2px);
}
#logo { width: 195px; height: 42px; cursor: pointer; }
#manifesto {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: 0.5px;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0 0 6px rgba(255,105,180,0.5);
}
#mint-cluster {
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
}
#mint-status {
  font-size: 20px; font-weight: 700;
  color: var(--neon-green);
  text-shadow: 0 0 8px var(--neon-green);
}
.status-dot {
  font-size: 12px; vertical-align: middle;
  animation: pulse 1.5s infinite; margin-left: 4px;
}
.status-dot.live { color: var(--neon-green); }
.status-dot.ended { color: #ff3333; }
@keyframes pulse { 50% { opacity: 0.3; } }

#mint-live {
  background: var(--neon-pink); color: #000;
  font-weight: 700; font-size: 16px;
  padding: 8px 16px;
  border: 3px solid #fff;
  text-decoration: none;
  animation: mintpulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 14px var(--neon-pink);
}
@media (hover: hover) and (pointer: fine) {
  #mint-live:hover {
    background: #fff; color: var(--neon-pink);
    text-shadow: none; transform: scale(1.06);
  }
}
@keyframes mintpulse {
  0%, 100% { box-shadow: 0 0 14px var(--neon-pink); }
  50%      { box-shadow: 0 0 28px var(--neon-pink), 0 0 8px var(--neon-cyan); }
}

/* GRID */
#grid {
  display: grid;
  grid-template-columns: 2.75fr 1fr 1.15fr;
  grid-template-rows: 1.3fr 1fr;
  grid-template-areas:
    "gallery traits xtras"
    "gallery market poopet";
  gap: 6px;
  min-height: 0;
}
#gallery-section { grid-area: gallery; }
#traits-section  { grid-area: traits; }
#market-section  { grid-area: market; }
#xtras-section   { grid-area: xtras; }
#poopet-section  { grid-area: poopet; }

@media (max-width: 1280px) {
  html, body { overflow: auto; height: auto; }
  #app { height: auto; }
  #grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "gallery gallery"
      "traits  xtras"
      "market  poopet";
  }

  /* Let panels flow naturally — no internal clipping */
  .panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  /* Dissolve scroll-wrap so panel-body becomes a direct child of .panel */
  .scroll-wrap {
    display: contents;
  }
  .panel-body[data-overlay-scroll] {
    position: static !important;
    overflow: visible !important;
    overflow-y: visible !important;
    height: auto !important;
    inset: auto !important;
    flex: 0 0 auto !important;
  }
  .overlay-scrollbar { display: none !important; }

  /* POOPET square via aspect-ratio (container queries don't work without fixed size) */
  #poopet-section .panel-body {
    container-type: normal;
    aspect-ratio: 1 / 1;
  }
  #poopet-frame {
    width: 100%;
    height: 100%;
  }

  /* Gallery thumbs may overflow on small screens — clamp width */
  .thumb,
  .thumb-img-wrap {
    max-width: 100%;
  }
  .thumb-img-wrap {
    aspect-ratio: 1 / 1;
    height: auto;
  }
}

@media (max-width: 640px) {
  #hero { grid-template-columns: 1fr; text-align: center; }
  #mint-cluster { justify-content: center; }
  #grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "gallery"
      "traits"
      "market"
      "xtras"
      "poopet";
  }
  #logo { width: 195px; margin: 0 auto; }
}

/* PANELS */
.panel {
  background: var(--panel-bg);
  border: 2px solid var(--neon-pink);
  padding: 8px;
  border-radius: 4px;
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  backdrop-filter: blur(3px);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.panel h2 {
  color: var(--neon-cyan);
  font-size: 16px;
  text-shadow: 1px 1px 0 var(--neon-pink);
  margin-bottom: 6px; flex-shrink: 0;
}
.panel-head {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; flex-wrap: wrap;
  margin-bottom: 6px; justify-content: space-between;
}
.panel-head h2 { margin-bottom: 0; }
.panel-body {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
}

/* OVERLAY SCROLLBAR (custom JS-driven) */
.panel-body[data-overlay-scroll] {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.panel-body[data-overlay-scroll]::-webkit-scrollbar { display: none; width: 0; height: 0; }
.scroll-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.scroll-wrap > .panel-body {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.overlay-scrollbar {
  position: absolute;
  top: 2px; right: 2px; bottom: 2px;
  width: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 5;
}
.scroll-wrap:hover .overlay-scrollbar,
.overlay-scrollbar.is-scrolling { opacity: 1; }
.overlay-thumb {
  position: absolute;
  right: 0;
  width: 100%;
  background: var(--neon-pink);
  border-radius: 3px;
  box-shadow: 0 0 6px var(--neon-pink);
  pointer-events: auto;
  cursor: grab;
  min-height: 20px;
}
.overlay-thumb:active { cursor: grabbing; }

/* Non-overlay panel scrollbars (markets/xtras) */
.panel-body:not([data-overlay-scroll])::-webkit-scrollbar { width: 6px; }
.panel-body:not([data-overlay-scroll])::-webkit-scrollbar-track { background: transparent; }
.panel-body:not([data-overlay-scroll])::-webkit-scrollbar-thumb { background: var(--neon-pink); border-radius: 3px; }

.panel.rare-combo {
  animation: combo-border 4s linear infinite;
}
@keyframes combo-border {
  0%   { box-shadow: 0 0 14px #ff0044; border-color: #ff0044; }
  20%  { box-shadow: 0 0 14px #ff8800; border-color: #ff8800; }
  40%  { box-shadow: 0 0 14px #ffee00; border-color: #ffee00; }
  60%  { box-shadow: 0 0 14px #22ff44; border-color: #22ff44; }
  80%  { box-shadow: 0 0 14px #00ddff; border-color: #00ddff; }
  100% { box-shadow: 0 0 14px #aa44ff; border-color: #aa44ff; }
}

#gallery-section { padding: 6px; }
#gallery-section #gallery-grid { gap: 2px; }

/* GALLERY TOOLBAR */
.gallery-toolbar {
  display: flex; gap: 4px; align-items: center;
  font-size: 11px;
}
#search-input {
  background: #000; color: var(--neon-green);
  border: 1px solid var(--neon-green);
  padding: 3px 6px;
  font-family: inherit; font-size: 12px;
  width: 70px;
}
#search-input::placeholder { color: var(--neon-green); opacity: 0.5; }
#sort-select {
  background: #000; color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  padding: 3px 4px;
  font-family: inherit; font-size: 11px;
  cursor: pointer;
}
.zoom-btn {
  background: #000; color: var(--neon-pink);
  border: 1px solid var(--neon-pink);
  width: 22px; height: 22px;
  font-family: inherit; font-weight: 700;
  cursor: pointer; padding: 0;
}
@media (hover: hover) and (pointer: fine) {
  .zoom-btn:hover { background: var(--neon-pink); color: #000; }
}
#zoom-label {
  font-size: 11px; color: var(--neon-pink);
  min-width: 36px; text-align: center;
}

/* ACTIVE FILTERS */
#active-filters {
  display: flex; flex-wrap: wrap; gap: 4px;
  align-items: center; font-size: 11px;
  margin-bottom: 6px;
}
#active-filters:empty { display: none; }
.filter-chip {
  background: var(--neon-cyan); color: #000;
  padding: 2px 6px; font-weight: 700;
  cursor: pointer; display: inline-flex;
  gap: 4px; align-items: center;
}
@media (hover: hover) and (pointer: fine) {
  .filter-chip:hover { background: var(--neon-pink); }
}
.filter-chip .x { font-size: 14px; line-height: 1; }
.combo-rarity {
  color: var(--neon-green); font-size: 11px;
  font-weight: 700; margin-left: 4px;
}
.clear-filters {
  background: #000; color: var(--neon-pink);
  border: 1px solid var(--neon-pink);
  padding: 2px 6px; font-size: 10px;
  cursor: pointer; font-family: inherit;
}
@media (hover: hover) and (pointer: fine) {
  .clear-filters:hover { background: var(--neon-pink); color: #000; }
}

/* GALLERY GRID + THUMB (image + tag below) */
#gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-content: flex-start;
  justify-content: center;
}
.thumb {
  flex: 0 0 auto;
  width: var(--thumb-size);
  background: transparent;
  cursor: pointer;
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.thumb-img-wrap {
  width: var(--thumb-size);
  height: var(--thumb-size);
  background: #111;
  position: relative;
  overflow: hidden;
}
.thumb img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
}
.thumb img.loaded { opacity: 1; }
.thumb-img-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    90deg,
    #111 0%, #2a1a2a 30%, #3a2a3a 50%, #2a1a2a 70%, #111 100%
  );
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s;
}
.thumb.loaded .thumb-img-wrap::before { opacity: 0; }
@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (hover: hover) and (pointer: fine) {
  .thumb:hover {
    transform: scale(1.04);
    border-color: var(--neon-cyan);
    z-index: 2;
    box-shadow: 0 0 10px var(--neon-cyan);
  }
}
.thumb .id-tag {
  background: rgba(0,0,0,0.7);
  color: var(--neon-green);
  font-size: 11px;
  text-align: center;
  padding: 1px 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* TRAITS TOOLBAR */
.traits-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}
#trait-search {
  flex: 1;
  min-width: 80px;
  background: #000; color: var(--neon-green);
  border: 1px solid var(--neon-green);
  padding: 3px 6px;
  font-family: inherit; font-size: 12px;
}
#trait-search::placeholder { color: var(--neon-green); opacity: 0.5; }
#trait-sort {
  background: #000; color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  padding: 3px 4px;
  font-family: inherit; font-size: 11px;
  cursor: pointer;
}
.trait-fold-btn {
  background: #000; color: var(--neon-pink);
  border: 1px solid var(--neon-pink);
  padding: 3px 6px;
  font-family: inherit; font-size: 11px;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .trait-fold-btn:hover { background: var(--neon-pink); color: #000; }
}

/* TRAITS */
.trait-cat { margin-bottom: 8px; }
.trait-cat h3 {
  color: var(--neon-pink); font-size: 14px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--neon-pink);
  position: sticky; top: 0;
  background: var(--panel-bg);
  z-index: 1;
  backdrop-filter: blur(3px);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
}
.trait-cat h3 .fold-arrow {
  font-size: 10px;
  transition: transform 0.15s;
}
.trait-cat.collapsed h3 .fold-arrow {
  transform: rotate(-90deg);
}
.trait-cat.collapsed .trait-row { display: none; }
.trait-cat.hidden { display: none; }
.trait-row {
  display: grid;
  grid-template-columns: 1fr 50px 70px;
  gap: 4px; font-size: 13px;
  padding: 2px 2px; align-items: center;
  cursor: pointer; border-radius: 2px;
  transition: background 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .trait-row:hover { background: rgba(255,105,180,0.15); }
}
.trait-row.active {
  background: rgba(0,255,255,0.2);
  outline: 1px solid var(--neon-cyan);
}
.trait-row .name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 1px 4px; border-radius: 2px;
  background-image: linear-gradient(
    90deg,
    rgba(255, 0, 68, var(--rarity, 0)),
    rgba(255, 136, 0, var(--rarity, 0)),
    rgba(255, 238, 0, var(--rarity, 0)),
    rgba(34, 255, 68, var(--rarity, 0)),
    rgba(0, 221, 255, var(--rarity, 0)),
    rgba(170, 68, 255, var(--rarity, 0)),
    rgba(255, 0, 68, var(--rarity, 0))
  );
  background-size: 300% 100%;
  animation: rainbow-slide 6s linear infinite;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
}
@keyframes rainbow-slide {
  from { background-position: 0% 0; }
  to   { background-position: 300% 0; }
}
.trait-row .bar {
  height: 4px; background: rgba(255,255,255,0.1);
  align-self: center;
}
.trait-row .bar > span {
  display: block; height: 100%;
  background: var(--neon-cyan);
}
.trait-row .count {
  text-align: right; color: var(--text-muted); font-size: 11px;
}

/* BUTTONS */
.big-btn {
  display: block; width: 100%;
  background: rgba(0,0,0,0.6);
  color: var(--text-primary);
  border: 2px solid var(--neon-cyan);
  padding: 6px 8px; margin: 3px 0;
  font-family: inherit; font-size: 13px;
  font-weight: 700; text-align: center;
  cursor: pointer; text-decoration: none;
  transition: all 0.1s;
}
@media (hover: hover) and (pointer: fine) {
  .big-btn:hover {
    background: var(--neon-cyan); color: #000;
    transform: scale(1.02);
    box-shadow: 0 0 12px var(--neon-cyan);
  }
  .big-btn.featured:hover { background: var(--neon-pink); color: #000; }
}
.big-btn.featured { border-color: var(--neon-pink); color: var(--neon-pink); }
.big-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

#load-more-btn {
  margin: 12px auto 4px auto;
  max-width: 320px;
  font-size: 14px;
  padding: 10px 16px;
}

/* XTRAS BLOCKS */
.xtra-block {
  border: 1px dashed var(--neon-cyan);
  padding: 6px;
  margin-bottom: 6px;
  background: rgba(0,0,0,0.3);
}
.xtra-block h3 {
  color: var(--neon-pink);
  font-size: 12px;
  margin-bottom: 4px;
}
.placeholder-mini {
  border: 1px dashed var(--text-muted);
  padding: 8px; text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 4px;
}

/* POOPET */
#poopet-section .panel-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}
#poopet-frame {
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
  border: 3px solid var(--neon-green);
  background: #000;
  display: block;
}

/* FOOTER */
footer {
  text-align: center; padding: 4px;
  font-size: 11px;
  background: var(--panel-bg);
  border: 2px solid var(--neon-green);
  border-radius: 4px;
  backdrop-filter: blur(2px);
}
#ascii-mobile { display: none; font-family: monospace; color: var(--neon-green); font-size: 10px; }
@media (max-width: 400px) { #ascii-mobile { display: block; } }

/* LIGHTBOX */
#lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.95);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
#lightbox-inner {
  max-width: 600px; width: 100%;
  background: #000; border: 3px solid var(--neon-pink);
  padding: 16px; position: relative;
}
#lightbox-img { width: 384px; height: 384px; max-width: 100%; display: block; margin: 0 auto; }
#lightbox-close {
  position: absolute; top: 4px; right: 4px;
  background: var(--neon-pink); color: #000;
  border: none; width: 32px; height: 32px;
  font-size: 18px; cursor: pointer;
}
#lightbox-info { margin-top: 12px; font-size: 13px; }
#lightbox-info .trait-tag {
  display: inline-block; margin: 2px;
  background: #111; border: 1px solid var(--neon-cyan);
  padding: 2px 8px; font-size: 11px;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
}
#lightbox-info .trait-tag.rainbowed {
  background-image: linear-gradient(
    90deg,
    rgba(255, 0, 68, var(--rarity, 0)),
    rgba(255, 136, 0, var(--rarity, 0)),
    rgba(255, 238, 0, var(--rarity, 0)),
    rgba(34, 255, 68, var(--rarity, 0)),
    rgba(0, 221, 255, var(--rarity, 0)),
    rgba(170, 68, 255, var(--rarity, 0))
  );
  background-size: 300% 100%;
  animation: rainbow-slide 6s linear infinite;
}
#lightbox-info .id-row {
  display: flex; gap: 8px; align-items: center;
  margin-top: 10px; flex-wrap: wrap;
}
#lightbox-info .id-row button.copy-id {
  background: #000;
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  padding: 4px 8px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  font-weight: 700;
}
#lightbox-info .id-row button.copy-id:hover {
  background: var(--neon-cyan); color: #000;
}
#lightbox-info .id-row button.copy-id.copied {
  background: var(--neon-green); color: #000; border-color: var(--neon-green);
}
#lightbox-info .nav-hint {
  color: var(--text-muted); font-size: 11px; margin-left: auto;
}

/* EASTER EGG STATES */
body.rainbow-mode { animation: hueshift 4s linear infinite; }
@keyframes hueshift { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

body.evil-mode { filter: invert(1) hue-rotate(180deg); transition: filter 0.5s; }
body.evil-mode #app { animation: spin360 1s ease-in-out 1; }
@keyframes spin360 { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.slop-drop {
  position: fixed; top: -40px; font-size: 32px;
  pointer-events: none; z-index: 999;
  animation: slopfall 3s linear forwards;
}
@keyframes slopfall { to { top: 110vh; transform: rotate(720deg); } }

.jig { animation: jig 0.4s ease-in-out 3; }
@keyframes jig {
  0%,100% { transform: rotate(0); }
  25% { transform: rotate(-15deg) scale(1.1); }
  75% { transform: rotate(15deg) scale(1.1); }
}

#skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 9999;
  background: #ffff00;
  color: #000;
  padding: 8px 16px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #000;
}
#skip-link:focus {
  top: 8px;
}
 
/* Universal focus visibility */
:focus-visible {
  outline: 3px solid #ffff00;
  outline-offset: 2px;
  border-radius: 2px;
}
.thumb:focus-visible {
  outline: 3px solid #ffff00;
  outline-offset: -3px;
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #bg-layer { animation: none !important; }
  .trait-row .name { animation: none !important; }
  .status-dot, #mint-live { animation: none !important; }
  body.evil-mode, body.rainbow-mode { filter: none !important; animation: none !important; }
  .slop-drop { display: none !important; }
} 

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