/* Midnight Marquee — editorial cinema palette.
   bg: deep ink (#0d0b10), surface: oxblood-tinted graphite, accent: warm ember.
   Fraunces for display (high-contrast serif), JetBrains Mono for chrome labels,
   Inter for body. Posters as the primary surface; gradient scrim reveals meta on hover.
   Status: todo = full color, active = ember left-rail, done = desaturated + dimmed. */

:root {
  --bg: #0d0b10;
  --bg-2: #15121a;
  --surface: #1c1822;
  --surface-2: #251f2d;
  --line: #2e2638;
  --text: #ece6dc;
  --muted: #8a8195;
  --accent: #e8754a;       /* warm ember */
  --accent-deep: #b8421f;
  --gold: #d9b26a;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 28px -16px rgba(0,0,0,0.7);
  --shadow-hover: 0 20px 50px -20px rgba(232,117,74,0.35), 0 24px 48px -20px rgba(0,0,0,0.8);

  --ease: cubic-bezier(.2,.7,.2,1);

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* per-type badge palette */
  --type-movie:    #7c6cfc;
  --type-show:     #3bbfb0;
  --type-game:     #f0693a;
  --type-book:     #c9a84c;
  --type-music:    #e0609d;
  --type-recipe:   #5bbf6e;
  --type-venue:    #6ab0e8;
  --type-purchase: #b87de0;
  --type-project:  #e8ad40;
  --type-other:    #8a8195;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse 1200px 600px at 80% -10%, rgba(232,117,74,0.10), transparent 60%),
    radial-gradient(ellipse 900px 500px at 10% 110%, rgba(217,178,106,0.06), transparent 60%),
    var(--bg);
}

/* ---------- TOPBAR ---------- */
.topbar {
  padding: 32px clamp(20px, 4vw, 56px) 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(13,11,16,0.96) 0%, rgba(13,11,16,0.85) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.brand-mark {
  font-size: 22px;
  color: var(--accent);
  transform: translateY(2px);
}
.brand h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1;
  font-style: italic;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

/* ---------- PAGE NAV (shareable type lists) ---------- */
.pagenav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
  align-self: center;
}
.pagenav a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.pagenav a:hover { color: var(--text); border-color: var(--accent); background: var(--surface); }
@media (max-width: 600px) { .pagenav { margin-left: 0; width: 100%; } }

/* ---------- CONTROLS ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 12px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.field:focus-within {
  border-color: var(--accent);
  background: var(--surface-2);
}
.field-search { flex: 1 1 240px; min-width: 200px; }
.field-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 0;
  outline: none;
  width: 100%;
  cursor: pointer;
}
.field input { cursor: text; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a8195' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 16px;
}
.field input::placeholder { color: var(--muted); }

.actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: stretch;
}
.btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 18px;
  height: auto;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), color .2s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #1a0d08;
  border-color: var(--accent);
  font-weight: 500;
}
.btn-primary:hover { background: #f08555; border-color: #f08555; color: #1a0d08; }
.import { cursor: pointer; }

/* ---------- GRID (now a column of per-type sections) ---------- */
.grid {
  padding: 40px clamp(20px, 4vw, 56px) 80px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 1800px;
  margin: 0 auto;
}
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 48px 34px;
  perspective: 2000px;
}

/* ---------- SECTION HEADERS ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.section-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-variation-settings: "opsz" 90, "SOFT" 30;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
}
.section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 3px 9px;
}

/* ---------- CARD ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
  transition: transform .35s var(--ease);
  isolation: isolate;
  content-visibility: auto;             /* skip layout/paint for off-screen cards */
  contain-intrinsic-size: 190px 460px;  /* reserved placeholder so scroll stays stable */
}
body[data-owner="true"] .card { cursor: grab; }
body[data-owner="true"] .card:active { cursor: grabbing; }

/* ---------- 3D OBJECT (items on a shelf) ---------- */
/* per-type thickness + spine colour */
.card { --thick: 24px; --spine-a: #2a2333; --spine-b: #15111c; }
.card[data-type="movie"] { --thick: 38px; --spine-a: #2456b8; --spine-b: #102a63; } /* Blu-ray keepcase */
.card[data-type="show"]  { --thick: 46px; --spine-a: #1b7d77; --spine-b: #0c423f; } /* DVD keepcase */
.card[data-type="game"]  { --thick: 50px; --spine-a: #8a3d1c; --spine-b: #3d1608; } /* game box */
.card[data-type="book"]  { --thick: 58px; --spine-a: #6a4a26; --spine-b: #2d2010; } /* book */

.stage {
  position: relative;
  aspect-ratio: 2 / 3;
  perspective: 1400px;
  transition: transform .45s var(--ease);
}
.obj {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(-25deg);
  transition: transform .5s var(--ease);
  /* will-change removed: 1500+ always-on compositor layers was the cost; the
     browser promotes the layer on hover/transition on demand instead. */
}
/* ground shadow under the standing object */
.stage::after {
  content: "";
  position: absolute;
  left: 4%; right: 14%; bottom: -10px; height: 22px;
  background: radial-gradient(ellipse at 45% 50%, rgba(0,0,0,0.6), transparent 70%);
  transform: translateZ(calc(var(--thick) / -2));
  filter: blur(3px);
  z-index: -1;
}

/* FRONT face (cover) */
.poster {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 2px 5px 5px 2px;
  background: repeating-linear-gradient(45deg, #1f1a26 0 2px, #181420 2px 8px);
  /* keepcase shell: outer drop, hard black case edge, top light lip, inner vignette */
  box-shadow:
    var(--shadow-card),
    inset 0 0 0 1.5px rgba(0,0,0,0.6),
    inset 0 1.5px 0 rgba(255,255,255,0.16),
    inset 0 0 26px rgba(0,0,0,0.32);
  transform: translateZ(calc(var(--thick) / 2));
  backface-visibility: hidden;
}
/* clear-plastic sleeve gloss across the cover (hover-independent, 3D-aligned) */
.obj::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px 5px 5px 2px;
  transform: translateZ(calc(var(--thick) / 2 + 0.2px));
  background: linear-gradient(
    113deg,
    rgba(255,255,255,0.26) 0%,
    rgba(255,255,255,0.06) 9%,
    rgba(255,255,255,0) 26%,
    rgba(255,255,255,0) 70%,
    rgba(255,255,255,0.05) 90%,
    rgba(255,255,255,0.12) 100%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 3;
}
/* page-edge sheen on the right of cases/books */
.poster::after { } /* reserved (status check uses it) */
.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter .35s var(--ease);
}
.poster img[src=""], .poster img:not([src]) { opacity: 0; }

/* LEFT face (spine) */
.spine {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: var(--thick);
  background: linear-gradient(90deg, var(--spine-a) 0%, var(--spine-b) 60%, #000 100%);
  transform-origin: left center;
  transform: rotateY(-90deg) translateX(calc(var(--thick) / -2));
  border-radius: 2px 0 0 2px;
  box-shadow: inset -6px 0 12px rgba(0,0,0,0.5), inset 2px 0 2px rgba(255,255,255,0.12);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.spine-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 88%;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
/* paper "pages" block behind the cover for books (right edge) */
.edge-top {
  position: absolute;
  top: 0; right: 0; height: 100%;
  width: calc(var(--thick) - 4px);
  transform-origin: right center;
  transform: rotateY(90deg) translateX(calc(var(--thick) / 2));
  background: repeating-linear-gradient(0deg, #d8cdb6 0 1px, #c2b594 1px 2px);
  opacity: 0;
}
.card[data-type="book"] .edge-top { opacity: 0.9; }

/* ---------- PLACEHOLDER (posterless cards) ---------- */
.poster-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  /* gradient set inline via data-type on .poster */
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}
.placeholder-glyph {
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.placeholder-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 60, "SOFT" 50;
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 0 16px;
  line-height: 1.25;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
/* Show placeholder only when no real poster image is loaded */
.card[data-has-poster="true"] .poster-placeholder { display: none; }

/* gradient scrim — always there subtly, intensifies on hover */
.scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,11,16,0) 40%, rgba(13,11,16,0.85) 100%);
  opacity: 0.55;
  transition: opacity .35s var(--ease);
  pointer-events: none;
}

/* type pill — colored per type */
.card .type {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(13,11,16,0.86);
  padding: 4px 8px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 2;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.card .type:empty { display: none; }
/* per-type color accent on the pill border + text */
.card[data-type="movie"]    .type { border-color: rgba(124,108,252,0.45); color: #b8b0ff; }
.card[data-type="show"]     .type { border-color: rgba(59,191,176,0.45); color: #7dddd5; }
.card[data-type="game"]     .type { border-color: rgba(240,105,58,0.45); color: #ffab80; }
.card[data-type="book"]     .type { border-color: rgba(201,168,76,0.45); color: #e0c97a; }
.card[data-type="music"]    .type { border-color: rgba(224,96,157,0.45); color: #f0a0c8; }
.card[data-type="recipe"]   .type { border-color: rgba(91,191,110,0.45); color: #90dda0; }
.card[data-type="venue"]    .type { border-color: rgba(106,176,232,0.45); color: #94ccf0; }
.card[data-type="purchase"] .type { border-color: rgba(184,125,224,0.45); color: #d0a8f0; }
.card[data-type="project"]  .type { border-color: rgba(232,173,64,0.45); color: #f0c868; }


/* verdict cluster (non-destructive rating) — owner only, appears on hover */
.verdict {
  position: absolute;
  bottom: 8px;                 /* moved off the top-left type pill / top-right badge */
  right: 8px;
  display: flex;
  gap: 5px;
  z-index: 5;                  /* above the rec-badge so the cluster stays clickable */
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
body[data-owner="false"] .verdict { display: none; }   /* guests can't rate */
.card:hover .verdict { opacity: 1; transform: translateY(0); }
.verdict button {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(13,11,16,0.9);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 15px; line-height: 1;
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  filter: grayscale(0.4);
  transition: transform .15s var(--ease), background .2s var(--ease), filter .2s var(--ease), border-color .2s var(--ease);
}
.verdict button:hover { transform: scale(1.12); filter: grayscale(0); background: rgba(13,11,16,0.92); }
/* highlight the active verdict (and keep it visible even when not hovering) */
.card[data-verdict="love"] .verdict,
.card[data-verdict="up"]   .verdict,
.card[data-verdict="down"] .verdict,
.card[data-verdict="skip"] .verdict { opacity: 1; transform: translateY(0); }
.card[data-verdict="love"] .v-love { background: #5a4410; border-color: var(--gold); filter: none; box-shadow: 0 0 10px rgba(217,178,106,0.5); }
.card[data-verdict="up"]   .v-up   { background: #1f5e2a; border-color: #5bbf6e; filter: none; }
.card[data-verdict="down"] .v-down { background: #6e2014; border-color: #e8754a; filter: none; }
.card[data-verdict="skip"] .v-skip { background: #3a3340; border-color: var(--muted); filter: none; }
/* Loved section header gets a gold tint */
.type-section[data-seen="loved"] .section-name { color: var(--gold); }
.type-section[data-seen="loved"] { border-left: 2px solid var(--gold); padding-left: 16px; margin-left: -18px; }

/* owner-only chrome (Export/Import) hidden for guests */
body[data-owner="false"] .owner-only { display: none; }

/* ---------- GUEST VOTING (Recommend / Don't) ---------- */
.gvote { display: none; }   /* hidden unless guest + voting enabled */
body[data-owner="false"][data-voting="on"] .gvote {
  display: flex;
  gap: 6px;
  position: absolute;
  left: 8px; bottom: 8px;
  z-index: 4;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.card:hover .gvote { opacity: 1; transform: translateY(0); }
.gvote button {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(13,11,16,0.92);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 100px;
  padding: 5px 9px;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
.gvote button:hover { transform: scale(1.06); background: rgba(13,11,16,0.95); }
.gvote[data-vote="up"]   .gv-up   { background: #1f5e2a; border-color: #5bbf6e; }
.gvote[data-vote="down"] .gv-down { background: #6e2014; border-color: #e8754a; }

/* friends' recommendation tally badge */
.rec-badge {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: #1a0d08;
  background: var(--gold);
  border-radius: 100px;
  padding: 3px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.rec-badge:empty { display: none; }

/* Played section accent (ember, like the game type) */
.type-section[data-seen="played"] .section-name { color: var(--type-game); }
.type-section[data-seen="played"] { border-left: 2px solid rgba(240,105,58,0.5); padding-left: 16px; margin-left: -18px; }

/* Recommended-by-Friends section accent */
.type-section[data-seen="rec"] .section-name { color: var(--gold); }
.type-section[data-seen="rec"] { border-left: 2px solid var(--gold); padding-left: 16px; margin-left: -18px; }
#lock { font-family: var(--font-mono); font-size: 11px; }

/* seen-it / not-interested collapsible sections */
.seen-section { border-top: 1px dashed var(--line); padding-top: 8px; }
.seen-section > summary { list-style: none; cursor: pointer; }
.seen-section > summary::-webkit-details-marker { display: none; }
.section-caret { margin-left: 8px; font-size: 11px; color: var(--muted); transition: transform .2s var(--ease); display:inline-block; }
.seen-section[open] > summary .section-caret { transform: rotate(180deg); }
.section[data-seen="disliked"] .poster, .seen-section[data-seen="disliked"] .poster img { filter: grayscale(0.5) brightness(0.8); }

/* meta — below poster */
.meta {
  padding: 14px 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meta-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 60;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
  outline: none;
  flex: 1;
  min-width: 0;
}
.title:focus { color: var(--accent); }
.year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.year:empty { display: none; }

.byline {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--gold);
  opacity: 0.85;
  margin: -2px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.byline:empty { display: none; }

.blurb {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
  outline: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blurb:focus {
  -webkit-line-clamp: unset;
  color: var(--text);
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.card .status {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 2px;
  cursor: pointer;
  outline: none;
  flex: 1;
}
.card .status:focus { border-bottom-color: var(--accent); color: var(--text); }

/* inline link in meta row */
.meta-link {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  flex-shrink: 0;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.meta-link:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.card[data-has-link="true"] .meta-link { display: flex; }

/* ---------- GENRE CHIPS ---------- */
.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 3px 9px;
  cursor: pointer;
  line-height: 1.2;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
.chip:active { transform: translateY(1px); }

/* ---------- SUMMARY UNFOLD ---------- */
.summary { margin-top: 2px; }
.summary > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
  padding: 2px 0;
  transition: color .18s var(--ease);
}
.summary > summary::-webkit-details-marker { display: none; }
.summary > summary:hover { color: var(--accent); }
.summary-caret { transition: transform .2s var(--ease); font-size: 9px; }
.summary[open] > summary { color: var(--text); }
.summary[open] .summary-caret { transform: rotate(180deg); }
.summary-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 6px 0 2px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  animation: card-in .25s var(--ease) both;
}

/* ---------- HOVER DELIGHT (settle toward face-on + lift) ---------- */
.card:hover .obj { transform: rotateY(-9deg) translateY(-6px); }
.card:hover .poster { box-shadow: var(--shadow-hover); }
.card:hover .scrim { opacity: 0.82; }

/* ---------- STATUS STATES ---------- */
.card[data-status="todo"] {}

.card[data-status="active"] .poster {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.card[data-status="active"] .poster::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  z-index: 2;
  box-shadow: 0 0 12px var(--accent);
}
.card[data-status="active"] .status { color: var(--accent); border-bottom-color: var(--accent); }

.card[data-status="done"] .poster img { filter: grayscale(0.85) brightness(0.7); }
.card[data-status="done"] .scrim { opacity: 0.75; }
.card[data-status="done"] .title { color: var(--muted); }
.card[data-status="done"] .poster::after {
  content: "✓";
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  background: rgba(13,11,16,0.85);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  z-index: 2;
}

/* dragging */
.card.dragging { opacity: 0.4; }
.card.drag-over .poster { outline: 2px dashed var(--accent); outline-offset: 4px; }

/* ---------- CARD ENTRANCE ANIMATION ---------- */
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}
.card {
  animation: card-in .35s var(--ease) both;
}
/* stagger up to 12 cards; beyond that they all share the final delay */
.card:nth-child(1)  { animation-delay: .02s; }
.card:nth-child(2)  { animation-delay: .05s; }
.card:nth-child(3)  { animation-delay: .08s; }
.card:nth-child(4)  { animation-delay: .11s; }
.card:nth-child(5)  { animation-delay: .14s; }
.card:nth-child(6)  { animation-delay: .17s; }
.card:nth-child(7)  { animation-delay: .20s; }
.card:nth-child(8)  { animation-delay: .22s; }
.card:nth-child(9)  { animation-delay: .24s; }
.card:nth-child(10) { animation-delay: .26s; }
.card:nth-child(11) { animation-delay: .27s; }
.card:nth-child(12) { animation-delay: .28s; }

/* ---------- EMPTY STATE ---------- */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
  text-align: center;
  animation: card-in .4s var(--ease) both;
}
.empty-glyph {
  font-size: 52px;
  line-height: 1;
  opacity: 0.5;
}
.empty-msg {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 60, "SOFT" 30;
  font-size: 22px;
  color: var(--muted);
  margin: 0;
}
.empty-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
  margin: 0;
}

/* ---------- SUGGESTION MODAL ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,6,11,0.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 20px;
  animation: card-in .2s var(--ease) both;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  width: min(440px, 100%);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-card h3 {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-variation-settings: "opsz" 80; font-size: 26px; margin: 0; color: var(--text);
}
.modal-sub { margin: -6px 0 4px; color: var(--muted); font-size: 13px; }
.modal-card input, .modal-card textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body); font-size: 14px; padding: 10px 12px;
  outline: none; resize: vertical; width: 100%;
}
.modal-card input:focus, .modal-card textarea:focus { border-color: var(--accent); }
.modal-card input::placeholder, .modal-card textarea::placeholder { color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.modal-msg { margin: 4px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--accent); min-height: 1em; }

/* ---------- FOOTER ---------- */
.footer {
  padding: 24px clamp(20px, 4vw, 56px) 40px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
}
.count { color: var(--text); }
.dot { opacity: 0.4; }

/* ---------- PLAYTIME CHIP + SURPRISE PICKER ---------- */
.playtime {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--type-game);
  margin: -2px 0 2px;
}
.playtime:empty { display: none; }

.surprise-card { width: min(460px, 100%); }
.surprise-pick { display: flex; gap: 16px; align-items: flex-start; margin: 4px 0 2px; }
.surprise-pick img { width: 116px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; box-shadow: var(--shadow-card); background: var(--surface-2); }
.surprise-meta { min-width: 0; }
.surprise-title { font-family: var(--font-display); font-style: italic; font-size: 22px; line-height: 1.12; color: var(--text); }
.surprise-year { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 3px; }
.surprise-blurb { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 8px 0 0; max-height: 7.5em; overflow: hidden; }
.surprise-link { display: inline-block; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--accent); text-decoration: none; }
.surprise-link:hover { text-decoration: underline; }
.surprise-link[hidden] { display: none; }

/* ---------- GUEST INTRO ---------- */
.intro {
  max-width: 1800px;
  margin: 28px auto 0;
  padding: 0 clamp(20px, 4vw, 56px);
}
.intro[hidden] { display: none; }
.intro-body {
  position: relative;
  background: linear-gradient(120deg, rgba(232,117,74,0.09) 0%, rgba(217,178,106,0.06) 100%);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 18px 48px 18px 22px;
  animation: card-in .35s var(--ease) both;
}
.intro-h {
  font-family: var(--font-display);
  font-style: italic; font-weight: 400;
  font-variation-settings: "opsz" 80, "SOFT" 30;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.1;
  margin: 0 0 6px;
  color: var(--text);
}
.intro-p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.intro-list {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 6px 24px;
}
.intro-list li { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.intro-list strong { color: var(--text); font-weight: 600; }
.intro-list a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(217,178,106,0.4); }
.intro-list a:hover { color: #f0cd86; border-bottom-color: var(--gold); }
.intro-note {
  margin: 12px 0 0;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); opacity: 0.72;
}
.intro-x {
  position: absolute; top: 12px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer;
  font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.intro-x:hover { color: var(--text); border-color: var(--muted); background: var(--surface-2); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .grid {
    gap: 28px;
    padding: 24px 16px 60px;
  }
  .section-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 22px 14px;
  }
  .section-name { font-size: 20px; }
  .title { font-size: 16px; }
  .blurb { font-size: 12px; -webkit-line-clamp: 2; }
  .actions { margin-left: 0; width: 100%; }
  .actions .btn { flex: 1; justify-content: center; }
  .brand-sub { display: none; }

  /* card overlays: shrink the top pills and drop the rating / vote clusters to
     the bottom corners so nothing collides on narrow cards. Touch has no hover,
     so the clusters are always visible here (the active verdict already was). */
  .card .type { top: 8px; left: 8px; font-size: 8.5px; padding: 3px 7px; letter-spacing: 0.12em; }
  .rec-badge { top: 8px; right: 8px; font-size: 9px; padding: 2px 7px; }
  .verdict {
    left: auto; right: 8px; bottom: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    max-width: 80px;            /* forces the 4 buttons into a tidy 2x2 block */
    opacity: 1;
    transform: none;
  }
  .verdict button { width: 34px; height: 34px; font-size: 16px; }
  body[data-owner="false"][data-voting="on"] .gvote {
    left: 8px; right: 8px; bottom: 8px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 1;
    transform: none;
  }
}

/* Touch devices have no hover, so a width breakpoint isn't enough — any
   no-hover pointer (phones AND tablets/landscape over 600px) gets the rating /
   vote clusters permanently shown, docked bottom and wrapped to 2x2 so they're
   usable and never hidden behind a hover that can't happen. */
@media (hover: none) {
  .verdict {
    top: auto; left: auto; right: 8px; bottom: 8px;
    flex-wrap: wrap; justify-content: flex-end; gap: 7px;
    max-width: 84px;
    opacity: 1; transform: none;
  }
  .verdict button { width: 34px; height: 34px; font-size: 16px; }
  body[data-owner="false"][data-voting="on"] .gvote {
    left: 8px; right: 8px; bottom: 8px;
    justify-content: center; flex-wrap: wrap;
    opacity: 1; transform: none;
  }
}

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

/* ---------- Screenshot inbox (owner review) ---------- */
.inbox-intro { margin: 8px 0 28px; max-width: 760px; }
.inbox-lede { color: var(--muted); margin: 6px 0 10px; line-height: 1.5; }
.inbox-status { color: var(--muted); font-size: 0.85rem; margin: 0 0 12px; min-height: 1.2em; }
.inbox-upload { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.inbox-upload-msg { color: var(--muted); font-size: 0.85rem; margin-top: 8px; min-height: 1.2em; }
.review-bar { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(255,255,255,0.12); }
.review-context { font-size: 0.8rem; line-height: 1.4; color: var(--text); margin: 0 0 4px; overflow-wrap: anywhere; }
.review-meta { font-size: 0.72rem; color: var(--muted); margin: 0 0 8px; }
.review-actions { display: flex; gap: 8px; }
.review-actions .btn { flex: 1; min-height: 40px; }
.card.reviewed { opacity: 0.35; transition: opacity .2s ease; }
.type-section[data-seen="inbox"] .section-name { color: var(--gold); }

/* ---------- Software: app icons / repo cards on a tinted tile ---------- */
.card[data-type="software"] .poster { background: radial-gradient(120% 90% at 50% 30%, #1d4a47 0%, #0c2a2a 70%); }
.card[data-type="software"] .poster img { object-fit: contain; padding: 22% 16%; filter: drop-shadow(0 10px 22px rgba(0,0,0,0.45)); }

/* ---------- Review flow: obvious on phones ---------- */
.nav-badge { display: inline-block; min-width: 1.5em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: #1a0d08; font-weight: 700; font-size: 0.75em; line-height: 1.5; text-align: center; }
.inbox-banner { display: flex; align-items: center; gap: 14px; margin: 4px 0 26px; padding: 16px 18px; border-radius: 14px; text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, rgba(232,117,74,0.22), rgba(217,178,106,0.12)); border: 1px solid var(--accent); min-height: 64px; }
.inbox-banner:hover { background: linear-gradient(135deg, rgba(232,117,74,0.32), rgba(217,178,106,0.18)); }
.inbox-banner-icon { font-size: 1.8rem; }
.inbox-banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.inbox-banner-text span { color: var(--muted); font-size: 0.85rem; }
.inbox-banner-go { font-weight: 700; color: var(--accent); white-space: nowrap; }
.inbox-unlock { min-height: 48px; font-size: 1rem; margin: 4px 0 12px; }
body[data-owner="true"] .inbox-unlock { display: none; }
body[data-view="inbox"] .gvote, body[data-view="inbox"] .verdict { display: none !important; }
.review-actions { display: flex; gap: 10px; }
.review-actions .btn { flex: 1; min-height: 48px; font-size: 1rem; letter-spacing: 0.04em; }
@media (max-width: 600px) {
  .review-actions .btn { min-height: 52px; }
  .inbox-banner { margin: 0 0 20px; }
}

/* PWA: respect the notch and home indicator in standalone mode */
.topbar {
  padding-top: calc(32px + env(safe-area-inset-top, 0px));
  padding-left: max(clamp(20px, 4vw, 56px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(20px, 4vw, 56px), env(safe-area-inset-right, 0px));
}
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
}
