/* RateCharacters */

:root {
  --bg: #26272b;          /* graphite, not black */
  --raise: #2f3035;
  --raise-2: #37383e;
  --raise-3: #44454c;
  --line: #3f4046;
  --bar: #1e1f22;         /* name bars under the tiles */
  --text: #efeee9;
  --text-2: #b7b8bd;
  --dim: #909197;
  --gold: #f2b33d;
  --gold-ink: #24190a;
  --oxblood: #8a3127;
  --star-off: #4a4b52;
  --page: min(1360px, 100% - 56px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto Flex", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { width: var(--page); margin: 0 auto; flex: 1; }

a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--gold); color: var(--gold-ink); padding: 8px 14px; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- Header ---------- */

.site-head {
  width: var(--page);
  margin: 0 auto;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.brand { display: flex; flex-direction: column; align-items: flex-start; }
.brand-link { display: block; line-height: 0; border-radius: 6px; -webkit-user-drag: none; user-select: none; }
.logo-mark { height: 40px; width: auto; display: block; overflow: visible; }
.logo-face { stroke: var(--gold); }
.logo-shade { stroke: var(--oxblood); }
.byline {
  margin: 3px 0 0 9px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.head-right { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.total {
  margin: 0;
  font-family: Roboto, "Roboto Flex", system-ui, sans-serif;
  font-size: 13px;
  color: var(--dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Search and the TV / Movies choice ---------- */

.finder { margin: 52px auto 34px; text-align: center; }
.finder-compact { margin: 8px auto 32px; }

.search { position: relative; width: min(600px, 100%); margin: 0 auto; display: flex; align-items: center; }
.search input {
  width: 100%;
  height: 52px;
  padding: 0 18px 0 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--raise);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .18s ease, background-color .18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: #696a71; background: var(--raise-2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.icon-search {
  position: absolute; left: 16px; width: 20px; height: 20px;
  fill: none; stroke: var(--dim); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}

.search-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  background: var(--raise); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; text-align: left; max-height: min(70vh, 560px); overflow: auto;
  box-shadow: 0 22px 48px rgba(0, 0, 0, .38);
  animation: panel-in .14s ease-out;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } }
.sp-head { padding: 10px 10px 4px; font-size: 12px; color: var(--dim); }
.sp-item {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px;
  border-radius: 8px; text-decoration: none; color: var(--text); outline: none;
}
.sp-item:hover, .sp-item:focus-visible { background: var(--raise-2); }
.sp-thumb { flex: none; width: 64px; height: 36px; border-radius: 4px; background: var(--raise-3); object-fit: cover; }
.sp-thumb.is-person { width: 36px; height: 45px; object-position: 50% 18%; }
.sp-text { min-width: 0; display: flex; flex-direction: column; }
.sp-name { font-size: 14px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-meta { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-all { display: block; margin-top: 4px; padding: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); text-decoration: none; border-radius: 0 0 8px 8px; }
.sp-all:hover, .sp-all:focus-visible { color: var(--text); background: var(--raise-2); }
.sp-none { padding: 14px 10px; font-size: 14px; color: var(--text-2); }

.kinds {
  display: inline-flex;
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border-radius: 999px;
  background: var(--raise);
  border: 1px solid var(--line);
}
.kind {
  min-width: 132px;
  padding: 11px 26px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 18px;
  font-weight: 750;
  font-stretch: 125%;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: background-color .2s ease, color .2s ease;
}
.kind:hover { color: var(--text); background: var(--raise-2); }
.kind[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.kind-note { margin-top: 12px; font-size: 13px; color: var(--dim); }

/* ---------- Title tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr));
  gap: 16px;
  transition: opacity .16s ease;
}
.tiles.is-swapping, .cards.is-swapping { opacity: 0; }

.tile {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bar);
  text-decoration: none;
  color: var(--text);
}
.tile-art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--raise-2);
}
.tile-art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s ease;
}
.tile:hover .tile-art img { transform: scale(1.035); }
.tile-label { display: block; padding: 11px 12px 13px; text-align: center; }
.tile-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 15px; font-weight: 500; line-height: 1.3;
}
.tile-meta { display: block; margin-top: 3px; font-size: 12px; color: var(--dim); }
.tiles-note { grid-column: 1 / -1; text-align: center; color: var(--text-2); padding: 48px 0; }

/* Shown behind every picture, and on its own when there's no picture. */
.initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; font-stretch: 125%; color: #5a5b62; letter-spacing: 0.02em;
}
.tile-art img, .card-art img, .person-art img, .world-art img { z-index: 1; }

.js img.fade { opacity: 0; }
.js img.fade.loaded { opacity: 1; }

/* ---------- Back link ---------- */

.crumbs { margin: 28px 0 18px; }
.crumbs a {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-2); text-decoration: none; font-size: 14px; padding: 4px 6px 4px 0;
}
.crumbs a:hover { color: var(--text); }
.icon-back { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- A title's page ---------- */

.world-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}
.world-art {
  position: relative; display: block; aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden; background: var(--raise-2);
}
.world-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.world-info h1 {
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.world-meta { margin-top: 12px; color: var(--text-2); font-size: 15px; }
.world-overview, .world-includes {
  margin-top: 14px; color: var(--text-2); font-size: 15px; line-height: 1.6; max-width: 62ch;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}

.cast-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 44px 0 16px; }
.cast-head h2, .more-from h2, .results h2 { font-size: 22px; font-weight: 750; font-stretch: 112%; }

.sort { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); }
.sort button {
  border: 0; background: none; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background-color .18s ease, color .18s ease;
}
.sort button:hover { color: var(--text); }
.sort button[aria-pressed="true"] { background: var(--raise-3); color: var(--text); }

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 16px;
  transition: opacity .14s ease;
}
.card {
  display: flex; flex-direction: column;
  border-radius: 8px; overflow: hidden;
  background: var(--raise); color: var(--text); text-decoration: none;
}
.card-art { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--raise-2); }
.card-art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s ease;
}
.card:hover .card-art img { transform: scale(1.035); }
.card-body { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px 12px; flex: 1; }
.card-name { font-size: 15px; font-weight: 600; line-height: 1.25; }
.card-score { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.card-score b { color: var(--text); font-weight: 600; }
.card-score.is-none { color: var(--dim); }
.icon-star { width: 14px; height: 14px; fill: var(--gold); flex: none; }
.card-rate {
  margin-top: auto; display: block; text-align: center;
  padding: 8px 10px; border-radius: 6px; background: var(--raise-3);
  font-size: 14px; font-weight: 600;
  transition: background-color .18s ease, color .18s ease;
}
.card-score + .card-rate { margin-top: 8px; }
.card:hover .card-rate, .card:focus-visible .card-rate { background: var(--gold); color: var(--gold-ink); }

/* ---------- A character's page ---------- */

.person { max-width: 640px; margin: 4px auto 0; text-align: center; }
.person-media { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 14px; }
.person-art {
  position: relative; display: block; width: min(260px, 54vw); aspect-ratio: 4 / 5; margin: 0 auto;
  border-radius: 12px; overflow: hidden; background: var(--raise-2);
}
.person-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.person h1 {
  margin-top: 22px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.person-credit { margin-top: 6px; color: var(--text-2); font-size: 15px; }

.rate { margin-top: 26px; }
.rate fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.stars { display: inline-flex; gap: 5px; touch-action: manipulation; }
.star { position: relative; display: block; width: 36px; height: 36px; border-radius: 6px; cursor: pointer; }
.star svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 55%; }
.star input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.fill { fill: var(--star-off); transition: fill .12s ease; }
.fill.on { fill: var(--gold); }
.star:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.star.bump svg { animation: pop .3s cubic-bezier(.2, .7, .2, 1); }
@keyframes pop { 40% { transform: scale(1.2); } }

.rate-save { margin: 14px auto 0; }
.js .rate-save { display: none; }
.rate-status { margin-top: 10px; min-height: 1.5em; font-size: 14px; color: var(--text-2); transition: color .2s ease; }
.rate-status.is-saved { color: var(--text); }
.rate-status.is-error { color: #f0a090; }

.fans {
  display: inline-block; min-width: 260px; margin-top: 24px; padding: 18px 26px 16px;
  border-radius: 12px; background: var(--raise);
}
.fans-score { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.comments-link {
  display: block; margin: 12px auto 0; padding: 4px 6px; border: 0; background: none; cursor: pointer;
  color: var(--text); font-size: 14px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #6b6c72;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.comments-link:hover { color: var(--gold); text-decoration-color: var(--gold); }
.fans-score [data-avg] { font-size: 42px; font-weight: 800; font-stretch: 112%; line-height: 1; font-variant-numeric: tabular-nums; }
.fans-score.is-none [data-avg] { font-size: 20px; font-weight: 700; }
.fans-out { font-size: 15px; color: var(--text-2); }
.fans-count { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.source { margin-top: 16px; font-size: 12px; color: var(--dim); }
.source a { color: var(--text-2); }

.more-from { margin-top: 64px; }
.more-from h2 { margin-bottom: 16px; }

/* ---------- Search page, empty states, text pages ---------- */

.results + .results { margin-top: 44px; }
.results h2 { margin-bottom: 16px; }

.empty { text-align: center; padding: 64px 16px; color: var(--text-2); }
.empty-title { font-size: 21px; font-weight: 750; font-stretch: 112%; color: var(--text); margin-bottom: 6px; }
.empty-404 .search { margin: 24px auto 18px; }
.empty a { color: var(--text); }

.prose { max-width: 66ch; margin: 0 auto; }
.prose h1 { font-size: 40px; font-weight: 800; font-stretch: 115%; margin-bottom: 18px; }
.prose h2 { font-size: 20px; font-weight: 700; margin: 28px 0 8px; }
.prose p { color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }

.message { max-width: 520px; margin: 18vh auto; text-align: center; padding: 0 20px; }
.message h1 { font-size: 26px; margin-bottom: 8px; }
.message p { color: var(--text-2); }


/* ---------- Icons and buttons ---------- */

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
  font: inherit; font-size: 14px; font-weight: 650; line-height: 1.2;
  transition: background-color .15s ease, color .15s ease, transform .1s ease, opacity .15s ease;
}
.btn .icon { width: 18px; height: 18px; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover:not(:disabled) { background: #f6c35c; }
.btn-ghost { background: var(--raise-3); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: #4f5058; }
.btn-danger { background: transparent; color: #f0a090; box-shadow: inset 0 0 0 1px #6a3a33; }
.btn-danger:hover { background: rgba(240, 160, 144, .08); }

.icon-btn {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--raise); color: var(--text); }
.icon-btn .icon { width: 22px; height: 22px; }

/* ---------- Account controls (top right) ---------- */

.login-link {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease;
}
.login-link:hover { background: var(--raise); border-color: #55565d; }
.account { position: relative; display: flex; align-items: center; gap: 6px; }
.bell .dot {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--gold); color: var(--gold-ink); font-size: 10px; font-weight: 800; line-height: 1;
}
.avatar-btn {
  width: 36px; height: 36px; padding: 0; border: 2px solid transparent; border-radius: 50%;
  background: none; cursor: pointer; transition: border-color .15s ease;
}
.avatar-btn img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: var(--raise-3); }

.pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 40;
  width: min(320px, calc(100vw - 32px)); padding: 6px;
  background: var(--raise); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, .38);
  animation: panel-in .14s ease-out;
}
.pop-notes { width: min(360px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow: auto; }
.pop-title { padding: 8px 10px 6px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.pop-empty { padding: 14px 10px; font-size: 14px; color: var(--text-2); }
.note {
  position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px;
  border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.4;
}
.note:hover { background: var(--raise-2); }
.note img { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.note small { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); }
.note.is-unread { background: rgba(242, 179, 61, .07); }
.note.is-unread::after { content: ""; position: absolute; top: 14px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.pop-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pop-who img { border-radius: 50%; }
.pop-who b { display: block; font-size: 15px; }
.pop-who small { display: block; font-size: 12px; color: var(--gold); }
.pop-menu a, .pop-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); text-decoration: none; font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.pop-menu a:hover, .pop-menu button:hover { background: var(--raise-2); }
.pop-menu .icon { width: 18px; height: 18px; color: var(--text-2); }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: auto;
  border-radius: 999px; background: var(--raise-3); color: var(--text); font-size: 12px; font-weight: 700;
}
.pop-menu .count { background: var(--gold); color: var(--gold-ink); }

/* ---------- Character page buttons ---------- */

.person-actions { display: flex; flex-direction: column; gap: 10px; justify-self: start; }
.act {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: var(--raise); color: var(--text);
  cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .12s ease, border-color .15s ease;
}
.act:hover { background: var(--raise-2); border-color: #55565d; }
.act:active { transform: scale(.94); }
.act .icon { width: 21px; height: 21px; }
.act-heart[aria-pressed="true"] { color: #ec5b56; border-color: #5c3533; }
.act-heart[aria-pressed="true"] .icon { fill: currentColor; }
.act.bump .icon { animation: pop .3s cubic-bezier(.2, .7, .2, 1); }

.card-season {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  padding: 3px 7px; border-radius: 6px; background: rgba(16, 16, 19, .62);
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1.3;
}
.card-sub { margin-top: -3px; font-size: 12px; color: var(--dim); }

.mod-row { display: flex; justify-content: center; margin-top: 28px; }

/* ---------- On-screen panels ---------- */

dialog.sheet {
  width: min(440px, calc(100% - 32px)); max-height: min(86vh, 720px); padding: 0 0 22px; overflow: auto;
  border: 0; border-radius: 16px; background: var(--raise); color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
dialog.sheet::backdrop { background: rgba(12, 12, 14, .58); }
dialog.sheet[open] { animation: sheet-in .22s cubic-bezier(.2, .7, .2, 1); }
dialog.sheet.is-closing { animation: sheet-out .15s ease-in forwards; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(8px) scale(.985); } }

dialog.sheet-side {
  margin: 0 0 0 auto; width: min(460px, 100%); height: 100%; max-height: 100%;
  border-radius: 16px 0 0 16px; display: none; flex-direction: column; padding-bottom: 0;
}
dialog.sheet-side[open] { display: flex; animation: side-in .26s cubic-bezier(.2, .7, .2, 1); }
dialog.sheet-side.is-closing { animation: side-out .16s ease-in forwards; }
@keyframes side-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes side-out { to { transform: translateX(40px); opacity: 0; } }

.sheet-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 12px 10px 20px; background: var(--raise);
}
.sheet-head h2 { font-size: 19px; font-weight: 750; font-stretch: 112%; }
.sheet-note { padding: 0 20px; margin-bottom: 16px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.sheet-note + .btn { margin: 0 20px; }
.sheet-label { padding: 0 20px; margin: 18px 0 8px; font-size: 13px; color: var(--dim); }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg); }
.tabs button {
  border: 0; background: none; cursor: pointer; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 650; color: var(--text-2); transition: background-color .15s ease, color .15s ease;
}
.tabs button[aria-pressed="true"] { background: var(--raise-3); color: var(--text); }

.auth-form { display: grid; gap: 14px; padding: 4px 20px 0; }
.field span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; outline: none;
  transition: border-color .15s ease;
}
.field input:focus { border-color: #6f7077; }
.form-msg { min-height: 1.3em; font-size: 13px; color: var(--text-2); }
.form-msg.is-error { color: #f0a090; }
.form-msg.is-ok { color: #8fd6a3; }
.fine { font-size: 12px; line-height: 1.5; color: var(--dim); }

.share-text { margin: 0 20px 14px; padding: 12px 14px; border-radius: 10px; background: var(--raise-2); font-size: 15px; line-height: 1.45; }
.share-link { display: flex; gap: 8px; padding: 0 20px; }
.share-link input {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text-2); font: inherit; font-size: 14px;
}
.apps { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px; }
.app {
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--raise-2);
  color: var(--text); text-decoration: none; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background-color .15s ease;
}
.app:hover { background: var(--raise-3); }

.picture-form { display: grid; gap: 12px; padding: 0 20px; }
.drop {
  position: relative; display: grid; place-items: center; min-height: 190px; overflow: hidden;
  border: 1.5px dashed #5b5c63; border-radius: 12px; background: var(--bg); cursor: pointer;
  transition: border-color .15s ease;
}
.drop:hover, .drop:focus-within { border-color: var(--gold); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { width: 100%; max-height: 280px; object-fit: contain; }
.drop-text { display: grid; justify-items: center; gap: 4px; padding: 20px; color: var(--text-2); font-size: 14px; text-align: center; }
.drop-text .icon { width: 28px; height: 28px; }
.drop-text small { font-size: 12px; color: var(--dim); }
.my-pictures { display: grid; gap: 8px; padding: 16px 20px 0; }
.my-pictures:empty { display: none; }
.mine { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; background: var(--raise-2); font-size: 13px; color: var(--text-2); }
.mine img, .mine .ph { width: 40px; height: 50px; border-radius: 6px; object-fit: cover; background: var(--raise-3); flex: none; }
.chip { margin-left: auto; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip-pending { background: rgba(242, 179, 61, .16); color: var(--gold); }
.chip-approved { background: rgba(120, 200, 140, .16); color: #8fd6a3; }
.chip-rejected { background: rgba(240, 160, 144, .14); color: #f0a090; }

/* Comments */
.comment-sort { align-self: flex-start; margin: 0 20px 12px; }
.compose { display: flex; gap: 10px; padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.compose-main { flex: 1; min-width: 0; }
.compose textarea {
  width: 100%; min-height: 66px; padding: 10px 12px; resize: vertical;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: 15px; line-height: 1.45; outline: none; transition: border-color .15s ease;
}
.compose textarea:focus { border-color: #6f7077; }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.compose-login { padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.comment-list { flex: 1; overflow: auto; padding: 4px 12px 24px; }
.comment { display: flex; gap: 10px; padding: 12px 8px; border-bottom: 1px solid rgba(255, 255, 255, .045); }
.comment.is-new { animation: comment-in .35s cubic-bezier(.2, .7, .2, 1); }
.comment.is-gone { opacity: 0; transform: translateX(16px); transition: opacity .2s ease, transform .2s ease; }
@keyframes comment-in { from { opacity: 0; transform: translateY(-6px); } }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12px; color: var(--dim); }
.comment-head b { font-size: 14px; font-weight: 650; color: var(--text); }
.mod-badge { padding: 1px 6px; border-radius: 4px; background: var(--gold); color: var(--gold-ink); font-size: 10px; font-weight: 800; }
.comment-body { margin-top: 3px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; align-items: center; gap: 2px; margin-top: 6px; margin-left: -8px; }
.vote {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background-color .15s ease, color .15s ease;
}
.vote:hover { background: var(--raise-2); color: var(--text); }
.vote .icon { width: 18px; height: 18px; }
.vote[data-vote="1"][aria-pressed="true"] { color: var(--gold); }
.vote[data-vote="1"][aria-pressed="true"] .icon { fill: rgba(242, 179, 61, .22); }
.vote[data-vote="-1"][aria-pressed="true"] { color: #f0a090; }
.vote[data-vote="-1"][aria-pressed="true"] .icon { fill: rgba(240, 160, 144, .2); }
.vote.bump .icon { animation: pop .3s cubic-bezier(.2, .7, .2, 1); }
.comment-delete { margin-left: auto; padding: 5px 9px; border: 0; border-radius: 999px; background: none; color: var(--dim); font: inherit; font-size: 12px; cursor: pointer; }
.comment-delete:hover { color: #f0a090; background: rgba(240, 160, 144, .08); }

/* ---------- Hearts, login and mod pages ---------- */

.page-head { margin: 4px 0 18px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; font-stretch: 115%; line-height: 1.05; }
.page-mod .page-head { margin-top: 28px; }

.auth-page { max-width: 780px; margin: 0 auto; }
.auth-page h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; font-stretch: 115%; margin-bottom: 24px; }
.auth-page h2 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.auth-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.auth-page .auth-form { padding: 0; }

.mod-tabs { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.mod-tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 650;
}
.mod-tabs a:hover { color: var(--text); }
.mod-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }
.mod-tabs .count { margin-left: 0; }

.req-list { display: grid; gap: 14px; }
.req {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
  padding: 14px; border-radius: 12px; background: var(--raise);
  transition: opacity .25s ease, transform .25s ease;
}
.req.is-done, .down-item.is-done { opacity: 0; transform: scale(.98); }
.req-pics { display: flex; gap: 10px; }
.req figure { margin: 0; text-align: center; }
.req-art { position: relative; display: block; width: 120px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--raise-2); }
.req-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.req figcaption { margin-top: 5px; font-size: 12px; color: var(--dim); }
.req-name a { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; }
.req-name a:hover { text-decoration: underline; }
.req-meta { margin-top: 2px; font-size: 14px; color: var(--text-2); }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.down-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.down-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--raise);
  transition: opacity .25s ease, transform .25s ease;
}
.down-art { position: relative; display: block; width: 44px; height: 55px; border-radius: 6px; overflow: hidden; background: var(--raise-2); flex: none; }
.down-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.down-art .initials { font-size: 14px; }
.down-text { flex: 1; display: grid; min-width: 0; }
.down-text small { font-size: 13px; color: var(--dim); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; background: #f2f1ec; color: #1f1f22;
  font-size: 14px; font-weight: 650; box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
  animation: toast-in .22s cubic-bezier(.2, .7, .2, 1);
}
.toast.is-gone { opacity: 0; transition: opacity .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Top characters and mod forms ---------- */

.top-link {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  color: var(--gold); text-decoration: none;
  font-size: 22px; font-weight: 850; font-stretch: 125%; letter-spacing: .04em;
  transition: color .15s ease, transform .15s ease;
}
.top-link .icon-star { width: 20px; height: 20px; }
.top-link:hover { color: #f6c35c; transform: translateY(-1px); }

.mod-add {
  display: grid; gap: 12px; max-width: 480px; margin: 40px auto 0; padding: 20px;
  border-radius: 12px; background: var(--raise);
}
.mod-add h2 { font-size: 19px; font-weight: 750; }
.mod-add-page { margin: 0; }
.mod-add .kinds { margin: 0; justify-self: start; }
.mod-add .kind { min-width: 0; font-size: 15px; padding: 8px 18px; cursor: pointer; }
.mod-add .kind input { position: absolute; opacity: 0; }
.mod-add .kind:has(input:checked) { background: var(--gold); color: var(--gold-ink); }
.form-msg a { color: var(--text); }

/* ---------- Home: sort and showcase ---------- */

.finder { position: relative; }
.home-sort { display: flex; width: max-content; margin: 0 0 14px; }
.showcase {
  position: absolute; top: -10px; right: 0; display: flex; gap: 14px; align-items: stretch;
  width: 300px; padding: 12px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; text-align: left;
  transition: opacity .45s ease, border-color .2s ease;
}
.showcase:hover { border-color: #55565d; }
.showcase.is-fading { opacity: 0; }
.showcase-art { position: relative; flex: none; width: 96px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--raise-2); }
.showcase-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; z-index: 1; }
.showcase-art .initials { font-size: 22px; }
.showcase-text { display: flex; flex-direction: column; min-width: 0; padding: 2px 0; }
.showcase-score { font-size: 34px; font-weight: 850; font-stretch: 115%; line-height: 1; color: var(--gold); }
.showcase-name { margin-top: 8px; font-size: 16px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.showcase-world { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.showcase-label { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; font-size: 13px; font-weight: 850; font-stretch: 125%; letter-spacing: .06em; color: var(--text-2); }
.showcase-label .icon-star { width: 13px; height: 13px; }
@media (max-width: 1180px) {
  .showcase { position: static; margin: 22px auto 0; width: min(340px, 100%); }
}

.or { text-align: center; font-size: 12px; color: var(--dim); }
.link-input {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px; outline: none;
}
.link-input:focus { border-color: #6f7077; }

/* ---------- Footer ---------- */

.site-foot {
  width: var(--page);
  margin: 80px auto 0;
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
}
.site-foot p + p { margin-top: 8px; }
.site-foot a { color: var(--text-2); }

/* ---------- Page transitions ---------- */

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
::view-transition-group(*) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  :root { --page: calc(100% - 32px); }
  .site-head { padding-top: 16px; }
  .logo-mark { height: 28px; }
  .byline { margin-left: 6px; font-size: 10px; }
  .total { margin-top: 5px; font-size: 12px; }
  .finder { margin: 34px auto 26px; }
  .kinds { margin-top: 18px; }
  .kind { min-width: 112px; padding: 10px 20px; font-size: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile-label { padding: 9px 8px 10px; }
  .tile-name { font-size: 14px; }
  .world-head { grid-template-columns: 1fr; gap: 20px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cards-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .cards-row .card { scroll-snap-align: start; }
  .stars { gap: 3px; }
  .star { width: 29px; height: 29px; }
  .person-media { gap: 10px; }
  .person-art { width: min(220px, 52vw); }
  .act { width: 40px; height: 40px; }
  .head-right { flex-direction: column; align-items: flex-end; gap: 4px; margin-top: 0; }
  .head-right .total { order: 2; font-size: 11px; }
  .login-link { padding: 6px 12px; font-size: 13px; }
  dialog.sheet, dialog.sheet-side {
    margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88vh; height: auto;
    border-radius: 18px 18px 0 0;
  }
  dialog.sheet-side { height: 88vh; }
  dialog.sheet[open], dialog.sheet-side[open] { animation: up-in .26s cubic-bezier(.2, .7, .2, 1); }
  dialog.sheet.is-closing, dialog.sheet-side.is-closing { animation: up-out .16s ease-in forwards; }
  .auth-columns { grid-template-columns: 1fr; }
  .req { grid-template-columns: 1fr; }
  .req-art { width: 100px; }
}
@keyframes up-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes up-out { to { transform: translateY(40px); opacity: 0; } }

@media (max-width: 400px) {
  .star { width: 27px; height: 27px; }
  .stars { gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
