/* Graphoria's shared palette is inherited from graphoria-theme.css. */
.location-workspace {
  --location-height: 650px;
}

.bridge-scene {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--graphoria-border);
  border-radius: 12px;
  background: var(--graphoria-wash);
}

.scene-title {
  padding: 1rem 1rem 0;
  text-align: center;
}

.scene-title .eyebrow {
  margin: 0;
}

.scene-title h2 {
  margin: .4rem 0 1rem;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.bridge-scene figure {
  margin: 0;
}

.bridge-scene img {
  display: block;
  width: 100%;
  height: auto;
}

.bridge-scene figcaption {
  padding: 1rem;
  text-align: center;
  color: var(--graphoria-muted);
  font-size: .9rem;
}

.location-right ul {
  padding-left: 1.3rem;
}

.location-right li {
  margin: .6rem 0;
}

details, .preparation-note {
  border-top: 1px solid var(--graphoria-border);
  margin-top: 1.5rem;
  padding-top: 1rem;
}

summary {
  cursor: pointer;
  min-height: 44px;
  color: var(--graphoria-river);
}

.skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10;
  padding: .7rem;
  background: var(--graphoria-panel);
}

.skip:focus {
  top: 0;
}

:focus-visible {
  outline: 3px solid var(--graphoria-river);
  outline-offset: 3px;
}

@media (max-width: 1199px) {
  .location-left nav {
    grid-template-columns: 1fr;
  }
}
body.location-page .location-left h1 {
  font-size: 1.8rem !important;
}
/* Fill the centre panel without increasing the page or sidebar heights. */
body[data-place="konigsberger-brucke"] .bridge-scene {
  position: relative;
}

body[data-place="konigsberger-brucke"] .bridge-scene > figure {
  position: absolute;
  inset: 0;
  margin: 0;
}

body[data-place="konigsberger-brucke"] .bridge-scene > figure > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
}

/* Story and map stay inside the existing centre panel. */
body[data-place="konigsberger-brucke"] [hidden] {
  display: none !important;
}

body[data-place="konigsberger-brucke"] .bridge-info {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 4;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid #315f59;
  border-radius: 50%;
  background: #f8faef;
  color: #244a45;
  box-shadow: 0 2px 10px #183b3440;
  font: bold italic 1.6rem Georgia, serif;
  cursor: pointer;
}

body[data-place="konigsberger-brucke"] .bridge-puzzle {
  position: absolute;
  inset: .6rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #a4b39c;
  border-radius: 9px;
  background: #f3f5ebf5;
}

.map-title {
  flex: none;
  padding: 1rem 4rem .4rem 1rem;
}

.map-title .eyebrow {
  margin: 0;
  font-size: .7rem;
}

.map-title h2 {
  margin: .25rem 0;
  font-size: clamp(1.2rem, 1.8vw, 1.8rem);
}

#walking-map {
  display: block;
  flex: 1 1 0;
  width: 100%;
  height: 0;
  min-height: 0;
}

.map-key {
  flex: none;
  margin: 0;
  padding: .6rem 1rem;
  font: .82rem/1.4 system-ui, sans-serif;
}

.land-area path {
  fill: #dce6c7;
  stroke: #6e8464;
  stroke-width: 5;
}

.land-area {
  cursor: pointer;
}

.land-area text {
  fill: #263b31;
  font: bold 25px Georgia, serif;
  pointer-events: none;
}

.land-area .you-marker {
  display: none;
  fill: #173d57;
  font: bold 14px system-ui, sans-serif;
  letter-spacing: 1px;
}

.land-area.is-current .you-marker {
  display: block;
}

.land-area.is-current path {
  stroke: #173d57;
  stroke-width: 8;
}

.land-area[aria-disabled="true"] {
  cursor: default;
}

.bridge-edge,
.bridge-deck,
.bridge-used-mark {
  fill: none;
  stroke-linecap: butt;
}

.bridge-edge {
  stroke: #6b624f;
  stroke-width: 38;
}

.bridge-deck {
  stroke: #f5e6bf;
  stroke-width: 28;
}

.bridge-used-mark {
  display: none;
  stroke: #173d57;
  stroke-width: 8;
  stroke-dasharray: 8 7;
}

.map-bridge circle {
  fill: #fffcf2;
  stroke: #5c614e;
  stroke-width: 3;
}

.map-bridge text {
  fill: #263b31;
  font: bold 23px system-ui, sans-serif;
  pointer-events: none;
}

.map-bridge.is-available {
  cursor: pointer;
}

.map-bridge.is-available:hover .bridge-deck {
  stroke: #fff9e8;
}

.map-bridge.is-used .bridge-used-mark {
  display: block;
}

.map-bridge.is-used circle {
  stroke-dasharray: 4 3;
}

.land-area:focus-visible path,
.map-bridge:focus-visible .bridge-edge {
  stroke: #173d57;
  stroke-width: 10;
}

.walk-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem;
  margin: .65rem 0;
}

.walk-buttons button,
#replay-story {
  font: .85rem/1.3 system-ui, sans-serif;
  min-height: 44px;
  padding: .45rem;
  cursor: pointer;
}

.walk-buttons button:disabled {
  opacity: .48;
  cursor: default;
}

.walk-score {
  margin: .7rem 0;
}

#walk-position {
  font-size: 1rem;
  margin: .6rem 0;
}

.walk-feedback {
  padding: .6rem .7rem;
  border-left: 3px solid #315f59;
  background: #e5ebdd;
  font: .88rem/1.45 system-ui, sans-serif;
}

#walk-log {
  padding-left: 1.4rem;
  font-size: .85rem;
}

.bridge-story {
  box-sizing: border-box;
  width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.4rem 1.6rem;
  border: 2px solid #78917e;
  border-radius: 14px;
  background: #f3f5eb;
  color: #343e35;
  box-shadow: 0 20px 80px #102c3260;
  font: 1.08rem/1.65 Georgia, serif;
}

.bridge-story::backdrop {
  background: #102c326b;
}

.story-topline,
.story-footer,
.story-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.story-topline .eyebrow {
  margin: 0;
}

.story-topline button {
  flex: none;
}

.bridge-story button {
  min-height: 44px;
  padding: .55rem .8rem;
  border: 1px solid #78917e;
  border-radius: 7px;
  background: #fafbf4;
  color: #244a45;
  font: .94rem/1.3 system-ui, sans-serif;
  cursor: pointer;
}

.bridge-story button:disabled {
  opacity: .45;
  cursor: default;
}

.story-panel {
  min-height: 295px;
}

.story-panel h2 {
  margin: 1rem 0;
  font-size: 1.75rem;
}

.story-panel ul {
  padding-left: 1.3rem;
}

.story-panel li {
  margin: .4rem 0;
}

.story-reminder {
  padding: .6rem .8rem;
  border-left: 3px solid #315f59;
  background: #e5ebdd;
}

.story-footer {
  padding-top: .8rem;
  border-top: 1px solid #a4b39c;
}

#story-progress {
  margin: 0;
  font: .85rem/1.4 system-ui, sans-serif;
}

.bridge-story .story-begin {
  background: #315f59;
  color: white;
}

.bridge-noscript {
  position: relative;
  margin: 1rem;
  padding: 1rem;
  background: #f3f5eb;
}

@media (max-width: 1199px) {
  body[data-place="konigsberger-brucke"] .bridge-scene {
    min-height: 480px !important;
  }
}

@media (max-width: 600px) {
  .bridge-story {
    padding: 1rem;
    font-size: 1rem;
  }

  .story-panel {
    min-height: 0;
  }

  .story-panel h2 {
    font-size: 1.45rem;
  }

  .story-footer {
    flex-wrap: wrap;
  }

  .story-actions {
    margin-left: auto;
  }

  .map-key {
    font-size: .75rem;
    padding: .5rem;
  }
}

@media print {
  .bridge-info,
  .bridge-story {
    display: none !important;
  }
}

/* Navigation above; the notebook rests at the foot of the left sidebar. */
body[data-place="konigsberger-brucke"] .location-left {
  display: flex;
  flex-direction: column;
}

body[data-place="konigsberger-brucke"] .traveller-notes {
  margin-top: auto;
  padding-top: 1rem;
}

/* Illustrated cartography replaces the former filled region shapes. */
body[data-place="konigsberger-brucke"] .land-area .land-hit,
body[data-place="konigsberger-brucke"] .land-area.is-current .land-hit {
  fill: transparent;
  stroke: none;
}

body[data-place="konigsberger-brucke"] .land-area .land-label {
  fill: #fff8e8ed;
  stroke: #67563d;
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 2px #122b3040);
}

body[data-place="konigsberger-brucke"] .land-area text {
  font: bold 20px Georgia, serif;
  fill: #293b36;
}

body[data-place="konigsberger-brucke"] .land-area .you-marker {
  font: bold 11px system-ui, sans-serif;
  fill: #112f47;
  paint-order: stroke;
  stroke: #fff8e8;
  stroke-width: 4px;
  stroke-linejoin: round;
}

body[data-place="konigsberger-brucke"] .land-area.is-current .land-label {
  stroke: #112f47;
  stroke-width: 3;
}

body[data-place="konigsberger-brucke"] .land-area:focus-visible .land-label {
  stroke: #112f47;
  stroke-width: 4;
}

.bridge-shadow {
  fill: #17314055;
  transform: translate(5px, 5px);
}

.bridge-abutment {
  fill: #b7aa8e;
  stroke: #746c58;
  stroke-width: 1.5;
}

.bridge-timber {
  fill: url(#bridge-wood);
  stroke: #62482f;
  stroke-width: 1;
}

.bridge-boards path {
  fill: none;
  stroke: #74502f;
  stroke-opacity: .65;
  stroke-width: 1;
}

.bridge-rail-shadow {
  fill: none;
  stroke: #543e2b;
  stroke-width: 5;
}

.bridge-rail {
  fill: none;
  stroke: #e0c697;
  stroke-width: 3;
}

.bridge-posts rect {
  fill: #93704a;
  stroke: #593e27;
  stroke-width: 1;
}

body[data-place="konigsberger-brucke"] .bridge-number {
  fill: #fff8e8f2;
  stroke: #67563d;
  stroke-width: 2;
  filter: drop-shadow(0 1px 2px #102a3a65);
}

body[data-place="konigsberger-brucke"] .map-bridge text {
  font: bold 17px system-ui, sans-serif;
  fill: #293b36;
}

.bridge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 44;
  pointer-events: stroke;
}

body[data-place="konigsberger-brucke"] .map-bridge .bridge-used-mark {
  display: none;
}

body[data-place="konigsberger-brucke"] .map-bridge.is-used .bridge-number {
  stroke: #112f47;
  stroke-dasharray: 4 3;
  stroke-width: 3;
}

body[data-place="konigsberger-brucke"] .map-bridge.is-available:hover .bridge-number,
body[data-place="konigsberger-brucke"] .map-bridge:focus-visible .bridge-number {
  fill: #ffffff;
  stroke: #112f47;
  stroke-width: 4;
}

.route-halo,
.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-halo {
  stroke: #fff8e8;
  stroke-width: 8;
  opacity: .96;
}

.route-line {
  stroke: #112f47;
  stroke-width: 4;
}

#route-start text {
  font: bold 12px system-ui, sans-serif;
  fill: #112f47;
}

#walking-route {
  pointer-events: none;
}

/* The artwork and controls share one coordinate system; no title/footer bands. */
body[data-place="konigsberger-brucke"] .bridge-puzzle {
  background: transparent;
}

body[data-place="konigsberger-brucke"] .bridge-puzzle #walking-map {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
}

/* Match Numberland's painted labels: lettering and a light halo, no plaques. */
body[data-place="konigsberger-brucke"] .land-label {
  display: none;
}

body[data-place="konigsberger-brucke"] .land-area > text:not(.you-marker) {
  font: bold 21px Georgia, serif;
  fill: #302b25;
  paint-order: stroke;
  stroke: #fffdf1;
  stroke-opacity: .88;
  stroke-width: 4px;
  stroke-linejoin: round;
}

body[data-place="konigsberger-brucke"] .land-area .you-marker {
  display: none;
}

body[data-place="konigsberger-brucke"] .land-area:focus-visible > text {
  stroke: #ffe3a0;
  stroke-width: 6px;
}

#before-walking button {
  display: block;
  width: 100%;
  margin: .7rem 0;
}

#continue-exploring {
  min-height: 44px;
  font: 600 1rem/1.3 system-ui, sans-serif;
  padding: .7rem;
}
.bridge-arrival-vignette {
  display: block;
  width: 100%;
  height: auto;
  max-height: 24rem;
  margin: 1rem auto 0;
  object-fit: contain;
}

@media (min-width: 1200px) {
  #challenge:has(> #before-walking:not([hidden])),
  #before-walking:not([hidden]) {
    display: flex;
    flex-direction: column;
  }
  #before-walking:not([hidden]),
  .bridge-arrival-vignette {
    flex: 1 1 0;
    min-height: 0;
  }
  #before-walking > :not(.bridge-arrival-vignette) {
    flex-shrink: 0;
  }
  .bridge-arrival-vignette {
    max-height: none;
  }
}
