/* Destinations fill the play surface as places in the same story. */
#game #menus {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
#game[data-location]:not([data-location=""]) { touch-action: auto; }
#game[data-location]:not([data-location=""]) > :is(.scene-hotspots,.hud,.courtyard-heading) {
  visibility: hidden;
}
#game #menus > .voyage-route.game-dialog.voyage-sheet {
  --route-page: #f8eed8;
  --route-ink: #293c32;
  --route-trim: #90764e;
  --route-width: 870px;
  --route-wall: #273c30;
  --sheet-cream: var(--route-page);
  --sheet-ink: var(--route-ink);
  --sheet-line: #bdab86;
  --sheet-gutter: clamp(16px, 4.5vw, 46px);
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  max-width: none;
  align-items: stretch;
  overflow: hidden;
  padding: 0 !important;
  background: var(--route-wall) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  pointer-events: auto;
  touch-action: pan-y pinch-zoom;
}
#game #menus > .voyage-route.sheet-enter {
  animation: arrive-location 185ms ease-out both !important;
}
@keyframes arrive-location {
  from { opacity: .3; transform: scale(1.014); }
  to { opacity: 1; transform: scale(1); }
}
#game #menus > .voyage-route > :is(header,.menu-body,.sheet-chapters,.voyage-decision,.menu-feedback) {
  box-sizing: border-box;
  width: min(100%, var(--route-width));
  max-width: none;
  margin-inline: auto !important;
}
#game #menus > .voyage-route > header {
  border-bottom: 1px solid color-mix(in srgb, var(--route-trim), transparent 45%) !important;
}
#game #menus > .voyage-route > header h2:focus { outline: none; }
#game #menus > .voyage-route .menu-body {
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  overflow: auto;
  background-color: var(--route-page) !important;
  background-image: var(--route-grain, linear-gradient(92deg, #42260e19, transparent 5% 95%, #42260e19)) !important;
}
#game #menus > .voyage-route .voyage-decision {
  position: relative;
  inset: auto;
  flex: none;
  background-color: var(--route-page) !important;
}
#game #menus > .menu-journal {
  --route-page: #f9f0d9;
  --route-wall: #493828;
  --route-grain: linear-gradient(90deg, #643a2629, transparent 3% 96%, #643a261c), repeating-linear-gradient(0deg, transparent 0 33px, #7954540b 34px 35px);
}
#game #menus > .menu-map {
  --route-page: #e8eee0;
  --route-wall: #153d40;
  --route-trim: #51746d;
  --route-grain: linear-gradient(0deg, #335c5311 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg,#335c5311 1px, transparent 1px) 0 0 / 22px 22px;
}
#game #menus > :is(.menu-craft,.menu-equipment) {
  --route-page: #efe2cb;
  --route-wall: #513b29;
  --route-trim: #865738;
  --route-grain: repeating-linear-gradient(3deg, #4926050d 0 1px, transparent 1px 12px), linear-gradient(90deg,#82491421, transparent 12% 88%,#82491421);
}
#game #menus > .menu-pet {
  --route-page: #edf1d7;
  --route-wall: #2b4b42;
  --route-trim: #4f7963;
}
#game #menus > .menu-bag {
  --route-page: #f5ead8;
  --route-wall: #544833;
  --route-grain: repeating-linear-gradient(90deg,#9b7f4110 0px 1px,transparent 1px 4px);
}
#game #menus > .menu-places {
  --route-page: #e9edda;
  --route-wall: #344735;
}
#game #menus > :is(.menu-title,.menu-story,.menu-transition,.menu-result,.menu-epilogue,.menu-debrief) {
  --route-width: 820px;
  --route-wall: #253e3c;
}
#game #menus > .menu-title::before { display: none !important; }
#game #menus > .menu-title > .menu-body { background-image: none !important; }
#game #menus .voyage-route :is(button,select,a,summary):focus-visible {
  outline: 2px solid #287867;
  outline-offset: 2px;
}
@media (min-width: 720px) {
  #game #menus > .voyage-route.game-dialog.voyage-sheet {
    background-image: linear-gradient(180deg, #142d1c00 40%, #142d1c8c), url("assets/render/home-dawn.webp") !important;
    background-position: center;
    background-size: cover;
    background-blend-mode: multiply;
  }
  #game #menus > .menu-map { --route-width: 960px; }
  #game #menus > .menu-journal { --route-width: 840px; }
}
@media (max-width: 590px) {
  #game #menus > .voyage-route { --sheet-gutter: 14px; }
  #game #menus > .voyage-route > header { min-height: 52px; }
  #game #menus > .voyage-route > .menu-body { padding-bottom: max(15px, env(safe-area-inset-bottom)) !important; }
}
@media (prefers-reduced-motion: reduce) {
  #game #menus > .voyage-route.sheet-enter { animation: none !important; }
}
#game[data-reduce-motion="true"] #menus > .voyage-route.sheet-enter { animation: none !important; }


/* The chart is spread across its table, the book opens onto ruled pages, and gear
   is laid out on the workshop surface. Each object has room for its own controls. */
#game #menus .menu-map .story-chart.map-islands {
  min-height: clamp(220px, 43dvh, 450px);
  border: 1px solid #648c80 !important;
  box-shadow: inset 0 0 22px #1f574f3b;
}
#game #menus .menu-journal .menu-body :is(.journal-entry,.empty-journal,.mission-panel) {
  border-radius: 0 !important;
  border-inline: 0 !important;
  padding-inline: clamp(11px, 3vw, 24px) !important;
  background: #fffaf04d !important;
  box-shadow: none !important;
}
#game #menus .menu-journal > .sheet-chapters {
  border-radius: 0 !important;
  background: #e8d8b8 !important;
}
#game #menus :is(.menu-craft,.menu-equipment) .forge-detail {
  border-radius: 2px !important;
  border-color: #a18158 !important;
  box-shadow: inset 0 1px 0 #fff5df, 0 2px 0 #ad9064;
}
#game #menus .menu-bag .bag-materials {
  border-top: 1px dashed #9b7652;
  padding-top: 12px;
}


/* Short menus stay over the current scene. */
#game #menus:has(> :is(.menu-pause,.menu-places,.voyage-compact)) {
  display: grid;
  place-items: center;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: #132a22a6;
  pointer-events: auto;
}
#game #menus > .voyage-route.game-dialog.voyage-sheet:is(.menu-pause,.menu-places,.voyage-compact) {
  --route-width: 542px;
  --sheet-gutter: clamp(10px, 3.3vw, 20px);
  position: relative;
  inset: auto;
  width: min(100%, var(--route-width));
  height: auto !important;
  max-height: 100%;
  margin: 0;
  border: 2px solid #9b8051;
  border-radius: 15px 9px 15px 9px !important;
  background: var(--route-page) !important;
  box-shadow: 0 6px 28px #0f241da8 !important;
}
#game #menus > :is(.menu-pause,.menu-places,.voyage-compact) > header {
  flex: none;
  min-height: 59px;
  padding-block: 6px !important;
  overflow: hidden;
}
#game #menus > :is(.menu-pause,.menu-places,.voyage-compact) > .menu-body {
  flex: 0 1 auto;
}
#game #menus .voyage-compact .menu-body > .button {
  min-height: 48px;
}
#game #menus .voyage-compact .menu-body > .button.danger {
  color: #fff4de !important;
  background: #804136 !important;
  border-color: #66372d !important;
}
#game #menus .menu-pause .voyage-pause-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}
#game #menus .menu-pause .voyage-pause-primary > :only-child {
  grid-column: 1 / -1;
}
#game #menus .menu-pause .voyage-pause-primary button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 56px;
  padding: 4px 6px !important;
  font-size: clamp(14px, 4.4vw, 17px);
  line-height: 1.25;
  text-align: left;
}
#game #menus .menu-pause .voyage-pause-primary .painted-icon {
  flex: none;
  width: clamp(30px, 10vw, 40px);
  height: 40px;
  object-fit: contain;
}
#game #menus .menu-pause .voyage-pause-primary small {
  display: block;
  margin-top: 1px;
  color: inherit;
  font-size: 11px;
}
#game #menus :is(.menu-pause,.menu-places) .voyage-destinations {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
#game #menus :is(.menu-pause,.menu-places) .voyage-destinations button {
  --object-size: 40px;
  grid-template-columns: var(--object-size) minmax(0, 1fr) auto;
  gap: 5px;
  min-height: 60px;
  padding: 5px !important;
  font-size: 14px;
  white-space: normal;
}
#game #menus :is(.menu-pause,.menu-places) .voyage-destinations .painted-icon {
  width: var(--object-size);
  height: var(--object-size);
  object-fit: contain;
}
#game #menus :is(.menu-pause,.menu-places) .voyage-destinations small {
  font-size: 11px;
  line-height: 1.3;
}
#game #menus .menu-pause .voyage-pause-extras {
  margin-top: 9px;
  border-top: 1px solid #bda982;
}
#game #menus .menu-pause .voyage-pause-extras summary {
  display: list-item;
  padding: 11px 2px;
  min-height: 44px;
  box-sizing: border-box;
  color: #415f50;
  cursor: pointer;
  font-size: 13px;
}
#game #menus .menu-pause .voyage-pause-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 5px;
}
#game #menus .menu-pause .voyage-pause-tools button {
  flex: 1 1 104px;
  min-width: 0;
  min-height: 48px;
  white-space: normal;
}
@media (max-height: 460px) and (min-width: 500px) {
  #game #menus > .voyage-route.game-dialog.voyage-sheet:is(.menu-pause,.menu-places,.voyage-compact) { --route-width: 650px; }
  #game #menus .menu-pause .voyage-pause-primary {
    position: sticky;
    top: -1px;
    z-index: 1;
    padding-block: 3px;
    background: var(--route-page);
  }
  #game #menus :is(.menu-pause,.menu-places) .voyage-destinations { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 350px) {
  #game #menus :is(.menu-pause,.menu-places) .voyage-destinations button { --object-size: 36px; }
}
@media (max-height: 390px) and (min-width: 500px) {
  #game #menus > :is(.menu-pause,.menu-places) > header { min-height: 48px; padding-block: 2px !important; }
  #game #menus > :is(.menu-pause,.menu-places) > header .sheet-illustration { max-height: 42px; max-width: 47px; }
  #game #menus > .menu-pause > .menu-body { padding-block: 7px 5px !important; }
  #game #menus .menu-pause .pause-note { margin-bottom: 5px; line-height: 1.35; }
  #game #menus .menu-pause .voyage-pause-primary { margin-bottom: 7px; padding-block: 1px; }
  #game #menus .menu-pause .voyage-pause-primary button { min-height: 50px; }
  #game #menus :is(.menu-pause,.menu-places) .voyage-destinations button { min-height: 52px; --object-size: 36px; }
  #game #menus .menu-pause .voyage-pause-extras { margin-top: 6px; }
}
