/* Psi Press · Blood on the Clocktower
   Night-sky grimoire. Gold is Rohan and the Day, lavender is Natalie and the Night,
   blue is the Good team and red is the Evil team. */

:root {
  --bg: #0c0a12;
  --bg-raise: #14101e;
  --bg-deep: #08070d;
  --panel: rgba(255, 246, 230, 0.028);
  --panel-strong: rgba(255, 246, 230, 0.05);
  --line: rgba(239, 230, 210, 0.11);
  --line-strong: rgba(239, 230, 210, 0.22);
  --text: #efe6d2;
  --muted: #a69daf;
  --faint: #6f677a;
  --gold: #e8b860;
  --gold-soft: rgba(232, 184, 96, 0.14);
  --gold-deep: #9c7630;
  --moon: #b8a6ff;
  --moon-soft: rgba(184, 166, 255, 0.14);
  --moon-deep: #6e5bc7;
  --good: #5ea4ff;
  --good-soft: rgba(94, 164, 255, 0.16);
  --evil: #e5484f;
  --evil-soft: rgba(229, 72, 79, 0.16);
  --up: #7fd6a4;
  --down: #f08a8f;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-label: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-ui: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 640px at 8% -8%, rgba(232, 184, 96, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 96% 0%, rgba(184, 166, 255, 0.11), transparent 62%),
    radial-gradient(900px 700px at 50% 120%, rgba(110, 91, 199, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums tabular-nums;
}

.sky-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  fill: #f3ecdc;
}
.sky-layer circle { opacity: 0.35; animation: twinkle 5s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.7; } }

h1, h2, h3, h4, p { margin: 0; }
.legend-number, .stat-tile strong, .board-rank, .chip-value, .profile-tile strong, .player-card-elo strong, .mini-grid strong, .tier-label, .method-steps li::before { font-variant-numeric: lining-nums tabular-nums; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.01em; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; line-height: 1.15; }
h4 { font-family: var(--font-ui); font-size: 0.95rem; font-weight: 700; }
a { color: var(--gold); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
small { font-size: 0.8em; }

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

.eyebrow {
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.55rem;
}
.section-copy { color: var(--muted); max-width: 68ch; margin-top: 0.5rem; }
.section-copy strong { color: var(--text); }
.muted { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }
.good-text { color: var(--good); }
.evil-text { color: var(--evil); }
.good-fill { fill: var(--good); }
.evil-fill { fill: var(--evil); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(12, 10, 18, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; color: var(--gold); transition: transform 0.6s ease; }
.brand:hover .brand-mark { transform: rotate(-30deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-label); font-size: 1rem; letter-spacing: 0.12em; }
.brand-text small { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.04em; }

.site-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  position: relative;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--panel-strong); }
.nav-link.is-active { color: var(--bg); background: var(--gold); }
.nav-link[hidden] { display: none; }
.nav-toggle { display: none; }

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

main { width: min(1240px, 100%); margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 80px; }
.view { display: none; }
.view.is-active { display: block; animation: rise 0.5s cubic-bezier(.2, .7, .2, 1); }
.view > * + * { margin-top: 22px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.panel {
  background: linear-gradient(180deg, rgba(255, 246, 230, 0.035), rgba(255, 246, 230, 0.018));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.6vw, 30px);
}
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head { padding: 18px 0 6px; }
.page-head h2 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.empty-state { color: var(--muted); padding: 18px 0; }
.footnote { color: var(--faint); font-size: 0.82rem; margin-top: 14px; }

/* ------------------------------------------------------------ buttons & fields */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.button:hover { transform: translateY(-1px); border-color: var(--gold); }
.button:active { transform: none; }
.button-gold { background: var(--gold); border-color: var(--gold); color: #1d1406; box-shadow: 0 8px 30px rgba(232, 184, 96, 0.25); }
.button-gold:hover { background: #f2c878; }
.button-moon { background: var(--moon); border-color: var(--moon); color: #170f33; box-shadow: 0 8px 30px rgba(184, 166, 255, 0.25); }
.button-moon:hover { background: #cabcff; border-color: #cabcff; }
.button-ghost { background: var(--panel-strong); }
.button-danger { background: var(--evil); border-color: var(--evil); color: #fff; }
.button-danger-ghost { color: var(--down); border-color: rgba(229, 72, 79, 0.4); }

.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.toolbar-left { justify-content: flex-start; margin: 14px 0 18px; }
.field { display: inline-flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; }
.field-block { display: flex; }
.field input, .field select {
  min-height: 42px;
  min-width: 150px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-raise);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
}
.field input:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-deep); }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 650; }
.segmented button.is-active { background: var(--panel-strong); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  vertical-align: middle;
}
.tag-good { color: var(--good); background: var(--good-soft); border-color: rgba(94, 164, 255, 0.3); }
.tag-evil { color: var(--evil); background: var(--evil-soft); border-color: rgba(229, 72, 79, 0.3); }
.tag-upset { color: var(--gold); background: var(--gold-soft); border-color: rgba(232, 184, 96, 0.35); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; background: var(--gold-soft); color: var(--gold); }
.badge-aura { background: var(--moon-soft); color: var(--moon); }
.badge-muted { background: var(--panel-strong); color: var(--muted); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(18px, 4vw, 48px) 0 8px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 6px 0 22px;
}
.hero-line { display: block; }
.hero-line-night {
  font-size: clamp(3.1rem, 7.6vw, 6.3rem);
  white-space: nowrap;
  background: linear-gradient(100deg, #fff8ea 10%, #d8ccff 55%, var(--moon) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 80px rgba(184, 166, 255, 0.25);
}
.hero-line-day {
  margin-top: 14px;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 3.3vw, 2.6rem);
  color: var(--gold);
}
.hero-lead { color: var(--muted); font-size: 1.08rem; max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.hero-art { position: relative; aspect-ratio: 400 / 480; max-height: 560px; justify-self: center; width: 100%; }
.tower-svg { width: 100%; height: 100%; overflow: visible; }
.orbit-ring { fill: none; stroke: rgba(239, 230, 210, 0.08); stroke-dasharray: 2 7; }
.orbit { transform-origin: 200px 250px; animation: orbit 80s linear infinite; }
.sun-rays { transform-box: fill-box; transform-origin: center; animation: spin 24s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.tower-window { animation: flicker 6s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { opacity: 0.95; } 45% { opacity: 0.55; } 50% { opacity: 0.9; } 70% { opacity: 0.7; } }

/* ------------------------------------------------------------ diptych */

.diptych { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: stretch; margin-top: 30px; }
.diptych-seam { position: relative; display: grid; place-items: center; }
.diptych-seam::before { content: ""; position: absolute; top: 8%; bottom: 8%; width: 1px; background: linear-gradient(var(--gold), var(--moon)); opacity: 0.5; }
.diptych-seam span {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--text);
}
.legend {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(22px, 3vw, 36px);
  border-radius: 24px;
  border: 1px solid var(--line);
  isolation: isolate;
}
.legend::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  top: -160px;
  filter: blur(10px);
  opacity: 0.5;
}
.legend-day { background: linear-gradient(160deg, rgba(232, 184, 96, 0.16), rgba(232, 184, 96, 0.02) 55%), var(--bg-raise); border-color: rgba(232, 184, 96, 0.28); }
.legend-day::after { right: -140px; background: radial-gradient(circle, rgba(232, 184, 96, 0.35), transparent 65%); }
.legend-night { background: linear-gradient(200deg, rgba(184, 166, 255, 0.17), rgba(110, 91, 199, 0.03) 55%), var(--bg-raise); border-color: rgba(184, 166, 255, 0.3); }
.legend-night::after { left: -140px; background: radial-gradient(circle, rgba(184, 166, 255, 0.35), transparent 65%); }
.legend-night .eyebrow { color: var(--moon); }
.legend-emblem { margin-bottom: 14px; }
.legend-emblem .sigil { filter: drop-shadow(0 0 22px rgba(232, 184, 96, 0.45)); animation: bob 7s ease-in-out infinite; }
.legend-night .legend-emblem .sigil { filter: drop-shadow(0 0 22px rgba(184, 166, 255, 0.5)); animation-delay: -3.5s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.legend-name { font-size: clamp(2.6rem, 4.6vw, 3.6rem); line-height: 1; }
.legend-title { font-family: var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.86rem; color: var(--gold); }
.legend-night .legend-title { color: var(--moon); font-size: 1.05rem; letter-spacing: 0.3em; }
.legend-figure { display: flex; align-items: flex-end; gap: 14px; margin: 18px 0 10px; }
.legend-number { font-family: var(--font-display); font-weight: 700; font-size: clamp(4rem, 8vw, 5.8rem); line-height: 0.85; color: var(--gold); text-shadow: 0 0 40px rgba(232, 184, 96, 0.3); }
.legend-night .legend-number { color: var(--moon); text-shadow: 0 0 40px rgba(184, 166, 255, 0.4); }
.legend-infinity { font-size: clamp(4.6rem, 9vw, 6.6rem); animation: breathe 4.5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }
.legend-figure small { color: var(--muted); font-size: 0.82rem; line-height: 1.35; padding-bottom: 8px; }
.legend .button { align-self: flex-start; margin-top: auto; }

/* ------------------------------------------------------------ rivalry */

.tape { width: 100%; max-width: 720px; margin: 0 auto; border-collapse: collapse; }
.tape th, .tape td { padding: 9px 14px; border-bottom: 1px solid rgba(239, 230, 210, 0.06); }
.tape thead th { padding-bottom: 14px; border-bottom: 1px solid var(--line-strong); font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.tape-name { display: inline-flex; align-items: center; gap: 10px; }
.tape .tape-day { width: 40%; text-align: right; }
.tape .tape-night { width: 40%; text-align: left; }
.tape thead .tape-day { color: var(--gold); }
.tape thead .tape-night { color: var(--moon); }
.tape tbody th { text-align: center; white-space: nowrap; color: var(--muted); font-size: 0.74rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.tape td { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.tape td small { margin: 0 3px; color: var(--faint); font-size: 0.78rem; font-weight: 600; }
.tape td.is-trail { color: var(--muted); font-weight: 500; }
.tape td.tape-day.is-lead { color: var(--gold); font-weight: 750; }
.tape td.tape-night.is-lead { color: var(--moon); font-weight: 750; }
.tape .tape-section th { padding-top: 22px; color: var(--text); font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.16em; border-bottom-color: var(--line-strong); }
.tape .tape-shared td { text-align: center; color: var(--muted); font-size: 0.95rem; font-weight: 600; }
.medal-track { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 8px;
  min-width: 62px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.medal:hover, .medal:focus-visible { transform: translateY(-3px); border-color: var(--line-strong); }
.medal-icon svg { width: 26px; height: 26px; display: block; }
.medal-date { font-size: 0.7rem; font-weight: 600; }
.medal-day { color: var(--gold); border-color: rgba(232, 184, 96, 0.3); background: var(--gold-soft); }
.medal-night { color: var(--moon); border-color: rgba(184, 166, 255, 0.32); background: var(--moon-soft); }
.medal-both { color: var(--text); }
.medal-none { color: var(--faint); }
.medal-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 18px; color: var(--muted); font-size: 0.8rem; }
.medal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.medal-key { width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--line-strong); }
.medal-key.medal-day { background: var(--gold); }
.medal-key.medal-night { background: var(--moon); }
.medal-key.medal-both { background: linear-gradient(90deg, var(--gold) 50%, var(--moon) 50%); }
.medal-key.medal-none { background: transparent; border-style: dashed; }

/* ------------------------------------------------------------ duel chart */

.compare-pickers { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.compare-pickers .field { flex-direction: row; align-items: center; gap: 8px; }
.compare-pickers select { min-width: 140px; }
.compare-vs { font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 1.2rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-day { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.dot-night { background: var(--moon); box-shadow: 0 0 12px var(--moon); }
.chart-host { position: relative; width: 100%; min-height: 120px; }
.chart-host svg { display: block; max-width: 100%; }
.elo-chart .tick line { stroke: var(--line); }
.elo-chart .tick text, .axis-label { fill: var(--faint); font-size: 11px; }
.start-line { stroke: var(--line-strong); stroke-dasharray: 4 5; }
.start-label { fill: var(--faint); font-size: 10.5px; letter-spacing: 0.04em; }
.series-line { fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.series-label { fill: var(--c); font-family: var(--font-display); font-weight: 700; font-size: 15px; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.series circle { stroke: var(--bg); stroke-width: 1.5; }
.crosshair { stroke: var(--line-strong); stroke-width: 1; }
.hit { cursor: crosshair; }

/* ------------------------------------------------------------ pulse */

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-tile { padding: 18px 18px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.stat-tile strong { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; line-height: 1; color: var(--text); }
.stat-tile > span { font-weight: 650; font-size: 0.86rem; color: var(--muted); }
.stat-tile small { color: var(--faint); font-size: 0.75rem; line-height: 1.3; }
.pulse-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.latest h3 { margin-bottom: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.latest .forecast { margin: 18px 0; }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.portal svg { width: 34px; height: 34px; color: var(--gold); margin-bottom: 8px; transition: transform 0.3s; }
.portal:nth-child(even) svg { color: var(--moon); }
.portal:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--panel-strong); }
.portal:hover svg { transform: scale(1.08) rotate(-4deg); }
.portal strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.portal small { color: var(--muted); }

/* ------------------------------------------------------------ forecast bars */

.forecast { display: grid; gap: 4px; }
.forecast-bar { position: relative; display: flex; height: 10px; border-radius: 999px; overflow: visible; background: var(--bg-deep); }
.forecast-bar .fg { width: var(--w); background: linear-gradient(90deg, #3d78c9, var(--good)); border-radius: 999px 0 0 999px; }
.forecast-bar .fe { flex: 1; background: linear-gradient(90deg, var(--evil), #a92f36); border-radius: 0 999px 999px 0; }
.forecast-mark { position: absolute; top: 50%; left: var(--x); width: 16px; height: 16px; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1.5px var(--text); }
.forecast-mark.winner-good { background: var(--good); }
.forecast-mark.winner-evil { background: var(--evil); }
.forecast-labels { display: flex; justify-content: space-between; font-size: 0.76rem; font-weight: 700; }
.forecast-compact { min-width: 150px; }
.forecast-compact .forecast-bar { height: 7px; }
.forecast-compact .forecast-mark { width: 11px; height: 11px; }

/* ------------------------------------------------------------ rankings */

.record-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.boards { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.board-formula { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; color: var(--moon); padding: 5px 10px; border-radius: 999px; background: var(--moon-soft); }
.board > div:first-child .eyebrow { margin-bottom: 4px; }
.board-list { display: grid; gap: 3px; }
.board-row {
  display: grid;
  grid-template-columns: 26px 34px minmax(0, 1.1fr) minmax(50px, 1fr) 72px 46px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.aura-row { grid-template-columns: 26px 34px minmax(0, 1.1fr) minmax(50px, 1fr) 82px; }
.board-row:hover, .board-row:focus-visible { background: var(--panel-strong); }
.board-row.is-day { background: linear-gradient(90deg, rgba(232, 184, 96, 0.14), transparent 80%); }
.board-row.is-night { background: linear-gradient(90deg, rgba(184, 166, 255, 0.14), transparent 80%); }
.board-row.is-provisional .board-value { color: var(--muted); }
.board-rank { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--faint); text-align: center; }
.board-row:nth-child(1) .board-rank { color: var(--gold); }
.board-row:nth-child(2) .board-rank { color: #d7d2c6; }
.board-row:nth-child(3) .board-rank { color: #c98b5b; }
.board-sigil, .board-sigil .sigil { display: block; }
.board-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.board-name strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-name small { color: var(--muted); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-bar { height: 6px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; }
.board-bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); animation: grow 0.9s cubic-bezier(.2, .7, .2, 1); }
.aura-bar i { background: linear-gradient(90deg, var(--moon-deep), var(--moon)); }
@keyframes grow { from { width: 0; } }
.board-value { text-align: right; font-weight: 700; font-size: 1.02rem; display: flex; flex-direction: column; line-height: 1.15; }
.board-value .range { font-weight: 500; color: var(--faint); font-size: 0.68rem; }
.board-swing { text-align: right; font-size: 0.8rem; font-weight: 650; }

.ladder-svg .band rect { fill: var(--panel-strong); stroke: var(--line); }
.ladder-svg .band text { fill: var(--muted); font-size: 10.5px; font-weight: 650; letter-spacing: 0.03em; }
.ladder-svg .band .band-cut { fill: var(--faint); font-size: 9.5px; }
.ladder-svg .band-6 rect, .ladder-svg .band-7 rect, .ladder-svg .band-8 rect { fill: rgba(232, 184, 96, 0.08); }
.ladder-svg .band-9 rect { fill: rgba(232, 184, 96, 0.16); }
.ladder-svg .band-10 rect { fill: rgba(232, 184, 96, 0.28); }
.ladder-svg .band-10 text, .ladder-svg .band-9 text { fill: var(--gold); }
.ladder-dot { cursor: pointer; }
.ladder-dot line { stroke: var(--line); }
.ladder-dot circle { fill: var(--bg-raise); stroke: var(--muted); stroke-width: 1.3; transition: r 0.15s; }
.ladder-dot text { fill: var(--text); font-size: 9px; font-weight: 700; pointer-events: none; }
.ladder-dot.is-unlisted circle { stroke-dasharray: 2 2; opacity: 0.7; }
.ladder-dot:hover circle, .ladder-dot:focus circle { stroke: var(--text); fill: var(--panel-strong); }
.ladder-dot.is-day circle { fill: var(--gold); stroke: var(--gold); }
.ladder-dot.is-day text { fill: #2a1d08; }
.ladder-dot.is-night circle { fill: var(--moon); stroke: var(--moon); }
.ladder-dot.is-night text { fill: #170f33; }

/* ------------------------------------------------------------ tables */

.table-shell { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: rgba(8, 7, 13, 0.4); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th.num { text-align: right; }
.data-table th { position: sticky; top: 0; text-align: left; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 12px 14px; background: var(--bg-raise); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th[data-sort] { cursor: pointer; user-select: none; }
.data-table th[data-sort]:hover { color: var(--text); }
.data-table th[data-dir="asc"]::after { content: " ▲"; color: var(--gold); }
.data-table th[data-dir="desc"]::after { content: " ▼"; color: var(--gold); }
.data-table td { white-space: nowrap; padding: 11px 14px; border-bottom: 1px solid rgba(239, 230, 210, 0.06); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-player], .data-table tbody tr[data-game] { cursor: pointer; transition: background 0.15s; }
.data-table tbody tr[data-player]:hover, .data-table tbody tr[data-game]:hover, .data-table tbody tr:focus-visible { background: var(--panel-strong); }
.data-table tr.is-day td:first-child { box-shadow: inset 3px 0 var(--gold); }
.data-table tr.is-night td:first-child { box-shadow: inset 3px 0 var(--moon); }
.data-table td small { color: var(--faint); }
.data-table.compact td, .data-table.compact th { padding: 8px 10px; }
.cell-player { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; }
.forecast-cell { min-width: 170px; }
.panel-flush { margin-top: 18px; }

/* ------------------------------------------------------------ tiers */

.tier-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; align-items: stretch; padding: 6px 0; border-top: 1px solid rgba(239, 230, 210, 0.06); }
.tier-row:first-child { border-top: 0; }
.tier-label { display: grid; place-items: center; border-radius: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; color: #120e1a; min-height: 54px; }
.tier-s .tier-label { background: linear-gradient(140deg, #ffe09a, var(--gold)); }
.tier-a .tier-label { background: linear-gradient(140deg, #ddd3ff, var(--moon)); }
.tier-b .tier-label { background: linear-gradient(140deg, #b5d5ff, var(--good)); }
.tier-c .tier-label { background: linear-gradient(140deg, #b8f0d6, #61c39a); }
.tier-d .tier-label { background: linear-gradient(140deg, #ffd0b0, #df8f5d); }
.tier-f .tier-label { background: linear-gradient(140deg, #ffb3b6, var(--evil)); }
.tier-row.is-empty .tier-label { opacity: 0.35; }
.tier-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tier-none { color: var(--faint); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.chip:hover, .chip:focus-visible { transform: translateY(-2px); border-color: var(--line-strong); background: rgba(255, 246, 230, 0.08); }
.chip.is-day { border-color: rgba(232, 184, 96, 0.45); background: var(--gold-soft); }
.chip.is-night { border-color: rgba(184, 166, 255, 0.45); background: var(--moon-soft); }
.chip-text { display: flex; flex-direction: column; line-height: 1.15; }
.chip-text strong { font-size: 0.88rem; }
.chip-text small { color: var(--muted); font-size: 0.72rem; }
.chip-value { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-left: 4px; }
.chip-badge { font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--bg-deep); }
.duo-sigils { display: inline-flex; }
.duo-sigils .sigil + .sigil { margin-left: -9px; }
.chip-small { padding: 3px 10px 3px 3px; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 16px; }

/* ------------------------------------------------------------ roster */

.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.player-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 246, 230, 0.04), rgba(255, 246, 230, 0.015));
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.player-card:hover, .player-card:focus-visible { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.player-card.is-day { border-color: rgba(232, 184, 96, 0.4); background: linear-gradient(160deg, rgba(232, 184, 96, 0.14), rgba(255, 246, 230, 0.015) 60%); }
.player-card.is-night { border-color: rgba(184, 166, 255, 0.4); background: linear-gradient(200deg, rgba(184, 166, 255, 0.15), rgba(255, 246, 230, 0.015) 60%); }
.player-card-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.player-card h3 { font-size: 1.45rem; line-height: 1.05; }
.player-card-top p { color: var(--muted); font-size: 0.82rem; }
.player-card-elo { text-align: right; display: flex; flex-direction: column; gap: 4px; line-height: 1; }
.player-card-elo strong { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; }
.player-card-elo small { color: var(--faint); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.player-card-spark { height: 38px; }
.player-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; flex-wrap: wrap; }
.badges { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.spark { width: 100%; height: 100%; overflow: visible; }
.spark-line { fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linejoin: round; }
.spark-base { stroke: var(--line); stroke-dasharray: 3 4; }
.spark-dot { fill: var(--c); }
.sigil { flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ------------------------------------------------------------ games */

.games-timeline { padding-bottom: 14px; }
.timeline-head { margin-bottom: 10px; }
.timeline-head .section-copy { margin-top: 0; }
.timeline-svg { overflow: visible; }
.axis-mid { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.axis-year { stroke: var(--line); }
.tl-game { cursor: pointer; }
.tl-game line { stroke-width: 2; }
.tl-game circle { stroke: var(--bg); stroke-width: 1.5; transition: r 0.15s; }
.tl-game.won-good line { stroke: rgba(94, 164, 255, 0.45); }
.tl-game.won-good circle { fill: var(--good); }
.tl-game.won-evil line { stroke: rgba(229, 72, 79, 0.45); }
.tl-game.won-evil circle { fill: var(--evil); }
.tl-game.is-upset circle { stroke: var(--gold); stroke-width: 2.5; }
.tl-game.is-dim { opacity: 0.18; }
.tl-game:hover circle, .tl-game:focus circle { r: 8; }
.issues details { padding: 16px 22px; }
.issues summary { cursor: pointer; color: var(--muted); }
.issues summary .eyebrow { display: inline; margin-right: 8px; }
.issues ul { color: var(--muted); margin: 12px 0 0; padding-left: 20px; font-size: 0.88rem; }

/* ------------------------------------------------------------ statistics */

.oracle-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr); gap: 22px; align-items: start; }
.oracle-pool { display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start; }
.oracle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, color 0.15s;
}
.oracle-chip small { color: var(--faint); font-size: 0.72rem; }
.oracle-chip:hover { transform: translateY(-1px); border-color: var(--line-strong); color: var(--text); }
.oracle-chip.is-good { background: var(--good-soft); border-color: var(--good); color: var(--text); }
.oracle-chip.is-evil { background: var(--evil-soft); border-color: var(--evil); color: var(--text); }
.oracle-chip.is-good small, .oracle-chip.is-evil small { color: var(--muted); }
.oracle-result { position: sticky; top: 90px; padding: 20px; border-radius: 16px; background: var(--bg-deep); border: 1px solid var(--line); }
.oracle-empty { display: grid; place-items: center; gap: 10px; color: var(--faint); text-align: center; padding: 34px 0; }
.oracle-empty svg { width: 70px; height: 70px; animation: spin 18s linear infinite; }
.oracle-gauge svg { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.gauge-good, .gauge-evil { fill: none; stroke-width: 18; stroke-linecap: butt; }
.gauge-good { stroke: var(--good); }
.gauge-evil { stroke: var(--evil); }
.gauge-needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; transition: all 0.5s; }
.gauge-hub { fill: var(--text); }
.gauge-label { font-size: 12px; font-weight: 700; }
.oracle-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.oracle-team h4 { display: flex; gap: 8px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.oracle-if { font-size: 0.8rem; color: var(--muted); margin: 6px 0; }
.oracle-team ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.oracle-team li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 7px; align-items: center; font-size: 0.85rem; }
.oracle-team li small { color: var(--faint); }
.oracle-team li b { font-size: 0.78rem; min-width: 34px; text-align: right; }
.stats-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.lookup-results h4 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin-bottom: 10px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mini-grid article { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.mini-grid span { display: block; color: var(--muted); font-size: 0.76rem; font-weight: 600; }
.mini-grid strong { font-family: var(--font-display); font-size: 1.6rem; }
.script-row { display: grid; grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.4fr); gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(239, 230, 210, 0.06); }
.script-row:first-of-type { border-top: 0; margin-top: 12px; }
.script-name { display: flex; flex-direction: column; line-height: 1.2; }
.script-name small { color: var(--faint); }
.split-bar { position: relative; display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--bg-deep); }
.split-bar i { display: flex; align-items: center; font-style: normal; font-size: 0.75rem; font-weight: 700; padding: 0 8px; }
.split-bar .fg { width: var(--w); background: linear-gradient(90deg, #2f5f9f, var(--good)); color: #071322; }
.split-bar .fe { flex: 1; justify-content: flex-end; background: linear-gradient(90deg, var(--evil), #8f252b); color: #fff; }
.split-bar .expect { position: absolute; left: var(--x); top: -2px; bottom: -2px; width: 3px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.role-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.role-row { display: grid; grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.4fr) 70px; gap: 12px; align-items: center; padding: 7px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; transition: background 0.15s; }
.role-row:hover { background: var(--panel-strong); }
.role-name { font-weight: 650; font-size: 0.9rem; }
.role-name small { color: var(--faint); font-weight: 600; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; margin-left: 4px; }
.role-bar { position: relative; display: block; height: 10px; width: var(--w); border-radius: 999px; background: rgba(239, 230, 210, 0.14); overflow: hidden; }
.role-bar .win { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--gold); border-radius: inherit; }
.role-count { text-align: right; font-weight: 700; display: flex; flex-direction: column; line-height: 1.1; }
.role-count small { color: var(--faint); font-weight: 500; font-size: 0.7rem; }

/* ------------------------------------------------------------ about */

.about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
.prose p { color: var(--text); font-size: 1.06rem; line-height: 1.7; max-width: 68ch; }
.prose p + p { margin-top: 14px; }
.about-grid .prose:first-child p:first-child { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.45; }
.facts { margin: 0; display: grid; gap: 12px; }
.facts div { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(239, 230, 210, 0.06); }
.facts dt { color: var(--muted); font-size: 0.85rem; }
.facts dd { margin: 0; font-weight: 600; }
.method h3 { font-size: 2rem; margin-bottom: 8px; }
.method-steps { list-style: none; counter-reset: step; padding: 0; margin: 18px 0 0; display: grid; gap: 26px; }
.method-steps li { counter-increment: step; position: relative; padding-left: 58px; }
.method-steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--gold); border: 1px solid rgba(232, 184, 96, 0.4); background: var(--gold-soft); }
.method-steps h4 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; margin-bottom: 6px; }
.method-steps p { font-size: 0.98rem; color: var(--muted); }
.method-steps pre { margin: 10px 0; padding: 12px 16px; border-radius: 12px; background: var(--bg-deep); border: 1px solid var(--line); color: var(--gold); font-size: 0.85rem; overflow-x: auto; white-space: pre; }
.method-note { margin-top: 24px; color: var(--faint) !important; font-size: 0.9rem !important; }
.title-table { margin-top: 14px; max-width: 760px; }

/* ------------------------------------------------------------ dialogs */

.dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #17121f, #100d17);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog[open] { animation: pop 0.25s cubic-bezier(.2, .7, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.dialog-small { width: min(560px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(5, 4, 9, 0.72); backdrop-filter: blur(4px); }
.dialog-body { max-height: calc(100vh - 34px); overflow-y: auto; padding: clamp(18px, 3vw, 30px); }
.dialog-body > * + * { margin-top: 18px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dialog-heading h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.profile-heading { display: flex; align-items: center; gap: 16px; }
.icon-button { flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel-strong); font-size: 1.3rem; line-height: 1; color: var(--muted); }
.icon-button:hover { color: var(--text); border-color: var(--gold); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.entry-message { margin-right: auto; color: var(--muted); font-size: 0.88rem; }
.entry-message.error { color: var(--down); }

.profile-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.profile-tile { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.profile-tile > span { color: var(--muted); font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }
.profile-tile strong { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; line-height: 1.05; }
.profile-tile small { color: var(--faint); font-size: 0.76rem; }
.profile-next { color: var(--muted); font-size: 0.9rem; }
.profile-next strong { color: var(--gold); }
#playerDialogContent > * + *, #gameDialogContent > * + * { margin-top: 18px; }
#playerDialogContent > .profile-next { margin-top: 8px; }
.profile-section h3 { font-size: 1.3rem; margin-bottom: 10px; }
.profile-section h3 + * { margin-top: 0; }
.profile-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.role-chip { display: inline-flex; gap: 4px; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--line); }
.role-chip.is-good { color: #b9d7ff; background: rgba(94, 164, 255, 0.08); border-color: rgba(94, 164, 255, 0.25); }
.role-chip.is-evil { color: #ffbcbf; background: rgba(229, 72, 79, 0.1); border-color: rgba(229, 72, 79, 0.3); }
.role-chip.is-demon { box-shadow: 0 0 0 1px var(--evil), 0 0 16px rgba(229, 72, 79, 0.25); }
.role-chip b { color: var(--text); }
.partner-list, .seat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.partner-list li, .seat-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
.partner-list li:hover, .seat-list li:hover, .partner-list li:focus-visible, .seat-list li:focus-visible { background: var(--panel-strong); }
.partner-list small, .seat-elo { color: var(--muted); font-size: 0.8rem; }
.partner-list b, .seat-list b { font-size: 0.82rem; min-width: 44px; text-align: right; }
.seat-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.seat-name small { color: var(--muted); font-size: 0.78rem; }
.stat-list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.stat-list div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(239, 230, 210, 0.06); font-size: 0.88rem; }
.stat-list dt { color: var(--muted); }
.stat-list dd { margin: 0; font-weight: 700; }
.team-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.team { padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.team h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.team-good.is-winner { border-color: rgba(94, 164, 255, 0.45); box-shadow: inset 0 0 40px rgba(94, 164, 255, 0.08); }
.team-evil.is-winner { border-color: rgba(229, 72, 79, 0.45); box-shadow: inset 0 0 40px rgba(229, 72, 79, 0.08); }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-grid .field input, .form-grid .field select { min-width: 0; width: 100%; }
.entry-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.entry-tools { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.entry-tools .field input { min-width: 120px; }
.participant-rows { display: grid; gap: 8px; }
.participant-row { display: grid; grid-template-columns: 1.2fr 1.2fr 0.8fr 0.8fr auto auto; gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.participant-row .field input, .participant-row .field select { min-width: 0; width: 100%; }
.entry-preview { padding: 12px 16px; border-radius: 12px; border: 1px dashed var(--line-strong); }
.entry-preview .eyebrow { margin-bottom: 2px; }
.entry-preview .section-copy { margin-top: 0; }

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

.tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 13, 23, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  display: grid;
  gap: 3px;
  font-size: 0.84rem;
}
.tooltip[hidden] { display: none; }
.tooltip.is-wide { min-width: 200px; }
.tooltip strong { font-weight: 700; }
.tip-sub { color: var(--muted); font-size: 0.78rem; }
.tip-row { display: flex; align-items: center; gap: 7px; }
.tip-row i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.tip-row b { margin-left: auto; }
.tip-row em { font-style: normal; font-size: 0.78rem; font-weight: 700; }

.st-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #2a2140, #0c0a12);
  color: var(--gold);
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 0 0 6px rgba(232, 184, 96, 0.08), 0 12px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}
.st-button:hover { transform: rotate(-8deg) scale(1.05); box-shadow: 0 0 0 8px rgba(232, 184, 96, 0.14), 0 12px 40px rgba(0, 0, 0, 0.5); }
.st-button[hidden] { display: none; }

.site-footer { border-top: 1px solid var(--line); padding: 28px clamp(16px, 4vw, 48px) 40px; text-align: center; color: var(--muted); font-size: 0.86rem; }
.footer-mark { font-family: var(--font-display); color: var(--gold); font-size: 1.2rem; }
.footer-small { color: var(--faint); font-size: 0.76rem; margin-top: 6px; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1240px) {
  .site-header { flex-wrap: wrap; gap: 12px; }
  .nav-toggle {
    display: grid;
    gap: 4px;
    margin-left: auto;
    width: 42px;
    height: 42px;
    place-content: center;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--panel-strong);
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.2s, opacity 0.2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .site-nav { display: none; width: 100%; flex-direction: column; gap: 4px; padding: 6px 0 4px; }
  .site-nav.is-open { display: flex; }
  .nav-link { padding: 12px 14px; border-radius: 12px; }
}

@media (max-width: 1080px) {
  .boards, .stats-grid, .about-grid, .oracle-layout { grid-template-columns: minmax(0, 1fr); }
  .oracle-result { position: static; }
  .pulse-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 920px) {
  .hero { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .hero-art { max-width: 340px; order: -1; margin: 0 auto -20px; }
  .diptych { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .diptych-seam { height: 64px; }
  .diptych-seam::before { top: 50%; bottom: auto; left: 10%; right: 10%; width: auto; height: 1px; background: linear-gradient(90deg, var(--gold), var(--moon)); }
  .profile-columns, .team-columns { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .participant-row { grid-template-columns: 1fr 1fr; }
  .participant-row .remove-participant { justify-self: end; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  main { padding-top: 16px; }
  .brand-text small { display: none; }
  .board-row { grid-template-columns: 22px 30px minmax(0, 1fr) 64px 40px; gap: 8px; padding: 8px 6px; }
  .aura-row { grid-template-columns: 22px 30px minmax(0, 1fr) 76px; }
  .board-bar { display: none; }
  .role-breakdown { grid-template-columns: minmax(0, 1fr); }
  .stat-list { grid-template-columns: minmax(0, 1fr); }
  .oracle-split { grid-template-columns: minmax(0, 1fr); }
  .script-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .toolbar .field, .toolbar .field select, .toolbar .field input { width: 100%; }
  .toolbar { width: 100%; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-button { right: 14px; bottom: 14px; width: 52px; height: 52px; }
  .tier-row { grid-template-columns: 44px minmax(0, 1fr); }
  .tier-label { font-size: 1.5rem; min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .tape th, .tape td { padding: 8px 6px; }
  .tape thead th { font-size: 1.25rem; }
  .tape td { font-size: 0.95rem; }
  .tape tbody th { font-size: 0.66rem; letter-spacing: 0.04em; white-space: normal; }
}

/* ------------------------------------------------------------ editors */

body:not(.is-editor) .editor-only { display: none !important; }
.editor-bar { margin-top: 10px; font-size: 0.8rem; color: var(--faint); }
.editor-bar[hidden] { display: none; }
.link-button { border: 0; background: none; padding: 0; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-like { color: var(--text); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link-like:hover { text-decoration-color: var(--gold); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }
.field textarea {
  min-height: 84px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-raise);
  color: var(--text);
  font: 500 0.94rem/1.45 var(--font-ui);
  resize: vertical;
}
.field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.field input[readonly] { color: var(--muted); background: var(--bg-deep); }
.form-grid .field textarea { width: 100%; min-width: 0; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-wide { grid-column: 1 / -1; }
.form-subhead { font-size: 1.3rem; }
.dialog-medium { width: min(720px, calc(100vw - 24px)); }
.dialog-actions[hidden], [hidden].button { display: none; }

/* ------------------------------------------------------------ avatars & profiles */

.avatar { flex-shrink: 0; display: block; border-radius: 50%; object-fit: cover; background: var(--bg-raise); box-shadow: 0 0 0 1px var(--line-strong); }
.profile-avatar { display: block; flex-shrink: 0; }
.profile-avatar .avatar, .profile-avatar svg { width: 72px; height: 72px; }
.table-player { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.crown-icon { flex-shrink: 0; vertical-align: -2px; }
.profile-title-line, .profile-card-title {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold); font-family: var(--font-label); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.profile-status { margin-top: 4px; color: var(--muted); font-style: italic; }
.profile-quote {
  margin: 0; padding: 14px 18px; border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--gold-soft);
  font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-style: italic; line-height: 1.3;
}
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile-major { color: var(--muted); font-size: 0.86rem; }
.subhead { margin: 30px 0 4px; font-size: 1.4rem; }
.subhead[hidden] { display: none; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.profile-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.profile-card:hover, .profile-card:focus-visible { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.profile-card.is-day { border-color: rgba(232, 184, 96, 0.4); background: linear-gradient(160deg, rgba(232, 184, 96, 0.12), rgba(255, 246, 230, 0.015) 60%); }
.profile-card.is-night { border-color: rgba(184, 166, 255, 0.4); background: linear-gradient(200deg, rgba(184, 166, 255, 0.13), rgba(255, 246, 230, 0.015) 60%); }
.profile-card-photo .avatar, .profile-card-photo svg { width: 84px; height: 84px; }
.profile-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-card h3 { font-size: 1.55rem; line-height: 1.05; }
.profile-card-status { color: var(--muted); font-size: 0.86rem; font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.profile-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.profile-card-record { display: flex; flex-direction: column; line-height: 1.15; }
.profile-card-record strong { font-family: var(--font-display); font-size: 1.3rem; }
.profile-card-record small { color: var(--faint); font-size: 0.74rem; }
.others-grid { margin-top: 12px; }

/* ------------------------------------------------------------ awards */

.award-nectar { --award: #f3a64a; --award-soft: rgba(243, 166, 74, 0.15); }
.award-elixir { --award: #c774e8; --award-soft: rgba(199, 116, 232, 0.15); }
.award-svg { flex-shrink: 0; color: var(--award); }
.award-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 7px; border-radius: 999px;
  background: var(--award-soft); color: var(--award); border: 1px solid color-mix(in srgb, var(--award) 40%, transparent);
  font-size: 0.78rem; font-weight: 700;
}
.award-pip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 4px; border-radius: 999px; background: var(--award-soft); color: var(--award); font-size: 0.74rem; font-weight: 700; }
.award-panel { border-color: color-mix(in srgb, var(--award) 35%, transparent); background: linear-gradient(160deg, var(--award-soft), rgba(255, 246, 230, 0.015) 55%); }
.award-panel h3 { display: flex; align-items: center; gap: 10px; font-size: 1.7rem; }
.award-icon { display: inline-flex; }
.award-board { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; counter-reset: award; }
.award-board li[data-player] {
  display: grid; grid-template-columns: 26px auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 7px 12px 7px 8px; border-radius: 12px; background: var(--panel-strong); cursor: pointer; counter-increment: award;
}
.award-board li[data-player]::before { content: counter(award); color: var(--faint); font-size: 0.8rem; text-align: right; }
.award-board li[data-player]:hover { background: rgba(255, 246, 230, 0.08); }
.award-board .award-name { font-weight: 600; }
.award-board b { font-family: var(--font-display); font-size: 1.35rem; color: var(--award); }
.awards-table td { vertical-align: middle; }
.awards-table .chip { margin: 2px 0; }
.game-awards { display: grid; gap: 6px; }
.award-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.award-line strong { color: var(--award); }
.award-names { color: var(--text); }
.award-toggles { display: flex; gap: 6px; align-items: center; align-self: end; min-height: 42px; }
.award-toggle {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--muted); font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.award-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.award-toggle:has(input:checked) { background: var(--award-soft); color: var(--award); border-color: var(--award); }
.award-toggle:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------------------ grades */

.grade {
  display: inline-grid; place-items: center; min-width: 34px; padding: 2px 8px; border-radius: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #120e1a;
}
.grade-s { background: linear-gradient(140deg, #ffe09a, var(--gold)); }
.grade-a { background: linear-gradient(140deg, #ddd3ff, var(--moon)); }
.grade-b { background: linear-gradient(140deg, #b5d5ff, var(--good)); }
.grade-c { background: linear-gradient(140deg, #b8f0d6, #61c39a); }
.grade-d { background: linear-gradient(140deg, #ffd0b0, #df8f5d); }
.grade-f { background: linear-gradient(140deg, #ffb3b6, var(--evil)); }
.trust { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; line-height: 1; }
.grade-table-shell { margin-top: 18px; }
.grade-table td, .grade-table th { text-align: center; }
.grade-table td:first-child, .grade-table th:first-child { text-align: left; }
.grade-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.grade-strip > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--panel-strong); }
.grade-strip span:first-child { color: var(--muted); font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.sw-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 14px; }
.sw-columns h4 { font-family: var(--font-label); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sw-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.grade-editor select { min-height: 34px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--text); }
.grade-editor th[scope="row"] { text-align: left; white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 0.92rem; color: var(--text); }
.grade-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.profile-editor { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.photo-field { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.photo-preview .avatar, .photo-preview svg { width: 120px; height: 120px; }
.file-button { cursor: pointer; }

/* ------------------------------------------------------------ upcoming */

.event-list { display: grid; gap: 12px; }
.event-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.event-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 74px; padding: 8px 0;
  border-radius: 14px; background: var(--gold-soft); border: 1px solid rgba(232, 184, 96, 0.35); line-height: 1.05;
}
.event-date span, .event-date small { font-family: var(--font-label); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.event-date strong { font-family: var(--font-display); font-size: 2rem; }
.event-body h3 { font-size: 1.5rem; }
.event-meta { color: var(--muted); font-size: 0.9rem; }
.event-notes { margin-top: 6px; white-space: pre-line; }
.past-events { margin-top: 26px; }
.past-events summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.past-events .event-card { opacity: 0.7; }

/* ------------------------------------------------------------ gallery */

.gallery-grid { columns: 3 260px; column-gap: 14px; }
.photo-tile {
  break-inside: avoid; margin: 0 0 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; transition: transform 0.2s, border-color 0.2s;
}
.photo-tile:hover, .photo-tile:focus-visible { transform: translateY(-3px); border-color: var(--line-strong); }
.photo-tile img { display: block; width: 100%; height: auto; }
.photo-tile figcaption { padding: 9px 12px; color: var(--muted); font-size: 0.86rem; }
.dialog-photo { width: min(1200px, calc(100vw - 24px)); }
.dialog-photo .dialog-body { padding: 14px; }
.photo-stage { position: relative; display: grid; place-items: center; background: var(--bg-deep); border-radius: 14px; min-height: 200px; }
.photo-stage img { display: block; max-width: 100%; max-height: calc(100vh - 220px); object-fit: contain; border-radius: 14px; }
.photo-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(12, 10, 18, 0.7); font-size: 1.6rem; }
.photo-nav:disabled { opacity: 0.25; cursor: default; }
.photo-prev { left: 10px; }
.photo-next { right: 10px; }
.photo-close { position: absolute; top: 10px; right: 10px; background: rgba(12, 10, 18, 0.7); }
.photo-info { padding: 0 4px; }
.photo-caption { font-family: var(--font-display); font-size: 1.3rem; }
.photo-caption[hidden] { display: none; }
.photo-edit { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 0 4px; }
.upload-list { display: grid; gap: 10px; }
.upload-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.upload-row img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; }
.upload-row.is-done { opacity: 0.45; }
.upload-row .field input { width: 100%; min-width: 0; }

@media (max-width: 920px) {
  .participant-row .award-toggles { grid-column: 1 / -1; }
  .grade-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grade-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .profile-editor { grid-template-columns: minmax(0, 1fr); }
  .form-grid-2, .sw-columns { grid-template-columns: minmax(0, 1fr); }
  .grade-strip, .grade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-card { grid-template-columns: auto minmax(0, 1fr); }
  .event-card .button { grid-column: 1 / -1; justify-self: start; }
  .profile-card { padding: 14px; gap: 12px; }
  .profile-card-photo .avatar, .profile-card-photo svg { width: 64px; height: 64px; }
}
