#adventure-entrances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
#adventure-entrances button { background: #dbe9cf; border-color: #708565; padding-inline: 5px; }
#adventure-entrances button:hover { background: #eaf3d5; }
#upstream-enter-adventure { color: #263b2c; background: #f3d994; border-color: #ffe7ad; }
#upstream-enter-adventure:hover { background: #ffe8b5; }

#adventure-room {
  --room-bg: #142b24;
  --room-chrome: #1d382e;
  --room-accent: #d5e6a5;
  --room-line: #789071;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  color: #fff0d3;
  color-scheme: dark;
  background: var(--room-bg);
  overflow: hidden;
}
#adventure-room[data-site="echo-cave"] {
  --room-bg: #151f2a;
  --room-chrome: #222e3d;
  --room-accent: #bce9de;
  --room-line: #617a84;
}
.adventure-room-layout {
  height: 100%;
  display: grid;
  grid-template: "header" auto "viewport" minmax(0, 1fr) "story" auto / minmax(0, 1fr);
}
.adventure-room-header {
  grid-area: header;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 5px;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 9px max(10px, env(safe-area-inset-left));
  background: var(--room-chrome);
  border-bottom: 1px solid var(--room-line);
}
.adventure-room-header h2 {
  margin: 0;
  font: 700 clamp(20px, 5.8vw, 30px)/1.12 "Songti SC", "Noto Serif CJK SC", serif;
  letter-spacing: .02em;
}
#adventure-room button {
  color: inherit;
  background: var(--room-bg);
  border-color: var(--room-line);
  padding-inline: 9px;
  font-size: 13px;
}
#adventure-room button:hover { border-color: var(--room-accent); }
#adventure-room #adventure-inventory {
  justify-self: end;
  color: var(--room-bg);
  background: var(--room-accent);
}
.adventure-viewport {
  grid-area: viewport;
  position: relative;
  min-height: 0;
  background: radial-gradient(ellipse at 50% 50%, var(--room-chrome), var(--room-bg) 78%);
}
.adventure-game {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}
.adventure-game canvas { display: block; image-rendering: pixelated; }
#adventure-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 14px;
  text-align: center;
  background: var(--room-bg);
}
.adventure-story {
  grid-area: story;
  max-height: 36dvh;
  padding: 12px max(13px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left));
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--room-chrome);
  border-top: 1px solid var(--room-line);
}
.adventure-story p { margin: 0; line-height: 1.55; }
#adventure-status { font-size: 15px; font-weight: 720; }
#adventure-line { color: var(--room-accent); font-size: 14px; margin-top: 3px; }
#adventure-line p + p { margin-top: 2px; }
#adventure-notebook { margin-top: 8px; border-top: 1px solid var(--room-line); }
#adventure-notebook summary { padding: 11px 0 5px; cursor: pointer; font-size: 14px; font-weight: 680; }
#adventure-observations { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }
#adventure-journal { margin: 0; padding: 3px 0 0 21px; color: #f6e9ce; font-size: 14px; }
#adventure-journal li { padding: 4px 0; }
#adventure-journal li p { color: var(--room-accent); }
#adventure-inspect { position: relative; margin-top: 10px; border-left: 2px solid var(--room-accent); padding: 5px 48px 5px 9px; }
#adventure-inspect p { margin-top: 1px; font-size: 13px; }
#adventure-inspect-close { position: absolute; top: 0; right: 0; }

@media (orientation: landscape) and (min-width: 690px) {
  .adventure-room-layout {
    grid-template: "header header" auto "viewport story" minmax(0, 1fr) / minmax(0, 1fr) minmax(275px, 30vw);
  }
  .adventure-room-header { padding-inline: 18px; }
  .adventure-story { max-height: none; padding: 24px 20px; border-top: none; border-left: 1px solid var(--room-line); }
  #adventure-notebook { margin-top: 16px; }
}
