/* =====================================================================
   TINY STICKERS — Y2K animated pixel collection
   Original, pure-CSS animation. No external images.
   Stickers are colour-driven: each shape reads var(--c) so the same
   shape can appear in every colour category.
   ===================================================================== */

:root {
  --bg:        #ffe8f3;
  --bg-2:      #e8f0ff;
  --ink:       #3a2a44;
  --panel:     #fffdf8;
  --panel-2:   #fff0f7;
  --accent:    #ff5fa2;
  --accent-2:  #7c5cff;
  --line:      #ffb3d1;
  --shadow:    #d98bb6;
  --font-ui:   "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-pix:  "Courier New", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    repeating-linear-gradient(45deg, #ffffff10 0 12px, #ffffff00 12px 24px),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M2 2l6 14 2-6 6-2z' fill='%23ff5fa2' stroke='%233a2a44' stroke-width='1'/%3E%3C/svg%3E") 2 2, auto;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline wavy var(--accent); }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.wrap { max-width: 1600px; margin: 0 auto; padding: 18px 22px 80px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; gap: 3px; flex-wrap: wrap; justify-content: center;
  padding: 4px 6px; margin-bottom: 14px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--shadow);
}
.topbar a {
  font-family: var(--font-pix); font-weight: bold; font-size: 11px; line-height: 1.1;
  padding: 3px 7px; border-radius: 6px; color: var(--ink);
  border: 1px dashed transparent; white-space: nowrap;
}
.topbar a:hover, .topbar a.here { border-color: var(--accent); background: var(--panel-2); text-decoration: none; }
.topbar a.here { color: var(--accent); }

/* in-page colour jump list */
.colornav {
  display:flex; flex-wrap:wrap; gap:6px; justify-content:center;
  margin: 0 0 18px; padding: 10px; border:2px dashed var(--line);
  border-radius: 12px; background: var(--panel-2);
}
.colornav a {
  font-family: var(--font-pix); font-size: 12px; padding: 3px 9px; border-radius: 999px;
  color:#fff; text-shadow: 0 1px 0 #0003;
}
.colornav a:hover { text-decoration:none; outline: 2px solid #fff; }

/* hero */
.hero {
  text-align: center; padding: 26px 16px;
  background: var(--panel);
  border: 4px solid var(--accent);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--shadow);
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.hero h1 {
  margin: 0; font-size: clamp(32px, 7vw, 60px); letter-spacing: 1px;
  background: linear-gradient(90deg,#ff5fa2,#ffb14e,#ffe14e,#5fd06b,#5fa8ff,#7c5cff,#ff5fa2);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbow-slide 6s linear infinite;
}
.hero p { font-family: var(--font-pix); margin: 8px 0 0; }
.hero .blink { color: var(--accent); }

/* =====================================================================
   SECTIONS + GRID
   ===================================================================== */
.section { margin: 26px 0; scroll-margin-top: 64px; }
.section h2 {
  font-family: var(--font-pix); font-size: 22px; margin: 0 0 4px;
  display: inline-flex; align-items:center; gap:8px; padding: 4px 14px;
  background: var(--accent); color: #fff; border-radius: 20px;
  box-shadow: 0 3px 0 var(--shadow);
}
.section h2 .swatch { width:14px; height:14px; border-radius:50%; border:2px solid #fff; }
.section .hint { font-size: 12px; opacity: .7; margin: 6px 2px 14px; font-family: var(--font-pix); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 88px; padding: 12px 6px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--shadow);
  cursor: pointer; transition: transform .12s, box-shadow .12s; position: relative;
}
.tile:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 6px 0 var(--shadow); }
.tile:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--shadow); }
.tile .label { font-size: 10px; font-family: var(--font-pix); opacity: .65; text-align:center; }
.tile.copied::after {
  content: "copied! ♥"; position: absolute; inset: auto 0 6px 0;
  font-size: 10px; font-family: var(--font-pix); color: var(--accent); font-weight: bold;
}
/* white stickers need a faint outline so they show on light panels */
.tile.wt .stk > * { filter: drop-shadow(0 0 1px #b9a9c0); }

/* ---- real-image sticker gallery (color page) ---- */
.realgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.realgrid img {
  width: 44px; height: 44px; object-fit: contain;
  image-rendering: pixelated;
  padding: 5px; border-radius: 10px; background: var(--panel);
  border: 2px solid transparent; cursor: pointer; transition: transform .1s, border-color .1s;
}
.realgrid img:hover { transform: scale(1.6); border-color: var(--accent); position: relative; z-index: 5; }
.realgrid img.saved-img { border-color: #4fc76a; transform: scale(1.3); }
.section.white .realgrid img, #white .realgrid img { background: #efe6f2; }
.loading { font-family: var(--font-pix); opacity: .7; padding: 20px; text-align: center; }

/* ---- search box ---- */
.searchbar { position: sticky; top: 44px; z-index: 40; margin: 0 0 14px; }
.searchbar input {
  width: 100%; padding: 12px 16px; font-family: var(--font-pix); font-size: 15px;
  color: var(--ink); background: var(--panel); border: 3px solid var(--accent);
  border-radius: 999px; box-shadow: 0 4px 0 var(--shadow); outline: none;
}
.searchbar input::placeholder { color: var(--shadow); }
.cat-empty { display: none; }
.pixcard.hide { display: none; }

/* ---- category tabs ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 16px; }
.tab {
  font-family: var(--font-pix); font-size: 13px; padding: 8px 15px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer;
  box-shadow: 0 3px 0 var(--shadow); transition: transform .1s;
}
.tab:hover { transform: translateY(-2px); }
.tab.active { background: var(--accent); color: #fff; border-color: #fff; }
.tab .n { opacity: .7; font-size: 11px; margin-left: 4px; }

/* ---- load more ---- */
.loadmore {
  display: block; margin: 22px auto 6px; padding: 13px 28px;
  font-family: var(--font-pix); font-weight: bold; font-size: 14px; color: #fff;
  background: var(--accent-2); border: 3px solid #fff; border-radius: 14px;
  box-shadow: 0 4px 0 var(--shadow); cursor: pointer;
}
.loadmore:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--shadow); }
.grid-info { text-align: center; font-family: var(--font-pix); font-size: 12px; opacity: .7; margin: 4px 0; }

/* ---- pixel grid: small cards sized to the pixel, shown crisp ---- */
.cardgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 58px);
  justify-content: center;
  gap: 8px;
}
.pixcard {
  width: 58px; height: 58px; display: grid; place-items: center; cursor: pointer; position: relative;
  background: var(--panel); border: 2px solid var(--line); border-radius: 10px;
  box-shadow: 0 2px 0 var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s;
}
.pixcard { text-decoration: none; color: inherit; }
.realcell { display: inline-block; line-height: 0; text-decoration: none; }
.pixcard:nth-child(3n)   { background: var(--panel-2); }
.pixcard:nth-child(5n)   { background: #f3ecff; }
.pixcard:nth-child(7n)   { background: #eafaf0; }
.pixcard img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.pixcard:hover { transform: translateY(-4px) rotate(-1deg); border-color: var(--accent); box-shadow: 0 7px 0 var(--shadow); }
.pixcard:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--shadow); }
.pixcard.copied { border-color: var(--accent); }
.pixcard.copied::after {
  content: "copied ♥"; position: absolute; inset: auto 0 5px 0; text-align: center;
  font-size: 9px; font-family: var(--font-pix); color: var(--accent); font-weight: bold;
}
.pixcard.saved { border-color: #4fc76a; }
.pixcard.saved::after {
  content: "saved ↓"; position: absolute; inset: auto 0 5px 0; text-align: center;
  font-size: 9px; font-family: var(--font-pix); color: #2f9c4f; font-weight: bold;
}

/* =====================================================================
   STICKERS — all read var(--c). Set --c on .stk to recolour.
   ===================================================================== */
.stk { width: 36px; height: 36px; display: grid; place-items: center; --c: var(--accent); }

/* spinning star */
.stk-star {
  width: 28px; height: 28px; background: var(--c);
  clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  animation: spin 3s linear infinite;
}
/* pulsing heart */
.stk-heart { position: relative; width: 26px; height: 24px; animation: heart-beat 1s ease-in-out infinite; }
.stk-heart::before, .stk-heart::after {
  content: ""; position: absolute; top: 0; width: 13px; height: 21px; background: var(--c); border-radius: 13px 13px 0 0;
}
.stk-heart::before { left: 13px; transform: rotate(-45deg); transform-origin: 0 100%; }
.stk-heart::after  { left: 0;    transform: rotate(45deg);  transform-origin: 100% 100%; }
/* blinking dot */
.stk-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); animation: blink 1s steps(1) infinite; }
/* rotating diamond */
.stk-diamond { width: 20px; height: 20px; background: var(--c); border-radius: 4px; animation: spin 4s linear infinite; }
/* pulsing circle */
.stk-circle { width: 22px; height: 22px; border-radius: 50%; background: var(--c); animation: pulse 1.3s ease-in-out infinite; }
/* bouncing pixel */
.stk-bounce { width: 16px; height: 16px; border-radius: 4px; background: var(--c); animation: bounce .7s ease-in-out infinite; }
/* twinkle */
.stk-sparkle {
  width: 24px; height: 24px; background: var(--c);
  clip-path: polygon(50% 0,58% 42%,100% 50%,58% 58%,50% 100%,42% 58%,0 50%,42% 42%);
  animation: spin 2.4s linear infinite, twinkle 1.2s ease-in-out infinite;
}
/* spinning dotted ring */
.stk-ring { width: 24px; height: 24px; border-radius: 50%; border: 5px dotted var(--c); animation: spin 2s linear infinite; }
/* floating bubble */
.stk-bubble { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffffffcc, var(--c) 65%); animation: float 2.2s ease-in-out infinite; }
/* flower */
.stk-flower { position: relative; width: 26px; height: 26px; animation: spin 6s linear infinite; }
.stk-flower::before {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(circle at 50% 18%, var(--c) 18%, transparent 19%),
    radial-gradient(circle at 50% 82%, var(--c) 18%, transparent 19%),
    radial-gradient(circle at 18% 50%, var(--c) 18%, transparent 19%),
    radial-gradient(circle at 82% 50%, var(--c) 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, #fff5 26%, transparent 27%);
}
/* bow */
.stk-bow { position: relative; width: 28px; height: 18px; animation: wobble 1.8s ease-in-out infinite; }
.stk-bow::before, .stk-bow::after {
  content:""; position:absolute; top:0; width:13px; height:18px; background: var(--c); border-radius:8px;
}
.stk-bow::before { left:0; clip-path: polygon(100% 0,100% 100%,0 50%); }
.stk-bow::after  { right:0; clip-path: polygon(0 0,0 100%,100% 50%); }
/* crescent moon */
.stk-moon { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: 7px 0 0 0 var(--panel) inset; animation: wobble 3s ease-in-out infinite; }
/* cloud */
.stk-cloud { position: relative; width: 30px; height: 16px; background: var(--c); border-radius: 12px; animation: float 2.6s ease-in-out infinite; }
.stk-cloud::before { content:""; position:absolute; top:-7px; left:6px; width:12px; height:12px; border-radius:50%; background: var(--c); }
.stk-cloud::after  { content:""; position:absolute; top:-5px; left:15px; width:9px; height:9px; border-radius:50%; background: var(--c); }
/* color-cycling cube (ignores --c on purpose) */
.stk-hue { width: 24px; height: 24px; border-radius: 6px; background: #5fa8ff; animation: hue 4s linear infinite; }

/* rainbow-only shapes */
.stk-pill { width: 32px; height: 14px; border-radius: 999px; background: linear-gradient(90deg,#ff5fa2,#ffe14e,#5fd06b,#5fa8ff,#7c5cff,#ff5fa2); background-size: 300% 100%; animation: rainbow-slide 3s linear infinite; }
.stk-rainbow-star { width:28px; height:28px; background: linear-gradient(90deg,#ff5fa2,#ffe14e,#5fd06b,#5fa8ff,#7c5cff,#ff5fa2); background-size:300% 100%; clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%); animation: spin 3s linear infinite, rainbow-slide 3s linear infinite; }
.stk-rainbow-heart { width:26px; height:24px; position:relative; animation: heart-beat 1s ease-in-out infinite; }
.stk-rainbow-heart::before, .stk-rainbow-heart::after { content:""; position:absolute; top:0; width:13px; height:21px; border-radius:13px 13px 0 0; background:linear-gradient(90deg,#ff5fa2,#ffe14e,#5fd06b,#5fa8ff,#7c5cff); background-size:200%; animation: rainbow-slide 3s linear infinite; }
.stk-rainbow-heart::before { left:13px; transform:rotate(-45deg); transform-origin:0 100%; }
.stk-rainbow-heart::after  { left:0; transform:rotate(45deg); transform-origin:100% 100%; }

/* misc: ghost, mushroom, coin, shooting star */
.stk-ghost { width: 22px; height: 26px; background: var(--c); border-radius: 11px 11px 0 0; position: relative; animation: wobble 1.6s ease-in-out infinite; }
.stk-ghost::before, .stk-ghost::after { content: ""; position: absolute; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: #3a2a44; }
.stk-ghost::before { left: 5px; } .stk-ghost::after { right: 5px; }
.stk-mush { width: 26px; height: 26px; position: relative; animation: bounce 1.2s ease-in-out infinite; }
.stk-mush::before { content:""; position:absolute; top:0; left:3px; width:20px; height:13px; background:#ff5b5b; border-radius:13px 13px 0 0; box-shadow: inset -3px 3px 0 #ffb3b3; }
.stk-mush::after  { content:""; position:absolute; bottom:0; left:8px; width:10px; height:12px; background:#fff0d8; border-radius:0 0 5px 5px; }
.stk-coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%,#fff3a8,#ffcf3f); animation: flip 1.8s ease-in-out infinite; }
.stk-shoot { width: 30px; height: 6px; position: relative; }
.stk-shoot::before { content: ""; position: absolute; right: 0; top: -2px; width: 10px; height: 10px; background: #fff; border-radius: 50%; box-shadow: 0 0 6px #ffe14e; }
.stk-shoot::after { content: ""; position: absolute; right: 8px; top: 1px; width: 22px; height: 3px; background: linear-gradient(90deg, transparent, #ffe14e); border-radius: 3px; animation: streak 1.4s ease-in-out infinite; }

/* =====================================================================
   BLINKIES
   ===================================================================== */
.blinkie-row { display: flex; flex-wrap: wrap; gap: 10px; }
.blinkie {
  width: 170px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-pix); font-size: 11px; font-weight: bold; letter-spacing: .5px;
  color: #fff; text-shadow: 1px 1px 0 #00000055; cursor: pointer;
  border: 2px solid #ffffffaa; box-shadow: 0 2px 0 #00000033;
  background-size: 200% 100%; animation: rainbow-slide 3s linear infinite;
}
.blinkie .bdot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink .8s steps(1) infinite; }
.b1 { background-image: linear-gradient(90deg,#ff5fa2,#ff9ecb,#ff5fa2); }
.b2 { background-image: linear-gradient(90deg,#7c5cff,#a991ff,#7c5cff); }
.b3 { background-image: linear-gradient(90deg,#2ec4b6,#7ef0e6,#2ec4b6); }
.b4 { background-image: linear-gradient(90deg,#ff8a3d,#ffc48a,#ff8a3d); }
.b5 { background-image: linear-gradient(90deg,#ff5fa2,#ffe14e,#5fd06b,#5fa8ff,#7c5cff,#ff5fa2); }
.b6 { background-image: linear-gradient(90deg,#ff4d6d,#ff99aa,#ff4d6d); }
.b7 { background-image: linear-gradient(90deg,#3da35d,#9be7b4,#3da35d); }
.b8 { background-image: linear-gradient(90deg,#222,#555,#222); }

/* =====================================================================
   DIVIDERS
   ===================================================================== */
.divider { text-align: center; margin: 22px 0; font-family: var(--font-pix); color: var(--accent); cursor: pointer; }
.divider .marquee-wrap { overflow: hidden; border-block: 2px dashed var(--line); padding: 4px 0; }
.divider .marquee { display: inline-block; white-space: nowrap; padding-left: 100%; animation: marquee 14s linear infinite; font-weight: bold; letter-spacing: 2px; }
.divider .stars-line { letter-spacing: 6px; animation: blink 1.2s steps(1) infinite; }
.divider .grad-line { display:block; height:8px; border-radius:999px; background:linear-gradient(90deg,#ff5fa2,#ffe14e,#5fd06b,#5fa8ff,#7c5cff,#ff5fa2); background-size:300% 100%; animation: rainbow-slide 4s linear infinite; }
.divider.copyable:hover { outline: 2px dashed var(--line); outline-offset: 6px; border-radius: 8px; }

/* =====================================================================
   STAMPS
   ===================================================================== */
.stamp-row { display:flex; flex-wrap:wrap; gap:14px; }
.stamp {
  width: 120px; height: 86px; border-radius: 10px; padding: 8px; cursor: pointer;
  background: var(--panel); border: 3px dotted var(--accent);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  font-family: var(--font-pix); font-size: 11px; text-align:center;
  box-shadow: 0 3px 0 var(--shadow); transition: transform .15s;
}
.stamp:hover { transform: rotate(2deg) scale(1.03); }

/* =====================================================================
   BUTTONS — classic 88x31 web buttons
   ===================================================================== */
.button-row { display:flex; flex-wrap:wrap; gap:12px; }
.btn88 {
  width: 88px; height: 31px; cursor: pointer;
  display:flex; align-items:center; justify-content:center; gap:5px;
  font-family: var(--font-pix); font-size: 10px; font-weight:bold; line-height:1.05; text-align:center;
  color:#fff; text-shadow:1px 1px 0 #0006;
  border: 2px outset #ffffffaa; border-radius: 3px; box-shadow: 0 2px 0 #0003;
  background-size: 200% 100%;
}
.btn88:hover { border-style: inset; }
.btn-pink { background: linear-gradient(135deg,#ff8ac0,#ff4d8d); }
.btn-purple { background: linear-gradient(135deg,#a991ff,#7c5cff); }
.btn-blue { background: linear-gradient(135deg,#7ec0ff,#4da6ff); }
.btn-green { background: linear-gradient(135deg,#8be7a3,#3da35d); }
.btn-dark { background: linear-gradient(135deg,#555,#222); }
.btn-rainbow { background: linear-gradient(90deg,#ff5fa2,#ffe14e,#5fd06b,#5fa8ff,#7c5cff,#ff5fa2); background-size:300% 100%; animation: rainbow-slide 3s linear infinite; }
.btn88 .tinystar { width:8px; height:8px; background:#fff; clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%); animation: spin 3s linear infinite; }

/* =====================================================================
   PANELS / CODE
   ===================================================================== */
.panel { background: var(--panel); border: 3px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: 0 4px 0 var(--shadow); margin: 18px 0; }
.panel h3 { margin-top: 0; font-family: var(--font-pix); color: var(--accent); }
pre { background: #2a1c33; color: #ffd9ec; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; border: 2px solid var(--accent-2); }
code { font-family: var(--font-pix); }
ol li, ul li { margin: 6px 0; }
.kbd { font-family: var(--font-pix); background:#fff; border:2px solid var(--line); border-radius:6px; padding:1px 7px; box-shadow:0 2px 0 var(--shadow); }
.note { border-left: 5px solid var(--accent); background: var(--panel-2); padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 13px; }

/* footer */
.footer { text-align: center; margin-top: 40px; font-family: var(--font-pix); font-size: 12px; opacity: .85; }
.footer .heart { color: var(--accent); animation: heart-beat 1s ease-in-out infinite; display:inline-block; }

/* sparkle cursor trail */
.spark { position: fixed; pointer-events: none; z-index: 9999; width: 10px; height: 10px; transform: translate(-50%,-50%);
  background: var(--accent); clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%); animation: spark-fade .8s ease-out forwards; }

/* back-to-top */
.totop { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: 48px; height: 48px; border-radius: 50%; border: 3px solid #fff;
  background: var(--accent); color: #fff; font-size: 20px; cursor: pointer; box-shadow: 0 4px 0 var(--shadow); animation: float 2.5s ease-in-out infinite; }

/* toast for copy feedback on non-tile copies */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9999;
  background: var(--accent); color:#fff; font-family: var(--font-pix); font-size:13px; font-weight:bold;
  padding: 8px 16px; border-radius: 999px; border:2px solid #fff; box-shadow:0 3px 0 var(--shadow);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events:none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* =====================================================================
   KEYFRAMES
   ===================================================================== */
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes blink      { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes hue        { to { filter: hue-rotate(360deg); } }
@keyframes bounce     { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float      { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wobble     { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes flip       { 0%,100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
@keyframes pulse      { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes heart-beat { 0%,100% { transform: scale(1); } 25% { transform: scale(1.18); } 40% { transform: scale(1); } }
@keyframes twinkle    { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes rainbow-slide { to { background-position: 300% 0; } }
@keyframes marquee    { to { transform: translateX(-100%); } }
@keyframes streak     { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes spark-fade { from { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0); } to { opacity: 0; transform: translate(-50%,-50%) scale(.2) rotate(160deg); } }

/* =====================================================================
   IMAGE PROTECTION (deterrents — see adgate.js)
   ===================================================================== */
.pixcard img, .realgrid img, .stk img, .hero img, body img {
  -webkit-user-drag: none; -khtml-user-drag: none; -moz-user-drag: none; user-drag: none;
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;   /* no long-press save sheet on iOS */
}

/* =====================================================================
   IN-APP BROWSER BANNER (Pinterest / IG / FB in-app webviews)
   ===================================================================== */
.inapp-bar {
  position: sticky; top: 0; z-index: 9000;
  background: #ffec99; color: #5a4a00; border-bottom: 2px solid #e0c84e;
  font-family: var(--font-pix); font-size: 12px; line-height: 1.4;
  padding: 9px 12px; text-align: center;
}
.inapp-btn {
  display: inline-block; margin-left: 6px; padding: 4px 10px; border-radius: 8px;
  background: var(--accent); color: #fff !important; font-weight: bold;
  text-decoration: none; border: 1px solid #fff; box-shadow: 0 2px 0 var(--shadow);
}

/* =====================================================================
   AD CARD (download gate)
   ===================================================================== */
.adgate-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(42,28,51,.62); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px;
}
.adgate-card {
  width: min(420px, 94vw);
  background: var(--panel); border: 4px solid var(--accent); border-radius: 22px;
  box-shadow: 0 8px 0 var(--shadow); padding: 22px 20px; text-align: center; position: relative;
  animation: adpop .22s ease-out;
}
.adgate-x {
  position: absolute; top: 8px; right: 12px; border: none; background: none;
  font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); opacity: .6;
}
.adgate-x:hover { opacity: 1; }
.adgate-title { font-family: var(--font-pix); font-size: 24px; font-weight: bold; color: var(--accent); }
.adgate-sub { font-family: var(--font-pix); font-size: 12px; opacity: .75; margin: 2px 0 16px; }
/* .pix-slot = savePanel's pixel wrapper (must not be named "ad-*" or
   EasyList cosmetic filters hide it); .ad-slot = the real ad box in showAd */
.ad-slot, .pix-slot {
  min-height: 180px; display: grid; place-items: center; overflow: hidden;
  border: 2px dashed var(--line); border-radius: 14px; background: var(--panel-2); margin-bottom: 16px;
}
/* iOS save image — must be fully interactive so long-press "Save to Photos" works */
.ios-save-img {
  width: 200px; height: 200px; max-width: 70vw; max-height: 70vw;
  object-fit: contain; image-rendering: pixelated;
  -webkit-touch-callout: default !important;
  -webkit-user-select: auto !important; user-select: auto !important;
  -webkit-user-drag: auto !important; pointer-events: auto !important;
}
.ad-support, .alt-save {
  display: block; margin-top: 10px; font-family: var(--font-pix); font-size: 12px;
  color: var(--accent-2); text-decoration: underline; opacity: .85;
}
.ad-label { font-family: var(--font-pix); font-size: 9px; letter-spacing: 2px; text-transform: uppercase; opacity: .5; }
.ad-fake { font-family: var(--font-pix); font-size: 18px; color: var(--accent-2); margin-top: 8px; line-height: 1.5; }
.ad-fake span { font-size: 11px; opacity: .7; }
.adgate-go {
  display: block; box-sizing: border-box; width: 100%; padding: 13px; margin-top: 4px;
  border: 3px solid #fff; border-radius: 14px; text-align: center; text-decoration: none;
  background: var(--accent); color: #fff !important; cursor: pointer;
  font-family: var(--font-pix); font-weight: bold; font-size: 15px; box-shadow: 0 4px 0 var(--shadow);
}
.adgate-go:disabled { opacity: .55; cursor: default; }
.adgate-go:not(:disabled):active { transform: translateY(2px); box-shadow: 0 2px 0 var(--shadow); }
@keyframes adpop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* =====================================================================
   RESPONSIVE — all devices
   ===================================================================== */
@media (max-width: 760px) {
  .wrap { padding: 14px 12px 64px; }
  .topbar { gap: 4px; padding: 6px; }
  .topbar a { font-size: 11px; padding: 4px 8px; }
  .colornav a { font-size: 11px; padding: 3px 8px; }
  .cardgrid { grid-template-columns: repeat(auto-fill, 52px); gap: 7px; }
  .pixcard { width: 52px; height: 52px; }
  .pixcard img { width: 40px; height: 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .blinkie { width: 100%; }
  pre { font-size: 11.5px; }
}
@media (max-width: 480px) {
  .hero { padding: 18px 12px; border-width: 3px; }
  .hero h1 { font-size: 34px; }
  .topbar { position: static; }            /* free up vertical space on tiny screens */
  .cardgrid { grid-template-columns: repeat(auto-fill, 48px); gap: 6px; }
  .pixcard { width: 48px; height: 48px; border-width: 2px; border-radius: 9px; }
  .pixcard img { width: 38px; height: 38px; }
  .realgrid img { width: 36px; height: 36px; }
  .panel { padding: 14px 14px; }
  .totop { width: 42px; height: 42px; right: 10px; bottom: 10px; }
  .adgate-card { padding: 18px 14px; }
  .ad-slot { min-height: 150px; }
}
@media (hover: none) {
  /* touch devices: tap feedback instead of hover-zoom */
  .pixcard:hover { transform: none; }
  .realgrid img:hover { transform: scale(1.2); }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
