:root {
  --ice: #EAF5FA;
  --paper: #FFFFFF;
  --ink: #072230;
  --ink-2: #3D5A68;
  --line: #C9DFE9;
  --dan: #12B0EE;
  --on-dan: #04202C;
  --dan-deep: #00739F;
  --live: #E0102B;
  --steam: #0E141B;
  --steam-ink: #DCE6EE;

  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --radius-card: 20px;
  --radius-media: 14px;
  --rail: 248px;
  --feed: 680px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ice: #061821;
    --paper: #0B2330;
    --ink: #E3F2F8;
    --ink-2: #9BB7C4;
    --line: #1C3A48;
    --dan-deep: #5CCBF5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ice: #061821;
  --paper: #0B2330;
  --ink: #E3F2F8;
  --ink-2: #9BB7C4;
  --line: #1C3A48;
  --dan-deep: #5CCBF5;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--ice);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  font-optical-sizing: auto;
}

a { color: var(--dan-deep); }
:focus-visible { outline: 3px solid var(--dan); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute; 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: 16px; top: -48px; z-index: 10;
  padding: 10px 16px; border-radius: 999px;
  background: var(--dan); color: var(--on-dan); font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- layout ---------- */

.shell {
  display: grid;
  grid-template-columns: 1fr;
  max-width: calc(var(--rail) + var(--feed) + 96px);
  margin: 0 auto;
}

.rail {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--ice) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.main { padding: 0 16px 48px; min-width: 0; }

@media (min-width: 1024px) {
  .shell { grid-template-columns: var(--rail) minmax(0, var(--feed)); gap: 48px; padding: 0 24px; }
  .rail {
    flex-direction: column; align-items: stretch; gap: 32px;
    height: 100vh; padding: 40px 0;
    background: none; backdrop-filter: none; border: 0;
  }
  .main { padding: 0 0 64px; }
}

/* ---------- wordmark ---------- */

.wordmark {
  display: inline-flex; align-items: center;
  color: var(--ink); text-decoration: none;
  font-size: 1.75rem; line-height: 1; letter-spacing: -0.03em;
}
.wordmark-o { width: 1.05em; height: 1.05em; color: var(--dan); margin-right: 0.02em; }
.wordmark-only { font-weight: 400; }
.wordmark-dan { font-weight: 800; }
@media (min-width: 1024px) { .wordmark { font-size: 2.25rem; } }

/* ---------- filters ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.filters button:hover { border-color: var(--dan); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filters .count { font-weight: 400; opacity: 0.7; font-variant-numeric: tabular-nums; }
.filters .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.filters button[hidden] { display: none; }

@media (max-width: 1023px) {
  .filters { width: 100%; }
  .filters button { min-height: 40px; padding: 0 14px; font-size: 0.875rem; }
}
@media (min-width: 1024px) {
  .filters { flex-direction: column; gap: 4px; }
  .filters button {
    justify-content: flex-start; border-color: transparent; background: none;
    font-size: 1.0625rem; padding: 0 16px;
  }
  .filters button:hover { background: var(--paper); border-color: var(--line); }
  .filters .count { margin-left: auto; }
}

.rail-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; margin-left: auto;
  border-radius: 999px; background: var(--dan); color: var(--on-dan);
  font-weight: 700; text-decoration: none;
}
.rail-cta:hover { background: color-mix(in srgb, var(--dan) 85%, #fff); }
@media (max-width: 1023px) {
  .rail .wordmark { margin-right: auto; }
  .rail-cta { order: -1; margin-left: 0; min-height: 40px; padding: 0 16px; font-size: 0.875rem; }
  .rail .wordmark { order: -2; }
}
@media (min-width: 1024px) { .rail-cta { margin: auto 0 0; } }

/* Plain links and buttons in the rail, for pages without filters */
.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 0.9375rem; text-decoration: none;
  cursor: pointer;
}
.nav-link[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.nav-link .count { font-weight: 400; opacity: 0.7; }
.nav-link .count:empty { display: none; }
@media (max-width: 1023px) { .nav-link { min-height: 40px; padding: 0 14px; font-size: 0.875rem; } }
@media (min-width: 1024px) {
  .nav-link { border-color: transparent; background: none; font-size: 1.0625rem; }
  .nav-link:hover { background: var(--paper); border-color: var(--line); }
  .nav-link[aria-current="page"]:hover { background: var(--ink); }
  .nav-link .count { margin-left: auto; }
}
.filters[hidden] { display: none; }

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

.hero { padding: 40px 0 28px; }
.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero-sub { margin: 16px 0 0; max-width: 42ch; font-size: 1.1875rem; color: var(--ink-2); }
.hero-status {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 20px 0 0; font-weight: 600;
}
.hero-status.has-live::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 22%, transparent);
}

.search {
  display: flex; align-items: center; gap: 10px;
  margin-top: 24px; padding: 0 18px;
  min-height: 52px;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px;
}
.search:focus-within { border-color: var(--dan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dan) 30%, transparent); }
.search svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.search input {
  flex: 1; min-width: 0; height: 50px;
  border: 0; background: none; color: var(--ink);
  font: inherit; font-size: 1.0625rem;
}
.search input:focus { outline: none; }
.search input::placeholder { color: var(--ink-2); opacity: 1; }

/* ---------- feed & cards ---------- */

.feed { display: grid; gap: 24px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 8px;
}
.card[hidden] { display: none; }
.card.is-live { border-color: var(--live); box-shadow: 0 0 0 1px var(--live); }

.card-media { position: relative; }

.media {
  position: relative; display: block; width: 100%;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--steam);
}
.media-video { aspect-ratio: 16 / 9; }
.media-steam { aspect-ratio: 16 / 4; }
.media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.media-loading {
  background: linear-gradient(100deg, var(--line) 30%, color-mix(in srgb, var(--line) 50%, var(--paper)) 50%, var(--line) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }

/* YouTube facade */
.facade {
  position: absolute; inset: 0; width: 100%; padding: 0; border: 0;
  background: #000; color: #fff; cursor: pointer; text-align: left; font: inherit;
}
.facade img { width: 100%; height: 100%; object-fit: cover; display: block; }
.facade::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(4, 18, 26, 0.88), rgba(4, 18, 26, 0) 50%);
}
.facade-play {
  position: absolute; top: 50%; left: 50%; z-index: 1;
  display: grid; place-items: center;
  width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: var(--dan); color: var(--on-dan);
  transition: transform 160ms ease;
}
.facade-play svg { width: 34px; height: 34px; margin-left: 4px; }
.facade:hover .facade-play { transform: scale(1.06); }
.facade-title {
  position: absolute; left: 20px; right: 20px; top: 14px; z-index: 1;
  display: grid; gap: 2px;
  font-size: 1.125rem; font-weight: 700; line-height: 1.25;
  text-wrap: balance;
}
.facade-title > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 520px) {
  .facade-title { left: 14px; right: 14px; top: 10px; font-size: 1rem; }
  .facade-play { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
}
.facade-kicker { font-size: 0.875rem; font-weight: 500; opacity: 0.85; }

/* Steam banner, 16:4 */
/* The avatar overlaps the bottom-left corner, so the game sits bottom-right. */
.media-steam {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr;
  gap: 4px 16px;
  padding: 14px 20px;
  color: var(--steam-ink); text-decoration: none;
  background:
    linear-gradient(90deg, rgba(14, 20, 27, 0.94) 0%, rgba(14, 20, 27, 0.6) 55%, rgba(14, 20, 27, 0.25) 100%),
    var(--art, linear-gradient(120deg, #1B2838, #2A475E)) center / cover no-repeat,
    var(--steam);
}
.media-steam.media-loading { background: var(--steam); animation: none; }
.steam-id { display: flex; align-items: center; gap: 10px; align-self: start; min-width: 0; }
.steam-logo {
  width: 22px; height: 22px; flex: none;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}
.steam-persona { font-weight: 700; font-size: 1.0625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steam-level {
  display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
  border: 2px solid #9AB7D0; border-radius: 50%;
  font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.steam-game {
  grid-column: 1 / -1; grid-row: 2; align-self: end; justify-self: end;
  display: grid; text-align: right;
  font-size: clamp(1rem, 3.2vw, 1.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em;
}
.steam-game-kicker { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; opacity: 0.8; }
.steam-cta {
  grid-column: 2; grid-row: 1; align-self: start;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(220, 230, 238, 0.14); border: 1px solid rgba(220, 230, 238, 0.35);
  font-size: 0.875rem; font-weight: 600; white-space: nowrap;
}
.media-steam:hover .steam-cta { background: rgba(220, 230, 238, 0.26); }
@media (max-width: 520px) {
  .media-steam { padding: 8px 12px; }
  .steam-logo { width: 18px; height: 18px; }
  .steam-cta { display: none; }
  .steam-game-kicker { display: none; }
  .steam-persona { font-size: 0.9375rem; }
  .steam-level { min-width: 24px; height: 24px; font-size: 0.6875rem; }
}

/* Twitch offline */
.media-offline {
  aspect-ratio: 16 / 9;
  display: grid; place-content: center; justify-items: center; gap: 6px;
  padding: 24px; text-align: center; text-decoration: none;
  background: #1B1530; color: #E9E3FF;
}
.offline-icon {
  width: 40px; height: 40px; margin-bottom: 8px;
  background: #A88BFF;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}
.offline-title { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.offline-sub { color: #BDB1E8; }

/* YouTube channel whose latest upload couldn't be fetched */
.media-youtube { background: #1A0B0B; color: #FFE5E5; }
.media-youtube .offline-icon { background: #FF4E45; }
.media-youtube .offline-sub { color: #F1B9B6; }

/* Nothing to show */
.media-empty {
  aspect-ratio: 16 / 5;
  display: grid; place-items: center; padding: 16px; text-align: center;
  background:
    radial-gradient(circle at 20% 30%, hsl(var(--h) 70% 82%) 0 18%, transparent 19%),
    radial-gradient(circle at 78% 70%, hsl(calc(var(--h) + 40) 70% 84%) 0 22%, transparent 23%),
    hsl(var(--h) 60% 92%);
  color: #12303D; font-weight: 600;
}

/* ---------- card body ---------- */

.card-body { padding: 0 12px 12px; }

.card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end; gap: 0 14px;
}

.avatar {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 88px; height: 88px; margin-top: -40px;
  border-radius: 50%;
  border: 4px solid var(--paper);
  background: hsl(var(--h) 65% 55%);
  color: #fff; font-size: 2.25rem; font-weight: 800;
  overflow: hidden;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.card-id { padding-top: 10px; min-width: 0; }
.card-name {
  display: flex; align-items: center; gap: 6px;
  margin: 0; font-size: 1.375rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.015em;
}
.card-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified { display: inline-flex; flex: none; color: var(--dan); }
.verified svg { width: 22px; height: 22px; }
.card-handle { margin: 2px 0 0; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.handle-live { color: var(--live); font-weight: 700; }

.subscribe {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px;
  background: var(--dan); color: var(--on-dan);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease;
}
.subscribe:hover { background: color-mix(in srgb, var(--dan) 85%, #fff); }

.card-bio { margin: 14px 0 0; max-width: 60ch; }

.socials { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.socials a {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.socials a:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.icon {
  width: 20px; height: 20px;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}
.icon-inline { background: none; mask: none; -webkit-mask: none; }
.icon-inline svg { width: 100%; height: 100%; display: block; }

@media (max-width: 560px) {
  .card-head { grid-template-columns: auto minmax(0, 1fr); }
  .subscribe { grid-column: 1 / -1; margin-top: 14px; }
  .avatar { width: 72px; height: 72px; margin-top: -32px; font-size: 1.75rem; }
  .card-name { font-size: 1.25rem; }
}

/* ---------- misc ---------- */

.empty { margin: 32px 0; padding: 24px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: var(--radius-card); }
.empty[hidden] { display: none; }

.footer { margin-top: 48px; color: var(--ink-2); font-size: 0.875rem; max-width: 60ch; }

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

/* ---------- forms (suggest + admin) ---------- */

.hero-compact { padding: 40px 0 24px; }
.hero-compact h1 { max-width: none; font-size: clamp(2.25rem, 6vw, 3.25rem); }
.hero-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 8px 24px 24px;
}
.panel[hidden] { display: none; }
@media (max-width: 560px) { .panel { padding: 4px 16px 20px; } }

.group { margin: 0; padding: 20px 0 4px; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.dan-form > .group:first-of-type, .panel > .group:first-child { border-top: 0; }
.group legend { padding: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.group-note { margin: 4px 0 0; color: var(--ink-2); max-width: 60ch; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px 20px; margin-top: 16px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.field label .icon { width: 16px; height: 16px; flex: none; }
.field .req { font-weight: 400; color: var(--ink-2); }

.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--ink-2) 55%, var(--line)); border-radius: 12px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--dan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dan) 30%, transparent); }
.field [aria-invalid="true"] { border-color: var(--live); }
.field-hint { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.field-error { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--live); }
.field-error[hidden] { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field-error, :root:not([data-theme="light"]) .form-error { color: #FF7A88; } }

.form-error { margin: 20px 0 0; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--live) 10%, var(--paper)); color: var(--live); font-weight: 600; }
.form-error[hidden] { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.button:hover { border-color: var(--ink-2); }
.button:disabled { opacity: 0.6; cursor: progress; }
.button-primary { background: var(--dan); border-color: var(--dan); color: var(--on-dan); }
.button-primary:hover { background: color-mix(in srgb, var(--dan) 85%, #fff); border-color: var(--dan); }
.button-danger { color: var(--live); }
.button-danger:hover { border-color: var(--live); }

/* Hidden from people; bots fill it in */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.done { padding: 28px 24px; }
.done h2 { margin: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.done p { margin: 8px 0 0; }

/* ---------- admin ---------- */

.login { max-width: 440px; }
.login .panel { padding-top: 24px; }

.admin-list { display: grid; gap: 16px; }
.row {
  display: grid; gap: 16px;
  padding: 20px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-card);
}
.row-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
.row-text { min-width: 0; }
.row-name { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.row-handle { margin: 0; color: var(--ink-2); }
.row-bio { margin: 8px 0 0; max-width: 60ch; overflow-wrap: anywhere; }
.row-meta { margin: 8px 0 0; font-size: 0.875rem; color: var(--ink-2); }
.row-note { margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid var(--dan); background: var(--ice); border-radius: 0 10px 10px 0; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 0 72px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .row-actions { padding-left: 0; } }

.avatar-sm { width: 56px; height: 56px; margin: 0; border-width: 0; font-size: 1.375rem; }
.socials-sm { margin-top: 10px; gap: 6px; }
.socials-sm a { width: 36px; height: 36px; }
.socials-sm .icon { width: 16px; height: 16px; }

dialog {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--paper); color: var(--ink);
}
dialog::backdrop { background: rgba(4, 18, 26, 0.55); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.dialog-body { overflow-y: auto; padding: 0 24px 16px; }
.dialog-body .dan-form > .group:first-of-type { border-top: 0; }
.dialog-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); }
.dialog-foot .form-error { margin: 0 auto 0 0; flex: 1 1 240px; }
@media (max-width: 560px) {
  .dialog-head, .dialog-foot { padding: 12px 16px; }
  .dialog-body { padding: 0 16px 12px; }
}
.icon-button {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  background: none; color: var(--ink); cursor: pointer;
}
.icon-button svg { width: 20px; height: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translateX(-50%);
  max-width: calc(100vw - 32px); margin: 0; padding: 12px 20px;
  border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600;
  box-shadow: 0 8px 24px rgba(4, 18, 26, 0.25);
}
.toast[hidden] { display: none; }

/* ---------- Dan Nominates Dan (Blood on the Clocktower) ---------- */

:root {
  --night: #120E1C;
  --night-2: #1E1730;
  --night-ink: #EFE8F7;
  --night-ink-2: #BDB3CF;
  --blood: #C0161F;
  --team-townsfolk: #1F55B3;
  --team-outsider: #1F77A8;
  --team-minion: #A64A12;
  --team-demon: #B3141C;
  --team-fabled: #2A7A30;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --team-townsfolk: #8DB0FF;
    --team-outsider: #7FCBF2;
    --team-minion: #F2A16B;
    --team-demon: #FF7A80;
    --team-fabled: #86D68B;
  }
}
:root[data-theme="dark"] {
  --team-townsfolk: #8DB0FF;
  --team-outsider: #7FCBF2;
  --team-minion: #F2A16B;
  --team-demon: #FF7A80;
  --team-fabled: #86D68B;
}

.team-townsfolk { --team: var(--team-townsfolk); }
.team-outsider  { --team: var(--team-outsider); }
.team-minion    { --team: var(--team-minion); }
.team-demon     { --team: var(--team-demon); }
.team-fabled    { --team: var(--team-fabled); }

.botc-hero {
  position: relative; overflow: hidden;
  margin: 24px 0 0; padding: 40px 32px 32px;
  border-radius: var(--radius-card);
  background:
    radial-gradient(ellipse at 85% -10%, rgba(192, 22, 31, 0.45), transparent 55%),
    radial-gradient(circle at 12% 110%, rgba(31, 85, 179, 0.35), transparent 50%),
    var(--night);
  color: var(--night-ink);
}
@media (max-width: 560px) { .botc-hero { padding: 28px 20px 24px; } }
.botc-title {
  margin: 0;
  font-family: "UnifrakturMaguntia", var(--font);
  font-weight: 400;
  font-size: clamp(2.75rem, 9vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: #FFF4F4;
  text-shadow: 0 2px 0 var(--blood);
}
.botc-sub { margin: 16px 0 0; max-width: 46ch; font-size: 1.1875rem; color: var(--night-ink); }
.botc-credit { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--night-ink-2); font-weight: 600; }
.botc-credit img { width: 32px; height: 32px; border-radius: 50%; }
.botc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button-night { background: rgba(239, 232, 247, 0.08); border-color: rgba(239, 232, 247, 0.3); color: var(--night-ink); }
.button-night:hover { background: rgba(239, 232, 247, 0.16); border-color: rgba(239, 232, 247, 0.55); }
.botc-hint { margin: 12px 0 0; font-size: 0.875rem; color: var(--night-ink-2); }

.botc-jump {
  position: sticky; top: 0; z-index: 4;
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 -16px; padding: 16px;
  background: color-mix(in srgb, var(--ice) 92%, transparent);
  backdrop-filter: blur(10px);
}
@media (max-width: 1023px) { .botc-jump { position: static; } }
.botc-jump a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: 0.9375rem; text-decoration: none;
}
.botc-jump a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--team, var(--ink-2)); }
.botc-jump a:hover { border-color: var(--team, var(--ink-2)); }

.botc-team { margin-top: 32px; scroll-margin-top: 80px; }
.botc-team h2 {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 3px solid var(--team, var(--ink));
  font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--team, var(--ink));
}
.botc-count { font-size: 1rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.roles { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.role {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 12px 16px 12px 8px;
  border-radius: 14px;
  scroll-margin-top: 80px;
}
.role:nth-child(odd) { background: var(--paper); }
.role:target { outline: 3px solid var(--team); outline-offset: -3px; }
.role img { width: 72px; height: 72px; object-fit: contain; }
.role-name { margin: 0; font-size: 1.125rem; font-weight: 800; color: var(--team); letter-spacing: -0.01em; }
.role-ability { margin: 2px 0 0; max-width: 62ch; }
.botc-star { color: var(--blood); font-weight: 800; }
@media (max-width: 560px) {
  .role { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .role img { width: 52px; height: 52px; }
}

.nights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px 24px; }
.night h3 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 800; }
.night-list { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 2px; }
.night-step { counter-increment: step; }
.night-step > a, .night-step > span:last-child { color: var(--team, var(--ink)); }
.night-step > a, .night-step {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px;
}
.night-step { padding: 0 10px; border-radius: 10px; font-weight: 700; }
.night-step::before {
  content: counter(step); min-width: 1.5em; text-align: right;
  font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.night-step > a { flex: 1; text-decoration: none; }
.night-step > a:hover span { text-decoration: underline; }
.night-step img { width: 32px; height: 32px; object-fit: contain; }
.night-step:nth-child(odd) { background: var(--paper); }
.night-dot { width: 32px; height: 32px; display: grid; place-items: center; }
.night-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--team, var(--ink-2)); }
.night-marker { font-weight: 600; color: var(--ink-2); }
.night-marker > span:last-child { color: var(--ink-2); }

/* Promo for the script on the front page */
.botc-promo {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px;
  margin-top: 24px; padding: 18px 20px;
  border-radius: var(--radius-card);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(192, 22, 31, 0.45), transparent 60%),
    var(--night);
  color: var(--night-ink); text-decoration: none;
}
.botc-promo-title { display: block; font-family: "UnifrakturMaguntia", var(--font); font-size: 1.75rem; line-height: 1.1; color: #FFF4F4; }
.botc-promo-sub { display: block; margin-top: 4px; color: var(--night-ink-2); }
.botc-promo-cta {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--blood); color: #fff; font-weight: 700; white-space: nowrap;
}
.botc-promo:hover .botc-promo-cta { background: #D61B25; }
@media (max-width: 560px) { .botc-promo { grid-template-columns: 1fr; } .botc-promo-cta { justify-self: start; } }

/* On phones the front page promo already links the script, so the rail stays short. */
@media (max-width: 1023px) { .rail-script { display: none; } }
@media (min-width: 1024px) { .rail-script { margin-top: -20px; } }
