/* timmy v2 — the poster.
   The whole app lives inside one thick-bordered graph-paper panel. Everything
   on it is a card with an ink border and a *coloured* hard shadow, tilted a
   degree or two off-axis; hovering straightens a thing out and lifts it. */

:root {
  --ink: #3b2a44;
  --bg: #f4eef8;
  --cream: #fffbe8;
  --paper: #fff;
  --muted: #7a6689;

  --pink: #ff2f86;
  --pink-soft: #ff5fa2;
  --purple: #a97bff;
  --purple-soft: #d9c8ff;
  --yellow: #ffd23f;
  --blue: #57c7ff;
  --green: #5fe0b0;

  /* Mint is a background colour; on cream it needs to darken this far before
     66px of Bungee is actually readable. */
  --teal: #2fb98f;

  --lilac-wash: #f2ecff;
  --pink-wash: #ffe3f1;
  --mint-wash: #eafff6;
  --blue-wash: #e6f7ff;

  --shout: "Bungee", "Baloo 2", system-ui, cursive;
  --display: "Baloo 2", "M PLUS Rounded 1c", system-ui, cursive;
  --body: "M PLUS Rounded 1c", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

/* Almost every fixed size on the poster is a clamp: the page has to hold its
   proportions from a phone to a wide desktop, and stepping them at a breakpoint
   makes the whole thing lurch. Only the feed's shelf switches shape outright,
   and only because a sideways drag has nowhere to go on a narrow screen. */
body {
  min-height: 100vh;
  padding: clamp(14px, 3vw, 32px) clamp(14px, 3vw, 40px) clamp(16px, 3vw, 34px);
}

a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--purple); }

input, button, select, textarea { font-family: inherit; }

:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

@keyframes tm-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@keyframes tm-wiggle { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes tm-pop { 0% { transform: scale(.72) rotate(-4deg); opacity: 0; } 70% { transform: scale(1.05) rotate(1deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes tm-slide { to { background-position: 60px 0; } }
/* tm-pop played backwards, for the panels that fold away again when their
   toggle is switched off — a password box that simply vanished would read as a
   glitch next to everything else that springs in. */
@keyframes tm-popout {
  0% { transform: scale(1) rotate(0); opacity: 1; }
  30% { transform: scale(1.06) rotate(1deg); }
  100% { transform: scale(.7) rotate(-5deg); opacity: 0; }
}
@keyframes tm-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ---------- the poster ---------- */

.poster {
  position: relative;
  min-height: 84vh;
  padding: 34px 44px 54px;
  overflow: hidden;
  background: var(--cream);
  background-image:
    repeating-linear-gradient(90deg, rgba(59, 42, 68, .055) 0 2px, transparent 2px 40px),
    repeating-linear-gradient(0deg, rgba(59, 42, 68, .055) 0 2px, transparent 2px 40px);
  border: 5px solid var(--ink);
  border-radius: clamp(20px, 3vw, 36px);
  box-shadow: 14px 14px 0 var(--ink);
}

/* Shapes that peek in from the margins. Purely decorative, never in the way. */
.blob {
  position: absolute;
  border: 5px solid var(--ink);
  pointer-events: none;
  z-index: 0;
}
.blob-1 { left: -130px; top: 300px; width: 220px; height: 220px; border-radius: 50%; background: var(--pink-wash); }
.blob-2 { right: -80px; top: 720px; width: 210px; height: 210px; border-radius: 52px; background: var(--blue-wash); transform: rotate(12deg); }

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vh, 24px);
  animation: tm-pop .28s ease-out;
}

.footer {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--purple);
  padding-top: 14px;
  transform: rotate(-1deg);
}

/* ---------- header ---------- */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; transform: rotate(-2deg); }
.brand:hover { color: inherit; }

.brand-face {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 20px;
  border: 4px solid var(--ink);
  background: linear-gradient(140deg, var(--pink-soft), var(--yellow));
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  animation: tm-float 3.4s ease-in-out infinite;
}

.brand-name {
  font-family: var(--shout);
  font-size: clamp(28px, 5vw, 40px);
  line-height: .9;
  color: var(--pink);
  text-shadow: 4px 4px 0 var(--ink);
}
.brand-tag {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: .4px;
  margin-top: 4px;
}

.tabs { display: flex; gap: 9px; flex-wrap: wrap; padding-top: 8px; }

.tab {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800;
  font-size: 15px;
  padding: 8px 20px;
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .12s, box-shadow .12s;
}
.tab:nth-child(odd) { --tilt: -2deg; }
.tab:nth-child(even) { --tilt: 2deg; }
.tab:hover { color: var(--ink); transform: translate(-2px, -2px) rotate(var(--tilt)); }
.tab[aria-current="page"],
.tab[aria-current="page"]:hover {
  background: var(--tab-color);
  transform: translate(2px, 2px) rotate(var(--tilt));
  box-shadow: 2px 2px 0 var(--ink);
}
.tab-feed   { --tab-color: var(--pink-soft); }
.tab-upload { --tab-color: var(--yellow); }
.tab-yt     { --tab-color: var(--blue); }
.tab-gif    { --tab-color: var(--green); }
.tab-note   { --tab-color: var(--green); }

/* ---------- hero type ---------- */

.hero { max-width: 700px; transform: rotate(-1.5deg); }
.hero-title {
  font-family: var(--shout);
  font-size: clamp(36px, 7vw, 66px);
  line-height: .9;
  margin: 0;
  color: var(--hero-color, var(--pink));
  text-shadow: 4px 4px 0 var(--ink);
  overflow-wrap: break-word;
}
.hero-sub {
  font-size: 16.5px;
  font-weight: 700;
  margin: 10px 0 0;
  max-width: 40ch;
}
.hero-pink   { --hero-color: var(--pink); }
.hero-purple { --hero-color: var(--purple); }
.hero-blue   { --hero-color: var(--blue); }
.hero-green  { --hero-color: var(--green); }
.hero-teal   { --hero-color: var(--teal); }

.title-sm { font-family: var(--display); font-size: 24px; font-weight: 800; margin: 0; }

.quip { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.quip.loud { color: var(--purple); }
.quip-wide { max-width: 34ch; }
.label { font-weight: 800; font-size: 15px; color: var(--muted); }

.error { color: var(--pink); font-weight: 800; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */

.btn {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink);
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800;
  font-size: 14px;
  padding: 7px 18px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover:not(:disabled) { color: var(--btn-fg); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: 3px 3px 0 var(--ink); }
/* Toggle buttons stay visually held down while they are the current choice. */
.btn[aria-pressed="true"],
.btn[aria-pressed="true"]:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.btn-pink   { --btn-bg: var(--pink-soft); --btn-fg: #fff; }
.btn-purple { --btn-bg: var(--purple);    --btn-fg: #fff; }
.btn-yellow { --btn-bg: var(--yellow);    --btn-fg: var(--ink); }
.btn-blue   { --btn-bg: var(--blue);      --btn-fg: #10303f; }
.btn-green  { --btn-bg: var(--green);     --btn-fg: #104032; }

.btn-md { font-size: 13.5px; padding: 9px 18px; border-radius: 13px; }
.btn-sm { font-size: 13px; padding: 6px 16px; box-shadow: 3px 3px 0 var(--ink); }

.btn-lg {
  font-family: var(--display);
  font-size: clamp(19px, 2.6vw, 25px);
  padding: 10px 36px;
  border-width: 4px;
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-1.5deg);
}
.btn-lg:hover:not(:disabled) { transform: rotate(0deg) translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.btn-lg:active:not(:disabled) { transform: rotate(0deg) translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }

.btn-x {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  flex: 0 0 auto;
  transition: transform .15s, box-shadow .12s;
}
.btn-x:hover:not(:disabled) { transform: rotate(90deg); box-shadow: 4px 4px 0 var(--ink); }

.btn-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------- cards ---------- */

.card {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: 7px 7px 0 var(--shade, var(--ink));
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: rotate(var(--tilt, 0deg));
}
.card-pop { animation: tm-pop .3s ease-out; }
.card-pink   { --shade: var(--pink-soft); }
.card-blue   { --shade: var(--blue); }
.card-green  { --shade: var(--green); }
.card-yellow { --shade: var(--yellow); }
.card-purple { --shade: var(--purple); }
.card-cream  { background: var(--cream); }
.card-tilt-l { --tilt: -1.5deg; }
.card-tilt-r { --tilt: 2deg; }

/* The lilac card is a solid purple slab with white type on it. */
.card-lilac {
  background: var(--purple);
  color: #fff;
  --shade: var(--ink);
}
.card-lilac .label, .card-lilac .quip { color: inherit; }

.shout {
  display: inline-block;
  align-self: flex-start;
  background: var(--yellow);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 8px 20px;
  font-weight: 800;
  font-size: 17px;
  animation: tm-wiggle 2.6s ease-in-out infinite;
}
.shout.sad { background: var(--purple-soft); }
.shout.bad { background: var(--pink-soft); color: #fff; }

/* Ink pill with hot type — used for counts and asides. */
.tally {
  align-self: flex-start;
  background: var(--ink);
  color: var(--yellow);
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 800;
  font-size: 13.5px;
  transform: rotate(2deg);
}

.chip {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.chip-lilac { background: var(--lilac-wash); border: 2px solid var(--purple-soft); }
.chip-mint  { background: var(--mint-wash); border: 2px solid #b6f0dd; }

.aside {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  max-width: 26ch;
  background: var(--cream);
  border-radius: 12px;
  padding: 6px 10px;
}

/* ---------- filter pills ---------- */

.pills { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.pill {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800;
  font-size: 14px;
  padding: 7px 18px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.pill:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.pill[aria-pressed="true"],
.pill[aria-pressed="true"]:hover {
  background: var(--pill-color, var(--yellow));
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}
.pill-yellow { --pill-color: var(--yellow); }
.pill-blue   { --pill-color: var(--blue); }
.pill-green  { --pill-color: var(--green); }

/* The count pill trails the filters, so it needs room past their shadows. */
.pills > .tally { margin-left: 8px; }

/* ---------- dropzones ---------- */

.drop {
  background: var(--paper);
  border: 4px dashed var(--ink);
  border-radius: 26px;
  box-shadow: 8px 8px 0 var(--shade, var(--pink-soft));
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transform: rotate(var(--tilt, -3deg));
  transition: transform .15s, box-shadow .15s;
}
.drop:hover, .drop.over { transform: rotate(0deg); box-shadow: 8px 8px 0 var(--purple); }
.drop-blue { --shade: var(--blue); }
.drop-tight { padding: 18px; }

.drop-title { font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1.05; }
.drop-sub { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 8px; }
.drop-cta {
  margin-top: 16px;
  display: inline-block;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 20px;
  font-weight: 800;
  font-size: 14px;
}

/* ---------- upload queue ---------- */

.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.queue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 10px 12px;
  min-width: 0;
}

.queue-face {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 11px;
  border: 3px solid var(--ink);
  background: var(--green);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 800;
}
.queue-face.busy { background: var(--yellow); }
.queue-face.bad { background: var(--pink-soft); color: #fff; }

/* The name owns its own line above the meta, so the row keeps one height
   whatever the state label grows into and the column can be narrow. */
.queue-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.queue-name {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-size { font-size: 11.5px; font-weight: 700; color: var(--muted); }

.queue-state {
  background: var(--green);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 11px;
  font-weight: 800;
  /* The short labels never wrap on their own, but a failure message can be a
     whole sentence — it has to be able to break, or the row outgrows its column
     and .poster's overflow clips the text off. */
  overflow-wrap: anywhere;
  text-align: center;
}
.queue-state.busy { background: var(--yellow); }
.queue-state.wait { background: var(--paper); color: var(--muted); }
.queue-state.bad { background: var(--pink-soft); color: #fff; }

.queue-info .progress { margin-top: 4px; }
.queue-speed { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* The queue scrolls inside its card once it outgrows a few files, and the feed
   scrolls sideways. Either way the native bar is hidden and drawn as a candy
   rail instead — a system scrollbar dropped on the poster reads as a piece of
   someone else's interface. The thumb is sized and dragged by `wireRail`. */
.scroller { position: relative; padding-right: 22px; min-width: 0; }
/* Laid on its side: the rail runs under the box rather than beside it. */
.scroller-flat { padding-right: 0; padding-bottom: 26px; }

.scroll-box {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.scroll-box::-webkit-scrollbar { display: none; }

.scroll-rail, .scroll-thumb {
  position: absolute;
  right: 0;
  width: 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  cursor: grab;
  touch-action: none;
}
.scroll-rail { top: 0; bottom: 0; background: var(--yellow); }
.scroll-thumb {
  background: var(--pink);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .55) 0 4px, transparent 4px 9px);
}
.scroll-rail:active, .scroll-thumb:active { cursor: grabbing; }

/* The flat pair. The thumb's `left` and `width` come from wireRail, so only the
   cross axis is pinned here. */
.scroll-rail-flat, .scroll-thumb-flat { top: auto; bottom: 0; height: 14px; }
.scroll-rail-flat { left: 0; right: 0; width: auto; }
.scroll-thumb-flat { right: auto; width: auto; background: var(--purple); }

/* ---------- progress ---------- */

.progress {
  height: 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background-image: linear-gradient(
    135deg,
    var(--pink-soft) 25%, var(--yellow) 25%, var(--yellow) 50%,
    var(--pink-soft) 50%, var(--pink-soft) 75%, var(--yellow) 75%
  );
  background-size: 60px 100%;
  animation: tm-slide 1s linear infinite;
  transition: width .2s;
}
.progress-fill.blue {
  background-image: linear-gradient(
    135deg,
    var(--blue) 25%, var(--green) 25%, var(--green) 50%,
    var(--blue) 50%, var(--blue) 75%, var(--green) 75%
  );
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- toggles ---------- */

.opt { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.opt input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.opt-box {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: transparent;
  transition: background .12s;
}
.opt input:checked + .opt-box { background: var(--opt-color, var(--green)); color: var(--ink); }
.opt input:focus-visible + .opt-box { outline: 3px solid var(--yellow); outline-offset: 3px; }
.opt-yellow { --opt-color: var(--yellow); }

.opt-text b { display: block; font-weight: 800; font-size: 15.5px; }
.opt-text i { display: block; font-style: normal; font-size: 12.5px; font-weight: 600; opacity: .9; }

/* ---------- text inputs ---------- */

.field {
  width: 100%;
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 13px 16px;
  outline: none;
}
.field:focus { border-color: var(--pink); }
.field::placeholder { color: #b3a6bd; }

/* Not ".share-row": that exact selector is a generic cosmetic filter in
   Fanboy's Social list, so ad blockers hide the whole row — link and copy
   button — on every site that uses the name. */
.link-row { display: flex; gap: 12px; flex-wrap: wrap; }
.share-value {
  flex: 1;
  min-width: min(100%, 220px);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--purple-soft);
  border-radius: 14px;
  padding: 12px 16px;
  outline: none;
}
.share-value:focus { border-color: var(--pink); }

/* ---------- range ---------- */

input[type="range"] {
  width: 100%;
  height: 24px;
  cursor: pointer;
  background: transparent;
  accent-color: var(--yellow);
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), var(--pink-soft));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
}
input[type="range"]::-moz-range-track {
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), var(--pink-soft));
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
}

/* The fps number, shouted. */
.readout {
  font-family: var(--shout);
  font-size: 46px;
  line-height: 1;
  text-shadow: 3px 3px 0 var(--ink);
}

/* ---------- the feed rail ---------- */

/* The drawer is a shelf you pull sideways, not a page you scroll down: two
   rows deep, filling column by column, so a drawerful stays on one screen and
   getting to the end is a deliberate act. Native bar hidden — the flat candy
   rail under it is the scrollbar, drawn by .scroll-rail/.scroll-thumb and
   driven by feed.js. */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, min-content);
  grid-auto-columns: clamp(240px, 78vw, 300px);
  gap: clamp(18px, 2.2vh, 34px) clamp(24px, 3.4vw, 44px);
  align-items: start;
  list-style: none;
  margin: 0;
  /* Room for what leans out of the cards: the tilt and the badge above, the
     hard shadow and the hover lift below. `overflow-y: hidden` clips anything
     that does not fit. */
  padding: 20px 6px 22px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail.grabbing { cursor: grabbing; }

/* The "add yours" tile is as tall as the pair of cards beside it. */
.rail-add { grid-row: span 2; align-self: stretch; }

/* Each tile takes its tilt and shadow colour from its position, so a feed of
   near-identical files still reads as a scattered pile rather than a table.
   The "add yours" tile holds the first slot, so the eight-card cycle starts at
   the second child. */
.tile {
  width: 100%;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 9px 9px 0 var(--shade);
  display: flex;
  flex-direction: column;
  transform: rotate(var(--tilt));
  transition: transform .15s, box-shadow .15s;
}
.tile:hover { transform: rotate(0deg) translateY(-6px); box-shadow: 12px 12px 0 var(--shade); }

.tile:nth-child(8n + 2) { --tilt: -2.5deg; --shade: var(--pink-soft); }
.tile:nth-child(8n + 3) { --tilt: 1.8deg;  --shade: var(--blue); }
.tile:nth-child(8n + 4) { --tilt: -1.2deg; --shade: var(--purple); }
.tile:nth-child(8n + 5) { --tilt: 2.4deg;  --shade: var(--yellow); }
.tile:nth-child(8n + 6) { --tilt: -1.8deg; --shade: var(--green); }
.tile:nth-child(8n + 7) { --tilt: 1.4deg;  --shade: var(--pink-soft); }
.tile:nth-child(8n + 8) { --tilt: -2.2deg; --shade: var(--blue); }
.tile:nth-child(8n + 1) { --tilt: 2deg;    --shade: var(--purple); }

.tile-thumb-link { display: block; position: relative; }

/* The kind badge straddles the tile's top edge, so it lives outside the
   clipping box that keeps the media inside the rounded corners. */
.tile-thumb {
  display: grid;
  place-items: center;
  height: clamp(104px, 15vh, 180px);
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  border-radius: 20px 20px 0 0;
}
.tile-thumb > video, .tile-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-kind {
  position: absolute;
  top: -12px;
  left: 16px;
  z-index: 2;
  background: var(--ink);
  color: #fff;
  font-family: var(--shout);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 5px 14px;
  border-radius: 999px;
  text-transform: uppercase;
}

.tile-slot {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, .8);
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px dashed var(--ink);
}

.tile-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.tile-name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  word-break: break-all;
  line-height: 1.35;
  color: var(--ink);
}
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tile-meta { font-size: 13.5px; font-weight: 700; color: var(--muted); }

/* The "add yours" tile that opens the rail. */
.tile-add {
  width: 100%;
  height: 100%;
  background: var(--yellow);
  border: 4px dashed var(--ink);
  border-radius: 26px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 34px 24px;
  min-height: 290px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink);
  transform: rotate(2deg);
  transition: transform .15s;
}
.tile-add:hover { color: var(--ink); transform: rotate(0deg) translateY(-6px); }
.tile-add-title { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.05; }
.tile-add-sub { font-size: 15px; font-weight: 700; color: #7a5f14; margin-top: 10px; }

/* Candy stripes stand in for anything we cannot preview; the palette cycles so
   a feed of plain files still reads as a row of different things. */
.stripe-0 { background-image: repeating-linear-gradient(135deg, var(--pink-wash) 0 13px, #ffd0e6 13px 26px); }
.stripe-1 { background-image: repeating-linear-gradient(135deg, var(--mint-wash) 0 13px, #d3f7ea 13px 26px); }
.stripe-2 { background-image: repeating-linear-gradient(135deg, var(--lilac-wash) 0 13px, #e3d6ff 13px 26px); }
.stripe-3 { background-image: repeating-linear-gradient(135deg, #fff6dc 0 13px, #ffeab0 13px 26px); }
.stripe-4 { background-image: repeating-linear-gradient(135deg, var(--blue-wash) 0 13px, #cceeff 13px 26px); }

/* ---------- media panels (single view, yt, gif) ---------- */

.stage {
  border: 4px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: #1b1220;
  display: grid;
  place-items: center;
}
/* Media keeps its own size — a portrait clip stretched to the full column
   width is just two black bars, and a 300px screenshot blown up is worse than
   the same screenshot centred on the stage. The cap keeps the preview and the
   facts beside it on one screen together. */
.stage > video, .stage > img { display: block; max-width: 100%; max-height: min(46vh, 380px); }
.stage-square { width: 160px; height: 160px; flex: 0 0 auto; }
.stage-square > img { width: 100%; height: 100%; object-fit: contain; }
/* The convert dropzone doubles as the preview, so it stays hand-sized and
   hugs the media instead of letterboxing it across the whole column. */
.stage-preview > video, .stage-preview > img {
  width: auto;
  max-width: 100%;
  max-height: 300px;
}

/* Fallback card for files we cannot render at all. */
.lump {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 20px;
  background-image: repeating-linear-gradient(135deg, var(--lilac-wash) 0 13px, #e3d6ff 13px 26px);
}
.lump-icon { font-size: 34px; line-height: 1; }
.lump-type { flex: 1; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--muted); }

.split { display: flex; gap: 18px; flex-wrap: wrap; }
.split-main { flex: 1; min-width: min(100%, 220px); display: flex; flex-direction: column; gap: 10px; }

/* ---------- page columns ---------- */

/* `auto-fit` + `1fr`, per the design: empty tracks collapse, so the columns
   that are actually present split the full width between them. */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 32px;
  align-items: start;
}
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 30px; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.col-tilt { transform: rotate(-1deg); }
.col-tilt-r { transform: rotate(1deg); }


/* The yt url form is a fixed-width card with the stats chips beside it. */
.row-top { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.form-card { width: 520px; max-width: 100%; }
.side-notes { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; transform: rotate(1.5deg); }

/* Compact "recently …" lists. */
.mini-list { display: flex; flex-direction: column; gap: 9px; }
.mini-row { display: flex; align-items: center; gap: 10px; }
.mini-chip {
  width: 40px;
  height: 28px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 7px;
  overflow: hidden;
  background-color: var(--cream);
}
.mini-chip > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-name {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  word-break: break-all;
  color: var(--ink);
}
.mini-ago { font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* The three last gifs, propped up beside the convert button. */
.gif-shelf { display: flex; gap: 10px; }
.gif-shelf > a {
  width: 74px;
  height: 74px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  display: block;
  background-color: var(--cream);
}
.gif-shelf > a:nth-child(1) { transform: rotate(4deg); }
.gif-shelf > a:nth-child(2) { transform: rotate(-5deg); }
.gif-shelf > a:nth-child(3) { transform: rotate(3deg); }
.gif-shelf img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- a shared drop (/v) ---------- */

/* The preview is the whole point of the page, so its card carries no padding:
   the media sits flush against the ink and the caption rides underneath. */
.view-card {
  padding: 0;
  gap: 0;
  border-radius: 28px;
  box-shadow: 12px 12px 0 var(--shade);
  overflow: hidden;
}
.view-stage { border-bottom: 4px solid var(--ink); }
/* The stage supplies its own frame everywhere else; here the card is the frame. */
.view-stage > .stage { border: 0; border-radius: 0; min-height: 280px; }
.view-stage > .lump { padding: 40px 24px; }
.view-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 22px;
}

/* How far this drop travels: public, link-only, or about to burn itself. */
.badge {
  background: var(--green);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 800;
  font-size: 12.5px;
  white-space: nowrap;
}
.badge-pink { background: var(--pink-soft); color: #fff; }
.badge-yellow { background: var(--yellow); }

.file-name {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 800;
  word-break: break-all;
  line-height: 1.35;
}

/* The switcher: every file in the drop, the focused one held down. */
.drop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
/* A drop can hold a lot of files; past a quarter of the screen the list scrolls
   rather than pushing the download button off the bottom. It scrolls on the
   upload queue's candy rail — same .scroller, same hidden native bar. */
.pick-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 26vh;
}
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--paper);
  color: inherit;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.pick:hover { transform: translate(-2px, -2px); }
.pick[aria-pressed="true"] { background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); }

.pick-chip {
  width: 44px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 9px;
  overflow: hidden;
  background-color: var(--cream);
}
.pick-chip > img, .pick-chip > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-text { flex: 1; min-width: 0; }
.pick-name {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  word-break: break-all;
  line-height: 1.3;
}
.pick-meta { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 2px; }

/* The report button files your complaint directly into the bin, and says so. */
.gag {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--ink);
  color: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--pink-soft);
  padding: 18px 20px;
}
/* Springs in, then shakes its head — the delay keeps the two off each other. */
.gag-in { animation: tm-pop .3s ease-out, tm-shake .34s ease-in-out .12s; }
.gag-face {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 3px solid var(--cream);
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  transform: rotate(-5deg);
}
.gag-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gag-title { font-family: var(--display); font-size: 21px; font-weight: 800; line-height: 1.15; }
.gag-text { font-size: 13.5px; font-weight: 700; line-height: 1.5; opacity: .92; }
.gag-text b { color: var(--yellow); }
.gag-dismiss {
  align-self: flex-start;
  margin-top: 4px;
  border-color: var(--cream);
  box-shadow: none;
  font-size: 13px;
  padding: 6px 18px;
}
.gag-dismiss:hover:not(:disabled) { box-shadow: none; }

/* ---------- notes: writing one ---------- */

/* Cream rather than white, so the title and body fields read as things laid
   *on* the card rather than part of it. */
.note-card {
  background: var(--cream);
  box-shadow: 9px 9px 0 var(--shade, var(--green));
  padding: 22px;
  gap: 14px;
}

.note-title {
  width: 100%;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 10px 16px;
  outline: none;
}
.note-title:focus { border-color: var(--pink); }
.note-title::placeholder { color: #b3a6bd; }

.note-body {
  width: 100%;
  resize: vertical;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: 18px;
  padding: 14px 16px;
  outline: none;
}
.note-body:focus { border-color: var(--pink); }
.note-body::placeholder { color: #b3a6bd; }

.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Flush in a row rather than propped up like a .tally. */
.tally-flat { align-self: auto; transform: none; padding: 6px 16px; font-size: 12.5px; }
.tally-flat.over { background: var(--pink); color: #fff; }

/* Both animations sit on the same element, so the one folding away has to keep
   its end state or it flashes back to full size before being removed. */
.springy { animation: tm-pop .3s ease-out; }
.springy.going { animation: tm-popout .24s ease-in forwards; }

.pw-panel {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pw-field {
  width: 100%;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
  background: var(--cream);
  border: 3px dashed var(--ink);
  border-radius: 14px;
  padding: 11px 14px;
  outline: none;
}
.pw-field:focus { border-color: var(--pink); }

.pw-meter { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pw-bars { display: flex; gap: 5px; align-items: center; }
.pw-bar {
  width: 26px;
  height: 8px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.pw-bar.lit { background: var(--pw-color, var(--yellow)); }
.pw-label { font-size: 12px; font-weight: 800; margin-left: 4px; color: var(--muted); }
.pw-label.weak { color: var(--pink); }
.pw-label.okay { color: #c79a00; }
.pw-label.good { color: var(--teal); }
.pw-hint { font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* A row of fat pills: the note's expiry choices, a file's facts. */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.chip-hard,
.chip-pick {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 5px 15px;
  font-weight: 800;
  font-size: 13px;
}
.chip-pick {
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.chip-pick:hover { transform: translate(-2px, -2px); }
.chip-pick[aria-pressed="true"] {
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- notes: reading one ---------- */

.note-read { display: flex; flex-direction: column; gap: 24px; align-items: center; }
.note-column { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 22px; }

.burn-banner {
  background: var(--pink-soft);
  color: #fff;
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 12px 20px;
  font-weight: 800;
  font-size: 14.5px;
  transform: rotate(-1.5deg);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.burn-banner .face { font-size: 16px; }

.note-sheet {
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 28px;
  box-shadow: 12px 12px 0 var(--purple);
  padding: clamp(18px, 4vw, 34px) clamp(16px, 3.5vw, 32px);
  transform: rotate(1deg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.note-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.note-heading { font-family: var(--shout); font-size: clamp(24px, 4.4vw, 34px); line-height: 1; color: var(--ink); margin: 0; overflow-wrap: break-word; }
.note-byline { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-top: 8px; }
.note-byline b { color: var(--purple); }

/* Monospace and pre-wrap: what arrives on a link like this is usually a
   password or a list, where the sender's line breaks are the formatting. */
.note-text {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: 20px;
  padding: 22px 24px;
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.lock-gate {
  background: var(--bg);
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.lock-face {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 4px solid var(--ink);
  background: var(--yellow);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  transform: rotate(-4deg);
}
.lock-title { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1.1; margin: 0; }
.lock-sub { font-size: 13.5px; font-weight: 700; color: var(--muted); max-width: 34ch; }
.lock-field {
  width: 100%;
  max-width: 320px;
  text-align: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--ink);
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: 14px;
  padding: 13px 16px;
  outline: none;
}
.lock-field:focus { border-color: var(--pink); }

/* Straight, unlike every other big button here: it sits centred in a gate that
   is already square to the page, where a tilt reads as a rendering fault. */
.btn-unlock {
  font-family: var(--display);
  font-size: 21px;
  padding: 9px 30px;
  transform: none;
}
.btn-unlock:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }

/* Springs in, then shakes its head. The delay keeps the pop and the shake from
   fighting over the same transform. */
.lock-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--pink-soft);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 18px;
  font-weight: 800;
  font-size: 14px;
  animation: tm-pop .28s ease-out, tm-shake .34s ease-in-out .1s;
}
.lock-error .face { font-size: 16px; }

.note-sign { text-align: center; font-size: 13.5px; font-weight: 700; color: var(--muted); }

/* The confetti canvas, created by confetti.js on the first celebration. Fixed
   over the whole viewport, above the poster, and never in the way of a click. */
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ---------- responsive ---------- */

/* The one real breakpoint. Everything else scales fluidly; this is where the
   feed's shelf stops being a shelf, because dragging sideways needs width the
   screen no longer has. */
@media (max-width: 880px) {
  .poster { padding: 24px 20px 40px; box-shadow: 8px 8px 0 var(--ink); }
  .blob { display: none; }

  /* An ordinary wrapping grid down the page: no sideways scroll, so no rail
     and nothing to drag. feed.js watches the same width and leaves the wheel
     and the pointer alone below it. */
  .rail {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    grid-auto-columns: auto;
    gap: 22px;
    padding: 6px 2px 10px;
    overflow-x: visible;
    overflow-y: visible;
    cursor: auto;
    user-select: auto;
  }
  /* No rail under it means no gutter to reserve. */
  .scroller-flat { padding-bottom: 0; }
  .rail-add { grid-row: auto; align-self: auto; }
  .tile-add {
    height: auto;
    min-height: 150px;
    padding: 22px 18px;
    box-shadow: 6px 6px 0 var(--ink);
    transform: none;
  }
}

/* Type and padding are already down to their clamp floors here; what is left is
   what a clamp cannot say. */
@media (max-width: 560px) {
  .tab { font-size: 13.5px; padding: 7px 14px; }
  .btn-lg { padding: 9px 26px; }
  .drop-title { font-size: 24px; }
  /* The clipped name relies on a tooltip to give the rest back, and a phone has
     no hover — so down here it wraps instead. */
  .queue-name { white-space: normal; overflow-wrap: anywhere; }
  /* Tilts read as broken layout once everything is stacked full-bleed. */
  .hero, .brand, .card, .drop, .tile, .tile-add, .col-tilt, .col-tilt-r, .side-notes, .tally, .footer, .btn-lg,
  .burn-banner, .note-sheet, .lock-face {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
