/* The atlas takes over the viewport. Other game menus keep their compact layout. */
#panel.wide[open] {
  position: fixed;
  inset: 0;
  width: 100%; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0;
  border: 0; border-radius: 0;
  overflow: hidden;
  background: #192431;
  color: #fffaf1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
#panel.wide .panel-head {
  height: max(48px, calc(40px + env(safe-area-inset-top)));
  padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid #f3f1e324;
}
#panel.wide .panel-mark { color: #d5dddc; }
#guide-section:not([hidden]) {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  min-height: 0;
}
#guide-section h2 {
  margin: 11px 14px 12px max(18px, env(safe-area-inset-left));
  font: 630 clamp(19px, 3.1vw, 26px)/1.1 'DM Sans', sans-serif;
  letter-spacing: -.035em;
}
#guide-progress { margin: 0 12px 0 0; color: #bdc7c6; font-size: 12px; }
.guide-grid { position: relative; grid-column: 1 / -1; height: 100%; min-height: 0; }
.map-wrap { position: absolute; inset: 0; overflow: hidden; }
#map { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#map.dragging { cursor: grabbing; }
#map:focus-visible { outline: 3px solid #f0bc59; outline-offset: -3px; }
.atlas-tools, .atlas-hint, .atlas-credit, .guide-side {
  background: #152331ef;
  color: #fffaf0;
  border: 1px solid #ffffff38;
  box-shadow: 0 3px 15px #1221232e;
}
.atlas-tools {
  position: absolute; display: flex; align-items: center; gap: 3px;
  top: 12px; right: max(14px, env(safe-area-inset-right)); padding: 3px; border-radius: 9px;
}
.atlas-tools button { color: inherit; border: none; background: transparent; min-width: 36px; height: 36px; padding: 0 9px; border-radius: 5px; font: 600 13px/1 'DM Sans', sans-serif; }
.atlas-tools button:nth-child(-n+2) { font-size: 20px; }
.atlas-tools button:hover:not(:disabled), .atlas-tools button[aria-pressed=true], .atlas-tools button[aria-expanded=true] { background: #42525d; }
.atlas-tools button:disabled { opacity: .38; cursor: default; }
.atlas-hint { position: absolute; top: 13px; left: max(14px, env(safe-area-inset-left)); padding: 8px 10px; border-radius: 7px; font-size: 12px; pointer-events: none; }
.atlas-credit { position: absolute; bottom: max(8px, env(safe-area-inset-bottom)); right: max(9px, env(safe-area-inset-right)); padding: 3px 6px; border: none; border-radius: 3px; font-size: 10px; text-decoration: none; }
.atlas-credit:hover { text-decoration: underline; }
.atlas-scale { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: max(18px, env(safe-area-inset-left)); height: 16px; color: #223831; text-shadow: 0 0 4px #fff; border: solid #3a4a42; border-width: 0 1.5px 2px; text-align: center; font: bold 10px/1 'DM Sans', sans-serif; pointer-events: none; }
.guide-side { position: absolute; top: 63px; right: max(14px, env(safe-area-inset-right)); width: min(300px, calc(100% - 28px)); max-height: calc(100% - 104px); overflow: auto; padding: 14px; border-radius: 10px; }
#landmark-list { display: grid; gap: 5px; }
#landmark-list button { display: flex; gap: 9px; width: 100%; padding: 8px; border: 1px solid #fff3; border-radius: 5px; background: transparent; color: inherit; align-items: center; text-align: left; font: 500 13px 'DM Sans', sans-serif; }
#landmark-list button[aria-pressed=true] { background: #483c47; border-color: #c7a2a7; }
.landmark-number { font-size: 10px; color: #d8bd91; font-variant-numeric: tabular-nums; }
.visited .landmark-number::after { content: ' ✓'; }
.landmark { margin-top: 12px; padding-top: 12px; border-top: 1px solid #fff3; }
.landmark h3 { margin: 0; font-size: 16px; }
.landmark p { margin: 5px 0 11px; color: #dbe3e2; }
@media (max-width: 560px) {
  #panel.wide .panel-head { height: max(41px, calc(36px + env(safe-area-inset-top))); }
  #guide-section h2 { font-size: 18px; margin: 10px 9px 10px 13px; }
  #guide-progress { font-size: 11px; }
  .atlas-tools { top: 8px; right: 8px; }
  .atlas-tools button { min-width: 33px; height: 38px; padding: 0 8px; }
  .atlas-hint { top: auto; left: 8px; bottom: max(38px, calc(30px + env(safe-area-inset-bottom))); font-size: 11px; padding: 5px 8px; }
  .guide-side { top: 59px; right: 8px; max-height: calc(100% - 93px); }
}

#guide-section.has-features { grid-template-rows: auto auto minmax(0, 1fr); }
.atlas-highlights {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
}
.atlas-feature-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #ffffff3b;
  border-radius: 6px;
  background: #263643;
  color: #f6f4ed;
  font: 550 12px/1.3 'DM Sans', sans-serif;
}
.atlas-feature-key::before {
  content: '';
  width: 11px; height: 9px; flex: none;
  background: var(--area-fill); border: 1px solid var(--area-edge); border-radius: 2px;
}
.key-school { --area-fill: #ba7784; --area-edge: #e5a6b2; }
.key-court { --area-fill: #e8be69; --area-edge: #f8d596; }
.key-sports-ground { --area-fill: #659b70; --area-edge: #9ec9a6; }
.atlas-feature-key[aria-pressed=true], .atlas-feature-key:hover { background: #3d505c; border-color: #a9b7b4; }
.atlas-feature-key select {
  max-width: 200px; padding: 0 2px; border: 0; border-radius: 2px;
  background: #263643; color: inherit; font: inherit; cursor: pointer; color-scheme: dark;
}
.atlas-feature-key select:focus-visible { outline: 2px solid #f0bc59; }
@media (max-width: 560px) {
  .atlas-highlights { padding: 0 8px 7px; gap: 4px; }
  .atlas-feature-key { min-height: 33px; font-size: 11px; padding: 4px 6px; gap: 4px; }
  .atlas-feature-key select { max-width: 134px; }
}
@media (max-height: 430px) and (orientation: landscape) {
  #panel.wide .panel-head { position: absolute; top: 0; right: 0; z-index: 1; height: 34px; padding: 2px 9px; border: 0; }
  #panel.wide .panel-mark { display: none; }
  #panel.wide[open] { grid-template-rows: minmax(0,1fr); }
  #guide-section h2 { font-size: 18px; margin-block: 6px; }
  .atlas-highlights { padding-bottom: 5px; }
}
.atlas-site-view::before { display: none; }
.atlas-site-view { background: #394c56; }
