:root {
  --bg: #0b0d14;
  --surface: #12151f;
  --surface-2: #181c29;
  --border: #252a3a;
  --border-strong: #353b50;
  --text: #e8e9ef;
  --text-2: #a7abba;
  --text-3: #70768a;
  --cyan: #3ee6f2;
  --cyan-dark: #138b96;
  --pink: #ff5c9f;
  --yellow: #f5d547;
  --green: #5ad68f;
  --red: #f0596a;
  --display: 'Fraunces', Georgia, serif;
  --sans: 'Figtree', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
  background:
    radial-gradient(900px 500px at 85% -120px, rgba(255,92,159,.10), transparent 70%),
    radial-gradient(800px 500px at 0% -100px, rgba(62,230,242,.08), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
em { font-style: normal; color: var(--text); font-weight: 600; }
.hidden, .mode-hidden { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.label { font-size: 13px; color: var(--text-3); font-weight: 500; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 20px; height: 58px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 21px; color: var(--cyan); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--pink); font-style: italic; }
.tb-cells { display: flex; margin: 0; min-width: 0; }
.tb-cell { padding: 0 16px; border-left: 1px solid var(--border); min-width: 0; }
.tb-cell dt { font-size: 12px; color: var(--text-3); }
.tb-cell dd { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.tb-elo dd { color: var(--yellow); }
@media (max-width: 640px) {
  .brand { display: none; }
  .tb-cells { width: 100%; justify-content: space-between; }
  .tb-cell { padding: 0 8px; }
  .tb-cell:first-child, .tb-cell.hidden + .tb-cell { border-left: 0; padding-left: 0; }
}

main { max-width: 1120px; margin: 0 auto; padding: 32px 20px 80px; }
.screen { display: none; }
.screen.active { display: block; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; padding: 28px 0 36px; }
.logo { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 9vw, 92px); line-height: .95; letter-spacing: -.035em; color: var(--cyan); }
.logo span { color: var(--pink); font-style: italic; }
.tagline { margin: 22px 0 0; font-size: 18px; color: var(--text-2); max-width: 500px; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } .linkmap { display: none; } }

/* a little Wikipedia link graph with one route drawn through it */
.linkmap { width: 100%; height: auto; overflow: visible; }
.linkmap .edges path { fill: none; stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 3 5; }
.linkmap .route { fill: none; stroke: var(--pink); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 2.4s .4s cubic-bezier(.6,.1,.3,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.linkmap .nodes rect { fill: var(--surface-2); stroke: var(--border-strong); }
.linkmap .nodes text { fill: var(--text-2); font: 500 13px var(--sans); text-anchor: middle; dominant-baseline: central; }
.linkmap .nodes .goal rect { fill: var(--yellow); stroke: var(--yellow); }
.linkmap .nodes .goal text { fill: #1d1800; font: 700 14px var(--display); }
.linkmap .start-dot circle { fill: var(--pink); }
@media (prefers-reduced-motion: reduce) { .linkmap .route { animation: none; stroke-dashoffset: 0; } }

.section-title { font-family: var(--display); font-weight: 700; font-size: 30px; margin: 60px 0 18px; letter-spacing: -.015em; display: flex; align-items: center; gap: 14px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 20px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title .count { font-size: 12px; color: var(--text-3); background: var(--surface-2); border-radius: 4px; padding: 0 6px; }
.home-grid, .lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.home-grid .card + .card, .lobby-grid .card + .card, .daily-grid .card + .card, .report-grid .card + .card { margin-top: 0; }
.daily-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 800px) { .home-grid, .lobby-grid, .daily-grid { grid-template-columns: 1fr; } }

/* ---------- daily card: a race bib ---------- */
.bib {
  --ink: #17140f; --ink-2: #5b5446; --paper: #f4ecd8;
  position: relative; background: var(--paper); color: var(--ink); border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 18px 40px rgba(0,0,0,.45);
  transform: rotate(-.6deg);
}
.bib .pin { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); z-index: 2; }
.bib .pin.tl { top: 14px; left: 14px; } .bib .pin.tr { top: 14px; right: 14px; }
.bib .pin.bl { bottom: 14px; left: 14px; } .bib .pin.br { bottom: 14px; right: 14px; }
.bib-strip {
  display: flex; justify-content: space-between; gap: 12px; background: var(--pink); color: #fff;
  padding: 11px 40px; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
}
.bib-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 14px 40px 0; }
.bib-num { font-family: var(--display); font-weight: 700; line-height: .85; display: flex; align-items: flex-start; gap: 6px; }
.bib-num small { font-size: 22px; font-style: italic; color: var(--ink-2); margin-top: 10px; }
.bib-num span { font-size: clamp(96px, 14vw, 140px); letter-spacing: -.05em; }
.bib-count { font-size: 13px; font-weight: 600; color: var(--ink-2); border: 1.5px solid var(--ink-2); border-radius: 99px; padding: 2px 10px; white-space: nowrap; margin-bottom: 12px; }
.bib-body { padding: 18px 40px 34px; border-top: 2px dashed rgba(23,20,15,.18); margin-top: 18px; }
.bib .muted { color: var(--ink-2); }
.bib .err { color: #b3243a; }
.daily-blurb { color: var(--ink-2); font-size: 16px; margin: 0 0 18px; max-width: 520px; }
.bib em { color: var(--ink); }
.bib .btn { background: transparent; border-color: var(--ink); color: var(--ink); }
.bib .btn-primary { max-width: 320px; background: var(--ink); color: var(--paper); box-shadow: 0 3px 0 #000; border: 0; }
.bib .btn-primary:hover { background: #2c2720; }
.bib .btn-primary:active { box-shadow: 0 1px 0 #000; }
.bib .small { margin: 12px 0 0; }
.done-line { display: flex; gap: 10px; align-items: baseline; font-family: var(--display); font-size: 30px; margin-bottom: 6px; flex-wrap: wrap; }
.done-line b { font-weight: 700; }
.done-line span { color: var(--ink-2); }
@media (max-width: 560px) { .bib-strip, .bib-main, .bib-body { padding-left: 32px; padding-right: 32px; } .bib { transform: none; } }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--text-2); }
input {
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 10px 12px; font-size: 15px; outline: none;
}
input::placeholder { color: var(--text-3); }
input:focus { border-color: var(--cyan); }
.hint { color: var(--text-3); font-size: 14px; margin: 0 0 16px; }
.party-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.join-row { display: flex; gap: 8px; flex: 1; min-width: 200px; }
.join-row input { flex: 1; letter-spacing: .25em; text-transform: uppercase; font-weight: 600; min-width: 0; }
.err { color: var(--red); font-size: 14px; margin-top: 10px; }
.err:empty { display: none; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
  padding: 9px 16px; font-weight: 600; font-size: 14px; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--text-3); background: #1f2433; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary {
  width: 100%; background: var(--cyan); border: 0; color: #061316; font-weight: 700;
  padding: 12px 18px; box-shadow: 0 3px 0 var(--cyan-dark);
}
.btn-primary:hover { background: #6ff0f8; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cyan-dark); }
.btn-big { font-size: 17px; padding: 15px 20px; }
#startBtn { margin-top: 20px; }

/* ---------- leaderboards ---------- */
.leaderboard { list-style: none; margin: 0; padding: 0; counter-reset: lb; }
.leaderboard li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); counter-increment: lb; }
.leaderboard li:first-child { border-top: 0; }
.leaderboard li:not(.muted)::before {
  content: counter(lb); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--surface-2);
}
.leaderboard li:nth-child(1):not(.muted)::before { background: #f5d547; color: #2b2300; }
.leaderboard li:nth-child(2):not(.muted)::before { background: #c9cede; color: #22252e; }
.leaderboard li:nth-child(3):not(.muted)::before { background: #d9905a; color: #2b1604; }
.leaderboard li.you .n { color: var(--cyan); }
.leaderboard .n { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard .e { color: var(--yellow); font-weight: 700; min-width: 36px; text-align: right; }
.leaderboard .w { font-size: 13px; color: var(--text-3); }
.leaderboard.detailed .w { min-width: 70px; text-align: right; }

.howto { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.howto li { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.howto b { font-family: var(--display); font-size: 34px; line-height: 1; font-style: italic; color: var(--cyan); }
.howto li:nth-child(2) b { color: var(--pink); }
.howto li:nth-child(3) b { color: var(--yellow); }
.howto li:nth-child(4) b { color: var(--green); }
@media (max-width: 800px) { .howto { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .howto { grid-template-columns: 1fr; } }

/* ---------- lobby ---------- */
.lobby-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.code { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 10vw, 76px); letter-spacing: .08em; line-height: 1; margin-top: 6px; color: var(--yellow); }
.lobby-actions { display: flex; gap: 8px; }
.manifest { list-style: none; margin: 0; padding: 0; }
.manifest li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.manifest li:first-child { border-top: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #0b0d14; flex: none; }
.manifest .n { flex: 1; font-weight: 600; }
.badge { font-size: 12px; color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 99px; padding: 0 8px; }
.badge.host { color: var(--yellow); border-color: #5a4d17; }
.badge.you { color: var(--cyan); border-color: #1b5a60; }
.manifest .e { color: var(--yellow); font-weight: 700; }
.setting { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); gap: 12px; }
.card-title + .setting { border-top: 0; padding-top: 0; }
.setting > span { color: var(--text-2); }
.setting > b { font-weight: 600; }
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); border-left: 1px solid var(--border-strong); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--cyan); color: #061316; }
.seg button:disabled { cursor: default; }
#waitHost { margin-top: 20px; }

/* ---------- loading ---------- */
.center-screen.active { display: grid; place-items: center; min-height: 50vh; }
.loading { text-align: center; color: var(--text-2); width: 220px; }
.loading .bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-bottom: 14px; }
.loading .bar i { display: block; height: 100%; width: 35%; background: var(--cyan); animation: slide 1s ease-in-out infinite alternate; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(185%); } }

/* ---------- study ---------- */
.study-head { position: sticky; top: 58px; z-index: 10; margin: 0 0 20px; padding-top: 8px; background: var(--bg); }
.study-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px 22px;
}
.target-title { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3.6vw, 36px); line-height: 1.15; margin-top: 4px; color: var(--pink); letter-spacing: -.01em; }
.countdown { text-align: right; flex: none; }
.countdown span { font-weight: 700; font-size: 46px; line-height: 1; display: block; }
.countdown small { font-size: 13px; color: var(--text-3); }
.countdown.urgent span { color: var(--red); }
.study-bar { height: 4px; background: var(--surface-2); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.study-bar div { height: 100%; width: 100%; background: var(--pink); transition: width .25s linear; }

/* ---------- race ---------- */
.race-bar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 16px; position: sticky; top: 66px; z-index: 10;
  box-shadow: 0 -8px 0 var(--bg);
}
.rb-target { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.rb-target b { font-family: var(--display); font-size: 22px; color: var(--pink); line-height: 1.2; font-weight: 700; }
.rb-stat { display: flex; flex-direction: column; }
.rb-stat b { font-size: 20px; font-weight: 700; }
.rb-btns { display: flex; gap: 6px; }
.race-grid { display: grid; grid-template-columns: 1fr 240px; gap: 20px; align-items: start; }
#scr-race.solo .race-grid { grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; }
@media (max-width: 900px) { .race-grid { grid-template-columns: 1fr; } .racers { order: -1; } }
.racers { position: sticky; top: 156px; margin-top: 30px; }
.racers ul { list-style: none; margin: 0; padding: 0; }
.racers li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.racers li:first-child { border-top: 0; }
.racers .n { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.racers .c { color: var(--text-2); font-weight: 600; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--text-3); min-height: 20px; }
.crumbs span.sep { color: var(--border-strong); }
.crumbs span.cur { color: var(--text); font-weight: 500; }

.peek { position: fixed; inset: 0; background: rgba(5,6,10,.7); display: grid; place-items: center; z-index: 50; padding: 16px; }
.peek-inner { max-width: 540px; width: 100%; }
.peek h3 { font-family: var(--display); font-size: 28px; font-weight: 700; margin: 4px 0 10px; }
.peek p { font-family: var(--serif); line-height: 1.65; font-size: 16px; color: var(--text-2); margin: 0 0 18px; }

/* ---------- article (dark reader) ---------- */
.paper {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px clamp(16px, 4vw, 48px); font-family: var(--serif); font-size: 17px; line-height: 1.7; color: #d4d7e2;
  min-height: 300px; overflow-wrap: anywhere;
}
.paper.loading-page { opacity: .45; pointer-events: none; }
.paper h1.art-title { font-family: var(--display); font-weight: 700; font-size: 38px; margin: 0 0 4px; line-height: 1.15; color: #fff; letter-spacing: -.01em; }
.paper .art-sub { font-family: var(--sans); font-size: 14px; color: var(--text-3); margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.paper h2 { font-family: var(--serif); font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-top: 1.6em; font-size: 25px; color: #fff; }
.paper h3, .paper h4 { color: #fff; margin-top: 1.3em; }
.paper a { color: var(--cyan); text-decoration: none; }
.paper a.wl:hover { text-decoration: underline; text-underline-offset: 3px; }
.paper a.dead { color: inherit; pointer-events: none; }
.paper.study a { pointer-events: none; }
.paper img { max-width: 100%; height: auto; background: #f4f4f4; border-radius: 2px; }
/* Wikipedia inline colors were made for white pages: neutralise them */
.paper [style*="background"] { background: transparent !important; }
.paper [style*="color"]:not(img) { color: inherit !important; }
.paper table { border-collapse: collapse; font-size: 14px; max-width: 100%; }
.paper td, .paper th { border: 1px solid var(--border); padding: 5px 8px; vertical-align: top; }
.paper th { color: #fff; }
.paper .infobox { float: right; clear: right; margin: 0 0 18px 22px; max-width: 320px; background: var(--surface-2); font-size: 13px; line-height: 1.45; font-family: var(--sans); }
.paper .infobox th { text-align: left; }
.paper .infobox-above, .paper .infobox-title { font-size: 16px; text-align: center !important; }
.paper figure[typeof~="mw:File/Thumb"], .paper figure[typeof~="mw:File/Frame"], .paper .thumb {
  float: right; clear: right; margin: 4px 0 16px 20px; max-width: 280px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 6px;
}
.paper figure figcaption { font-family: var(--sans); font-size: 13px; line-height: 1.45; padding: 6px 2px 2px; color: var(--text-2); }
.paper .navbox { font-size: 13px; margin-top: 22px; width: 100%; font-family: var(--sans); }
.paper .navbox-title, .paper .navbox-group { background: var(--surface-2) !important; }
.paper .hatnote { font-style: italic; color: var(--text-2); padding-left: 1.5em; margin-bottom: .6em; }
.paper .mw-collapsible-toggle, .paper .mw-editsection, .paper .reference, .paper .reflist, .paper .mw-references-wrap,
.paper .noprint, .paper .metadata, .paper .ambox, .paper .sistersitebox, .paper .side-box, .paper .mw-empty-elt, .paper style, .paper link { display: none !important; }
@media (max-width: 640px) { .paper .infobox, .paper .thumb, .paper figure { float: none; margin: 0 0 14px; max-width: 100%; } }

/* ---------- daily report ---------- */
.report-hero { padding: 20px 0 28px; }
.report-headline { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 6vw, 58px); line-height: 1.05; margin-top: 8px; letter-spacing: -.02em; }
.route { margin: 12px 0 0; color: var(--text-2); font-size: 17px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { --c: var(--cyan); background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: var(--radius); padding: 14px 18px; }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1.1; margin-top: 2px; color: var(--c); }
.stat:nth-child(2) { --c: var(--pink); }
.stat:nth-child(3) { --c: var(--yellow); }
.stat:nth-child(4) { --c: var(--green); }
@media (max-width: 640px) { .stat-row { grid-template-columns: 1fr 1fr; } }
.report-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 800px) { .report-grid { grid-template-columns: 1fr; } }
.cmp { margin: 0 0 8px; font-size: 16px; color: var(--text-2); }
.cmp b { color: var(--text); font-size: 18px; }
.cmp.muted { font-size: 14px; color: var(--text-3); margin-top: 12px; }
.hist-wrap { margin-top: 20px; }
.hist { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; height: 140px; margin-top: 10px; }
.hcol { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; text-align: center; min-width: 0; }
.hbar { background: var(--border-strong); border-radius: 3px 3px 0 0; }
.hcol.mine .hbar { background: var(--pink); }
.hn { font-size: 12px; color: var(--text-3); min-height: 18px; }
.hl { font-size: 12px; color: var(--text-3); padding-top: 4px; border-top: 1px solid var(--border-strong); }
.hcol.mine .hl, .hcol.mine .hn { color: var(--pink); font-weight: 700; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats b { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.mini-stats span { font-size: 13px; color: var(--text-3); }
.route-block + .route-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.route-block .label { margin-bottom: 8px; }
.report-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.report-actions .btn-primary { width: auto; }
.score-note { font-size: 13px; color: var(--text-3); margin-top: 16px; }

/* ---------- party results ---------- */
.logbook { list-style: none; margin: 0; padding: 0; }
.logbook li { padding: 14px 0; border-top: 1px solid var(--border); }
.logbook li:first-child { border-top: 0; padding-top: 0; }
.logbook .row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.logbook .n { flex: 1; font-weight: 600; }
.logbook .d { font-weight: 700; }
.logbook .d.up { color: var(--green); }
.logbook .d.down { color: var(--red); }
.path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.path span.chip { border: 1px solid var(--border-strong); border-radius: 99px; padding: 2px 10px; color: var(--text-2); }
.path span.chip.goal { background: var(--yellow); border-color: var(--yellow); color: #1a1500; font-weight: 600; }
.path span.arr { color: var(--text-3); }
.res-actions { max-width: 420px; margin: 28px 0 0; display: flex; flex-direction: column; gap: 10px; }
.winner-flag { font-size: 12px; font-weight: 600; background: var(--yellow); color: #1a1500; border-radius: 99px; padding: 1px 9px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 10px 16px; font-size: 14px; transition: transform .2s; z-index: 200; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }
