/* Round Table Data. Mobile-first; no build step. */
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/BodoniModa-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #EDEBF2;
  --card: #FFFFFF;
  --ink: #1B1426;
  --muted: #665E73;
  --line: #D9D4E3;
  --accent: #9B1C3F;
  --accent-ink: #FFFFFF;
  --panel: #F7F5FA;
  --av-fill: #F1EFE8;
  --av-r-fill: #FCEBEB;
  --av-p-fill: #EEEDFE;
  --av-t-fill: #E1F5EE;
  --red: #E24B4A;
  --purple: #7F77DD;
  --teal: #1D9E75;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --radius: 6px;
  --gutter: 16px;
  --tap: 44px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14101C;
    --card: #1E1829;
    --ink: #EFEAF5;
    --muted: #A79FB5;
    --line: #352E44;
    --accent: #FF6B8A;
    --accent-ink: #14101C;
    --panel: #251E31;
    --av-fill: #2B2438;
    --av-r-fill: #45202B;
    --av-p-fill: #2D2852;
    --av-t-fill: #123A2F;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, .scroll-x:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 8px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap);
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none;
  white-space: nowrap;
}
.brand-mark { width: 18px; height: 18px; border-radius: 50%; border: 2px dashed var(--accent); display: inline-block; }
.subnav {
  max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.spoiler { display: flex; align-items: center; gap: 6px; min-width: 0; }
.spoiler-label { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.select, .input {
  min-height: var(--tap); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: inherit; padding: 0 10px; max-width: 100%;
}
.input { width: 100%; padding: 10px 12px; }
.input-code { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .spoiler-label { display: none; } }

/* Type */
h1, h2, h3, .h-serif, .page-title, .hero-title, .card-title { font-family: var(--serif); font-weight: 700; line-height: 1.1; margin: 0 0 .4em; }
.page-title { font-size: clamp(1.7rem, 6vw, 2.6rem); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--muted); margin: 0 0 .5rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.error, .flash-error { color: var(--red); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 36px; padding: 0 10px; font-size: .9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
form.inline { display: inline; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 16px; box-shadow: none;
}
.card.narrow { max-width: 440px; margin: 24px auto; }
.card-title { font-size: 1.35rem; }
.card-head { margin-bottom: 8px; }
.card-label { font-family: var(--sans); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.hook { margin: 0; color: var(--muted); font-size: .95rem; }
.card-foot { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid > .card { margin: 0; min-width: 0; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Graphics */
.graphic { width: 100%; }
.graphic svg.rtd-graphic { display: block; width: 100%; height: auto; max-width: 620px; margin: 0 auto; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border-radius: var(--radius); }
.scroll-x-wide svg.rtd-graphic { min-width: 560px; }
.rtd-graphic .bg { fill: var(--card); }
.rtd-graphic .t { fill: var(--ink); }
.rtd-graphic .ts { fill: var(--muted); }
.rtd-graphic .th { fill: var(--ink); font-family: var(--serif); font-weight: 700; }
.rtd-graphic .av { fill: var(--av-fill); stroke: #888780; }
.rtd-graphic .av-r { fill: var(--av-r-fill); stroke: #E24B4A; }
.rtd-graphic .av-p { fill: var(--av-p-fill); stroke: #7F77DD; }
.rtd-graphic .av-t { fill: var(--av-t-fill); stroke: #1D9E75; }
.rtd-graphic .panel { fill: var(--panel); stroke: var(--line); }
.rtd-graphic .gl { stroke: var(--line); }
.rtd-graphic .ring { stroke: var(--muted); }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; margin: 8px 0 20px; }
.hero-title { font-size: clamp(2.6rem, 13vw, 5.4rem); letter-spacing: -.01em; margin-bottom: .2em; }
.hero-lede { font-size: 1.15rem; margin: 0 0 1rem; }
.hero-graphic { margin: 0; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr .95fr; gap: 32px; }
}
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 0 0 20px; }
.stat { padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-num { font-family: var(--serif); font-weight: 700; font-size: clamp(1.6rem, 7vw, 2.4rem); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--muted); }

/* Lists */
.ep-list { list-style: none; padding: 0; margin: 0; }
.ep-row { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; min-height: 64px; }
.ep-row:hover { border-color: var(--muted); }
.ep-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; min-width: 2ch; text-align: center; color: var(--accent); }
.ep-body { display: flex; flex-direction: column; min-width: 0; }
.ep-head { font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.page-head { margin-bottom: 16px; }

.player-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .player-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .player-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.player-grid .card { margin: 0; }
.player-tile { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; min-height: 72px; }
.player-meta { display: flex; flex-direction: column; min-width: 0; gap: 2px; align-items: flex-start; }
.player-name { font-weight: 700; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--av-fill); border: 1.5px solid #888780; color: var(--ink);
  font-weight: 700; font-size: .9rem; letter-spacing: .02em;
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.3rem; }
.avatar.is-banished { background: var(--av-r-fill); border-color: var(--red); }
.avatar.is-murdered { background: var(--av-p-fill); border-color: #534AB7; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; vertical-align: middle; }
.badge-traitor, .badge-red { color: var(--red); }
.badge-faithful { color: var(--teal); }
.badge-purple { color: var(--purple); }
.badge-gray { color: var(--muted); }

.stat-card-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 12px; }
.stat-grid > div { background: var(--card); padding: 12px; }
.stat-grid dt { font-size: .78rem; color: var(--muted); }
.stat-grid dd { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 1.8rem; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.table th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.check { flex-direction: row !important; align-items: center; gap: 10px !important; min-height: var(--tap); }
.check input { width: 22px; height: 22px; }
.flashes { margin-bottom: 12px; }
.flash { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--teal); padding: 10px 12px; border-radius: var(--radius); margin: 0 0 8px; }
.flash-error { border-left-color: var(--red); color: inherit; }
.flash-warning { border-left-color: #C98A1A; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--muted); font-size: .9rem; }
.disclaimer { font-weight: 600; color: var(--ink); margin: 0 0 6px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .ep-row, .subnav a { transition: border-color .15s ease, background-color .15s ease; }
  html { scroll-behavior: smooth; }
}
@media print {
  .topbar, .footer .small, .card-foot { display: none; }
}

/* ---------------------------------------------------------------- admin */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inline-form { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.list { list-style: none; padding: 0; margin: 0 0 16px; }
.list-card { margin-bottom: 10px; }
.list-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.chip-published, .chip-ok, .chip-posted { color: var(--teal); border-color: var(--teal); }
.chip-draft, .chip-rendered { color: var(--muted); }
.chip-approved, .chip-scheduled, .chip-publishing { color: var(--purple); border-color: var(--purple); }
.chip-error, .chip-failed { color: var(--red); border-color: var(--red); }
.chip-warn { color: #C98A1A; border-color: #C98A1A; }
.card-error { border-left: 4px solid var(--red); }
.card-warn { border-left: 4px solid #C98A1A; }
.errors { margin: 0; padding-left: 18px; color: var(--red); }
.errors strong { color: var(--ink); }
.danger-zone { margin-top: 24px; text-align: right; }
.player-tile-admin { display: flex; gap: 12px; align-items: center; min-width: 0; }

.stepper { max-width: 640px; margin: 0 auto; }
.progress { width: 100%; height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 16px; }
.progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.step-q { font-family: var(--serif); font-size: clamp(1.6rem, 7vw, 2.2rem); font-weight: 400; margin: 0 0 16px; }
.step-q strong { font-weight: 800; }
.vote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .vote-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vote-btn {
  display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; text-align: left; cursor: pointer; touch-action: manipulation;
}
.vote-btn .avatar { width: 40px; height: 40px; font-size: .85rem; }
.vote-btn:active { transform: scale(.98); }
.vote-btn.is-selected { border: 2px solid var(--accent); background: var(--av-r-fill); }
.vote-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.step-nav { justify-content: space-between; margin: 16px 0; }
.voter-list summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; }
.jump { padding-left: 20px; margin: 8px 0 0; }
.jump li { padding: 6px 0; }
.jump a[aria-current] { font-weight: 800; }

.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.carousel figure { flex: 0 0 86%; max-width: 420px; margin: 0; scroll-snap-align: center; }
.carousel img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: contain; background: var(--panel); }
.carousel figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.banner { padding: 12px 16px; border-radius: var(--radius); margin: 0 0 16px; font-weight: 600; }
.banner-red { background: var(--red); color: #fff; }
.banner-red a { color: #fff; }
.banner-warn { background: #C98A1A; color: #fff; }
.switch-form { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
a.plain { color: inherit; text-decoration: none; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.table td a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; font-weight: 700; }
