/* Home page — synthesis of green's home-landing hero + red-grid gallery
   (2026-07-11). Loaded from home.html.j2 AFTER base.css so equal-
   specificity overrides here win. Tokens (cherry oklch, warm inks,
   grade colors, fonts, radii) all come from base.css :root. */

/* ───── Hero ───── */
/* Wrap the hero in a hairline outline so it reads as a contained
   region without adding a grey slab. The atmospheric page gradient
   still shows through — just contained. */
.home-hero .hero {
  padding: 48px 40px 40px;
  background: transparent;
  border: 1px solid color-mix(in oklch, var(--ink-300), transparent 40%);
  border-radius: var(--rad-md);
  /* 56px so the top edge of the hero box aligns with the kicker-text
     top on every .shell.<stage> page (Leon 2026-07-12). */
  margin-top: 56px;
}
@media (max-width: 720px) {
  .home-hero .hero { padding: 36px 24px 32px; }
}
.home-hero .hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 7.5vw, 92px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink-900);
}
/* a comma's tail drops into the next line at 0.92 (see _hero_headline) */
.home-hero .hero-title.has-comma { line-height: 1.1; }
/* typing caret while a headline is deleted and typed (_hero_headline) */
.hero-title.hl-caret::after,
.hero-title .hl-caret::after {
  content: "";
  display: inline-block;
  inline-size: .07em;
  block-size: .78em;
  margin-inline-start: .06em;
  background: var(--accent-500);
  vertical-align: baseline;
  animation: hl-blink 1s steps(1) infinite;
}
@keyframes hl-blink { 50% { opacity: 0; } }
/* Editing restarts the idle blink; the text itself keeps animating. */
.hero-title.hl-editing.hl-caret::after,
.hero-title.hl-editing .hl-caret::after { animation: none; }
.home-hero .hero-sub {
  margin: 14px 0 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-700);
}

/* Two-column hero row: drop-zone + Discord-invite panel side by side,
   equal heights, stacked below 720px. */
.hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 4px;
}
@media (max-width: 720px) {
  .hero-row { grid-template-columns: 1fr; }
}

/* Drop-zone (left) — same hand-off machinery as before (#homeDrop /
   #homeOsr in home.js), reskinned to green's concept: dashed border,
   "drag a .osr here / — or — / Upload Replay". */
.hero-upload-panel {
  position: relative;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 14px;
  padding: 56px 32px;
  text-align: center;
  border: 2px dashed color-mix(in oklch, var(--ink-500), transparent 40%);
  border-radius: var(--rad-md);
  background: color-mix(in oklch, var(--ink-100), transparent 30%);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.hero-upload-panel:hover,
.hero-upload-panel:focus-visible,
.hero-upload-panel.drag {
  border-color: var(--red-500);
  background: color-mix(in oklch, var(--red-500), transparent 94%);
}
.hero-upload-panel input[type="file"] {
  position: absolute; opacity: 0; pointer-events: none;
  width: 0; height: 0;
}
.hero-drop-cue {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--ink-800);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.hero-drop-cue code {
  background: color-mix(in oklch, var(--red-400), transparent 82%);
  padding: 2px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: inherit;
  color: var(--red-400);
  font-weight: 700;
  line-height: 1;
}
.hero-drop-or {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-500);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.hero-upload-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red-500);
  border: 1px solid var(--red-500);
  border-radius: var(--rad-sm);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 10px 22px;
  transition: 140ms ease;
}
.hero-upload-btn:hover {
  background: var(--red-400);
  border-color: var(--red-400);
  color: var(--on-accent-hover);
  box-shadow: 0 6px 22px -6px var(--red-glow);
  transform: translateY(-1px);
}

/* Flat Discord branding, with a darker panel in the site's dark theme. */
.hero-discord-panel {
  --discord-blurple: #5865F2;
  --discord-light: #E0E3FF;
  --discord-ink: #23272A;
  --discord-surface: var(--discord-light);
  --discord-button: var(--discord-blurple);
  --discord-button-ink: #fff;
  --discord-accent: var(--discord-blurple);
  display: flex; flex-direction: column;
  gap: 14px;
  padding: 28px 32px;
  border: 1px solid var(--discord-blurple);
  border-radius: var(--rad-md);
  background: var(--discord-surface);
}
html[data-v2-icons]:not([data-theme="light"]) .hero-discord-panel {
  --discord-surface: var(--discord-blurple);
  --discord-ink: #fff;
  --discord-button: var(--discord-light);
  --discord-button-ink: #23272A;
  --discord-accent: var(--discord-light);
}
.hero-discord-head {
  display: flex; align-items: center; gap: 10px;
}
.hero-discord-icon {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 900; line-height: 1;
  color: var(--discord-accent);
}
.hero-discord-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--discord-ink);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.hero-discord-points {
  margin: 0; padding: 0 0 0 18px;
  display: flex; flex-direction: column; gap: 7px;
  font-family: var(--font-body);
  font-size: 13.5px; line-height: 1.45;
  color: var(--discord-ink);
}
.hero-discord-points li::marker { color: var(--discord-accent); }
.hero-discord-points code {
  background: color-mix(in srgb, var(--discord-blurple) 15%, var(--discord-light));
  padding: 1px 6px; border-radius: 3px;
  font-family: var(--font-mono); font-size: 12px;
  color: #23272A;
}
.hero-btn.hero-discord-cta {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--discord-button);
  border: 1px solid var(--discord-button);
  border-radius: var(--rad-sm);
  color: var(--discord-button-ink);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 10px 22px;
  transition: 140ms ease;
}
.hero-btn.hero-discord-cta:hover {
  background: var(--discord-button);
  color: var(--discord-button-ink);
  box-shadow: 0 6px 22px -6px color-mix(in srgb, var(--discord-button), transparent 40%);
  transform: translateY(-1px);
}
.hero-btn.hero-discord-cta:focus-visible {
  outline: 2px solid var(--discord-button);
  outline-offset: 3px;
}
@media (max-width: 720px) {
  .home-hero .hero { padding-top: 36px; }
  .hero-upload-panel { padding: 40px 24px; }
  .hero-discord-panel { padding: 22px 24px; }
}

/* Whole-page drag overlay (was inline in the old template). */
#homeDropOverlay {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: oklch(0.07 0.01 25 / 0.86);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 800; font-size: 26px;
  text-align: center;
  pointer-events: none;
  border: 4px dashed var(--red-500);
}
#homeDropOverlay.show { display: flex; }
#homeDropOverlay .o-ico { font-size: 46px; color: var(--red-500); }

/* ───── "Most viewed by mode" lanes ───── */
.featured-section { margin-top: 26px; margin-bottom: 14px; }
.featured-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px;
}
.featured-head .f-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--ink-800);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.featured-head .f-sub {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-500);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.mode-scroll .mini-card {
  background: color-mix(in oklch, var(--ink-100), transparent 30%);
  border: 1px solid color-mix(in oklch, var(--ink-800), transparent 93%);
  border-radius: var(--rad-md);
  overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.mode-scroll .mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--red-500);
  color: inherit;
}
.mode-scroll .mini-card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink-50);
  overflow: hidden;
}
.mode-scroll .mini-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.mode-scroll .mini-card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, oklch(0.07 0.01 25 / 0.7) 100%);
}
.mode-scroll .mini-card .grade {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: auto; height: auto;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900; font-size: 15px;
  padding: 2px 8px;
  border: 0; border-radius: 3px;
  backdrop-filter: none;
  color: var(--ink-0);
  letter-spacing: 0.02em; line-height: 1.2;
}
.mode-scroll .mini-card .views-pill {
  position: absolute; bottom: 6px; right: 6px; z-index: 2;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700;
  background: color-mix(in oklch, var(--ink-0), transparent 15%);
  color: var(--red-400);
  padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.mode-scroll .mini-card .body {
  padding: 8px 10px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.mode-scroll .mini-card .song {
  font-family: var(--font-body);
  font-size: 12px; font-weight: 500;
  color: var(--ink-800); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mode-scroll .mini-card .meta {
  font-family: var(--font-mono);
  font-size: 9px; color: var(--ink-500);
  text-transform: uppercase; letter-spacing: 0.05em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mode-scroll .mini-card .meta .player-name {
  color: var(--red-400); font-weight: 700;
}
.mode-scroll .empty {
  flex: 1;
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-500);
  font-style: italic;
  letter-spacing: 0.04em; text-transform: none;
  border: 1px dashed color-mix(in oklch, var(--ink-500), transparent 60%);
  border-radius: var(--rad-md);
}

/* ───── Gallery head + controls (red-grid proportions) ───── */
.gallery-head { padding: 26px 0 14px; }
.gallery-head .title {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.gallery-head .meta {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: none;
}
/* Chips: one wrapping rail, pill-shaped per the concept. */
.gallery-controls {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.gallery-controls .chips { gap: 6px; }
.gallery-controls .chip {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  padding: 6px 12px;
  border-radius: 999px;
}
.gallery-controls .chip:hover {
  color: var(--ink-800);
  border-color: var(--red-500);
  background: var(--ink-100);
  transform: none;
}
.gallery-controls .chip.active {
  background: var(--red-500);
  color: var(--on-accent);
  border-color: var(--red-500);
}

/* Versus-start button — the "Render versus" entry point on the
   gallery. Sits to the right of the mode chips; distinctive enough
   to read as an action, not a filter. */
.gallery-controls .chip.chip-versus-start {
  margin-left: auto;
  color: var(--red-400);
  border-color: color-mix(in oklch, var(--red-500), transparent 50%);
  background: color-mix(in oklch, var(--red-500), transparent 92%);
  font-weight: 700;
}
.gallery-controls .chip.chip-versus-start:hover {
  color: var(--ink-0);
  background: var(--red-500);
  border-color: var(--red-500);
}

/* ───── Versus pick-mode toolbar + card states ─────
   When pick mode is on, .grid.pick-mode swaps card hover to a
   crosshair-y cursor + fades incompatible/composite cards; selected
   cards get a cherry ring so the picked set reads at a glance. */
.versus-pick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in oklch, var(--red-500), transparent 55%);
  background: color-mix(in oklch, var(--red-500), transparent 92%);
  border-radius: var(--rad-md);
  font-family: var(--font-mono);
}
.versus-pick-bar .vpb-status {
  display: flex; align-items: baseline; gap: 14px;
  min-width: 0;
}
.versus-pick-bar .vpb-count {
  font-size: 13px; font-weight: 700;
  color: var(--red-400);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.versus-pick-bar .vpb-hint {
  font-size: 11px; color: var(--ink-500);
  letter-spacing: 0.04em;
}
/* Right-anchored button cluster — every control sits here so the hint
   text on the left can grow/shrink without shoving the buttons. */
.versus-pick-bar .vpb-right {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: flex-end;
  margin-left: auto;
}
.versus-pick-bar .vpb-layout {
  display: inline-flex; gap: 2px;
  padding: 2px;
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  border-radius: 999px;
}
.versus-pick-bar .vpb-layout-opt {
  padding: 5px 12px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.versus-pick-bar .vpb-layout-opt:hover { color: var(--ink-800); }
.versus-pick-bar .vpb-layout-opt.active {
  background: var(--red-500);
  color: var(--ink-0);
}
.versus-pick-bar .chip {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.versus-pick-bar .chip:hover {
  color: var(--ink-800);
  border-color: var(--red-500);
}
.versus-pick-bar .chip.primary {
  background: var(--red-500);
  border-color: var(--red-500);
  color: var(--ink-0);
  font-weight: 700;
}
.versus-pick-bar .chip.primary:hover { background: var(--red-400); }
.versus-pick-bar .chip.primary[disabled] {
  background: color-mix(in oklch, var(--red-500), transparent 65%);
  border-color: color-mix(in oklch, var(--red-500), transparent 65%);
  cursor: not-allowed;
  color: var(--ink-100);
}

.grid.pick-mode > .card { cursor: pointer; }
.grid.pick-mode > .card.pick-selected {
  /* Inset box-shadow, NOT outline: `outline` is rendered as a rectangle
     ignoring border-radius on iOS Safari (and older WebKit), so the red
     ring sat "off" the rounded card corners. An inset shadow follows the
     radius everywhere. */
  box-shadow: inset 0 0 0 3px var(--red-500), 0 8px 28px -8px var(--red-glow);
}
.grid.pick-mode > .card.pick-incompat,
.grid.pick-mode > .card.pick-composite {
  opacity: 0.35;
  filter: grayscale(0.6);
  cursor: not-allowed;
}
.grid.pick-mode > .card.pick-incompat:hover,
.grid.pick-mode > .card.pick-composite:hover { transform: none; }
/* Overlay-mode mod-bucket dropout warning. Selected but outside the
   biggest matching-sig group — pipeline would drop it. Amber ring on
   top of the cherry pick-selected outline so it reads as "picked but
   won't survive overlay's bucket rule". */
.grid.pick-mode > .card.pick-selected.pick-mod-drop {
  box-shadow: inset 0 0 0 3px oklch(0.72 0.16 65), 0 8px 28px -8px oklch(0.72 0.16 65 / 0.55);
}

/* Duplicate-replay marker — a render whose replay (player+score+acc+diff)
   matches an earlier card on the page. Small amber chip in the stats row so
   you can tell identical plays apart in the versus picker. */
/* Prominent, solid inline chip — a subtle translucent pill got missed. */
.card .dup-badge {
  align-self: center;
  margin-left: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: oklch(0.16 0.03 60);
  background: oklch(0.80 0.185 68);            /* solid bright amber */
  box-shadow: 0 0 0 1.5px oklch(0.92 0.09 80 / 0.85),
              0 1px 5px -1px oklch(0.08 0.02 40 / 0.6);
  white-space: nowrap;
}
/* The whole duplicate card also gets an amber left rail + faint wash on the
   thumbnail, so dupes are distinguishable at a glance — not only by the chip.
   (::after is the existing legibility gradient; this ::before is the rail.) */
.card.is-dup .thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-left: 4px solid oklch(0.80 0.185 68);
  background: linear-gradient(90deg, oklch(0.80 0.185 68 / 0.20), transparent 24%);
  pointer-events: none;
}

/* ───── Recent grid — hard 12-column, span-3 cards ───── */
.grid {
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.grid > .card { grid-column: span 3; }
@media (max-width: 1080px) { .grid > .card { grid-column: span 4; } }
@media (max-width: 820px)  { .grid > .card { grid-column: span 6; } }
@media (max-width: 520px)  { .grid > .card { grid-column: span 12; } }

/* Card body — Sora at card scale (red-grid) instead of the display-
   face shout, so 24 cards read as a catalog, not 24 posters. */
.card .body { padding: 12px 14px 14px; gap: 6px; }
.card .diff {
  font-size: 10px;
  color: var(--ink-500);
}
.card .song {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-800);
}
.card .stats { gap: 10px; margin-top: 0; }
.card .player {
  border-top: 0;
  padding-top: 0;
  margin-top: auto;
  text-transform: none;
  letter-spacing: 0.02em;
}
.card .player .views { color: var(--red-400); }
/* Legibility gradient under the badges (base.css removed its own; the
   solid grade/mode chips want a little anchoring again). */
.card .thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, oklch(0.07 0.01 25 / 0.55) 100%);
  pointer-events: none;
}

/* Grade badge — solid fill per grade (concept), replacing base.css's
   44px glass square. */
.card .grade {
  top: 8px; right: 8px;
  width: auto; height: auto;
  display: inline-block;
  font-size: 18px;
  padding: 3px 10px;
  border: 0; border-radius: 4px;
  backdrop-filter: none;
  letter-spacing: 0.02em; line-height: 1.2;
  z-index: 2;
}
.card .grade.ss, .mini-card .grade.ss { background: var(--grade-ss); color: var(--ink-0); }
.card .grade.s,  .mini-card .grade.s  { background: var(--grade-s);  color: var(--ink-0); }
.card .grade.a,  .mini-card .grade.a  { background: var(--grade-a);  color: var(--ink-0); }
.card .grade.b,  .mini-card .grade.b  { background: var(--grade-b);  color: var(--ink-0); }
.card .grade.c,  .mini-card .grade.c  { background: var(--grade-c);  color: var(--ink-0); }
.card .grade.d,  .mini-card .grade.d  { background: var(--grade-d);  color: var(--ink-0); }

/* Ruleset badge, top-left of the thumb. */
.card .thumb .mode-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  background: color-mix(in oklch, var(--ink-0), transparent 15%);
  color: var(--ink-800);
  padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* ───── Versus chip on card thumb ─────
   Label always says VERSUS · Np (Red's call 2026-07-13) — tier lives
   only in the gradient, keyed on `kind` from the backend event card:
   - .versus   = 2 players,        cherry → magenta
   - .extended = 3-8 players,      magenta → purple
   - .merged   = 9+ players,       purple → deep teal
   All three anchor top-left; on any card-* variant the mode-badge
   moves to top-RIGHT so it doesn't collide. */
.card .thumb .versus-tag {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: #fff;
  padding: 4px 10px; border-radius: 6px;
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.5);
}
.card .thumb .versus-tag.versus {
  background: linear-gradient(135deg, #E0455E 0%, #B0389B 100%);
}
.card .thumb .versus-tag.extended {
  background: linear-gradient(135deg, #B0389B 0%, #7C3FC7 100%);
}
.card .thumb .versus-tag.overlay {
  background: linear-gradient(135deg, #7C3FC7 0%, #2E7A8F 100%);
}
.card.card-versus .thumb .mode-badge,
.card.card-extended .thumb .mode-badge,
.card.card-overlay .thumb .mode-badge {
  left: auto; right: 8px;
}
/* Inline label under the song title, matching the chip color via
   background-clip so the text carries the same gradient. */
.card .body .versus-label {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  background-clip: text; -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}
.card .body .versus-label.versus {
  background-image: linear-gradient(135deg, #E0455E 0%, #B0389B 100%);
}
.card .body .versus-label.extended {
  background-image: linear-gradient(135deg, #B0389B 0%, #7C3FC7 100%);
}
.card .body .versus-label.overlay {
  background-image: linear-gradient(135deg, #7C3FC7 0%, #2E7A8F 100%);
}
.card .body .name-trophy {
  color: var(--ink-800); font-weight: 500;
}

/* DMCA-muted pill (was inline styles in the template). */
.card .thumb .muted-pill {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: #3b1f24; color: #ffd2d2;
  border: 1px solid #6a3940; border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
}

/* ───── Empty state (no renders at all) ───── */
.gallery-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: 56px 24px;
  border: 2px dashed color-mix(in oklch, var(--ink-500), transparent 40%);
  border-radius: var(--rad-md);
  background: color-mix(in oklch, var(--ink-100), transparent 30%);
}
.gallery-empty .empty-icon {
  font-family: var(--font-display);
  font-size: 42px; line-height: 1;
  color: var(--red-400);
}
.gallery-empty a { color: var(--red-400); }
.gallery-empty a:hover { color: var(--red-500); }

/* ───── Thumbnail progressive-load: skeleton shimmer ─────
   loading="lazy" defers off-screen fetches (already on the img tags).
   decoding="async" decodes off the main thread.
   Here we add a subtle animated skeleton on the .thumb container so
   empty slots animate a soft gradient sweep on slow connections
   instead of showing blank white.

   The original note here said the loaded img "naturally covers the
   shimmer — no JS needed". It covers it visually, but the animation
   underneath never stops: every .thumb on the page keeps animating a
   gradient forever, occluded, for the life of the tab. On a 24-card
   grid that is 24 perpetual compositor jobs behind opaque images —
   invisible on fast hardware, ruinous on old. .is-loaded (set in
   home.js) ends it. */
.card .thumb,
.mode-scroll .mini-card .thumb {
  background:
    linear-gradient(
      110deg,
      var(--ink-50) 20%,
      color-mix(in oklch, var(--ink-100), transparent 40%) 45%,
      var(--ink-50) 70%
    );
  background-size: 200% 100%;
  animation: r3d-shimmer 1.6s linear infinite;
}
@keyframes r3d-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
/* Loaded, or failed — either way there is nothing left to wait for, so
   stop animating and drop back to the flat placeholder colour. Also
   drops the gradient itself, so the element stops being a paint layer
   rather than merely a still one. */
.card .thumb.is-loaded,
.mode-scroll .mini-card .thumb.is-loaded {
  background: var(--ink-50);
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .card .thumb, .mode-scroll .mini-card .thumb { animation: none; }
  .hero-title.hl-caret::after, .hero-title .hl-caret::after { animation: none; }
}

/* Skip layout, paint and compositing for cards outside the viewport.
   contain-intrinsic-size keeps the scrollbar honest before a card has
   ever been rendered; `auto` means the real size is remembered once it
   has. Ignored wholesale by browsers that don't support it. */
.card {
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}

/* Load-more pagination (replaced infinite scroll so the footer is
   reachable). Button reuses the chip look, centered under the grid. */
.grid-more-row { display: flex; justify-content: center; margin: 18px 0 6px; }
.grid-more-btn {
  /* Match the gallery chips exactly — button element needs the full
     reset since UA button styles otherwise leak through. */
  appearance: none; -webkit-appearance: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  padding: 8px 22px;
  border-radius: 999px;
  min-width: 160px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.grid-more-btn:hover {
  color: var(--red-400);
  border-color: var(--red-500);
}
.grid-more-btn:disabled { opacity: 0.5; cursor: wait; }

/* Hero drop panel with the score-link bar in it. The panel is stretched
   to match the Discord card beside it, so it was carrying a lot of empty
   air above and below three short lines. The bar goes into that space
   rather than on top of it: tighter padding and gaps keep the row the
   same height it was, with the dead space now doing something.
   :has() so the original spacing is untouched wherever the bar isn't
   rendered — and browsers without :has() simply keep the old look. */
.hero-upload-panel:has(.up-url) {
  padding: 26px 24px;
  gap: 10px;
}
.hero-upload-panel:has(.up-url) .hero-drop-or { margin: 0; }
.hero-upload-panel .up-url { margin-top: 14px; }
