/* coolspacetricks.com — the sticker sheet (Phase C, 2026-11).
   The library as sheets of kiss-cut stickers: a cyan release liner is the
   ground, white sheets carry the graphics, each graphic is a sticker you can
   peel (lift, tilt, a corner curling back to the liner). Phone first. */

@font-face {
  font-family: "Bagel Fat One";
  src: url(bagel-fat-one.woff2) format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --liner: #19c2ff;
  --liner-deep: #0a89bd;
  --liner-grid: rgb(255 255 255 / 0.3);
  --sheet: #ffffff;
  --sheet-2: #f2f7fb;
  --ink: #10131a;
  --ink-2: #333c4b;
  --muted: #566173;
  --cut: #d3e1eb;
  --sticker: #ffffff;
  --on-ink: #ffffff;
  --on-ink-2: rgb(255 255 255 / 0.82);
  --foil: linear-gradient(100deg, #c9b6ff 0%, #9ff3e0 26%, #ffe08a 52%, #ffb3e6 76%, #c9b6ff 100%);
  --select: #ffe08a;
  --lift: 0 1px 1px rgb(16 19 26 / 0.07), 0 3px 8px rgb(16 19 26 / 0.09);
  --lift-hi: 0 8px 12px rgb(16 19 26 / 0.13), 0 18px 30px rgb(16 19 26 / 0.17);
  --sheet-shadow: 0 1px 0 rgb(4 50 80 / 0.12), 0 22px 44px -18px rgb(4 50 80 / 0.55);
  --display: "Bagel Fat One", ui-rounded, system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r-sheet: 22px;
  --r-sticker: 14px;
  --gap: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --liner: #052a40;
    --liner-deep: #021624;
    --liner-grid: rgb(255 255 255 / 0.055);
    --sheet: #1c1d21;
    --sheet-2: #26282d;
    --ink: #eef3f8;
    --ink-2: #c9d3df;
    --muted: #9aa8b8;
    --cut: #35383e;
    --select: #6c5cc7;
    --lift: 0 1px 1px rgb(0 0 0 / 0.3), 0 3px 8px rgb(0 0 0 / 0.35);
    --lift-hi: 0 8px 12px rgb(0 0 0 / 0.4), 0 18px 30px rgb(0 0 0 / 0.5);
    --sheet-shadow: 0 1px 0 rgb(0 0 0 / 0.4), 0 22px 44px -18px rgb(0 0 0 / 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 var(--body);
  color: var(--ink);
  background-color: var(--liner);
  background-image:
    linear-gradient(var(--liner-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--liner-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  caret-color: var(--ink);
}
::selection { background: var(--select); color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
* { scrollbar-color: var(--liner-deep) transparent; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
p { margin: 0 0 0.9em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── The pack header ───────────────────────────────────────────────── */
.pack {
  position: relative;
  margin: 0 0 4px;
  padding: 16px 16px 22px;
  color: var(--on-ink);
  background: #10131a; /* the pack is ink-black in both themes */
  border-radius: 0 0 var(--r-sheet) var(--r-sheet);
  overflow: hidden;
  display: grid;
  gap: 12px;
}
.pack::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 8px;
  background: var(--foil);
}
.brand { text-decoration: none; display: inline-block; }
@media (prefers-color-scheme: dark) { .pack { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08); } }
.brand b { display: block; font: 400 clamp(30px, 8.6vw, 46px)/0.92 var(--display); letter-spacing: -0.01em; }
.brand span { display: block; margin-top: 6px; font: 600 14px/1.35 var(--body); color: var(--on-ink-2); }
.search { display: flex; align-items: center; gap: 6px; }
.search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  font: 600 16px var(--body);
  color: var(--on-ink);
  background: color-mix(in srgb, var(--on-ink) 10%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--on-ink) 30%, transparent);
  border-radius: 999px;
  caret-color: var(--on-ink);
}
.search input::placeholder { color: var(--on-ink-2); }
.search input:focus-visible { outline-color: var(--on-ink); }
.search button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: var(--foil);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.search button:focus-visible { outline-color: var(--on-ink); }

/* ── The section tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding-inline: 12px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  font: 700 15px var(--body);
  color: var(--ink);
  text-decoration: none;
  background: var(--sheet);
  border-radius: 999px;
  box-shadow: var(--lift);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tab:hover { transform: translateY(-2px) rotate(-1.5deg); box-shadow: var(--lift-hi); }
.tab[aria-current="page"] { color: var(--sheet); background: var(--ink); }
.tab small { font: 800 11px var(--body); text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 999px; color: var(--ink); background: var(--foil); }

/* ── Sheets ────────────────────────────────────────────────────────── */
.page { width: min(100%, 1180px); margin: 0 auto; padding: 0 var(--gap) 40px; }
.sheet {
  background: var(--sheet);
  border-radius: var(--r-sheet);
  padding: 16px 14px 22px;
  box-shadow: var(--sheet-shadow);
  margin-bottom: 22px;
}
.sheet > h1, .sheet-head h1 { font-size: clamp(28px, 8vw, 46px); }
.sheet-head { margin: 4px 2px 16px; }
.sheet-head p { margin: 8px 0 0; color: var(--muted); font-size: 15px; max-width: 62ch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin-bottom: 8px; font: 600 14px var(--body); color: var(--muted); }
.crumbs a { color: var(--muted); padding: 8px 0; }
.crumbs a:hover { color: var(--ink); }
.crumbs span[aria-hidden] { opacity: 0.6; }
.note { color: var(--muted); font-size: 14px; }
.flash { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; font-weight: 700; background: var(--sheet-2); }
.flash.error { color: #b00032; }
@media (prefers-color-scheme: dark) { .flash.error { color: #ff8fa6; } }

/* ── Stickers ──────────────────────────────────────────────────────── */
.stickers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--cell, 100px), 44%), 1fr));
  gap: 14px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sticker {
  /* contour-cut: the graphic's own outline in white vinyl, lifted off the sheet */
  --contour: drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff) drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff);
  position: relative;
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 8px;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r-sticker);
  transition: transform 0.45s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.sticker img, .sticker .tile {
  display: block;
  height: auto;
  filter: var(--contour) drop-shadow(0 2px 3px rgb(16 19 26 / 0.22));
  transition: filter 0.45s var(--ease);
}
.sticker img.x2 { image-rendering: pixelated; }
.sticker:hover, .sticker:focus-visible, .sticker:active, .sticker.peeling { transform: translateY(-4px) rotate(-4deg); }
.sticker:hover img, .sticker:focus-visible img, .sticker:active img, .sticker.peeling img,
.sticker:hover .tile, .sticker:focus-visible .tile, .sticker:active .tile {
  filter: var(--contour) drop-shadow(0 10px 12px rgb(16 19 26 / 0.3));
}
.sticker.peeling { transform: translateY(-5px) rotate(-8deg); }
.sticker .label { margin-top: 10px; font: 700 14px/1.25 var(--body); text-align: center; }
.sticker .count { display: block; font: 600 13px var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }

/* phones: big graphics two to a row, small ones three (the wall stays three) */
@media (max-width: 559px) { .stickers.two, .stickers.themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* themes: one sticker per theme, its best graphic and its name */
.themes { --cell: 150px; }
.themes .sticker { align-content: start; padding: 12px 10px 14px; }
.themes .sticker .art { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; }
.themes .sticker .art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile { width: 100%; aspect-ratio: 1; border-radius: 6px; background-repeat: repeat; background-size: auto; }
.themes .sticker .tile { aspect-ratio: 4 / 3; }

/* layouts: wide previews with their names */
.layouts { --cell: 220px; }
.layouts .sticker { align-content: start; }

/* cursors: the cell shows the cursor in action */
.cursors .sticker { min-height: 110px; }

/* ── The wall (home) ───────────────────────────────────────────────── */
.wall { --cell: 96px; }
.wall .sticker { aspect-ratio: 1; min-height: 0; }
.wall .sticker img { position: absolute; inset: 8px; margin: auto; max-width: calc(100% - 16px); max-height: calc(100% - 16px); object-fit: contain; }
.wall-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 4px 2px 16px; }
.wall-head h1 { font-size: clamp(28px, 8vw, 46px); }
.wall-head p { margin: 0; color: var(--muted); font-size: 15px; }
.makers { --cell: 150px; margin-top: 4px; }
@media (min-width: 760px) { .stickers.makers { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.makers .sticker { align-content: start; padding: 12px 10px 14px; }
.makers .art { display: flex; align-items: center; justify-content: center; gap: 4px; height: 92px; }

/* news */
.news { max-width: 72ch; }
@media (min-width: 900px) { .news { max-width: none; columns: 2; column-gap: 44px; column-rule: 1.5px solid var(--cut); } .news article { break-inside: avoid; } }
.news article { padding: 18px 0; border-top: 1.5px solid var(--cut); }
.news article:first-child { border-top: 0; padding-top: 4px; }
.news h3 { font-size: 22px; margin-bottom: 8px; }
.news time { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.news img, .news iframe { max-width: 100%; height: auto; }
.news embed, .news object, .news ruffle-embed, .news ruffle-object { display: block; max-width: 100%; }

/* ── Theme chips (siblings) ────────────────────────────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 14px; scrollbar-width: thin; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  font: 700 14px var(--body);
  color: var(--ink);
  text-decoration: none;
  background: var(--sheet-2);
  border-radius: 999px;
  transition: background 0.2s;
}
.chip:hover { background: var(--cut); }
.chip[aria-current="page"] { color: var(--sheet); background: var(--ink); }

/* ── Pager ─────────────────────────────────────────────────────────── */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 22px; }
.pager .count { text-align: center; font: 700 14px var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  font: 800 15px var(--body);
  color: var(--sheet);
  text-decoration: none;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { color: var(--ink); background: var(--sheet-2); }
.btn.foil { color: #10131a; background: var(--foil); }
.btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.pager .next { justify-self: end; }

/* ── The held graphic (item pages) ─────────────────────────────────── */
.held {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 12px 22px;
  margin: 0 0 18px;
  border-radius: 18px;
  background-color: var(--sheet-2);
  background-image:
    linear-gradient(color-mix(in srgb, var(--liner) 14%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--liner) 14%, transparent) 1px, transparent 1px);
  background-size: 20px 20px;
}
.held-sticker {
  display: grid;
  place-items: center;
  max-width: 100%;
  padding: 16px;
  background: var(--sticker);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1.5px #dfe8ef, var(--lift-hi);
  transform: rotate(-1.2deg);
  overflow: auto;
}
.held-sticker img { display: block; max-width: 100%; height: auto; }
.held-sticker img.x2 { image-rendering: pixelated; }
.held-sticker.peeled { animation: peel 0.75s var(--ease); }
@keyframes peel {
  0% { transform: rotate(-1.2deg); }
  35% { transform: translateY(-14px) rotate(-7deg) scale(1.04); box-shadow: inset 0 0 0 1.5px #dfe8ef, 0 22px 30px rgb(16 19 26 / 0.22), 0 34px 60px rgb(16 19 26 / 0.22); }
  100% { transform: rotate(-1.2deg); }
}
.ticket {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  margin: 0;
  padding: 6px 14px;
  font: 600 13px var(--body);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  background: var(--sheet);
  border: 1.5px dashed var(--cut);
  border-radius: 10px;
}
.ticket a { color: inherit; }
.code h2 { font-size: 26px; margin-bottom: 6px; }
.code p { color: var(--muted); font-size: 15px; max-width: 62ch; }
.code textarea, textarea.code-box {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 12px 14px;
  font: 13px/1.5 var(--mono);
  color: var(--ink);
  background: var(--sheet-2);
  border: 1.5px solid var(--cut);
  border-radius: 14px;
  resize: vertical;
}
.code .btn { margin-top: 12px; }
.more { margin-top: 26px; }
.more h2 { font-size: 22px; margin-bottom: 10px; }

/* ── Forms (makers, feedback, hosting) ─────────────────────────────── */
.form { display: grid; gap: 14px; max-width: 640px; }
.form label { display: grid; gap: 6px; font: 700 15px var(--body); }
.form input[type="text"], .form input[type="email"], .form input[type="number"], .form input[type="file"], .form select, .form textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font: 16px var(--body);
  color: var(--ink);
  background: var(--sheet-2);
  border: 1.5px solid var(--cut);
  border-radius: 12px;
}
.form textarea { min-height: 120px; }
.form .check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.form .check input { width: 22px; height: 22px; accent-color: var(--ink); }
.form input[type="color"] { width: 64px; height: 44px; padding: 2px; border: 1.5px solid var(--cut); border-radius: 10px; background: var(--sheet-2); }

/* ── Ads: reserved space, never beside navigation ──────────────────── */
.ad { display: grid; place-items: center; margin: 22px auto; max-width: 100%; }
@media (max-width: 759px) { .ad.wide { display: none; } }
.ad:empty { display: none; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }

/* ── Footer ────────────────────────────────────────────────────────── */
.foot { width: min(100%, 1180px); margin: 0 auto; padding: 8px 16px 40px; font-size: 14px; color: var(--ink); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; font-weight: 800; }
.foot nav a { display: inline-block; padding: 10px 0; }
.foot p { margin: 0; max-width: 70ch; }
@media (prefers-color-scheme: dark) { .foot { color: var(--ink-2); } }

/* ── The item bar (Prev · Copy code · Share · Next) ────────────────── */
body.has-bar { padding-bottom: 96px; }
.bar {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr 1fr;
  gap: 4px;
  padding: 6px;
  color: var(--sheet);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 10px 30px -8px rgb(4 30 50 / 0.6);
}
.bar a, .bar button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 52px;
  font: 800 12px var(--body);
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.bar a:hover, .bar button:hover { background: color-mix(in srgb, var(--sheet) 14%, transparent); }
.bar .copy { color: #10131a; background: var(--foil); }
.bar .copy:hover { background: var(--foil); filter: brightness(1.05); }
.bar [aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.bar :focus-visible { outline-color: var(--sheet); outline-offset: -3px; }
.toast {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  font: 800 14px var(--body);
  color: #10131a;
  background: var(--foil);
  border-radius: 999px;
  box-shadow: var(--lift-hi);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Page-specific pieces ──────────────────────────────────────────── */
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; padding: 10px 16px; font-weight: 800; color: var(--sheet); background: var(--ink); border-radius: 999px; transition: top 0.2s; }
.skip:focus { top: 12px; }
.search.on-sheet { margin: 0 0 18px; max-width: 520px; }
.search.on-sheet input { color: var(--ink); background: var(--sheet-2); border-color: var(--cut); caret-color: var(--ink); }
.search.on-sheet input::placeholder { color: var(--muted); }
.search.on-sheet input:focus-visible { outline-color: var(--ink); }
.tile.big { width: min(320px, 72vw); aspect-ratio: 4 / 3; }
.held.made { justify-items: center; overflow-x: auto; }
.held.made img { image-rendering: pixelated; }
.ticker-stage { justify-items: center; overflow-x: auto; }
.colors { display: flex; flex-wrap: wrap; gap: 14px; }
.colors label { justify-items: start; }
.prose p { max-width: 68ch; color: var(--ink-2); }
.cse { min-height: 360px; }
.makers .art img { width: auto; max-height: 92px; }
.layouts .sticker img { width: 100%; height: auto; border-radius: 8px; }
.layouts .sticker .label { font-size: 14px; }
.cursors .sticker { cursor: pointer; }
.code { display: grid; align-content: start; gap: 0; }
.code .btn { justify-self: start; }

/* the glitter maker's own form, in the house style */
#gm input[type="text"], #gm input[type="number"], #gm select {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  font: 16px var(--body);
  color: var(--ink);
  background: var(--sheet-2);
  border: 1.5px solid var(--cut);
  border-radius: 12px;
}
#gm input[type="text"] { width: 100%; }
#gm .gm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
#gm .gm-row > label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
#gm .gm-row > label:first-child { flex: 1 1 100%; }
#gm input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ink); }
@media (max-width: 559px) { #gm .gm-row > label { flex: 1 1 100%; } }
.ticker-stage embed, .ticker-stage ruffle-embed { max-width: 100%; height: auto; aspect-ratio: 8 / 1; }

/* ── Wider screens ─────────────────────────────────────────────────── */
@media (min-width: 760px) {
  :root { --gap: 20px; }
  .pack {
    width: min(100% - 40px, 1180px);
    margin: 18px auto 6px;
    padding: 20px 24px 26px;
    border-radius: var(--r-sheet);
    grid-template-columns: 1fr minmax(260px, 380px);
    align-items: end;
  }
  .tabs { width: min(100% - 40px, 1180px); margin: 0 auto; padding: 12px 0; flex-wrap: wrap; overflow: visible; }
  .page { width: min(100% - 40px, 1180px); padding: 0 0 40px; }
  .foot { width: min(100% - 40px, 1180px); padding: 8px 0 40px; }
  .sheet { padding: 24px 24px 28px; }
  .stickers { grid-template-columns: repeat(auto-fill, minmax(var(--cell, 110px), 1fr)); gap: 18px 16px; }
  .wall { --cell: 110px; }
  .held { padding: 40px 20px 28px; }
  .item-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
  .item-cols .held { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
