/* One playable console, surrounded by the world being restored. */
.world-atmosphere {
  inset: 0;
  filter: none;
  opacity: 1;
  background:
    linear-gradient(180deg, #091722a6, #0917224d 38%, #091722e8),
    var(--scene-image) center 54% / cover;
}
.world-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #0b1823c4 12%, #0b182342 65%);
}
body.console-phone .topbar {
  z-index: 3;
}
.map-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: #edf6ea;
  background: #101e29d9;
  border: 1px solid #d6edc438;
  border-radius: 24px;
  font:
    650 12px/1 system-ui,
    sans-serif;
}
#map-progress {
  color: #d6eaa5;
  font-variant-numeric: tabular-nums;
}
body.console-phone .header-controls {
  gap: 8px;
}
body.console-phone #puzzle-title {
  text-shadow: 0 3px 24px #000;
}
body.console-phone #play-stats {
  border-radius: 16px;
  background: #0a1826c4;
}
body.console-phone .board-wrap {
  background: #091923e8;
  box-shadow:
    0 24px 75px #0008,
    0 0 0 1px #e1ecc91c;
}
body.console-phone .actions button,
body.console-phone #play-modes button {
  background: #152530e8;
}
body.console-phone #play-modes button.active {
  background: #d7e8ae;
  border-color: #d7e8ae;
  color: #18291e;
}
body.console-phone #play-tools > button {
  background: #12232de8;
}
@media (min-width: 701px) and (min-height: 501px) {
  body.console-phone .app-shell {
    max-width: none;
    padding: 20px 36px;
  }
  body.console-phone .topbar {
    flex-basis: 48px;
  }
  body.console-phone .brand {
    font-size: 18px;
    opacity: 1;
    letter-spacing: -0.6px;
  }
  body.console-phone .brand-symbol {
    display: inline-flex;
  }
  body.console-phone .play-stage {
    margin: auto;
    max-width: 560px;
    padding: 18px 0 12px;
  }
  body.console-phone .puzzle-heading {
    margin-bottom: 14px;
  }
  body.console-phone .play-panel {
    position: static;
    width: 100%;
  }
  body.console-phone #puzzle-title {
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -1px;
  }
  body.console-phone .board-wrap,
  body.console-phone #play-stats {
    width: min(100%, 500px, max(200px, calc(100svh - 410px)));
    max-width: none;
  }
  body.console-phone #play-stats {
    margin-bottom: 12px;
    margin-inline: auto;
  }
  body.console-phone #play-stats .stats {
    width: 100%;
    margin: 0;
  }
  body.console-phone .actions {
    margin-top: 14px;
    gap: 12px;
  }
  body.console-phone #play-navigation {
    width: min(100%, 500px);
    margin-top: 14px;
  }
  body.console-phone #play-modes .mode-switch {
    grid-template-columns: repeat(4, 1fr);
  }
  body.console-phone #play-tools {
    margin-top: 8px;
  }
  body.console-phone .world-atmosphere {
    background-position:
      center,
      center 56%;
  }
  body.console-phone .world-atmosphere::after {
    background: linear-gradient(
      90deg,
      #09172212,
      #091722dd 36%,
      #091722dd 64%,
      #09172212
    );
  }
}
@media (min-width: 701px) and (min-height: 501px) and (max-height: 690px) {
  body.console-phone .play-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 14px 32px;
    align-content: center;
    align-items: center;
    max-width: 960px;
  }
  body.console-phone .play-panel {
    grid-column: 1;
    grid-row: 1;
  }
  body.console-phone .board-wrap,
  body.console-phone #play-stats {
    width: min(100%, calc(100svh - 300px));
  }
  body.console-phone .actions {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }
  body.console-phone #play-navigation {
    grid-column: 2;
    grid-row: 1 / 3;
    width: 100%;
    margin: 0;
  }
  body.console-phone #play-modes .mode-switch {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* The map is a game destination selector, with locked chapters still explorable. */
#world-map-dialog {
  width: min(1060px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100svh - 32px);
  padding: 26px;
  overflow: auto;
  color: #f1f5ee;
  background: #10212b;
  border: 1px solid #c6dfd13b;
  border-radius: 26px;
  box-shadow: 0 40px 140px #000a;
}
#world-map-dialog::backdrop {
  background: #06131dc9;
  backdrop-filter: blur(10px);
}
.map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.map-kicker {
  margin: 0 0 8px;
  color: #daedb1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}
#map-title {
  margin: 0;
  font:
    650 30px/1.1 system-ui,
    sans-serif;
  letter-spacing: -1px;
}
#map-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #ffffff30;
  border-radius: 50%;
  color: #fff;
  background: #ffffff09;
}
.map-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}
.map-preview {
  min-width: 0;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 540px;
  background: #0a1721;
}
#map-art {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
}
.map-preview-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  height: 100%;
  min-height: inherit;
  padding: 26px;
  background: linear-gradient(
    180deg,
    transparent 12%,
    #081821bd 53%,
    #081821 95%
  );
}
#map-world-title {
  margin: 0 0 10px;
  font:
    650 32px/1.1 system-ui,
    sans-serif;
  letter-spacing: -1px;
}
#map-story {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  max-width: 34ch;
}
#map-requirement {
  font-size: 12px;
  line-height: 1.5;
  color: #e6dfc8;
  margin: 12px 0 0;
}
#map-requirement:empty {
  display: none;
}
#map-travel {
  margin-top: 22px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid #d7e8ae;
  border-radius: 12px;
  background: #d7e8ae;
  color: #17261d;
  font:
    700 13px/1.3 system-ui,
    sans-serif;
  text-align: left;
}
#map-travel:disabled {
  background: #1d3038;
  color: #ccd5d2;
  border-color: #ffffff24;
  opacity: 1;
}
.map-route {
  align-self: center;
  min-width: 0;
}
.map-route-summary {
  margin: 0 0 14px;
  color: #d7e8ae;
  font-size: 12px;
  font-weight: 650;
}
#map-destinations {
  position: relative;
  display: grid;
  gap: 8px;
}
#map-destinations::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 30px;
  bottom: 30px;
  width: 1px;
  background: #d7e8ae50;
}
.map-destination {
  position: relative;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  min-height: 74px;
  padding: 8px 12px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #eef4ef;
  background: transparent;
}
.map-destination:hover {
  background: #ffffff0a;
}
.map-destination[aria-pressed="true"] {
  border-color: #d7e8ae80;
  background: #d7e8ae12;
}
.map-node {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #132b35;
  border: 1px solid #afc7c957;
  border-radius: 50%;
  color: #c5d6d5;
  font-size: 10px;
}
.is-restored .map-node {
  background: #d7e8ae;
  color: #17261d;
}
.map-destination img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
}
.map-destination.is-locked img {
  filter: saturate(0.5);
}
.map-destination-copy {
  display: grid;
  gap: 5px;
  flex: 1;
}
.map-destination strong {
  font:
    650 13px/1.3 system-ui,
    sans-serif;
}
.map-state {
  color: #b9ccc9;
  font:
    400 11px/1.3 system-ui,
    sans-serif;
}
.map-arrow {
  color: #d7e8ae;
  font-size: 24px;
}
.map-footnote {
  color: #b9ccc9;
  font-size: 11px;
  line-height: 1.5;
  margin: 14px 4px 0;
}
body.large-text .map-state,
body.large-text .map-footnote,
body.large-text #map-requirement {
  font-size: 14px;
}
@media (max-width: 700px) {
  #world-map-dialog {
    padding: 16px;
    border-radius: 20px;
    width: calc(100vw - 16px);
    max-height: calc(100svh - 16px);
  }
  .map-heading {
    margin-bottom: 16px;
    position: sticky;
    top: -16px;
    z-index: 2;
    background: #10212b;
    padding-block: 12px;
  }
  #map-title {
    font-size: 25px;
  }
  .map-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .map-preview {
    min-height: 310px;
  }
  .map-preview-copy {
    padding: 20px;
  }
  #map-world-title {
    font-size: 27px;
  }
  #map-story {
    font-size: 13px;
  }
  #map-travel {
    margin-top: 16px;
  }
  .map-destination {
    min-height: 66px;
  }
  .map-button {
    padding-inline: 12px;
    gap: 7px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  #world-map-dialog[open] {
    animation: map-arrive 220ms ease-out;
  }
  @keyframes map-arrive {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
@media (forced-colors: active) {
  .map-destination,
  .map-button,
  #map-travel {
    border: 1px solid ButtonText;
  }
  .map-destination[aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
}
