:root {
  --bg: #14171b;
  --panel: #1a1e23;
  --panel-2: #21262c;
  --line: #272d34;
  --line-strong: #3a424b;
  --text: #e6e8ea;
  --muted: #929aa3;
  --faint: #656d77;
  --accent: #63a685;
}

* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }

*::-webkit-scrollbar { width: 0; height: 0; display: none; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  background-image:
    radial-gradient(900px 460px at 20% -120px, rgba(99, 166, 133, .07), transparent 70%),
    radial-gradient(1100px 620px at 85% 0, rgba(88, 116, 150, .09), transparent 72%),
    linear-gradient(180deg, #1a1e24 0%, var(--bg) 46%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .62), transparent 22%, transparent 78%, rgba(0, 0, 0, .62)),
    linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 16%, transparent 76%, rgba(0, 0, 0, .68));
}

body {
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 1px solid var(--line-strong); outline-offset: 3px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.topbar {
  background: rgba(20, 23, 27, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 19px;
}

.topbar-links { display: flex; gap: 22px; }

.topbar-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color .18s ease;
}

.topbar-links a:hover { color: var(--text); }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.hero { padding: 46px 0 26px; border-bottom: 1px solid var(--line); }

.hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  animation: rise .45s cubic-bezier(.22,.61,.36,1) both;
}

.hero-copy h1 {
  font-family: "Prompt", sans-serif;
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 600;
  line-height: 1.2;
  max-width: 460px;
}

.hero-copy p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: 440px;
}

.stat-block {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.stat span {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat label {
  font-size: 11px;
  color: var(--faint);
}

.bar {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: 18px;
  animation: rise .45s cubic-bezier(.22,.61,.36,1) .06s both;
}

.tabs { display: flex; gap: 18px; }

.tab {
  background: none;
  border: none;
  padding: 0;
  color: var(--faint);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color .16s ease;
}

.tab:hover { color: var(--muted); }
.tab.is-on { color: var(--text); }

.order { margin-right: auto; color: var(--muted); }
.order:hover { color: var(--text); }
.order[data-order="stale"] { color: var(--accent); }

#search {
  width: 180px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 4px 0;
  transition: border-color .18s ease;
}

#search::placeholder { color: var(--faint); }
#search:focus { outline: none; border-bottom-color: var(--line-strong); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 10px;
}

.card {
  background: rgba(26, 30, 35, .6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
  animation: rise .3s cubic-bezier(.22,.61,.36,1) both;
  transition: background .16s ease, border-color .16s ease;
}

.card:hover { background: rgba(33, 38, 44, .9); border-color: var(--line-strong); }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--panel-2);
  flex-shrink: 0;
  object-fit: cover;
}

.card-title { min-width: 0; }

.name {
  display: block;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator {
  display: block;
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-rows {
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 0;
  font-variant-numeric: tabular-nums;
}

.line label {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: var(--faint);
}

.line b { font-weight: 500; color: var(--text); }

.is-quiet .line b { color: var(--faint); }

.note {
  display: block;
  font-size: 11px;
  color: var(--accent);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.more {
  width: 100%;
  margin-top: 18px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 11px;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.more:hover { color: var(--text); border-color: var(--line-strong); }

.empty {
  padding: 46px 0;
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}

.checked {
  margin-top: 16px;
  font-size: 12px;
  color: var(--faint);
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 42px;
  padding: 26px 0 44px;
}

footer .fine {
  color: var(--faint);
  font-size: 12px;
  max-width: 620px;
}

body.locked { overflow: hidden; }

.sheet { position: fixed; inset: 0; z-index: 20; }

.sheet-back {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 12, .7);
  animation: fade .2s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@keyframes slide {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.sheet-panel {
  position: relative;
  max-width: 760px;
  margin: 46px auto;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  animation: slide .28s cubic-bezier(.22,.61,.36,1) both;
}

.sheet.closing .sheet-back { animation: fade .22s ease reverse both; }
.sheet.closing .sheet-panel { animation: slide .22s cubic-bezier(.22,.61,.36,1) reverse both; }

.sheet-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-shadow: 0 1px 6px rgba(8, 10, 12, .9);
  cursor: pointer;
  transition: color .16s ease;
}

.sheet-close:hover { color: var(--text); }

.loading { padding: 60px 0; text-align: center; color: var(--faint); font-size: 13px; }

.banner {
  height: 210px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  flex-wrap: wrap;
}

.sheet-head .icon { width: 54px; height: 54px; border-radius: 12px; }

.sheet-head h2 {
  font-family: "Prompt", sans-serif;
  font-size: 20px;
  font-weight: 600;
}

.sheet-head p { font-size: 13px; color: var(--faint); }

.play {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  transition: color .16s ease;
}

.play:hover { color: var(--accent); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  border-top: 1px solid var(--line);
}

.fact {
  padding: 11px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact label { display: block; font-size: 11px; color: var(--faint); }

.fact span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.block { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: none; }

.block h3 {
  font-family: "Prompt", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.block h4 {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  margin: 16px 0 8px;
}

.bio {
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.shout {
  font-size: 13px;
  color: var(--accent);
  margin-top: 8px;
}

.group-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.group-name { font-size: 15px; font-weight: 500; }
.group-name:hover { color: var(--accent); }
.group-sub { font-size: 12px; color: var(--faint); }

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.person {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  min-width: 0;
  transition: border-color .16s ease, background .16s ease;
}

.person:hover { border-color: var(--line-strong); background: var(--panel-2); }

.person img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--panel-2);
  flex-shrink: 0;
}

.person span { min-width: 0; display: block; }

.person-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-sub {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roles { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

.role {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  background: var(--panel);
  padding: 8px 12px;
  font-size: 12px;
}

.role-name { color: var(--text); }
.role-rank { color: var(--faint); font-family: "IBM Plex Mono", monospace; }
.role-count { color: var(--muted); font-family: "IBM Plex Mono", monospace; width: 72px; text-align: right; }

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shots img { width: 100%; border-radius: 8px; display: block; }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 34px; }
  .hero-inner { gap: 26px; }
  .stat-block { gap: 22px; }
  .bar { gap: 16px; }
  .tabs { gap: 14px; }
  #search { width: 100%; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .sheet-panel { margin: 0; max-height: 100vh; border-radius: 0; border: none; }
  .banner { height: 150px; }
  .sheet-head { padding: 16px; }
  .play { margin-left: 0; width: 100%; text-align: center; }
  .block { padding: 16px; }
  .shots { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
