/* The walk round is one compact workspace: position and objective, map and
   available moves, then optional review. Shared room rankings live outside it. */
.map-race{--walk-columns:minmax(0,1fr) minmax(min(17rem,45%),27%);container:walk-round / inline-size}
.map-race .walk-content{position:relative}
.map-race .walk-mode-heading{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:6px 16px}
.map-race .walk-mode-heading h3{margin:0;font-size:1rem}
.map-race :is(.walk-landing-countdown,.walk-storm-countdown){font-size:.8125rem;font-variant-numeric:tabular-nums}
.map-race .walk-landing{margin-bottom:16px}
.map-race .walk-landing-start{margin:6px 0;color:var(--muted)}
.map-race .walk-landing-map{margin:12px 0}
.map-race .walk-landing-map:empty{display:none}
.map-race .walk-landing-map .atlas-viewport{min-height:calc(var(--map-controls-inset,60px) + 220px)}
.map-race .walk-landing-objective{margin:8px 0 0}
.map-race .walk-landing-hint{margin:6px 0 12px;color:var(--muted)}
.map-race :is(.walk-landing-suggestions,.walk-landing-words){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;list-style:none;padding:0;margin:0}
.map-race :is(.walk-landing-suggestions,.walk-landing-words) button{width:100%;min-height:44px;padding:8px 10px;text-align:left;overflow-wrap:anywhere;font-size:.875rem}
.map-race .walk-landing-suggestions button{border-color:var(--control)}
.map-race .walk-landing-coverage{margin:8px 0}
.map-race .walk-landing-all summary{min-height:36px;align-content:center;font-size:.8125rem;cursor:pointer}
.map-race .walk-landing-search{display:grid;gap:4px;margin:8px 0}
.map-race .walk-landing-search input{min-width:0;width:100%;min-height:44px}
.map-race .walk-landing-count{margin:8px 0}
.map-race .walk-landing-words{max-height:19rem;overflow:auto;overscroll-behavior:contain;padding:3px}
.map-race .walk-storm{padding:12px;margin:0 0 12px;border:1px solid var(--line);border-inline-start:4px solid var(--control);border-radius:6px}
.map-race .walk-storm-risk{margin:8px 0 4px;font-size:.875rem;font-weight:600}
.map-race .walk-storm-alive{margin:4px 0}
.map-race .walk-storm-zones summary{min-height:28px;align-content:center;cursor:pointer}
.map-race .walk-storm-zones p{margin:6px 0 0;line-height:1.6}
.map-race .walk-storm[data-risk=warning]{border-inline-start-color:var(--accent);border-inline-start-style:dashed;background:color-mix(in srgb,var(--accent) 8%,transparent)}
.map-race .walk-storm[data-risk=eliminated]{border-inline-start-color:var(--muted)}
.map-race .walk-choice-risk{font-size:.6875rem;flex:0 0 100%;color:var(--muted);text-align:left}
.map-race .walk-choice-risk:empty{display:none}
.map-race .walk-neighbors [data-risk=warning]{border-style:dashed;border-color:var(--accent)}
.map-race .walk-neighbors [data-risk=closed] .walk-choice-word{text-decoration:line-through}
.map-race .walk-neighbors [data-escape=true]{outline:2px solid var(--accent);outline-offset:1px}
.map-race .atlas-point[data-decoration=warning].is-labeled::before{outline:2px dashed var(--accent);outline-offset:4px}
.map-race .atlas-point[data-decoration=closed]::before{outline:0;opacity:.25}
.map-race .atlas-point[data-decoration=closed].is-labeled::before{outline:1px solid var(--muted);outline-offset:1px;opacity:.7}
.map-race .atlas-point[data-decoration=closed] .atlas-label{text-decoration:line-through}
.map-race .atlas-decoration{display:inline-flex;align-items:center;justify-content:center;margin-inline-start:5px;min-width:1.1em;height:1.1em;border:1px solid currentColor;border-radius:50%;font-size:.8em;font-weight:750;text-decoration:none}
.map-race .walk-review-heading{position:sticky;top:0;z-index:3;background:var(--page);padding-bottom:8px}
.map-race .walk-review-heading select{flex:0 1 24rem}
.map-race.walk-round-review .walk-review{padding:0 0 12px;gap:8px 24px;align-items:start}
.map-race.walk-round-review .walk-history{flex:1 1 100%}
.map-race.walk-round-review .walk-history p{line-height:1.8;overflow-wrap:anywhere;margin:4px 0 0}
.map-race.walk-round-review .walk-solution{flex:0 1 100%}
.map-race .walk-primary{display:contents}
.map-race .walk-summary{display:grid;grid-template-columns:var(--walk-columns);gap:6px 16px;align-items:center;padding:0;margin:0 0 8px}
.map-race .walk-current{margin:0;line-height:1.25;min-width:0;width:100%;scroll-margin:8px}
.map-race .walk-current:focus-visible{outline:2px solid var(--focus,#d9b17c);outline-offset:4px;border-radius:2px}
.map-race .walk-current-label{font-size:.75rem;font-weight:400;color:var(--muted)}
.map-race .walk-current-value{width:100%;min-height:44px;flex-wrap:nowrap;gap:8px;padding:6px 10px}
.map-race .walk-current-name{display:flex;align-items:center;gap:6px;flex:1 1 auto;min-width:0;max-width:100%}
.map-race :is(.walk-current-icon,.walk-back-icon){width:18px;height:18px;flex:none}
.map-race .walk-destination{min-width:0;margin:0}
.map-race .walk-destination>div{display:grid;gap:2px;min-width:0}
.map-race .walk-destination strong{font-size:1rem;font-weight:600}
.map-race .walk-destination .small{font-size:.75rem}
.map-race .walk-stats{display:flex;flex-wrap:wrap;gap:4px 12px;margin:0 0 0 auto;text-align:right;font-size:.75rem;color:var(--muted)}
.map-race .walk-stats:empty{display:none}
.map-race .walk-context{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;font-size:.75rem;margin-top:4px}
.map-race .walk-start{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.map-race .walk-start strong{font-size:inherit}
.map-race .walk-clock{font-size:inherit;color:var(--muted);margin:0}
.map-race .walk-board{grid-template-columns:var(--walk-columns);gap:16px;align-items:start}
.map-race .walk-board:has(.walk-sidebar[hidden]){grid-template-columns:minmax(0,1fr)}
.map-race:has(.walk-sidebar[hidden]) .walk-summary{grid-template-columns:minmax(0,1fr)}
.map-race:has(.walk-sidebar[hidden]) .walk-destination>div{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
.map-race :is(.atlas-viewport,.map-load-state){height:clamp(300px,32vw,390px);min-height:0;aspect-ratio:auto}
.map-race .walk-sidebar{container:walk-choices / inline-size}
.map-race .walk-neighbors{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;overflow-anchor:none}
.map-race .walk-neighbors button,.map-race .walk-choice-placeholder{min-height:44px;height:100%;padding:8px 10px;font-size:.8125rem;background:var(--surface,transparent)}
.map-race .walk-neighbors button{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 8px}
.map-race .walk-neighbors button.guess-row{background:var(--guess-surface);color:var(--guess-text)}
.map-race .walk-choice-word{flex:1 1 auto;min-width:0;max-width:100%}
.map-race .walk-choice-temperature{flex:none;margin-inline-start:auto;font-weight:650;white-space:nowrap}
.map-race .walk-neighbors button:not(:disabled):hover{border-color:var(--accent)}
.map-race .walk-neighbors button:not(.guess-row):not(.walk-move-picked):not(:disabled):hover{background:color-mix(in srgb,var(--accent) 9%,transparent)}
.walk-word-placeholder{display:block;position:relative;width:100%;min-width:0}
.walk-word-placeholder:after,.walk-choice-placeholder:after{content:'';display:block;width:60%;height:.5em;border-radius:3px;background:var(--line)}
.walk-word-placeholder:after{position:absolute;left:0;top:50%;transform:translateY(-50%)}
.walk-choice-placeholder{position:relative;display:flex;align-items:center;border:1px solid var(--line);border-radius:6px;line-height:1.4}
.walk-choice-placeholder:after{position:absolute;left:10px;top:50%;transform:translateY(-50%)}
.map-race .walk-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:8px 0 0}
.map-race .walk-actions button{min-height:36px;margin:0;font-size:.75rem;padding:6px 10px}
.map-race .walk-actions .walk-back{width:100%;min-height:44px;padding:8px 10px;font-size:.8125rem;text-align:left;border:1px solid var(--line);border-radius:6px;background:var(--guess-surface);color:var(--guess-text)}
.map-race .walk-back .guess-word{font-size:inherit;font-weight:400}
.map-race .walk-back .guess-temperature{min-width:0;font-size:inherit;font-weight:650}
.map-race.walk-navigation-tiles .walk-actions .walk-current{display:flex}
.map-race.walk-navigation-tiles .walk-actions :is(.walk-current-value,.walk-back){min-height:44px;padding:7px 9px;gap:4px 8px;flex-wrap:wrap;font-size:.8125rem;line-height:1.4;border:2px solid var(--control);border-radius:6px}
.map-race.walk-navigation-tiles .walk-actions .walk-current-value{flex:1;border-style:dashed;cursor:default}
.map-race.walk-navigation-tiles .walk-current :is(.guess-word,.guess-temperature){font-size:inherit;min-width:0}
.map-race.walk-navigation-tiles .walk-current .guess-word{font-weight:400}
.map-race.walk-navigation-tiles .walk-current .guess-temperature{font-weight:650}
.map-race.walk-navigation-tiles .walk-back .guess-word{display:flex;align-items:center;gap:6px}
.map-race.walk-navigation-tiles .walk-back-word{min-width:0;overflow-wrap:anywhere}
.map-race .walk-back:not(:disabled):hover{border-color:var(--accent)}
/* Only navigation tiles need a visit marker. History and review temperatures
   keep the shared plain surface; the heat fill stays solid everywhere. */
.map-race :is(.walk-neighbors,.walk-actions) .guess-row[data-visited=true]:not(.walk-move-picked){background-color:var(--surface);background-image:repeating-linear-gradient(135deg,color-mix(in srgb,var(--guess-text) 10%,transparent) 0 1px,transparent 1px 7px)}
.map-race .walk-move-picked{position:relative;z-index:2;opacity:1!important;cursor:wait}
.map-race .walk-neighbors button.walk-move-quick,.map-race .walk-actions .walk-back.walk-move-quick{opacity:1!important;cursor:wait;border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
.map-race .walk-neighbors button.walk-move-picked,.map-race .walk-actions .walk-back.walk-move-picked{--guess-fill:var(--heat);--guess-text:#182023;background:#f7f8fa;color:var(--guess-text);border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--heat,var(--accent)) 70%,transparent),0 8px 20px #0004}
.map-race .walk-move-picked :is(.walk-choice-word,.guess-word){font-weight:650}
.map-race .walk-move-picked.walk-move-filling.guess-row::before{transition:width 220ms cubic-bezier(.2,.7,.2,1)}
.map-race .walk-move-picked.guess-row::after{opacity:1}
/* One decorative tile stays visible from lift through landing. Keep its native
   source in the layout and accessibility tree without drawing a second copy. */
.map-race .walk-move-source{opacity:0!important}
.walk-move-ghost{pointer-events:none;user-select:none;isolation:isolate;transform-origin:top left;will-change:transform,opacity}
:root .walk-move-layer.guess-row{--guess-fill:var(--heat);--guess-text:#182023;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-height:0;padding:8px 10px;border:1px solid var(--accent);border-radius:6px;background:#f7f8fa;color:var(--guess-text);font-size:.8125rem;line-height:1.4;box-shadow:0 6px 16px #0003;transform-origin:top left;will-change:transform,opacity}
.walk-move-layer.walk-move-filling::before{transition:width 220ms cubic-bezier(.2,.7,.2,1)}
.walk-move-ghost :is(.guess-word,.walk-choice-word,.walk-current-name){font-size:inherit;min-width:0;max-width:100%;font-weight:650;overflow-wrap:anywhere}
.walk-move-ghost :is(.guess-temperature,.walk-choice-temperature){font-size:inherit;min-width:0;margin-inline-start:auto;font-weight:650;white-space:nowrap}
.walk-move-ghost :is(.walk-current-name,.guess-word:has(svg)){display:flex;align-items:center;gap:6px;flex:1 1 auto}
.walk-move-ghost svg{width:18px;height:18px;flex:none}
@media(prefers-reduced-motion:reduce){.map-race .walk-move-picked.walk-move-filling.guess-row::before{transition:none}}
.map-race .walk-meta{display:flex;align-items:start;justify-content:space-between;gap:8px 20px;margin-top:8px;color:var(--muted)}
.map-race .walk-coverage{margin:0;font-size:.6875rem;line-height:1.5;max-width:65ch}
/* Reserve the reading width before opening, so the focused summary keeps its row. */
.map-race .walk-help{flex:1 1 10rem;margin:0;min-width:10rem;max-width:30rem;text-align:right}
.map-race .walk-help summary{font-size:.6875rem;min-height:24px;white-space:nowrap}
.map-race .walk-hint{font-size:.75rem;line-height:1.5;margin:4px 0 0;text-align:left}
.map-race .walk-review{display:flex;flex-wrap:wrap;gap:0 24px;padding:7px 0}
.map-race .walk-replay{min-width:0;margin-bottom:12px}
/* Native range focus can scroll the timeline beneath a sticky player picker,
   especially with enlarged text. Keep replay controls in one reading flow. */
.map-race:has(.walk-replay:not([hidden])) .walk-review-heading{position:static}
.map-race .walk-replay .map-replay{margin:8px 0}
.map-race .walk-replay .replay-timeline{flex-basis:12rem;min-width:0;flex-wrap:wrap}
.map-race .walk-replay .replay-timeline input{min-width:0}
.map-race .walk-replay .replay-timeline>.mono{margin-inline-start:auto}
.map-race .walk-replay .replay-timeline button{flex:none;padding:6px 10px;font-size:1.1rem;min-height:36px}
/* Enlarged phone text needs a useful slider, not a clipped elapsed time. */
@container walk-round (max-width:20rem){
  .map-race .walk-replay .replay-timeline{display:grid;grid-template-columns:auto minmax(0,1fr) auto;flex-basis:100%}
  .map-race .walk-replay .replay-timeline input{width:100%}
  .map-race .walk-replay .replay-timeline .mono{grid-column:1/-1;justify-self:end}
}
.map-race .walk-replay-roster{display:flex;flex-wrap:wrap;gap:4px 18px;list-style:none;padding:0;margin:8px 0;font-size:.75rem}
.map-race :is(.walk-replay-roster li,.walk-replay-selected){min-width:0;overflow-wrap:anywhere;border-inline-start:3px solid var(--player-color);padding-inline-start:7px}
.map-race .walk-replay-selected{margin:8px 0;font-size:.75rem}
.map-race .walk-replay-roster [data-outcome=eliminated],.map-race .walk-replay-selected[data-outcome=eliminated]{color:var(--muted)}
.map-race .walk-replay-disclosures{display:flex;flex-wrap:wrap;gap:0 20px}
.map-race .walk-replay-disclosures details{min-width:0;margin:0}
.map-race .walk-replay-disclosures details[open]{flex-basis:100%}
.map-race .walk-replay-disclosures summary{min-height:32px;align-content:center}
.map-race .walk-replay-moments ol{list-style:none;padding:0;margin:6px 0;max-height:14rem;overflow:auto;overscroll-behavior:contain}
.map-race .walk-replay-moments button{width:100%;text-align:start;white-space:normal;min-height:36px}
.map-race .walk-replay-moments [aria-current=step]{background:var(--hover);color:var(--accent)}
/* The expanded recording opens onto its map and timeline. Storm details and
   potentially long text histories follow the map instead of displacing it. */
.map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden]))>:not(.walk-primary){order:5}
.map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden]))>.walk-review-heading{order:0}
.map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden]))>.walk-replay{order:1}
.map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden])) .walk-board{order:2}
.map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden])) .walk-summary{order:3}
.map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden])) .walk-storm{order:4}
/* A short landscape phone has room beside the map, not above it. Keep the
   player/timeline in one column so its toolbar cannot consume the whole view. */
@media(min-width:600px) and (max-height:500px){
  .map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden])){display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:8px 12px;align-content:start}
  .map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden]))>:not(.walk-primary),
  .map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden])) .walk-primary>*{grid-column:1/-1}
  .map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden]))>.walk-review-heading{grid-column:1;grid-row:1;position:static;padding-bottom:0}
  .map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden]))>.walk-replay{grid-column:1;grid-row:2;margin-bottom:0}
  .map-dialog .map-race .walk-content:has(>.walk-replay:not([hidden])) .walk-board{grid-column:2;grid-row:1/3;align-self:stretch}
}
/* Keep ordinary phone routes paired; enlarged narrow text needs a full row. */
.map-race .walk-review details{margin:0;min-width:0;flex:1 1 10rem}
.map-race .walk-review summary{font-size:.8125rem;min-height:32px;display:list-item;align-content:center}
.map-race .walk-review p{margin:6px 0 10px;font-size:.8125rem}
.map-race [hidden]{display:none!important}
.map-dialog .map-race :is(.atlas-viewport,.map-load-state){height:clamp(300px,55dvh,850px)}
@media(min-width:761px){
  .map-dialog .map-race{display:flex;flex-direction:column;height:100%;min-height:0}
  .map-dialog .map-race .walk-content{display:flex;flex-direction:column;flex:1;min-height:0}
  .map-dialog .map-race .walk-board{grid-template-columns:minmax(0,1fr) minmax(min(17rem,45%),27%);flex:1;min-height:auto;align-items:stretch}
  .map-dialog .map-race .walk-map{display:flex;min-height:0}
  .map-dialog .map-race :is(.atlas-viewport,.map-load-state){flex:1;height:auto;min-height:300px}
}
/* Finished players have no move list to reserve space for. Let the map use
   the remaining dialog height on phones too; open routes can still scroll. */
.map-dialog .map-race[data-walk-done=true]{display:flex;flex-direction:column;height:100%;min-height:0}
.map-dialog .map-race[data-walk-done=true] .walk-content{display:flex;flex-direction:column;flex:1;min-height:0}
.map-dialog .map-race[data-walk-done=true] .walk-content>:not(.walk-primary),
.map-dialog .map-race[data-walk-done=true] .walk-primary>:not(.walk-board){flex:none}
.map-dialog .map-race[data-walk-done=true] .walk-board{flex:1;min-height:240px;align-items:stretch}
.map-dialog .map-race[data-walk-done=true] .walk-map{display:flex;min-height:0}
.map-dialog .map-race[data-walk-done=true] :is(.atlas-viewport,.map-load-state){flex:1;height:auto;min-height:240px}
/* Keep the exit outside the complete reading area at every screen width. */
.map-dialog .map-race.map-contained-scroll{display:flex;flex-direction:column;gap:12px;height:100%;min-height:0;overflow:hidden}
.map-dialog .map-race.map-contained-scroll>.walk-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:6px;scroll-padding:6px}
.map-dialog .map-race.map-contained-scroll>.walk-content:focus-visible{outline-offset:-4px}
@media(max-width:760px){
  .map-race .walk-summary{grid-template-columns:minmax(0,1fr)}
  .map-race .walk-destination>div{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
  .map-race .walk-board,.map-dialog .map-race .walk-board{grid-template-columns:minmax(0,1fr);gap:12px}
  .map-race :is(.atlas-viewport,.map-load-state){height:300px}.map-race .walk-sidebar{margin:0}
  .map-race .walk-neighbors{grid-template-columns:repeat(4,minmax(0,1fr))}
  .map-race .walk-actions{display:flex;flex-wrap:wrap;gap:8px}.map-race .walk-actions button{min-height:40px}
  .map-race .walk-meta{flex-wrap:wrap;gap:4px}.map-race .walk-help{text-align:left;min-width:0;max-width:none}
}
@media(max-width:480px){
  .map-race .walk-neighbors{grid-template-columns:repeat(2,minmax(0,1fr))}
  .map-race :is(.atlas-viewport,.map-load-state){height:260px}
  .map-race .walk-review{gap:0 12px}
}
@media(prefers-reduced-motion:reduce){.map-race .walk-neighbors button,.map-race .walk-choice-placeholder{transition:none}}
/* A room sidebar can leave a narrow map even on a desktop window. Respond to
   the actual workspace width, not only the viewport. */
@container walk-round (max-width:640px){
  .map-race .walk-summary{grid-template-columns:minmax(0,1fr)}
  .map-race .walk-destination>div{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
  .map-race .walk-board{grid-template-columns:minmax(0,1fr);gap:12px}
  .map-race :is(.atlas-viewport,.map-load-state){height:300px}.map-race .walk-sidebar{margin:0}
  .map-race .walk-neighbors{grid-template-columns:repeat(4,minmax(0,1fr))}
  .map-race .walk-actions{display:flex;flex-wrap:wrap;gap:8px}.map-race .walk-actions button{min-height:40px}
  .map-race .walk-meta{flex-wrap:wrap;gap:4px}.map-race .walk-help{text-align:left;min-width:0;max-width:none}
}
/* Landing context keeps each suggested start a single direct action. */
.walk-landing-suggestions button:has(.walk-landing-word){display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left}
.walk-landing-name{display:flex;align-items:baseline;gap:7px;max-width:100%}
.walk-landing-number{display:inline-grid;place-items:center;flex:none;min-width:1.35em;min-height:1.35em;border:1px solid var(--control);border-radius:50%;font-size:.75em;font-weight:650}
.walk-landing-word{font-weight:650}
.walk-landing-nearby,.walk-landing-distance{max-width:100%;overflow-wrap:anywhere}
.walk-landing-distance{font-variant-numeric:tabular-nums}
@container walk-round (max-width:18rem){
  .map-race .walk-landing-suggestions{grid-template-columns:minmax(0,1fr)}
}
@container walk-round (max-width:480px){
  .map-race .walk-neighbors{grid-template-columns:repeat(2,minmax(0,1fr))}
  .map-race :is(.atlas-viewport,.map-load-state){height:260px}
}
/* Match the native Words footer: keep the disclosure control in place while
   its complete text uses the narrow reader. Older engines retain the flex row. */
@supports selector(details::details-content){
  @container walk-round (max-width:640px){
    .map-race .walk-meta{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:4px 20px}
    .map-race .walk-coverage{grid-column:1;grid-row:1;max-width:none}
    .map-race .walk-help{display:contents}
    .map-race .walk-help>summary{grid-column:2;grid-row:1;justify-self:end;text-align:right}
    .map-race .walk-help::details-content{grid-column:1/-1;grid-row:2;min-width:0}
    .map-race .walk-help:not([open])::details-content{display:none}
    .map-race .walk-hint{margin:0;max-width:none}
  }
  @container walk-round (max-width:640px) and (max-width:calc(20rem + 20px)){
    .map-race .walk-meta{grid-template-columns:minmax(0,1fr)}
    .map-race .walk-coverage{grid-column:1;grid-row:1}
    .map-race .walk-help>summary{grid-column:1;grid-row:2;justify-self:start;text-align:left}
    .map-race .walk-help::details-content{grid-row:3}
  }
  /* This final reader block can extend scrolling without shrinking the map
     above it or moving the focused disclosure control. */
  .map-dialog .map-race.map-contained-scroll>.walk-content>.walk-meta:last-child{position:relative}
  .map-dialog .map-race.map-contained-scroll>.walk-content>.walk-meta:last-child .walk-help::details-content{position:absolute;grid-area:auto;top:calc(100% + 4px);right:0;width:min(100%,30rem)}
  .map-dialog .map-race.map-contained-scroll>.walk-content>.walk-meta:last-child .walk-help:not([open])::details-content{display:none}
  .map-dialog .map-race.map-contained-scroll>.walk-content>.walk-meta:last-child .walk-hint{margin:0}
}
/* Keep ordinary words intact as text grows, including narrow room sidebars. */
@container walk-choices (max-width:32rem){.map-race .walk-neighbors{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container walk-choices (max-width:16rem){.map-race .walk-neighbors{grid-template-columns:minmax(0,1fr)}}
/* Current and Back finish the same two-column reading flow as the neighbours.
   Keep the pair at enlarged text sizes too; words and scores wrap within tiles. */
.map-race.walk-navigation-tiles .walk-summary{grid-template-columns:minmax(0,1fr)}
.map-race.walk-navigation-tiles .walk-destination>div{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
.map-race.walk-navigation-tiles :is(.walk-neighbors,.walk-actions){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;align-items:stretch}
.map-race.walk-navigation-tiles .walk-actions{margin-top:6px}
.map-race.walk-navigation-tiles .walk-stats{grid-column:1/-1}
/* Parent results own completed counts/time; expanded maps retain them in Help. */
.map-race.walk-external-result .walk-context :is(.walk-moves,.walk-clock){display:none}
.map-dialog .map-race.walk-external-result .walk-context :is(.walk-moves,.walk-clock):not([hidden]){display:inline-grid}
.map-race .map-load-state{min-height:min-content}
.map-race .walk-word-history{margin-top:16px;min-width:0}
.map-race .walk-map-disclosure{margin-top:12px;min-width:0}
.map-race .walk-word-actions{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;margin-inline-start:auto}
.map-race .walk-map-toggle{flex:none;color:var(--muted)}
.map-race .walk-map-toggle[aria-expanded=true]{color:var(--accent);background:var(--hover)}
.map-race .walk-map-toggle svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.map-race .walk-word-history .section-heading{gap:6px 16px;flex-wrap:wrap;margin-bottom:8px}
.map-race .walk-word-history h3{margin:0;font-size:1rem}
.map-race .walk-word-history .guess-row{min-height:40px;padding:7px 10px}
.map-race .walk-word-kind{display:inline-block;margin-inline-start:8px;font-size:.6875rem;font-weight:400}
.map-race .walk-word-unavailable{margin:8px 0 0}
/* Pair wide discoveries in reading order only when both columns have
   enough room at the current text size. */
@container walk-round (min-width:48rem){
  .map-race .walk-word-rows{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:16px}
  /* Growing history must not shrink the map above it. Keep
     the wide reading map tied to the viewport, independent of row count. */
  .map-dialog .map-race[data-walk-done=false]:has(.walk-word-history:not([hidden])) .walk-board{flex:none}
  .map-dialog .map-race[data-walk-done=false]:has(.walk-word-history:not([hidden])) :is(.atlas-viewport,.map-load-state){height:clamp(300px,55dvh,850px)}
}
/* Completed routes grow the reader below a stable dedicated map at every
   width; inline, active and observer workspaces keep their existing sizing. */
.map-dialog .map-race[data-walk-done=true]:has(.walk-word-history:not([hidden])) .walk-board{flex:none}
.map-dialog .map-race[data-walk-done=true]:has(.walk-word-history:not([hidden])) :is(.atlas-viewport,.map-load-state){height:clamp(240px,55dvh,850px)}

/* Both Walks keep the same word-first DOM on every screen. Give the map
   a secondary right column only when both columns have enough reading space. */
@media(min-width:761px){
  @container walk-round (min-width:42rem){
    .map-race.walk-word-first .walk-content{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-areas:"play map" "history map" "meta map";gap:16px 24px;align-items:start}
    .map-race.walk-word-first .walk-primary{display:block;grid-area:play;min-width:0}
    .map-race.walk-word-first :is(.walk-summary,.walk-board){grid-template-columns:minmax(0,1fr)}
    .map-race.walk-word-first .walk-destination>div{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
    .map-race.walk-word-first .walk-word-history{grid-area:history;margin:0}
    .map-race.walk-word-first .walk-word-rows{grid-template-columns:minmax(0,1fr)}
    .map-race.walk-word-first .walk-map-disclosure{grid-area:map;margin:0}
    .map-race.walk-word-first .walk-meta{grid-area:meta;margin:0}
  }
}
/* Fit the active map and every move control in an expanded narrow reader.
   Intrinsic minimums retain scrolling with enlarged text or a short viewport;
   discoveries below this group cannot squeeze the map when expanded. */
@container walk-round (max-width:640px){
  .map-dialog .map-race[data-walk-done=false]:has(.walk-sidebar:not([hidden]))>.walk-content{container-type:size}
  .map-dialog .map-race[data-walk-done=false]:has(.walk-sidebar:not([hidden])) .walk-primary{display:flex;flex-direction:column;height:100cqh;min-height:min-content}
  .map-dialog .map-race[data-walk-done=false]:has(.walk-sidebar:not([hidden])) .walk-primary>:not(.walk-board){flex:none}
  .map-dialog .map-race[data-walk-done=false]:has(.walk-sidebar:not([hidden])) .walk-primary>.walk-board{display:flex;flex-direction:column;flex:1;min-height:min-content;align-items:stretch}
  .map-dialog .map-race[data-walk-done=false]:has(.walk-sidebar:not([hidden])) .walk-primary .walk-map{display:flex;flex:1;min-height:240px}
  .map-dialog .map-race[data-walk-done=false]:has(.walk-sidebar:not([hidden])) .walk-primary .walk-sidebar{flex:none}
  .map-dialog .map-race[data-walk-done=false]:has(.walk-sidebar:not([hidden])) .walk-primary :is(.atlas-viewport,.map-load-state){flex:1;height:auto;min-height:240px}
}
