:root {
  --bg: #16132b;
  --bg-2: #211c3d;
  --bg-3: #2a2450;
  --ink: #efe9ff;
  --muted: #b3a9cf;
  --gold: #f4c96b;
  --gold-deep: #d9a441;
  --lav: #b9a3ff;
  --pink: #ff9fcf;
  --mint: #8fe3b0;
  --danger: #e36a7a;
  --twitch: #9146ff;
  --line: rgba(255, 255, 255, 0.1);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #3a2d6b 0%, transparent 60%), var(--bg);
  color: var(--ink);
  font: 16px/1.55 'Nunito', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}

.sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 70%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 15%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 75% 45%, #fff5 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 80%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 20% 90%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 65% 88%, #fff5 50%, transparent 51%);
}

a { color: var(--gold); }
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; font-family: 'Nunito', sans-serif; font-weight: 800; }
code { background: #0003; padding: 1px 6px; border-radius: 6px; font-size: .9em; }

.top, main, .foot { position: relative; z-index: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.2rem; }
.brand-mark { color: var(--gold); font-size: 1.3rem; }
.top nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.top nav a, .linkish { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 700; background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.top nav a:hover, .linkish:hover { color: var(--ink); }
.top nav a.on { color: var(--bg); background: var(--gold); }
form.inline { display: inline; margin: 0; }
main { flex: 1; padding-top: 28px; padding-bottom: 48px; }

.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 800; color: var(--lav); margin: 0 0 8px; display: inline-flex; align-items: center; gap: 8px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 #8fe3b088; animation: pulse 2s infinite; }
.pulse.off { background: var(--muted); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px #8fe3b000; } 100% { box-shadow: 0 0 0 0 #8fe3b000; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.hero { text-align: center; padding: 20px 0 30px; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); }
.lede { color: var(--muted); max-width: 580px; margin: 0 auto 18px; }
.server-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.pill b { color: var(--gold); }
.pill .dotlight { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.pill.down { opacity: .6; }
.pill.down .dotlight { background: var(--danger); }
.pill.down b { color: var(--muted); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid.two { margin-bottom: 18px; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
main > .card { margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.more { font-weight: 700; text-decoration: none; font-size: .9rem; }
.empty { color: var(--muted); }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .85rem; }

.server-block + .server-block { margin-top: 14px; }
.heads { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.heads li { display: flex; align-items: center; gap: 8px; background: var(--bg-3); padding: 4px 12px 4px 4px; border-radius: 999px; font-weight: 700; font-size: .92rem; }
.heads img { border-radius: 50%; image-rendering: pixelated; }

.tabs { display: inline-flex; background: var(--bg-3); border-radius: 999px; padding: 3px; }
.tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: .85rem; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.tabs button.on { background: var(--lav); color: #211a3d; }
.ranks { list-style: none; margin: 8px 0 0; padding: 0; }
.ranks li { display: grid; grid-template-columns: 26px 24px minmax(0, 7rem) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; }
.ranks li.empty { display: block; }
.ranks img, .list img, .av { border-radius: 5px; image-rendering: pixelated; }
.rank { font-weight: 800; color: var(--muted); text-align: center; }
.rank.r1 { color: var(--gold); } .rank.r2 { color: #d8d8e8; } .rank.r3 { color: #e3a878; }
.who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--lav), var(--pink)); border-radius: 999px; }
.val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--gold); min-width: 3.5em; text-align: right; }

.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.list li:last-child { border-bottom: 0; }
.list .when { font-size: .85rem; font-weight: 700; color: var(--lav); }
.list li.today { background: linear-gradient(90deg, #f4c96b22, transparent); border-radius: 10px; padding-left: 6px; }
.list li.today .when { color: var(--gold); }

.plist { list-style: none; margin: 8px 0 0; padding: 0; }
.plist li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.plist li:last-child { border-bottom: 0; }
.ptext { margin: 0 0 4px; font-family: 'Fraunces', serif; font-style: italic; overflow-wrap: anywhere; }
.pmeta { margin: 0; font-size: .85rem; color: var(--muted); }
.src { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; background: #b9a3ff33; color: var(--lav); margin-left: 4px; }
.src.mc { background: #8fe3b033; color: var(--mint); }

.totals { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 28px; text-align: center; }
.totals b { display: block; font-family: 'Fraunces', serif; font-size: 2rem; color: var(--gold); }
.totals span { color: var(--muted); font-size: .9rem; }

.btn { display: inline-block; border: 0; cursor: pointer; text-decoration: none; background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #2b2140; font: 800 1rem 'Nunito', sans-serif; padding: 10px 22px; border-radius: 999px; }
.btn:hover { filter: brightness(1.06); }
.btn.small { padding: 6px 14px; font-size: .88rem; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.twitch { background: var(--twitch); color: #fff; }
.danger-text { color: var(--danger) !important; }

.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.panel.narrow { max-width: 580px; margin: 0 auto; }
.panel.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.stack label { font-weight: 700; font-size: .9rem; margin-top: 6px; }
.stack .btn { align-self: flex-start; margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input { width: 100%; font: inherit; color: var(--ink); background: #15122a; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.row input { width: auto; flex: 1 1 160px; }
input:focus { outline: 2px solid var(--lav); outline-offset: 1px; }
input.code { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; max-width: 12rem; }
.notice { padding: 10px 14px; border-radius: 10px; background: #2c2650; border: 1px solid var(--line); }
.notice.ok { background: #25402a; border-color: #3e6b45; }
.notice.err { background: #4a2330; border-color: #7a3848; }
.notice.small { font-size: .85rem; padding: 6px 10px; margin: 8px 0 0; }
.steps { padding-left: 1.2em; }
.steps li { margin: 6px 0; }

.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head .who { display: flex; align-items: center; gap: 14px; }
.dash-head .who img { border-radius: 50%; }
.dash-head h1 { margin: 0; }
.dash-head p { margin: 0; }
.linked { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.linked img { border-radius: 8px; image-rendering: pixelated; }
.linked p { margin: 0; }
.state { display: inline-block; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; }
.state.on { background: #8fe3b033; color: var(--mint); }
.state.off { background: #e36a7a33; color: #ff9aa6; }
.state.wait { background: #f4c96b33; color: var(--gold); }

.effects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 16px; }
.effect { background: var(--bg-3); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.effect.on { border-color: var(--lav); }
.toggle { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.toggle input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--lav); flex: none; }
.toggle .emoji { font-size: 1.4rem; line-height: 1; }
.toggle small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.nums label { font-size: .8rem; color: var(--muted); font-weight: 700; }
.nums input { margin-top: 4px; }
.tests { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.chip { background: var(--bg-3); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.chip:hover { border-color: var(--lav); }

.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.card:has(.tbl) { overflow-x: auto; }
.tbl th { text-align: left; color: var(--muted); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px 6px 0; white-space: nowrap; }
.tbl td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr.dim td { opacity: .5; }
.tbl .acts { white-space: nowrap; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--muted); }

.foot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding-top: 18px; padding-bottom: 28px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.foot .dot { opacity: .5; }

@media (max-width: 760px) {
  .grid, .effects { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .panel { padding: 20px; }
  .ranks li { grid-template-columns: 22px 24px minmax(0, 1fr) auto; }
  .ranks .bar { display: none; }
  .list li { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .list li .muted { display: none; }
  .totals { gap: 24px; }
}

.bits-note { background: #9146ff1f; border: 1px solid #9146ff55; border-radius: 12px; padding: 10px 14px; font-size: .9rem; margin: 10px 0 6px; }
.bits-note .warn { color: var(--gold); font-weight: 700; }
.cat-title { margin: 22px 0 2px; font-size: 1.05rem; }
.cat-title.scary { color: #ff9aa6; }
.effect.scare.on { border-color: #e36a7a; }
.badge-scary { display: inline-block; font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: #e36a7a33; color: #ff9aa6; padding: 1px 7px; border-radius: 999px; vertical-align: 2px; }
.chip.scary:hover { border-color: var(--danger); }
