:root {
  color-scheme: light;
  --page: #f6f5fa;
  --paper: #fff;
  --panel: #faf7fd;
  --line: #e2d9ec;
  --ink: #251d37;
  --muted: #635570;
  --accent: #5a46db;
  --accent-ink: #543d82;
  --accent-wash: #f1eafa;
  --light: #eeedd7;
  --dark: #83956c;
  font: 16px/1.45 DadChessNavigation, Manrope, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100svh; margin: 0; color: var(--ink); background: var(--page); }
button, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, a { -webkit-tap-highlight-color: transparent; }
button, a, select, input { outline-offset: 3px; }
:focus-visible { outline: 2px solid #7560d8; }
a { color: inherit; }
.skip-link {
  position: fixed;
  z-index: 20;
  inset: 8px auto auto 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-140%);
}
.skip-link:focus { transform: translateY(0); }
.svg-defs { position: absolute; width: 0; height: 0; pointer-events: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon-button, .map-button, .control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--accent-ink);
  background: var(--paper);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.2;
  transition: background-color 160ms ease, border-color 160ms ease;
}
:is(.icon-button,.map-button,.control):hover:not(:disabled) { background: var(--accent-wash); }
:is(.icon-button,.map-button,.control) svg, .timer svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.control.primary { color: var(--paper); border-color: var(--accent); background: var(--accent); }
.control.primary:hover:not(:disabled) { border-color: #4b36c5; background: #4b36c5; }
.control:disabled, .icon-button:disabled { opacity: .48; }
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
  column-gap: 18px;
  row-gap: 34px;
  align-items: stretch;
  width: min(calc(100% - 48px), 1004px);
  margin-inline: auto;
  padding: 31px 0 24px;
}
.route-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; min-width: 0; }
.route-head-main { flex: 1; min-width: 0; }
.route-head h1 { margin: 0; font-size: clamp(25px, 3vw, 37px); line-height: 1.12; letter-spacing: -.034em; }
.route-head-tools { display: flex; flex: none; gap: 7px; }
.sound-muted, #task-sound[aria-pressed="false"] .sound-waves { display: none; }
#task-sound[aria-pressed="false"] .sound-muted { display: inline; }
#task-settings { display: none; }

.board-panel { width: 100%; justify-self: end; }
.chessboard {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  background:
    conic-gradient(var(--light) 25%, var(--dark) 0 50%, var(--light) 0 75%, var(--dark) 0)
    left top / 25% 25%;
  box-shadow: 0 3px 0 #dcded0;
  touch-action: none;
  user-select: none;
}
.square {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  touch-action: none;
  cursor: default;
  border: 0;
  border-radius: 0;
}
.square.light { background: var(--light); }
.square.dark { background: var(--dark); }
.square:focus-visible { outline: 3px solid #172519; outline-offset: -4px; box-shadow: inset 0 0 0 7px #fff0b2; z-index: 5; }
.square:is(.selected, .last, .correct, .mistake):not(.hint)::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: #e9d884a3;
  pointer-events: none;
}
.square.selected:not(.hint)::before { background: #eed887b5; }
.square.correct:not(.hint, .selected)::before { background: #a9c284bf; }
.square.mistake:not(.hint)::before { background: #e2a396d6; }
.square.mistake-flash::before { animation: mistake-flash 280ms ease-out both; }
@keyframes mistake-flash {
  from { background: #e76660; }
  to { background: #e2a396d6; }
}
.square.hint::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: #d1b7eabf;
  pointer-events: none;
}
.square.target::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 35%;
  border-radius: 50%;
  background: #19261540;
  pointer-events: none;
}
.square.target:has(.piece)::after {
  inset: 0;
  border-radius: 0;
  background: radial-gradient(circle closest-side, transparent 83%, #19261540 85%);
}
.square.piece-draggable { cursor: grab; }
.chessboard.dragging, .chessboard.dragging .square { cursor: grabbing; }
.square.drag-over { box-shadow: inset 0 0 0 2px #ffe36a; }
.square > .piece {
  display: block;
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.square > .restore-capture { animation: restore-capture 140ms ease-out both; }
@keyframes restore-capture { from { opacity: 0; scale: .83; } }
.square .file, .square .rank {
  position: absolute;
  z-index: 7;
  font: 700 clamp(9px, 1.3vw, 12px)/1 Arial, sans-serif;
  color: #46563b;
  pointer-events: none;
}
.square .file { right: 4%; bottom: 4%; }
.square .rank { left: 6.5%; top: 6%; }
@media (max-width: 1000px) {
  .square.hint::before { border-width: 2px; }
  .square .file, .square .rank { font-size: 10px; }
}

.square.dark :is(.file, .rank) { color: #fffdf2; }

.journey {
  min-width: 0;
  min-height: 430px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 2px #ebe2f0;
}
.journey-task {
  grid-template-rows: auto auto auto;
  align-self: start;
  min-height: 0;
  gap: 13px;
  padding: 15px;
}
.route-progress {
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 740;
}
.journey-task .route-progress { grid-row: 3; padding: 10px 0 0; border-top: 1px solid var(--line); }
.route-level-label { display: flex; grid-column: 1/-1; align-items: baseline; justify-content: space-between; gap: 8px; }
.route-level-label strong { font-size: 19px; letter-spacing: -.02em; }
#route-eyebrow, .route-remaining, .score-line .rating { color: var(--muted); }
.journey-task .route-level-label { display: none; }
.score-line { display: flex; grid-column: 1/-1; align-items: baseline; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.points-total { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.score-change { margin-inline-start: 2px; color: #2e7446; font-weight: 830; }
.score-change[data-sign="minus"] { color: #9f494c; }
.route-track { grid-column: 1/-1; display: flex; }
#route-points { flex: 1; height: 6px; overflow: hidden; border-radius: 99px; background: #ece5f4; }
#route-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 170ms ease; }
.route-remaining { margin: 0; align-self: center; }
.route-streak { display: inline-flex; align-items: center; gap: 3px; color: #855523; }
.route-streak svg { width: 14px; height: 14px; fill: currentColor; }

.route-map {
  grid-row: 2;
  position: relative;
  min-height: 260px;
  overflow: hidden;
  container-type: size;
  background: #292339 url('/assets/img/tasks/route-landscape.webp') center / cover no-repeat;
}
.route-map::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  background: linear-gradient(180deg,#26213855,transparent 27px,transparent calc(100% - 20px),#26213866);
  pointer-events: none;
}
.route-map-bar { position: absolute; z-index: 6; inset: 8px 8px auto; display: flex; justify-content: end; pointer-events: none; }
.route-browse { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.route-return { pointer-events: auto; color: #f7effa; background: #332642e8; border-color: #bca8c184; font-size: 11px; }
.route-return:hover:not(:disabled) { background: #4d3a5e; }
.route-return[data-direction="up"] svg { transform: rotate(180deg); }
.route-scroll {
  --level-pitch: max(28px, 7.3cqh);
  position: absolute;
  inset: 0;
  overflow: hidden auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  overflow-anchor: none;
}
.route-scroll::-webkit-scrollbar { display: none; }
.route-scroll:focus-visible { outline-offset: -3px; }
.route-nodes { display: flex; flex-direction: column-reverse; min-height: 100%; margin: 0; padding: 24px 0 12px; list-style: none; }
.route-zone { position: relative; flex: none; height: calc(var(--zone-rows) * var(--level-pitch)); --tile-tone: saturate(1); }
.route-zone:nth-child(3) { --tile-tone: sepia(.21) saturate(1.28); }
.route-zone:nth-child(4) { --tile-tone: saturate(.4) brightness(1.04); }
.route-zone:nth-child(5) { --tile-tone: saturate(.6) hue-rotate(145deg); }
.route-zone:nth-child(6) { --tile-tone: saturate(.75) hue-rotate(88deg); }
.route-zone:nth-child(7) { --tile-tone: saturate(1.4) sepia(.3); }
.route-zone:nth-child(8) { --tile-tone: saturate(.8) hue-rotate(325deg); }
.route-zone[data-state="current"] { z-index: 3; }
.route-zone-title {
  position: absolute;
  right: 5%;
  bottom: 1.1cqh;
  left: 5%;
  z-index: 4;
  width: fit-content;
  margin: 0 auto;
  padding: 3px 9px;
  border-radius: 99px;
  color: #fff6fe;
  background: #302442cf;
  font-size: 12px;
  font-weight: 750;
}
.route-zone[data-state="current"] .route-zone-title { display: none; }
.courtyard-path, .route-steps { position: absolute; inset: 0; width: 100%; height: 100%; }
.courtyard-path { fill: none; stroke-linecap: round; filter: drop-shadow(0 1px 1px #0f0c1ac9); pointer-events: none; }
.courtyard-path-track { stroke: #a890a6; stroke-width: 3px; }
.courtyard-path-glint { stroke: #eaddcd; stroke-opacity: .87; stroke-width: 1.18px; }
.route-steps { margin: 0; padding: 0; list-style: none; }
.route-steps li {
  position: absolute;
  left: var(--x);
  bottom: calc((1.5 + var(--step)) * var(--level-pitch));
  width: min(13.25cqw, 10.5cqh, 54px);
  aspect-ratio: 12 / 11;
  transform: translate(-50%, 50%);
}
.route-steps li[data-state="current"] { z-index: 2; }
.route-zone::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(170deg,#31243d70,#48395455 65%,#55465c36);
  opacity: 0;
  transition: opacity 550ms ease;
  pointer-events: none;
}
.route-zone[data-state="locked"]::after { opacity: 1; }
.node-icon, .node-tile { position: absolute; inset: 0; width: 100%; height: 100%; }
.node-icon { color: #3e3347; pointer-events: none; }
.node-tile {
  inset: 50% auto auto 50%;
  width: 111%;
  height: 106%;
  translate: -50% -48%;
  transform-origin: center;
  filter: var(--tile-tone) drop-shadow(0 3px 2px #11101980);
  transition: scale 180ms ease, filter 180ms ease;
}
.node-number {
  position: absolute;
  inset: 50% 0 auto;
  transform: translateY(-50%);
  text-align: center;
  font-size: clamp(12px, 3.7cqw, 16px);
  font-weight: 830;
  line-height: 1;
}
.node-pawn {
  position: absolute;
  bottom: 41%;
  left: 50%;
  width: 76%;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 1px #44371588);
}
.route-steps li[data-state="current"] .node-tile {
  scale: 1.25;
  filter: var(--tile-tone) drop-shadow(0 0 2px #f5e6ff) drop-shadow(0 0 7px #c6aaee99);
}
.route-steps li[data-state="current"] .node-number { visibility: hidden; }
.route-steps li[data-state="done"] .node-tile { filter: var(--tile-tone) saturate(.75) brightness(.86) drop-shadow(0 3px 2px #11101980); }
.route-steps li[data-state="done"] .node-icon::after {
  content: "✓";
  position: absolute;
  right: 7%;
  bottom: 5%;
  display: grid;
  place-items: center;
  width: 13px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #42594e;
  color: #eff8f1;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.attempt { grid-row: 1; min-width: 0; }
.coach-note { height: 100%; }
.feedback {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.feedback[data-tone="hint"] { border-color: #ddd1ef; background: #f2ebfa; }
.feedback[data-tone="hint"] .turn-label { display: none; }
.feedback[data-tone="retry"] { border-color: #f0d3d8; background: #fff2f1; }
.feedback[data-tone="success"] { border-color: #dae9dc; background: #f0f6ee; }
.task-context { display: flex; align-items: center; justify-content: space-between; gap: 5px 8px; width: 100%; min-height: 23px; margin-bottom: 6px; }
.task-level-label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 770; }
.turn-label { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; color: var(--accent-ink); font-size: 12px; font-weight: 780; }
.turn-label::before { content: ""; width: 8px; height: 8px; border: 1px solid #80699b; border-radius: 50%; background: #fffafe; }
.turn-label[data-side="b"]::before { background: #45395a; }
.feedback h2 { margin: 0; font-size: clamp(18px, 2.2vw, 24px); line-height: 1.2; letter-spacing: -.025em; }
.feedback[data-tone="success"] h2 { color: #315c47; }
.feedback[data-tone="retry"] h2 { color: #853e47; }
.feedback #status-copy {
  min-height: 0;
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
  margin: 7px 0 0;
  color: #4b405b;
  font-size: 14px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}
.feedback:not(:has(h2:not([hidden]))) #status-copy { font-size: clamp(17px, 2.1vw, 24px); color: var(--ink); font-weight: 790; letter-spacing: -.02em; }
.feedback-more, .lesson-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 44px;
  padding: 5px 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 780;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: start;
}
#route-load-retry { margin-top: 8px; }
.actions { grid-row: 3; display: grid; gap: 8px; }
#map-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 14px; }
#rating-meaning { grid-column: 1/-1; }
.task-help-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.32; }
#task-actions { grid-row: 2; align-content: end; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; color: var(--muted); font-size: 12px; font-weight: 720; }
.timer { display: inline-flex; align-items: center; align-self: center; gap: 5px; padding: 4px 7px; border-radius: 8px; color: var(--accent-ink); background: var(--accent-wash); font-variant-numeric: tabular-nums; }
.timer svg { width: 15px; height: 15px; }
.task-tools { grid-row: 2; }
.move-review { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: stretch; border: 1px solid var(--line); border-radius: 11px; padding: 3px; text-align: center; }
.move-review .icon-button { border-color: transparent; background: var(--accent-wash); font-size: 23px; }
.move-review-label { display: none; }
.move-caption { display: grid; place-content: center; gap: 1px; margin: 0; padding: 2px 5px; color: var(--ink); font-size: 13px; }
.move-caption small { color: var(--muted); font-size: 11px; font-weight: 710; }
.task-buttons { display: flex; gap: 8px; }
.task-buttons > .control { flex: 1 1 0; }
#hint { background: var(--accent-wash); }
#hint:hover:not(:disabled) { background: #e9def7; }
.task-actions--reveal #hint { display: none; }

.modal {
  width: min(calc(100% - 28px), 468px);
  max-height: min(90svh, 660px);
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 16px 52px #24153833;
  overflow: auto;
}
.modal::backdrop { background: #241c3b92; }
.modal[open] { animation: route-modal-in 210ms cubic-bezier(.2, .7, .3, 1) both; }
.modal[open]::backdrop { animation: route-panel-in 210ms ease-out both; }
@keyframes route-modal-in { from { opacity: 0; transform: translateY(12px) scale(.99); } }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.dialog-head h2 { margin: 6px 0 0; font-size: clamp(22px, 3vw, 27px); line-height: 1.12; letter-spacing: -.025em; }
.dialog-head form { margin: 0; }
.dialog-head .close { color: #624782; background: #f3edf8; border-color: transparent; font-size: 26px; line-height: 1; }
.dialog-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; font-weight: 780; }
.feedback-modal { width: min(calc(100% - 28px), 568px); }
#feedback-dialog-copy { margin: 0; color: #493d56; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-modal .lesson-link { margin-top: 10px; }

.practice-option { display: grid; gap: 8px; padding-block: 9px; }
.practice-option + .practice-option { padding-bottom: 0; }
.practice-option label { font-size: 13px; font-weight: 790; }
.practice-option select, .setting select {
  min-width: 0;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #faf7fd;
  font-size: 14px;
  font-weight: 720;
}
.practice-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.practice-errors-button {
  min-height: 68px;
  justify-content: flex-start;
  gap: 10px;
  color: var(--ink);
  background: #faf7fd;
  text-align: start;
}
.practice-review-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 9px; background: #eee4f9; color: var(--accent-ink); font-size: 21px; }
.practice-errors-button small { display: block; margin-top: 4px; color: var(--muted); }
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 4px 0;
  border-top: 1px solid #ede6f2;
  font-size: 14px;
  font-weight: 740;
}
.setting:first-of-type { display: grid; justify-content: stretch; gap: 7px; border: 0; padding-bottom: 12px; font-size: 13px; }
.setting input {
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 5px 0;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #e6deed;
  cursor: pointer;
  transition: background-color 170ms ease;
}
.setting input::before {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  width: 18px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 2px #3b2a4840;
  transition: translate 170ms ease;
}
.setting input:checked { border-color: var(--accent); background: var(--accent); }
.setting input:checked::before { translate: 18px 0; }
.promotion-description { display: flex; justify-content: space-between; gap: 5px; margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 740; }
.promotion-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.promotion-options button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  padding: 6px 1px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 780;
}
.promotion-options button:hover { border-color: #b7a4d7; background: var(--accent-wash); }
.promotion-options svg { width: min(100%, 48px); aspect-ratio: 1; }

.attempt { align-self: start; }
.feedback { min-block-size: 154px; }
.feedback[data-tone="normal"]:not(:has(h2:not([hidden]))) { min-block-size: 145px; }
body:is([data-phase="revealed"],[data-phase="solved"]) .move-review { grid-template-columns: 87px minmax(0, 1fr) 87px; }
body:is([data-phase="revealed"],[data-phase="solved"]) .move-review-label { display: inline; font-size: 11px; }
#task-help-note { text-align: center; }

@media (max-width: 760px) {
  :root { scrollbar-width: none; }
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(calc(100% - 32px), 548px);
    padding: 12px 0 12px;
  }
  .route-head { gap: 8px; min-height: 44px; }
  .route-head h1 { font-size: 28px; }
  .route-head-tools { gap: 5px; }
  #back-to-route span, #map-open span { display: none; }
  body:not([data-phase="overview"]):not([data-path="open"]) .route-head h1 { font-size: 22px; }
  body[data-path="open"] .route-head h1 { font-size: 21px; }
  body:is([data-phase="overview"], [data-path="open"]) .board-panel { display: none; }
  .journey {
    min-height: max(350px, calc(100svh - var(--dadchess-site-header-height, 0px) - var(--dadchess-dock-height, 78px) - 77px));
    min-height: max(350px, calc(100dvh - var(--dadchess-site-header-height, 0px) - var(--dadchess-dock-height, 78px) - 77px));
    grid-template-rows: auto minmax(260px, 1fr) auto;
  }
  .journey-task, .journey-task #task-actions { display: contents; }
  .journey-task .attempt { order: 1; align-self: stretch; }
  .board-panel { order: 2; }
  .journey-task .task-meta, .journey-task .task-tools { order: 3; }
  .journey-task .route-progress { order: 4; }
  .journey-task #task-help-note { order: 5; }
  .journey-task .task-buttons { order: 6; }
  .route-progress { padding: 10px 13px; }
  .journey-task .route-progress { gap: 3px 8px; padding: 5px 2px; border: 0; }
  .feedback, .feedback[data-tone="normal"]:not(:has(h2:not([hidden]))) { min-block-size: 120px; padding: 9px 10px; }
  .feedback-more, .lesson-link { min-height: 32px; }
  .task-context { margin-bottom: 3px; }
  .task-level-label, .turn-label { font-size: 11px; }
  .turn-label { margin-bottom: 3px; }
  .feedback #status-copy { margin-top: 3px; font-size: 13px; }
  .feedback:not(:has(h2:not([hidden]))) #status-copy { font-size: 17px; }
  .feedback h2 { font-size: 17px; }
  .task-help-note { font-size: 10.5px; }
  #task-actions { gap: 5px; }
  .task-meta { font-size: 11px; }
  .move-review { grid-template-columns: 44px minmax(0, 1fr) 44px; padding: 1px; }
  .move-review .icon-button { min-height: 44px; }
  body:is([data-phase="revealed"],[data-phase="solved"]) .move-review { grid-template-columns: 72px minmax(0, 1fr) 72px; }
  .modal {
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: min(86svh, 670px);
    margin: auto 0 0;
    padding: 24px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
  .modal::before {
    content: "";
    position: absolute;
    inset: 9px auto auto 50%;
    width: 38px;
    height: 4px;
    margin-inline-start: -19px;
    border-radius: 99px;
    background: #d9cce5;
  }
  .modal[open] { animation-name: route-sheet-in; }
  @keyframes route-sheet-in { from { transform: translateY(100%); } }
}
@media (max-width: 390px) {
  body[data-path="open"] .route-head { flex-wrap: wrap; }
  .route-head-tools .icon-button, .route-head-tools .map-button { padding-inline: 8px; }
  .task-buttons > .control { padding-inline: 5px; font-size: 12px; }
}
.board-surface {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
}
.board-surface:has(.score-token) { z-index: 1; }
#journey-shell[data-panel-motion="entering"] > :is(#journey-map, #task-view, #map-actions, #task-actions):not([hidden]) {
  animation: task-panel-content-in 200ms ease-out;
}
@keyframes task-panel-content-in { from { opacity: .62; translate: 0 3px; } }
@keyframes route-panel-in { from { opacity: 0; } }
.piece-motion {
  position: absolute;
  z-index: 4;
  width: 12.5%;
  height: 12.5%;
  pointer-events: none;
}
.piece-motion.piece-motion-trail {
  z-index: 3;
  filter: blur(1.4px);
}
.square .move-check-glow {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  inset: 0;
  background: radial-gradient(circle, #f44037a0 0%, #bd372b67 48%, transparent 77%);
  animation: piece-check-glow 480ms ease-out both;
}
@keyframes piece-check-glow {
  0% { opacity: .2; transform: scale(.72); }
  23% { opacity: .85; transform: scale(1); }
  100% { opacity: 0; }
}
.score-overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
}
.square:has(.move-mark) { z-index: 2; }
.square .move-mark {
  position: absolute;
  z-index: 3;
  right: -8%;
  top: -1%;
  display: grid;
  place-items: center;
  width: clamp(15px, 45%, 35px);
  aspect-ratio: 1;
  border: 1px solid #e7f5d9ab;
  border-radius: 50%;
  background: #44864e;
  color: #fff9e9;
  box-shadow: 0 1px 3px #17271980;
  font-size: clamp(10px, 2.3vw, 21px);
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
}
.square:nth-child(8n) .move-mark { right: 4%; }
.move-mark-arrival { animation: move-mark-arrival 150ms ease-out both; }
@keyframes move-mark-arrival {
  from { opacity: 0; transform: scale(.72); }
}
.square .move-mark[data-state="wrong"] {
  border-color: #ffe5d9ab;
  background: #ae4b45;
}
.score-token {
  --token-size: clamp(30px, 6.1cqw, 54px);
  position: absolute;
  display: grid;
  place-items: center;
  inline-size: max-content;
  min-inline-size: var(--token-size);
  block-size: var(--token-size);
  padding-inline: .45em;
  border: 1px solid #fff2cb;
  border-radius: 999px;
  background: #f2d293;
  color: #362913;
  box-shadow: 0 3px 10px #28241565;
  font-size: calc(var(--token-size) * var(--score-type-scale));
  font-weight: 860;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  animation: score-flight var(--flight-duration) cubic-bezier(.25, .2, .4, 1) both;
}
.score-token-amount { white-space: nowrap; }
@keyframes score-flight {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.76); }
  16%, 30% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  88% { opacity: .95; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--flight-x)), calc(-50% + var(--flight-y))) scale(.32);
  }
}
#route-fill.charged { background: #ee9a50; box-shadow: inset 0 0 5px #ffd591; }
#route-score.is-awarded { animation: route-score-glow 360ms ease-out; }
#route-fill.is-awarded { animation: route-fill-glow 360ms ease-out; }
@keyframes route-score-glow {
  30% { text-shadow: 0 0 13px #ffe4a6b0; }
}
@keyframes route-fill-glow {
  30% { box-shadow: inset 0 0 8px 2px #fff2b5; }
}

.route-unlock {
  color: #694182;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}
#task-level-notice {
  display: inline-block;
  margin: 0;
}
#task-level-notice[hidden] { display: none; }
.route-streak:not([hidden]) + #task-level-notice { margin-inline-start: 8px; }
#map-level-notice {
  position: absolute;
  z-index: 5;
  inset: 8px auto auto 50%;
  max-inline-size: calc(100% - 22px);
  inline-size: max-content;
  margin: 0;
  padding: 6px 11px;
  transform: translateX(-50%);
  border: 1px solid #c5acd8;
  border-radius: 99px;
  background: #f5eafb;
  text-align: center;
  pointer-events: none;
  animation: route-unlock-in 220ms ease-out both;
}
#map-level-notice.route-unlock-milestone {
  color: #362913;
  background: #f2d293;
  box-shadow: 0 0 15px #f2d29363;
}
@keyframes route-unlock-in {
  from { opacity: 0; translate: 0 -4px; }
}

.node-pawn[data-prestige="1"] { filter: saturate(.3) drop-shadow(0 3px 1px #44371588); }
.node-pawn[data-prestige="2"] { filter: saturate(1.55) brightness(.78) drop-shadow(0 3px 1px #44371588); }
.node-pawn[data-prestige="3"] { filter: saturate(.15) brightness(1.14) drop-shadow(0 3px 1px #44371588); }
.node-pawn[data-prestige="4"] { filter: hue-rotate(146deg) saturate(1.4) drop-shadow(0 3px 1px #44371588); }
.node-pawn[data-prestige="5"] { filter: hue-rotate(280deg) saturate(1.3) drop-shadow(0 3px 1px #44371588); }
.node-pawn[data-prestige="6"] { filter: saturate(2) drop-shadow(0 3px 1px #44371588); }
.node-pawn[data-prestige="7"] { filter: brightness(1.18) drop-shadow(0 0 7px #edbe63); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

#task-settings:not([hidden]) { display: inline-flex; }
#task-actions:has(.move-review[hidden]) .task-tools,
.task-meta:not(:has(> :not([hidden], .visually-hidden))) { display: none; }
body[data-phase="wrong"] .task-buttons > #primary { order: -1; }
body[data-path="open"] .route-head-tools { display: contents; }
body[data-path="open"] #map-open { order: -1; }
body[data-path="open"] #map-open span { display: inline; }
body[data-path="open"] #map-open svg { display: none; }
