:root {
  color-scheme: light;
  --paper: #eef0ef;
  --ink: #141414;
  --muted: #65625b;
  --rail: #222;
  --line: #d2d6d3;
  --panel: #fafbfa;
  --accent: #006bb6;
  --danger: #b3261e;
  --ok: #006b3f;
  font-family: Inter, Avenir, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
select,
a {
  font: inherit;
}

a {
  color: var(--accent);
  text-underline-offset: .18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  border-radius: 2px;
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

button {
  border: 0;
  cursor: pointer;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  border-radius: 4px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 900;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 8px solid var(--rail);
  padding-bottom: 18px;
}

.kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
}

.home-title {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(36px, 7vw, 74px);
  line-height: .88;
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 900;
  text-align: left;
}

.home-title:hover,
.home-title:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.objective {
  max-width: 540px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.date-lockup {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.date-lockup strong {
  color: var(--ink);
  font-size: 26px;
}

.game {
  padding-top: 24px;
}

.site-footer {
  display: grid;
  gap: 10px;
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
}

.site-footer p {
  max-width: 760px;
  margin: 0;
}

.info-shell {
  width: min(900px, calc(100vw - 32px));
}

.info-masthead {
  align-items: start;
}

.brand-link {
  display: inline-block;
  color: var(--ink);
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 900;
  line-height: .9;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-link:hover {
  text-decoration: none;
}

.info-main {
  padding-top: 28px;
}

.back-row {
  margin: 0 0 22px;
}

.back-row a {
  color: var(--ink);
  font-weight: 900;
}

.info-main > header {
  margin-bottom: 26px;
}

.info-main h1 {
  max-width: 760px;
  font-size: clamp(34px, 7vw, 62px);
  line-height: .95;
  text-transform: uppercase;
}

.lede {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.info-card {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 30px);
  background: var(--panel);
}

.info-card h2 {
  margin-bottom: 12px;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.1;
}

.info-card h3 {
  margin: 22px 0 8px;
  font-size: 18px;
}

.info-card p,
.info-card li,
.definition-list dd,
.definition-list dt {
  line-height: 1.65;
}

.info-card p:last-child,
.info-card ul:last-child,
.info-card ol:last-child {
  margin-bottom: 0;
}

.info-card li + li {
  margin-top: 8px;
}

.formula {
  overflow-wrap: anywhere;
  border-left: 6px solid var(--accent);
  padding: 12px 14px;
  background: #eef6fb;
  font-weight: 800;
}

.definition-list {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 10px 18px;
  margin: 0;
}

.definition-list dt {
  font-weight: 900;
}

.definition-list dd {
  margin: 0;
}

.placeholder {
  border: 1px dashed var(--muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 800;
}

.timeline {
  margin: 0;
  padding-left: 22px;
}

.timeline time {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.board {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.side,
.workspace,
.summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side {
  padding: 18px;
  display: grid;
  gap: 18px;
}

.station-pair {
  display: grid;
  gap: 12px;
}

.station {
  border-left: 8px solid var(--rail);
  padding-left: 12px;
}

.station span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.station strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
}

.intro-prompt {
  margin: -2px 0 0;
  padding: 10px 12px;
  border-left: 6px solid var(--accent);
  background: #eef6fb;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
}

.orientation-map {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fbfaf4;
}

.map-toggle summary {
  display: none;
}

.orientation-map svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 11;
}

.map-bg {
  fill: #f3efe4;
}

.map-park {
  fill: rgba(93, 142, 89, .18);
}

.paris-outline {
  fill: none;
  stroke: #9c9588;
  stroke-width: 2.2;
}

.seine {
  fill: none;
  stroke: #6ca6c8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.5;
}

.map-marker circle {
  stroke: none;
}

.map-marker text {
  paint-order: stroke;
  stroke: #fffdf8;
  stroke-linejoin: round;
  stroke-width: 4;
  fill: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-anchor: middle;
}

.start-marker circle {
  fill: var(--accent);
}

.end-marker circle {
  fill: var(--danger);
}

.current-marker circle {
  fill: var(--ok);
}

.hint {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 6px solid var(--accent);
  background: #eef6fb;
  font-weight: 800;
}

.route-list {
  display: grid;
  gap: 10px;
}

.route-summary summary {
  display: block;
  margin: 0 0 1em;
  font-size: 1.17em;
  font-weight: bold;
  list-style: none;
  pointer-events: none;
}

.route-summary summary::-webkit-details-marker {
  display: none;
}

.muted {
  color: var(--muted);
}

.leg-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.line-badge {
  min-width: 38px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.2);
  font-weight: 900;
  color: #fff;
}

.walk-badge {
  min-width: 38px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 2px solid rgba(18, 50, 59, .18);
  background: #eef6fb;
  color: var(--ink);
  font-weight: 900;
}

.leg-chip p {
  margin: 0;
  min-width: 0;
  padding-right: 8px;
}

.leg-chip small {
  color: var(--muted);
}

.leg-detail {
  display: block;
  margin-top: 5px;
}

.leg-chip > small:last-child {
  justify-self: end;
  min-width: 58px;
  text-align: right;
}

.workspace {
  min-height: 620px;
  padding: 20px;
}

.step-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--rail);
  margin-bottom: 16px;
  padding-bottom: 10px;
}

.step-title h2 {
  margin: 0;
  font-size: 28px;
}

.step-title span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.choice-section {
  display: grid;
  gap: 8px;
}

.choice-section + .choice-section {
  margin-top: 16px;
}

.choice-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.choice {
  min-height: 56px;
  border: 2px solid var(--rail);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 5px;
}

.choice:hover,
.choice:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.choice strong {
  font-size: 17px;
}

.choice small {
  color: var(--muted);
  line-height: 1.25;
}

.stop-strip {
  display: grid;
  position: relative;
  gap: 6px;
  max-width: 760px;
}

.stop-choice {
  position: relative;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 9px 12px;
}

.stop-node {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 3px solid var(--rail);
  border-radius: 999px;
  background: #fff;
}

.stop-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.destination-choice {
  border-color: var(--ok);
  background: #eef8f2;
  box-shadow: inset 0 0 0 3px rgba(0,107,63,.28);
}

.destination-choice strong {
  color: var(--ok);
}

.destination-choice .stop-node {
  border-color: var(--ok);
  background: var(--ok);
}

.destination-choice .stop-main > small {
  color: var(--ok);
  font-weight: 900;
  text-transform: uppercase;
}

.stop-meta {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 132px;
}

.stop-time {
  font-weight: 900;
  white-space: nowrap;
}

.transfer-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: end;
  min-width: 0;
}

.transfer-lines .line-badge {
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-width: 1px;
  font-size: 12px;
}

.line-choice {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.line-choice > span {
  display: grid;
  gap: 2px;
}

.walk-choice {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.walk-choice > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.walk-lines {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 4px;
  max-width: 116px;
}

.walk-lines .line-badge {
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-width: 1px;
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.action {
  min-height: 42px;
  padding: 0 14px;
  border: 2px solid var(--rail);
  border-radius: 4px;
  background: var(--rail);
  color: #fff;
  font-weight: 900;
}

.action.secondary {
  background: transparent;
  color: var(--rail);
}

.notice {
  margin-top: 14px;
  color: var(--danger);
  font-weight: 800;
}

.result {
  display: grid;
  gap: 18px;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 2px solid var(--rail);
}

.scorebox {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.scorebox:last-child {
  border-right: 0;
}

.scorebox span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.scorebox strong {
  font-size: 28px;
}

.result-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}

.route-panel {
  min-width: 0;
}

.route-panel h3 {
  margin-bottom: 10px;
  border-bottom: 2px solid var(--rail);
  padding-bottom: 8px;
}

.time-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--line);
}

.time-breakdown span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  background: #fff;
}

.time-breakdown small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.time-breakdown strong {
  font-size: 14px;
}

.summary {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.summary h2 {
  margin: 0;
  font-size: 42px;
}

.share {
  border: 2px solid var(--rail);
  padding: 14px;
  white-space: pre-wrap;
  font-family: "Cascadia Mono", Consolas, monospace;
  background: #fff;
}

.copy-status {
  align-self: center;
  color: var(--ok);
  font-weight: 900;
}

.source-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 20px, 680px);
    padding: 14px 0 86px;
  }

  .masthead,
  .board {
    grid-template-columns: 1fr;
  }

  .masthead {
    display: grid;
    align-items: start;
  }

  .date-lockup {
    justify-items: start;
  }

  .game {
    padding-top: 14px;
  }

  .board {
    gap: 12px;
  }

  .side {
    padding: 12px;
    gap: 10px;
  }

  .station-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .station {
    min-width: 0;
    border-left-width: 6px;
    padding-left: 8px;
  }

  .station span {
    font-size: 11px;
  }

  .station strong {
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.12;
  }

  .map-toggle summary,
  .route-summary summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 36px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 7px 10px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    pointer-events: auto;
  }

  .map-toggle summary::after,
  .route-summary summary::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
  }

  .map-toggle[open] summary::after,
  .route-summary[open] summary::after {
    content: "-";
  }

  .orientation-map {
    margin-top: 8px;
  }

  .orientation-map svg {
    height: 118px;
    aspect-ratio: auto;
  }

  .intro-prompt {
    display: none;
  }

  .route-summary .route-list {
    max-height: 172px;
    margin-top: 8px;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }

  .route-summary .muted {
    margin: 0;
    font-size: 14px;
  }

  .leg-chip {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
  }

  .leg-chip > small:last-child {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    text-align: left;
  }

  .workspace {
    min-height: 0;
    padding: 14px;
  }

  .step-title {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .step-title h2 {
    font-size: 24px;
  }

  .step-title span {
    line-height: 1.25;
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stop-strip {
    max-width: none;
  }

  .choice {
    min-width: 0;
    min-height: 48px;
    padding: 9px;
    overflow-wrap: anywhere;
  }

  .choice strong,
  .choice small {
    min-width: 0;
  }

  .choice strong {
    font-size: 16px;
    line-height: 1.2;
  }

  .choice small {
    line-height: 1.25;
  }

  .choice:not(.line-choice) {
    grid-template-columns: 1fr;
  }

  .stop-choice {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 10px;
  }

  .stop-meta {
    grid-column: 2;
    flex-wrap: wrap;
    gap: 6px;
    justify-items: start;
    justify-content: start;
    min-width: 0;
  }

  .transfer-lines {
    justify-content: start;
  }

  .walk-choice {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .walk-lines {
    max-width: 78px;
  }

  .line-choice {
    align-content: center;
  }

  .toolbar {
    margin-top: 14px;
  }

  .action {
    min-height: 44px;
    flex: 1 1 142px;
    padding: 0 10px;
    white-space: normal;
  }

  .scoreboard {
    grid-template-columns: 1fr;
  }

  .scorebox {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .scorebox:last-child {
    border-bottom: 0;
  }

  .time-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .line-choice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .definition-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .definition-list dd + dt {
    margin-top: 12px;
  }
}
