*{box-sizing:border-box}html,body{margin:0;height:100%}body[data-pattern-place]{padding:0;background:#dbeaf3;font:17px/1.5 Georgia,serif}.quarter-workspace{height:100dvh;padding:12px;display:grid;grid-template-columns:260px minmax(0,1fr) 280px;gap:12px}.ice-sidebar{overflow:auto;height:100%;padding:18px}.ice-sidebar h1{font-size:2.15rem}.eyebrow{font:600 .66rem/1.6 system-ui;letter-spacing:.12em}.ice-destinations{gap:6px}.ice-destinations a{font-size:.8rem;padding:8px}.archive-notebook{margin-top:24px;border-top:1px solid #92b4cb;padding-top:16px}textarea{width:100%;font:inherit;padding:8px;border:1px solid #7aa5c2;border-radius:6px;resize:vertical}.small{font-size:.82rem!important}.scene{position:relative;min-width:0;min-height:0;align-self:stretch;display:flex;align-items:center;justify-content:center;background:#203e55;border:1px solid #92b4cb;border-radius:12px;overflow:hidden}#map{display:block;width:100%;max-height:100%;aspect-ratio:3/2}.region{fill:transparent;stroke:transparent;stroke-width:4;cursor:crosshair;transition:fill .18s}.region:hover{stroke:white;stroke-width:5}.region:focus-visible{outline:none;stroke:white;stroke-width:7;stroke-dasharray:10 5}.boundary{fill:none;stroke:#203329;stroke-width:3;stroke-linejoin:round;opacity:.65}.conflict{stroke:#fff;stroke-width:9;stroke-dasharray:12 8;filter:drop-shadow(0 1px 2px #111)}.scene-caption{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:space-between;gap:8px;background:#203e55ed;color:white;padding:12px 16px;font:600 .8rem system-ui;pointer-events:none}#palette{display:grid;grid-template-columns:1fr 1fr;gap:10px}button{font:600 .87rem/1.3 system-ui;cursor:pointer;padding:11px;border-radius:7px}#palette button{background:var(--paint);color:var(--ink);min-height:62px;border:3px solid transparent;box-shadow:none}#palette button[aria-pressed=true]{border-color:#182b3b;outline:3px solid white;outline-offset:-6px}button:disabled{opacity:.45;cursor:default}.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}#feedback{padding:12px;border-left:3px solid #356d94;background:#dcecf6}#menu{display:none}dialog{max-width:560px;border:2px solid #9f885d;border-radius:8px;background:#f5ead0;color:#3e382d;padding:28px;font:18px/1.6 Georgia}dialog::backdrop{background:#102739aa}#close-discovery{float:right}#discovery{width:100%;animation:glow 2s infinite alternate}@keyframes glow{to{box-shadow:0 0 18px #5d9dcc}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}@media(max-width:1100px){.quarter-workspace{grid-template-columns:220px minmax(0,1fr) 240px;gap:8px;padding:8px}.ice-sidebar{padding:12px}.ice-sidebar h1{font-size:1.8rem}}@media(max-width:800px){html,body{height:auto}.quarter-workspace{height:auto;display:flex;flex-direction:column}.ice-sidebar{overflow:visible}.introduction h1{margin-bottom:8px}.introduction>p:not(.eyebrow){margin:8px 0}#menu{display:block}#destinations{display:none}#destinations.open{display:block}.archive-notebook{margin-top:12px}.introduction .archive-notebook{display:none}.scene{width:100%;padding-bottom:40px}#map{width:100%}.instructions{width:100%}#palette{grid-template-columns:repeat(4,1fr)}#palette button{font-size:.75rem;padding:6px}.scene-caption{font-size:.72rem}}
@media(max-width:800px){.introduction .archive-notebook{display:block}}

/* Arrival scene: fixed-height centre with independent sidebar scrolling. */
[hidden]{display:none!important}
.introduction{display:flex;flex-direction:column}.introduction .archive-notebook{margin-top:auto;padding-top:18px}
.quarter-backdrop{display:block;width:100%;height:100%;object-fit:contain}
.arrival-scene{background:#c7e5ef;border:1px solid #729fbb;box-shadow:0 6px 24px #254f7020}
.exploration-sign{margin:24px 0;padding:16px;background:#ffffffa8;border:1px solid #92b4cb;border-radius:8px;border-top:4px solid #e8b632}
.exploration-sign button{width:100%}.exploration-sign .eyebrow{font-size:.65rem}.instructions h2{font-size:1.55rem;line-height:1.2}
@media(min-width:801px){.quarter-workspace{grid-template-columns:280px minmax(0,1fr) 300px}.ice-sidebar h1{font-size:2.15rem}.scene{align-self:center;height:min(calc(100dvh - 24px),calc((100vw - 640px)*2/3));min-height:0}.ice-sidebar{min-height:0}.archive-notebook textarea{max-height:120px}}
@media(min-width:801px) and (max-width:1100px){.quarter-workspace{grid-template-columns:220px minmax(0,1fr) 240px}.scene{height:calc((100vw - 492px)*2/3)}.ice-sidebar h1{font-size:1.8rem}}
@media(max-width:800px){.arrival-scene{padding:0;aspect-ratio:3/2}.quarter-backdrop{height:auto}.introduction .archive-notebook{margin-top:16px}.introduction #destinations:not(.open)+.archive-notebook{display:none}}

/* Match the arrival scene to the full sidebar height on desktop. */
@media(min-width:801px){.quarter-workspace{grid-template-rows:minmax(0,1fr)}.scene.arrival-scene{align-self:stretch;height:100%;min-height:0}.arrival-scene .quarter-backdrop{width:100%;height:100%;object-fit:cover;object-position:center}}

/* Hamlet tools sit over the centre panel only. */
.scene.activity-open{display:flex;flex-direction:column;background:#cce0dd;padding:0 0 96px;justify-content:center}
#hamlet-stage{width:100%;min-height:0;display:flex;align-items:center;justify-content:center;flex:1;overflow:hidden}
#hamlet-stage #map{width:100%;height:100%;max-height:100%;aspect-ratio:3/2;object-fit:contain}
.paint-bar{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;gap:16px;min-height:90px;padding:12px;background:linear-gradient(#f3fbffef,#d5e9f5);border-top:1px solid #739ab5;box-shadow:0 -3px 14px #203e5522}
.paint-bar #palette{display:flex;gap:10px}.paint-bar #palette button{min-width:86px;min-height:50px;padding:9px 12px;font-size:.85rem;box-shadow:0 2px 3px #203e5533}.paint-actions{display:flex;gap:8px;border-left:1px solid #92b4cb;padding-left:16px}.paint-actions button{background:#f7fcff}.road-edge{fill:none;stroke:#6d7864;stroke-width:22;stroke-linejoin:round}.road-surface{fill:none;stroke:#e8ddbf;stroke-width:16}.road-detail{fill:none;stroke:#fff8e2;stroke-width:2;stroke-dasharray:3 8;opacity:.65}
#plot-labels rect{fill:#fffffff0;stroke:#41617b;stroke-width:1.5}#plot-labels text{fill:#203e55;font:600 18px Georgia,serif}.region{cursor:pointer}.region:focus-visible{stroke:#172b3b;stroke-width:7;stroke-dasharray:10 5}.region.conflict{stroke:#172b3b;stroke-width:10;stroke-dasharray:12 8;filter:drop-shadow(0 0 3px white)}#activity-panel #back{margin-top:16px}#activity-panel #counter{font-weight:bold}#activity-panel h2:focus{outline:none}#selected{font-size:.9rem}
@media(min-width:801px) and (max-width:1300px){.paint-bar{gap:8px;flex-wrap:wrap;padding:8px}.paint-bar #palette{gap:5px}.paint-bar #palette button{min-width:58px;padding:7px;font-size:.75rem}.paint-actions{padding-left:8px;gap:5px}.paint-actions button{padding:8px}.scene.activity-open{padding-bottom:120px}.paint-bar{min-height:110px}}
@media(max-width:800px){.scene.activity-open{aspect-ratio:auto;padding:0 0 130px;min-height:390px}#hamlet-stage{flex:none;aspect-ratio:3/2;width:100%}.paint-bar{flex-wrap:wrap;gap:8px;min-height:120px}.paint-bar #palette{width:100%;justify-content:center;gap:6px}.paint-bar #palette button{min-width:64px;font-size:.75rem;padding:8px}.paint-actions{border:0;padding:0}.instructions #feedback{margin:16px 0}}

/* Keep tools inside the centre at narrow desktop widths. */
.paint-bar #palette{flex:1;min-width:0}.paint-bar #palette button{min-width:0;flex:1}.paint-bar{gap:8px}.paint-actions{padding-left:8px}.region{stroke:#17372c;stroke-width:3;stroke-linejoin:round}.region:hover{stroke:#fff;stroke-width:5}#hamlet-stage #map{max-width:100%}

/* Hamlet and Town use the same three-panel workspace. */
.instructions{display:flex;flex-direction:column}.level-menu{display:grid;gap:8px;margin-top:20px;padding-top:16px;border-top:1px solid #92b4cb}.level-menu button{width:100%;background:#e5f3fb;color:#214d6d}.level-menu button[aria-pressed=true]{background:#386d91;color:white}.paint-bar{flex-wrap:wrap;min-height:112px}.paint-bar #palette{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:1;gap:6px}.paint-bar #palette button{min-width:0;min-height:39px;padding:6px;font-size:.75rem}.scene.activity-open{padding-bottom:112px}#shared-borders{fill:none;stroke:#192c2b;stroke-width:1.8;stroke-linejoin:round}.region{stroke:transparent;stroke-width:4}.region:hover{stroke:#173c58;stroke-width:4}.paint-actions{flex-direction:column}.instructions #back{margin-top:18px}@media(min-width:1500px){.paint-bar #palette{grid-template-columns:repeat(8,minmax(0,1fr))}.paint-bar{min-height:84px}.scene.activity-open{padding-bottom:84px}.paint-actions{flex-direction:row}}@media(max-width:800px){.scene.activity-open{padding-bottom:112px}.paint-bar{min-height:112px}.paint-bar #palette{width:auto}.paint-bar #palette button{min-width:0}.paint-actions{flex-direction:column}}
.scene.arrival-scene.activity-open {
  padding-bottom: 0;
}

.scene.activity-open .paint-bar {
  position: static;
  flex: none;
  width: 100%;
}

@media (max-width: 800px) {
  .scene.arrival-scene.activity-open {
    min-height: 0;
  }
}
.quarter-people {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.resident-shadow {
  fill: #253a61;
  opacity: .22;
}

.scene.activity-open .quarter-people {
  display: none;
}

#city-best {
  padding: .55rem .7rem;
  border: 1px solid #92b4cb;
  border-radius: 7px;
  background: #e5f3fb;
  font-weight: bold;
}
