:root {
  --world-ink: #263f3d;
  --world-edge: #536a61;
  --world-cream: #fcf5e5;
  --world-mint: #c7d7bc;
  --world-green: #31544e;
  --world-gold: #eed196;
  --world-shadow: #a69d8270;
}

body { min-width: 18rem; min-height: 100svh; }

.world-shell {
  width: min(100% - 3rem, 68rem);
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 2.4rem) 0 1rem;
}

.world-header, .world-brand, .world-nav, .world-placebar, .world-ground {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.world-header { justify-content: space-between; margin-bottom: 1.05rem; }
.world-brand { gap: .72rem; min-width: 0; }
.world-brand img { image-rendering: pixelated; border: 1px solid var(--world-edge); box-shadow: 2px 2px var(--world-shadow); }
.world-brand h1 { color: var(--world-ink); font-size: clamp(1.7rem, 4.1vw, 3rem); }
.world-brand p { margin-top: .23rem; color: #475f55; font-size: .82rem; font-weight: 650; }
.world-nav { flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }

.world-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  background: var(--world-cream);
  border: 1px solid var(--world-edge);
  color: var(--world-ink);
  box-shadow: 2px 2px 0 var(--world-shadow);
  padding: .5rem .78rem;
  font-weight: 710;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
}

.world-button:not(:disabled):hover { background: #e2e8d4; }
.world-button.primary { background: var(--world-green); color: #fff4d9; }
.world-button.primary:not(:disabled):hover { background: #456b5f; }
.world-button:disabled { background: #e3dfcd; color: #5c6659; box-shadow: none; cursor: default; }

.world-view { border: 1px solid var(--world-edge); box-shadow: 4px 4px 0 var(--world-shadow); background: var(--world-cream); }
.world-placebar { justify-content: space-between; padding: .47rem .8rem; background: #e2e7d2; }
.world-placebar h2 { font-size: .94rem; font-weight: 750; }
.world-placebar p { font-size: .82rem; color: #35564e; font-weight: 670; }
.world-activity-score { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .28rem .8rem; padding: .42rem .8rem; background: #f2ead3; font-size: .81rem; }
.world-activity-score div { display: flex; align-items: baseline; gap: .28rem; }
.world-activity-score dt { color: #596753; }
.world-activity-score dd { font-weight: 750; font-variant-numeric: tabular-nums; }
.world-activity-score div[hidden] { display: none; }
.world-sport-meter {
  position: relative;
  display: inline-block;
  width: 5.8rem;
  height: .58rem;
  border: 1px solid #344c46;
  background: linear-gradient(to right, #496e60 var(--sport-start), #d4a658 var(--sport-start), #d4a658 var(--sport-end), #496e60 var(--sport-end));
}
.world-sport-meter::after {
  position: absolute;
  content: '';
  left: var(--sport-progress);
  top: -3px;
  bottom: -3px;
  width: 3px;
  background: #f8edcf;
  border: 1px solid #344c46;
  transform: translateX(-50%);
}
.world-canvas-wrap { position: relative; min-width: 0; background: #397681; }

.world-social {
  position: absolute;
  inset: auto auto .45rem .45rem;
  z-index: 1;
  display: flex;
  gap: .35rem;
}
.world-social[hidden], [data-film="1"] .world-social { display: none; }
.world-social .world-button {
  min-width: 44px;
  padding-inline: .62rem;
  font-size: .82rem;
  touch-action: manipulation;
}

.world-joystick {
  display: none;
  position: absolute;
  z-index: 2;
  left: .5rem;
  bottom: .5rem;
  width: clamp(76px, 10vw, 96px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid #f4e8c5a8;
  border-radius: 50%;
  background: #263b38bb;
  box-shadow: inset 0 0 0 3px #203835, 0 2px 3px #182a285e;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.world-joystick span {
  width: 45%;
  aspect-ratio: 1;
  border: 2px solid #314d44;
  border-radius: 50%;
  background: #f2e5bc;
  box-shadow: inset 0 -3px #b8ac83, 0 2px 2px #192b2880;
  transform: translate(var(--stick-x, 0px), var(--stick-y, 0px));
  pointer-events: none;
}
.world-joystick[data-held] span { background: #f9db8e; }
.world-social:not([hidden]) + .world-joystick { bottom: 3.6rem; }
[data-film="1"] .world-joystick { display: none; }

#world-canvas {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
}

.world-welcome {
  position: absolute;
  inset: auto auto clamp(.75rem, 3vw, 2rem) clamp(.75rem, 3vw, 2rem);
  width: min(34rem, calc(100% - 1.5rem));
  padding: clamp(1rem, 2.8vw, 1.6rem);
  color: #fff4d9;
  background: #233f3c;
  border: 1px solid #b4bc91;
  box-shadow: 5px 5px #213c3c8c;
}

.world-view:has(#welcome:not([hidden])) .world-placebar { display: none; }
.world-welcome h2 { font: 700 clamp(2rem, 4.4vw, 3.25rem)/.97 var(--display); text-wrap: balance; }
.world-welcome p { max-width: 36ch; margin-top: .65rem; line-height: 1.4; }
.world-welcome-actions, .world-action-row, .world-dialog-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.world-welcome-actions { margin-top: 1rem; }
.world-welcome-actions .world-button { border-color: #b4bc91; box-shadow: 2px 2px #112b2a; }
.world-welcome-actions .primary { min-width: 6rem; background: #f0d095; color: #263f3d; }
.world-welcome-actions .primary:not(:disabled):hover { background: #ffe8b8; }
.world-welcome-actions .world-help-button { color: inherit; background: transparent; }
.world-welcome-actions .world-help-button:not(:disabled):hover { background: #365b53; }
.world-welcome-actions .world-button:focus-visible { outline-color: #fff4d9; }

.world-view:has(#welcome:not([hidden])) #world-canvas {
  width: 100%;
  max-height: calc(100dvh - 10.75rem);
  object-fit: cover;
}

@media (max-width: 620px) and (orientation: portrait),
       (pointer: coarse) and (orientation: portrait),
       (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .world-shell:has(#welcome:not([hidden])) {
    width: min(100% - env(safe-area-inset-left) - env(safe-area-inset-right) - 1.2rem, 68rem);
    height: 100dvh;
    padding-top: max(.65rem, env(safe-area-inset-top));
    padding-bottom: max(.55rem, env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .world-view:has(#welcome:not([hidden])),
  .world-view:has(#welcome:not([hidden])) :is(.world-stage, #world-foyer, .world-canvas-wrap) {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
  }
  .world-view:has(#welcome:not([hidden])) .world-canvas-wrap {
    grid-area: 1 / 1;
    grid-template-rows: minmax(12rem, 1fr) auto;
  }
  .world-view:has(#welcome:not([hidden])) #world-canvas {
    height: auto;
    min-height: 0;
    max-height: none;
    align-self: stretch;
    object-position: 20% center;
  }
  .world-welcome {
    position: static;
    width: auto;
    border: 0;
    border-top: 1px solid #b4bc91;
    box-shadow: none;
  }
  .world-shell:has(#welcome:not([hidden])) .world-ground { padding-top: .45rem; }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .world-shell:has(#welcome:not([hidden])) {
    width: auto;
    margin-inline: max(.6rem, env(safe-area-inset-left)) max(.6rem, env(safe-area-inset-right));
  }
  .world-view:has(#welcome:not([hidden])) .world-canvas-wrap {
    grid-template: minmax(0, 1fr) / minmax(0, 1fr) minmax(18.8rem, 35%);
  }
  .world-welcome { align-content: center; padding: .75rem; border-top: 0; border-left: 1px solid #b4bc91; }
  .world-welcome h2 { font-size: clamp(1.95rem, 3.9vw, 2.6rem); }
  .world-welcome p { font-size: .93rem; }
  .world-welcome-actions .world-button { min-width: 0; padding-inline: .55rem; }
  #character-dialog { width: min(45rem, 100% - 1.4rem); }
  #character-dialog .world-character { grid-template-columns: 5.2rem minmax(0, 1fr); }
  #character-dialog .world-avatar-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #controls-dialog .world-controls-guide { padding: .25rem .75rem .65rem; }
  .world-control-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .85rem; }
  #controls-dialog .world-control-steps > div { padding: .4rem .16rem; }
  #controls-dialog .world-dialog-actions { margin-top: .5rem; }
}

.world-controls {
  display: flex;
  gap: .65rem 1.1rem;
  align-items: center;
  padding: .76rem .82rem;
  border-top: 1px solid var(--world-edge);
}

.world-control-note { flex: 1 1 10rem; }
#world-status { font-size: .98rem; font-weight: 720; }
#world-help { margin-top: .2rem; font-size: .8rem; color: #4d6055; }
.world-touch-help { display: none; }
.world-crossing { margin-top: .35rem; }
.world-crossing progress { display: block; width: min(14rem, 100%); height: .65rem; accent-color: #477869; }
.world-action-row { justify-content: flex-end; align-items: center; }
#world-action[data-bite] { color: #392d20; background: var(--world-gold); }

.world-walks {
  padding: .55rem .82rem .62rem;
  border-top: 1px solid var(--world-edge);
  background: #e7e8d7;
}
.world-walks summary {
  width: fit-content;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 700;
  padding-block: .25rem;
}
.world-walks summary:focus-visible { outline: 2px solid var(--world-ink); outline-offset: 3px; }
#world-walk-options { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
#world-walk-options button { text-align: left; }
.world-jam {
  padding: .65rem .82rem;
  border-top: 1px solid var(--world-edge);
  background: #e9e1ec;
}
.world-jam-controls { display: flex; flex-wrap: wrap; gap: .4rem; }
#jam-pads { margin-top: .5rem; }
#jam-pads button { min-width: 4.25rem; display: inline-flex; align-items: center; justify-content: space-between; gap: .4rem; }
#jam-pads kbd { font-size: .72em; color: #5b4b63; }
#jam-pads button[data-playing] { background: #dacaeb; color: #312946; }
.world-jam-status { margin-top: .4rem; font-size: .8rem; color: #52455b; }

.world-ground { justify-content: flex-end; padding: .88rem .06rem 0; font-size: .8rem; color: #40594f; }

.world-dialog {
  width: min(36rem, 100% - 1.4rem);
  max-height: min(90svh, 100% - 1.4rem);
  color: var(--world-ink);
  background: var(--world-cream);
  border: 1px solid var(--world-edge);
  box-shadow: 6px 6px #163c4250;
  padding: 0;
  overflow: auto;
}

.world-dialog::backdrop { background: #1c393b99; }
.world-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .7rem;
  padding: .65rem .85rem;
  border-bottom: 1px solid var(--world-edge);
  background: #e2e7d2;
}
.world-dialog-head h2 { font: 700 clamp(1.24rem, 4.2vw, 2rem)/1 var(--display); }
.literary-place-content { display: grid; justify-items: start; gap: .8rem; padding: .85rem; }
.literary-place .world-dialog-head { align-items: start; }
.world-pilot-dialog { max-width: 26rem; }
.world-pilot-body { padding: .85rem; }
.world-pilot-body p { line-height: 1.4; }
.world-pilot-meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3em;
  align-items: center;
  gap: .7rem;
  margin-top: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.world-pilot-meter progress { width: 100%; height: 1rem; accent-color: var(--world-green); }
.world-arrival-progress { display: block; width: 100%; height: 1rem; accent-color: var(--world-green); }
.world-preload-bytes {
  margin-top: .45rem;
  color: #40594f;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
#character-form { padding: .75rem .85rem .85rem; }
.world-character { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr; align-items: start; gap: .9rem; }
.world-preview { display: grid; gap: .48rem; }
.world-preview canvas { width: 100%; aspect-ratio: 96 / 104; image-rendering: pixelated; border: 1px solid var(--world-edge); background: var(--world-mint); }
.world-field { display: grid; gap: .27rem; font-size: .82rem; font-weight: 700; }
.world-name { margin-bottom: .52rem; }
.world-field :is(input, select) {
  font: inherit;
  font-weight: 550;
  color: var(--world-ink);
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--world-edge);
  background: #fff9eb;
  padding: .38rem .4rem;
}
.world-field :is(input, select):focus-visible { outline: 2px solid #a3412d; outline-offset: 1px; }
.world-avatar-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .55rem; }
.world-dialog-actions { justify-content: flex-end; margin-top: .8rem; }
.world-error { font-size: .86rem; color: #8a3728; font-weight: 720; margin-top: .6rem; }

.nearby-chat {
  width: min(28rem, calc(100% - 1.4rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100dvh - 1.4rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
.nearby-chat-body { display: grid; gap: .6rem; padding: .7rem .85rem .85rem; }
#nearby-chat-scope { color: #40594f; font-size: .87rem; line-height: 1.35; }
.nearby-chat-history {
  min-height: 3.5rem;
  max-height: min(13rem, 38dvh);
  background: #f3ead5;
  border: 1px solid #b9b49d;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
.nearby-chat-history li { padding: .42rem .5rem; }
.nearby-chat-history li + li { border-top: 1px solid #d8ccb0; }
.nearby-chat-history strong { color: #31544e; }
.nearby-chat-status { color: #40594f; font-size: .81rem; line-height: 1.3; }
.nearby-chat-status:empty { display: none; }
.nearby-chat-status[data-error] { color: #8a3728; }
.nearby-chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .46rem; align-items: end; }
.nearby-chat-form input { font-size: 1rem; min-height: 44px; }
@media (orientation: landscape) and (max-height: 500px) {
  .nearby-chat-history { max-height: min(10rem, 34dvh); }
}

.world-map-dialog { width: min(100% - 1rem, 94rem); height: 94svh; max-height: 94svh; }
.world-map-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.world-map-dialog[data-map-frame="whole"] {
  --world-map-aspect: 1.0345;
  width: min(100% - 1rem, max(30rem, calc((94svh - 14.1rem) * var(--world-map-aspect) + 1rem)));
  height: min(94svh, calc((100vw - 1rem) / var(--world-map-aspect) + 15rem));
  margin: auto;
}
@media (any-pointer: coarse), (max-width: 740px) {
  .world-map-dialog, .world-map-dialog[data-map-frame="whole"] {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding-block-end: env(safe-area-inset-bottom);
  }
  .world-map-dialog .world-dialog-head {
    padding: max(.42rem, env(safe-area-inset-top)) max(.65rem, env(safe-area-inset-right))
      .42rem max(.65rem, env(safe-area-inset-left));
  }
  .world-map-dialog #city-frame {
    min-height: 0;
    padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .world-map-dialog .world-dialog-head h2 { font-size: 1.45rem; }
}

#close-map { flex: none; white-space: nowrap; }
.world-map-feedback { margin: .35rem 0 0; font-size: .82rem; }
.world-map-feedback[data-error] { color: #8a3728; }
#city-frame { display: block; width: 100%; height: 100%; border: 0; }
.world-menu-dialog { width: min(30rem, 100% - 1.4rem); }

.world-room-menu {
  display: grid;
  gap: .5rem;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--world-edge);
}
.world-room-menu header, .world-room-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem;
}
.world-room-menu h3 { margin: 0; font: 700 1.25rem/1.1 var(--display); }
.world-room-menu p { margin: 0; font-size: .85rem; }
#room-roster { margin: 0; padding: 0; list-style: none; }
#room-roster li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  padding: .35rem 0;
  border-block-end: 1px solid #d5cfb8;
}
#room-roster li > div:first-child { min-width: 0; }
#room-roster li > div:last-child { display: flex; gap: .32rem; flex-wrap: wrap; }
#room-roster strong, #room-roster small { display: block; overflow-wrap: anywhere; }
#room-roster small { font-size: .79rem; color: #3c544b; }
.world-room-menu .world-button {
  min-height: 44px;
  padding: .34rem .56rem;
  font-size: .84rem;
}
.world-room-links { justify-content: flex-start; }
.world-room-links strong { margin-inline-end: .18rem; font-size: .85rem; }
#room-feedback[data-error] { color: #8a3728; }
.world-room-menu [aria-disabled="true"] { opacity: .65; }
#room-manual-link { width: 100%; }
.room-alternate-link { margin: .3rem .85rem .5rem; }

#room-notices {
  position: absolute;
  z-index: 8;
  inset: .58rem auto auto .58rem;
  max-width: calc(100% - 1.16rem);
  padding: .35rem .55rem;
  border: 2px solid #2b4944;
  background: #f5ecd1;
  color: #213939;
  box-shadow: 2px 2px #243f3677;
  font-size: .8rem;
  font-weight: 700;
  pointer-events: none;
}
@media (max-width: 440px) {
  #room-roster li { gap: .27rem .4rem; }
  .world-room-menu .world-button { padding-inline: .4rem; }
}
.world-menu-actions { display: grid; gap: .55rem; padding: .8rem; }
.world-beta-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.world-beta-actions:not(:has(button:not([hidden]))) { display: none; }
.world-drinks { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.world-controls-dialog { width: min(34rem, 100% - 1.4rem); }
.world-controls-guide { padding: .45rem .85rem .85rem; }
.world-about-dialog {
  width: min(41rem, calc(100% - 1.4rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: min(90dvh, calc(100dvh - 1.4rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  overflow: hidden;
}
.world-about-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.world-about-note {
  display: grid;
  justify-items: start;
  gap: .85rem;
  padding: clamp(.85rem, 3vw, 1.4rem);
  overflow: auto;
  overscroll-behavior: contain;
  line-height: 1.55;
}
.world-about-note:focus-visible { outline-offset: -3px; }
.world-about-portrait { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.world-control-steps { margin: 0; }
.world-control-steps > div { padding: .6rem .16rem; border-block-end: 1px solid #d4c9ae; }
.world-control-steps dt { font-weight: 750; }
.world-control-steps dd { margin: .17rem 0 0; font-size: .91rem; line-height: 1.42; }
.world-control-steps kbd { font-size: .9em; }

.field-guide { width: min(48rem, 100% - 1.4rem); }
.field-guide[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.field-guide-pages { display: grid; grid-template-columns: 1.1fr 1fr; overflow: auto; }
.field-guide-page { min-width: 0; padding: 1rem; }
.field-guide-page + .field-guide-page { border-inline-start: 1px solid #c9bfa3; background: #f6edd8; }
.field-guide-page h3 { margin: 0; font: 700 1.28rem/1.15 var(--display); }
.field-guide-handhelds { margin-block-start: 1.15rem; }
.field-guide-caption, .field-guide-message { margin: .38rem 0 .7rem; color: #4e6258; font-size: .86rem; }
.field-guide-list { list-style: none; margin: 0; padding: 0; }
.field-guide-list li { min-width: 0; border-block-end: 1px solid #d4c9ae; overflow-wrap: anywhere; }
.field-guide-task { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr) auto; align-items: start; gap: .55rem; padding: .58rem 0; }
.field-guide-check { display: grid; place-items: center; width: 1.05rem; height: 1.05rem; margin-top: .14rem; border: 1px solid var(--world-edge); font-size: .82rem; line-height: 1; }
.field-guide-task[data-complete] .field-guide-check { background: var(--world-green); color: #fff4d9; }
.field-guide-task strong { display: block; line-height: 1.25; }
.field-guide-place, .field-guide-count { display: block; color: #4e6258; font-size: .83rem; }
.field-guide-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.field-guide-form, .field-guide-note { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .45rem; }
.field-guide-form input { width: 100%; min-height: 44px; }
.field-guide-note { align-items: center; padding: .24rem 0; }
.field-guide-note label { display: flex; align-items: center; gap: .48rem; min-height: 44px; cursor: pointer; }
.field-guide-note input { flex: none; width: 1.08rem; height: 1.08rem; margin: 0; accent-color: var(--world-green); }
.field-guide-note input:checked + span { text-decoration: line-through; }
.field-guide-note button { padding-inline: .5rem; font-size: .85rem; }
.field-guide .world-button { user-select: none; }
.field-guide :focus-visible { outline: 2px solid #923c2a; outline-offset: 2px; }
@media (max-width: 570px) {
  .field-guide-pages { grid-template-columns: minmax(0, 1fr); }
  .field-guide-page + .field-guide-page { grid-row: 1; border-inline-start: 0; border-block-end: 1px solid #c9bfa3; }
}
.oak-stage[open] {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #120d16;
  color: #fff0d1;
}
:root:has(.oak-stage[open]), body:has(.oak-stage[open]) { overflow: hidden; }
body:has(.oak-stage[open]) .world-shell { overflow: clip; }
.oak-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: max(.25rem, env(safe-area-inset-top)) max(.7rem, env(safe-area-inset-right))
    .25rem max(.7rem, env(safe-area-inset-left));
  background: #38273a;
  border-bottom: 2px solid #99654d;
}
.oak-stage-header h2 { font: 700 clamp(1rem, 4vw, 1.5rem)/1 var(--display); margin: 0; }
.oak-stage-header button { flex: none; min-height: 44px; }
.oak-stage-game { position: relative; margin-bottom: env(safe-area-inset-bottom); }
.oak-stage-game:focus { outline: none; }

@media (orientation: landscape) and (max-height: 480px) {
  .oak-stage[open] {
    grid-template-columns: clamp(6.5rem, 14vw, 8rem) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .oak-stage-header {
    flex-direction: column;
    align-items: stretch;
    padding: max(.7rem, env(safe-area-inset-top)) .4rem max(.7rem, env(safe-area-inset-bottom))
      max(.4rem, env(safe-area-inset-left));
    border-right: 2px solid #99654d;
    border-bottom: 0;
  }
  .oak-stage-header h2 { font-size: 1.05rem; }
  .oak-stage-header button { padding-inline: .35rem; }
  .oak-stage-game { margin-right: env(safe-area-inset-right); }
}

.world-stage { display: grid; }
.world-stage > :is(#world-foyer, #pinball-room, #pool-room) { grid-area: 1 / 1; min-width: 0; }
#world-view:is([data-view$="-pinball"], [data-view$="-pool"]) :is(.world-stage, .world-canvas-wrap) { overflow: hidden; }
.world-nav[inert] { display: none; }

.pinball-room {
  position: relative;
  align-self: stretch;
  color: #fff0d1;
  background: #211c2c;
  z-index: 1;
}
.pinball-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .6rem clamp(.7rem, 2.6vw, 1.55rem);
  color: #ffdf96;
  background: #38273a;
  border-bottom: 2px solid #99654d;
}
.pinball-head h2 { font: 700 clamp(1.25rem, 4vw, 2.15rem)/1 var(--display); }
.pinball-head-actions { display: flex; flex: none; gap: .35rem; }
.pinball-head button { flex: none; white-space: nowrap; }
.pinball-cabinet {
  width: min(100%, 58rem);
  min-width: 0;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, .88fr);
  grid-template-rows: auto auto auto auto 1fr;
  grid-template-areas: "field scores" "field mission" "field controls" "field options" "field .";
  gap: .78rem clamp(.6rem, 3vw, 2.1rem);
  align-items: start;
  padding: clamp(.65rem, 2vw, 1.25rem);
}
.pinball-scores {
  grid-area: scores;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .42rem;
  margin: 0;
  text-align: center;
}
.pinball-scores div { padding: .42rem .56rem; background: #181626; border: 1px solid #754c61; }
.pinball-scores dt { font-size: .76rem; color: #e5c4a5; }
.pinball-scores dd { margin: .12rem 0 0; font: 700 1.48rem/1.1 var(--display); color: #ffe095; font-variant-numeric: tabular-nums; }
.pinball-field { grid-area: field; min-width: 0; display: grid; place-items: center; }
#pinball-canvas {
  display: block;
  width: min(100%, 22rem, max(10rem, calc(60dvh - 6.5rem)));
  height: auto;
  aspect-ratio: 224 / 360;
  image-rendering: pixelated;
  background: #151523;
  box-shadow: 0 0 0 1px #896449, 4px 4px 0 #140e1e;
}
#pinball-canvas:focus-visible { outline: 2px solid #ffdc89; outline-offset: 2px; }
.pinball-mission {
  grid-area: mission;
  background: #1a1727;
  border: 1px solid #754c61;
  padding: .55rem;
}
.pinball-mission p { margin: .42rem 0 0; font-size: .81rem; color: #ead0b9; }
.pinball-lamps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .34rem; }
.pinball-lamps span {
  text-align: center;
  padding: .23rem .33rem;
  border: 1px solid #75596d;
  color: #e5c8ae;
  background: #312437;
  font: 700 .92rem/1.1 var(--display);
}
.pinball-lamps [data-lit] { border-color: #ebbd69; background: #f5c869; color: #341c30; }
.pinball-mission[data-showtime] { border-color: #ffc772; }
.pinball-controls-zone { grid-area: controls; display: grid; gap: .43rem; }
.pinball-status { min-height: 1.12rem; margin: 0; color: #ffe095; font-size: .87rem; font-weight: 700; }
.pinball-power { display: flex; align-items: center; gap: .48rem; color: #e9c5ab; font-size: .75rem; }
.pinball-meter { display: block; position: relative; flex: 1; }
.pinball-meter progress { display: block; width: 100%; height: .55rem; accent-color: #79b9c7; }
.pinball-meter::after { content: ''; position: absolute; pointer-events: none; top: -.1rem; left: 44%; width: 24%; height: .15rem; background: #f5cc70; }
.pinball-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .38rem; }
.pinball-controls .world-button { padding-inline: .2rem; min-height: 46px; font-size: .86rem; touch-action: none; user-select: none; }
.pinball-controls [data-pinball="plunger"] { background: #e4a857; border-color: #f3c67e; }
.pinball-controls [data-held] { background: #c3784b; color: #fff4db; transform: translateY(1px); }
#world-action:is([data-pinball-ready], [data-oak-stage-ready]) { -webkit-tap-highlight-color: transparent; }
.pinball-options { grid-area: options; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.pinball-options p { margin: 0; flex: 1 1 9rem; font-size: .77rem; color: #e9c5ab; }
.pinball-options .world-button { font-size: .77rem; min-height: 36px; padding-inline: .5rem; }

.pool-room {
  z-index: 1;
  align-self: stretch;
  background: #231f24;
  color: #f5e8cb;
}
.pool-head, .pool-head-actions, .pool-turn, .pool-actions {
  display: flex;
  align-items: center;
  gap: .36rem;
}
.pool-head {
  justify-content: space-between;
  padding: .54rem clamp(.55rem, 2vw, 1.25rem);
  border-bottom: 2px solid #875b3a;
  background: #302522;
}
.pool-head h2 { font: 700 clamp(1.22rem, 3vw, 1.9rem)/1.08 var(--display); }
.pool-head-actions { flex: none; }
.pool-head .world-button { min-height: 44px; padding-inline: .58rem; white-space: nowrap; }
.pool-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem);
  align-items: center;
  gap: clamp(.55rem, 2vw, 1.2rem);
  max-width: 74rem;
  margin-inline: auto;
  padding: clamp(.55rem, 2vw, 1.2rem);
}
.pool-field { display: grid; place-items: center; min-width: 0; }
#pool-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 52rem;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
  background: #34252a;
  box-shadow: 0 0 0 1px #8d6246, 3px 3px #16151a;
}
#pool-canvas:focus-visible { outline: 2px solid #f1cf87; outline-offset: 3px; }
.pool-console { display: grid; justify-items: stretch; gap: .55rem; min-width: 0; }
.pool-status { color: #ffe2a6; font-weight: 700; margin: 0; line-height: 1.3; }
.pool-shot-result, .pool-help { color: #ddc6ac; margin: 0; font-size: .8rem; line-height: 1.32; }
.pool-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: .36rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.pool-players li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .35rem;
  border: 1px solid #765245;
  background: #302528;
  padding: .3rem .48rem;
  min-width: 0;
}
.pool-players li[data-turn] { border-color: #d9ac62; background: #544131; }
.pool-players li > span { min-width: 0; overflow-wrap: anywhere; font-size: .8rem; }
.pool-players strong { font: 700 1.26rem/1 var(--display); color: #ffe2a6; }
.pool-aim { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: .35rem .55rem; }
.pool-turn button { font-size: 1.05rem; min-width: 44px; padding: .35rem; }
.pool-aim > button { grid-column: 1 / -1; }
.pool-power { display: grid; gap: .12rem; min-width: 0; font-size: .79rem; }
.pool-power span { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: .25rem; }
.pool-power input { width: 100%; min-width: 0; margin: 0; height: 32px; accent-color: #e7ad70; }
.pool-actions { flex-wrap: wrap; }
.pool-actions:has(> :not([hidden])) { padding-top: .1rem; }
.pool-actions:has(> :not([hidden])) .world-button { flex: 1; text-wrap: balance; padding-inline: .52rem; }
.pool-aim .primary, .pool-actions .primary { border-color: #e9aa71; background: #a54049; color: #fff4df; }
.pool-aim .primary:enabled:hover, .pool-actions .primary:enabled:hover { background: #ba5157; }

@media (max-width: 660px) {
  .pool-head-actions .world-button { font-size: .78rem; }
  .pool-body { grid-template-columns: minmax(0, 1fr); }
  .pool-console { gap: .45rem; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .pool-head { padding-block: .34rem; }
  .pool-body { grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem); align-items: start; padding-block: .4rem; }
  #pool-canvas { width: min(100%, calc((100dvh - 10.5rem) * 5 / 3)); }
  .pool-console { gap: .34rem; }
  .pool-help { font-size: .75rem; }
}

@media (max-width: 650px) {
  .pinball-head { padding: .35rem .58rem; }
  .pinball-head button { font-size: .77rem; padding-inline: .4rem; min-height: 41px; }
  .pinball-cabinet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "scores" "field" "controls" "mission" "options";
    gap: .42rem;
    padding: .48rem .58rem .64rem;
  }
  .pinball-scores div { padding: .17rem .36rem; }
  .pinball-scores dd { font-size: 1.24rem; }
  #pinball-canvas { width: min(100%, 15.4rem, max(8rem, calc(61dvh - 12.3rem))); }
  .pinball-status { min-height: 1rem; font-size: .79rem; }
  .pinball-mission { padding: .36rem; }
  .pinball-mission p { font-size: .73rem; margin: .26rem 0 0; }
  .pinball-lamps span { font-size: .8rem; }
  .pinball-options p { flex-basis: 8rem; }
}

/* Dedicated tables use their own controls and title on touch screens. */
@media (pointer: coarse) and (max-width: 1100px), (max-width: 650px) {
  :root:not([data-film="1"]) .world-shell:has(#world-view:is([data-view="pinball"], [data-view="pool"])) {
    width: 100%;
    margin: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
      env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: #211c2c;
  }
  :root:not([data-film="1"]) .world-shell:has(#world-view:is([data-view="pinball"], [data-view="pool"]))
    :is(.world-header, .world-placebar, .world-ground) { display: none; }
  :root:not([data-film="1"]) #world-view:is([data-view="pinball"], [data-view="pool"]) {
    border: 0;
    box-shadow: none;
  }
  :root:not([data-film="1"]) :is(.pinball-room, .pool-room):not([hidden], [inert]) {
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: auto;
  }
  .pinball-head, .pool-head { padding: .4rem max(.58rem, env(safe-area-inset-right)) .4rem .58rem; }
  .pinball-head h2, .pool-head h2 { font-size: clamp(1.12rem, 3.6vw, 1.6rem); }
  .pinball-head-actions, .pool-head-actions { flex-wrap: wrap; }
  :is(.pinball-head, .pool-head, .pinball-options) .world-button { min-height: 44px; }
  .pinball-options .world-button { min-width: 44px; }
  .pinball-cabinet {
    grid-template-columns: minmax(8rem, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "field scores" "field controls" "field mission" "field options";
    align-items: stretch;
    gap: .5rem clamp(.6rem, 2vw, 1.1rem);
    min-height: 0;
    padding: .54rem .62rem .65rem;
  }
  .pinball-field { container-type: size; min-height: 0; }
  #pinball-canvas { width: min(100%, 22rem, max(6.6rem, calc(100cqh * 224 / 360))); }
  .pinball-options { align-self: start; }
  .pool-body { width: 100%; }
  .pool-power input { height: 44px; }
}
@media (pointer: coarse) and (orientation: portrait) and (max-width: 1100px), (max-width: 650px) and (orientation: portrait) {
  .pinball-cabinet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(8.2rem, 1fr) auto auto auto;
    grid-template-areas: "scores" "field" "controls" "mission" "options";
  }
  #pinball-canvas { width: min(100%, 22rem, calc(100cqh * 224 / 360)); }
  .pool-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
  }
  #pool-canvas { width: min(100%, 46rem); }
}
@media (max-width: 500px) and (orientation: portrait) {
  .pinball-head, .pool-head { flex-wrap: wrap; gap: .32rem; }
  .pinball-head-actions, .pool-head-actions { width: 100%; }
  :is(.pinball-head-actions, .pool-head-actions) .world-button { flex: 1; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .pinball-cabinet { grid-template-rows: auto auto auto minmax(44px, 1fr); }
  .pinball-scores div { padding: .25rem .4rem; }
  .pinball-scores dd { font-size: 1.25rem; }
  .pinball-mission { padding: .36rem; }
  .pinball-controls-zone { gap: .33rem; }
  .pool-body {
    grid-template-columns: minmax(0, 1fr) minmax(16.5rem, 44%);
    grid-template-rows: minmax(0, 1fr);
    gap: .64rem;
  }
  .pool-field {
    container-type: size;
    align-self: stretch;
    min-height: 9rem;
  }
  #pool-canvas { width: min(100%, calc(100cqh * 5 / 3)); }
  .pool-aim { grid-template-columns: max-content minmax(0, 1fr) max-content; gap: .4rem; }
  .pool-aim > button { grid-column: 3; grid-row: 1; padding-inline: .44rem; }
}

@media (any-pointer: coarse), (max-width: 740px) {
  .world-touch-help { display: inline; }
  .world-key-help { display: none; }
  .world-joystick:not([hidden]) { display: grid; }
}

@media (max-width: 620px) {
  .world-shell { width: calc(100% - 1.2rem); padding-top: .72rem; }
  .world-brand { gap: .45rem; }
  .world-brand img { width: 30px; height: 30px; }
  .world-brand p { font-size: .7rem; }
  .world-header { gap: .35rem; margin-bottom: .65rem; }
  .world-nav .world-button { padding-inline: .42rem; font-size: .76rem; }
  .world-header:has(.world-nav:not([inert]) #show-city:not([hidden])) { gap: .42rem; }
  .world-header:has(.world-nav:not([inert]) #show-city:not([hidden])) .world-brand { gap: .42rem; }
  .world-header:has(.world-nav:not([inert]) #show-city:not([hidden])) .world-brand h1 { font-size: clamp(1.12rem, 4.7vw, 1.6rem); }
  .world-header:has(.world-nav:not([inert]) #show-city:not([hidden])) .world-nav { gap: .28rem; }

  .world-placebar { font-size: .82rem; padding-inline: .58rem; }
  .world-placebar h2, .world-placebar p { font-size: .78rem; }
  .world-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .46rem .58rem; padding: .56rem; }
  .world-control-note { grid-column: 1 / -1; }
  .world-action-row .world-button { padding-inline: .53rem; font-size: .82rem; }
  .world-character { grid-template-columns: minmax(4.6rem, 5.8rem) minmax(0, 1fr); gap: .58rem; }
  .world-field :is(input, select) { font-size: 1rem; }
  .world-avatar-options { gap: .37rem; }
  .world-dialog-actions { justify-content: stretch; }
  .world-dialog-actions .world-button { flex: 1; }
}

@media (max-width: 370px) {
  .world-character { grid-template-columns: minmax(0, 1fr); }
  .world-preview { grid-template-columns: 3.6rem max-content; align-items: center; }
}

@media (any-pointer: coarse), (max-width: 740px), (max-height: 800px) {
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) {
    width: min(100%, 84rem);
    height: 100dvh;
    padding: max(.55rem, env(safe-area-inset-top)) max(.65rem, env(safe-area-inset-right))
      max(.45rem, env(safe-area-inset-bottom)) max(.65rem, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .world-view[data-view="foyer"]:has(#world-controls:not([hidden])) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
  }
  .world-view[data-view="foyer"]:has(#world-controls:not([hidden])) :is(.world-stage, #world-foyer, .world-canvas-wrap) {
    min-height: 0;
  }
  .world-view[data-view="foyer"]:has(#world-controls:not([hidden])) .world-stage {
    grid-template-rows: minmax(0, 1fr);
  }
  #world-foyer:has(#world-controls:not([hidden])) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  }
  #world-foyer > .world-activity-score { grid-row: 1; }
  #world-foyer > .world-canvas-wrap { grid-row: 2; }
  #world-foyer > .world-controls { grid-row: 3; }
  #world-foyer > .world-walks { grid-row: 4; }
  #world-foyer > .world-jam { grid-row: 5; }
  .world-view[data-view="foyer"]:has(#world-controls:not([hidden])) #world-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) .world-header {
    margin-bottom: .55rem;
  }
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) .world-nav {
    flex: none;
    flex-wrap: nowrap;
  }
  .world-nav .world-button { min-width: 44px; white-space: nowrap; }
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) .world-ground {
    padding-top: .4rem;
  }
  #world-foyer:has(#world-controls:not([hidden])) .world-controls {
    display: grid;
    grid-template: "note actions" auto / minmax(6rem, 1fr) minmax(9rem, 1fr);
    gap: .45rem .8rem;
    padding: .55rem .65rem;
  }
  .world-control-note { grid-area: note; min-width: 0; }
  .world-action-row { grid-area: actions; justify-content: flex-end; }
  .world-action-row > .world-button { min-width: 44px; }
  #world-walk-options { max-height: 22dvh; overflow: auto; }
}

@media (pointer: fine) and (min-width: 741px) and (max-height: 800px) {
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) {
    width: min(100% - 2rem, 68rem);
  }
}

@media (max-width: 620px) {
  #world-foyer:has(#world-controls:not([hidden])) .world-controls {
    grid-template: "note" auto "actions" auto / minmax(0, 1fr);
  }
}

@media (max-width: 740px) and (orientation: portrait), (any-pointer: coarse) and (orientation: portrait) {
  /* The city camera renders to this client aspect. Fill through bitmap rounding and rotation. */
  .world-view.world-city-active[data-view="foyer"]:has(#world-controls:not([hidden])) #world-canvas {
    object-fit: fill;
  }
}

@media (max-width: 360px) {
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) .world-header {
    display: grid;
    gap: .36rem;
  }
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) .world-nav {
    justify-content: flex-start;
  }
}

@media (orientation: landscape) and (max-height: 500px) and (any-pointer: coarse),
       (orientation: landscape) and (max-height: 500px) and (max-width: 740px) {
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) {
    padding-top: max(.35rem, env(safe-area-inset-top));
  }
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) .world-header { margin-bottom: .35rem; }
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) .world-brand h1 { font-size: 1.6rem; }
  .world-shell:has(.world-view[data-view="foyer"] #world-controls:not([hidden])) .world-brand img { width: 32px; height: 32px; }
  .world-placebar { padding-block: .3rem; }
  #world-foyer:has(#world-controls:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) clamp(15rem, 36%, 21rem);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  #world-foyer > :is(.world-activity-score, .world-walks, .world-jam) { grid-column: 1 / -1; }
  #world-foyer > .world-canvas-wrap { grid-column: 1; }
  #world-foyer > .world-controls { grid-area: 2 / 2; }
  #world-foyer > .world-walks { grid-row: 3; }
  #world-foyer > .world-jam { grid-row: 4; }
  #world-foyer:has(#world-controls:not([hidden])) .world-controls {
    grid-template: "note" auto "actions" minmax(0, 1fr) / minmax(0, 1fr);
    gap: .4rem .45rem;
    border-top: 0;
    border-inline-start: 1px solid var(--world-edge);
  }
  .world-action-row { max-height: 100%; overflow-y: auto; align-content: safe center; }
  .world-action-row .world-button { width: 100%; padding-inline: .35rem; }
  .world-joystick { width: 70px; }
}

@media (orientation: landscape) and (max-height: 360px) and (pointer: coarse) {
  .world-city-active #world-services { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

.world-services { margin: .15rem 0 0; font-size: .82rem; font-variant-numeric: tabular-nums; opacity: .86; }

#world-menu { position: relative; }
#menu-report-badge {
  position: absolute;
  inset-block-start: -.34rem;
  inset-inline-end: -.25rem;
  padding: .13rem .31rem;
  min-width: 1.2rem;
  color: #fff4d0;
  background: #805137;
  font-size: .68rem;
  line-height: 1rem;
  border: 1px solid #f1dfb1;
}
#ledger-link-count {
  margin-inline-start: .25rem;
  font-size: .79rem;
}
.report-pin-controls:not([hidden]) {
  position: absolute;
  z-index: 4;
  inset-block-start: .45rem;
  inset-inline: .45rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  justify-content: space-between;
  padding: .3rem;
  color: #fff2d4;
  background: #243f3e;
  border: 1px solid #dfc78d;
}
.report-pin-controls p { margin: .15rem .35rem; font-size: .85rem; }
.report-pin-controls button { flex: none; min-height: 44px; }
#report-pin-cursor {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  width: 25px;
  height: 25px;
  transform: translate(-50%, -50%);
  border: 2px solid #ffe7a4;
  outline: 2px solid #254442;
  background:
    linear-gradient(#ffe7a4, #ffe7a4) center / 1px 15px no-repeat,
    linear-gradient(#ffe7a4, #ffe7a4) center / 15px 1px no-repeat;
}
#world-canvas.choosing-report-pin { cursor: crosshair; }

.nearby-records-disclosure {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin-block-start: .2rem;
}
.nearby-records-disclosure summary {
  padding: .25rem .5rem;
  color: #4a3d28;
  background: #f1dfb1;
  border: 1px solid #9a8057;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
}
.nearby-records-disclosure[open] {
  z-index: 6;
}
#nearby-records {
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: calc(100% + .25rem);
  width: min(30rem, calc(100vw - 2.15rem));
  max-height: min(55dvh, 24rem);
  padding: .35rem;
  overflow: auto;
  background: #24232b;
  border: 1px solid #927456;
  box-shadow: 3px 3px #18172156;
}
#course-records {
  margin-block-start: .4rem;
}

@media (pointer: coarse) {
  .nearby-records-disclosure summary {
    min-height: 38px;
    padding-block: .55rem;
  }
}
.world-train {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: .42rem;
  row-gap: .16rem;
  margin: .18rem 0 0;
  min-width: 0;
  font-size: .82rem;
  line-height: 1.3;
}
.world-train-platform {
  flex: none;
  color: #f9efd8;
  background: #3f514b;
  border: 1px solid #35473f;
  padding: .1rem .34rem;
  font-weight: 750;
}
.world-train-service { font-weight: 750; }
.world-train-riders { color: #4a6157; font-weight: 650; white-space: nowrap; }
.world-ferry { margin-top: .22rem; color: #35544e; font-size: .83rem; }
.world-ferry-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .16rem .48rem; }
.world-ferry-line + .world-ferry-line { margin-top: .16rem; }
.world-ferry-source {
  padding: .06rem .34rem;
  border: 1px solid #b0bcaa;
  background: #edf0de;
  font-size: .74rem;
  white-space: nowrap;
}
.world-ferry-clock { color: var(--world-ink); font-weight: 750; font-variant-numeric: tabular-nums; }
#world-ferry-time { white-space: nowrap; }
.world-view[data-ferry-aboard] #world-canvas { cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  .world-view[data-ferry-aboard] #world-canvas { animation: ferry-board .42s ease-out; }
  @keyframes ferry-board { from { opacity: .55; } to { opacity: 1; } }
}
@media (any-pointer: coarse), (max-width: 740px), (max-height: 800px) {
  #world-foyer:has(#world-controls:not([hidden])) .world-controls[data-vehicle-aboard] {
    grid-template: "note actions" auto / minmax(0, 1fr) auto;
  }
}
@media (orientation: landscape) and (max-height: 500px) and (any-pointer: coarse),
       (orientation: landscape) and (max-height: 500px) and (max-width: 740px) {
  #world-foyer:has(#world-controls:not([hidden])) .world-controls[data-vehicle-aboard] {
    grid-template: "note" auto "actions" auto / minmax(0, 1fr);
    align-content: center;
  }
}

/* Film mode: the game canvas alone, full screen, for recording footage. */
[data-film="1"] body { background: #101a1c; overflow: hidden; }
[data-film="1"] #world-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover; z-index: 50; cursor: none; }
[data-film="1"] #pinball-room:not([hidden]) { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; background: #151523; }
[data-film="1"] #pinball-canvas { width: auto; height: 88vh; }
[data-film="1"] .pinball-head, [data-film="1"] .pinball-mission, [data-film="1"] .pinball-controls-zone,
[data-film="1"] .pinball-options { display: none; }
[data-film="1"] .pinball-cabinet { display: flex; align-items: center; gap: 4vw; }
[data-film="1"] .pinball-scores { display: grid; gap: 3vh; margin: 0; font-size: 2.4vh; }
[data-film="1"] .pinball-scores dt { font-size: 2.2vh; }
[data-film="1"] .pinball-scores dd { font-size: 5vh; }
#film-caption {
  position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%); z-index: 70; margin: 0;
  padding: .5em 1em .55em; width: max-content; max-width: 92vw; text-align: center; text-wrap: balance;
  font: 400 clamp(1rem, 3.4vh, 2.6rem)/1.15 Pixelify, "Space Grotesk", system-ui, sans-serif;
  color: #213939; background: #f4e8ccf2; border: .14em solid #213939; box-shadow: .22em .22em 0 #16303250;
}
#film-card {
  position: fixed; inset: 0; z-index: 80; display: grid; place-content: center; gap: 2.2vh; text-align: center;
  background: #eee8d9; color: #213939;
}
#film-card h1 { margin: 0; font: 400 clamp(2rem, 13vh, 9rem)/1 Pixelify, "Space Grotesk", system-ui, sans-serif; letter-spacing: 0; }
#film-card p { margin: 0; font: 400 clamp(1rem, 4.2vh, 3rem)/1.2 Pixelify, "Space Grotesk", system-ui, sans-serif; }
#film-caption[hidden], #film-card[hidden] { display: none; }

[data-film="1"] #film-screen { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; background: #151523; }
[data-film="1"] #film-caption, [data-film="1"] #film-card { visibility: hidden; }

.city-activity-options,
.city-course-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.city-activity-options:empty,
.city-course-choices:empty,
.city-course p:empty { display: none; }

.city-course {
  position: absolute;
  z-index: 3;
  inset: .5rem auto auto .5rem;
  width: min(23rem, calc(100% - 1rem));
  max-height: calc(100% - 1rem);
  overflow-y: auto;
  color: #243d3a;
  background: #f6efd9;
  border: 1px solid #60766b;
  box-shadow: 2px 3px #243d3a55;
  padding: .42rem .57rem;
  font-size: .83rem;
}

.city-course-head {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.city-course-head h3 { margin: 0 auto 0 0; font-size: .93rem; }
.city-course p { margin: .23em 0; }
.city-course .world-button { min-height: 2.2rem; padding: .25rem .52rem; }
.city-course { --course-accent: #537460; border-top: 3px solid var(--course-accent); }
.city-course[data-palette="blue"] { --course-accent: #3f7186; }
.city-course[data-palette="clay"] { --course-accent: #987254; }
.city-course-meter { width: 100%; height: .42rem; display: block; accent-color: var(--course-accent); margin: .36rem 0; }
.city-course-art { display: block; width: 100%; height: clamp(44px, 8vh, 62px); image-rendering: pixelated; }
.city-course-reading { font-size: .76rem; font-weight: 650; }
.city-course-camera { display: flex; gap: .35rem; align-items: stretch; margin: .35rem 0; }
.city-course-camera input { flex: 1 1 60px; min-width: 50px; accent-color: var(--course-accent); }
.city-course-checklist { display: flex; flex-wrap: wrap; gap: .25rem; padding: 0; margin: .32rem 0; list-style: none; }
.city-course-checklist:empty { display: none; }
.city-course-checklist li { padding: .24em .45em; background: #e2e5d4; }
.city-course-checklist .is-complete { color: #fff4d9; background: var(--course-accent); }
.city-course-journal summary { cursor: pointer; font-weight: 650; }
.city-course-journal ol { margin: .2rem 0; max-height: 5rem; overflow-y: auto; padding-left: 1.4rem; }
.city-course-journal li { padding: .16rem 0; }

@media (pointer: coarse) {
  .city-course .world-button { min-height: 44px; }
}

@media (max-height: 460px) and (orientation: landscape) {
  .city-course { font-size: .76rem; padding-block: .32rem; }
  .city-course-art { height: 36px; }
  .city-course-reading { font-size: .7rem; }
  .world-canvas-wrap:has(.city-course:not([hidden])) .world-social { left: auto; right: .45rem; }
}
.surf-ride:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}

.surf-ride canvas { width: min(150px, 45vw); height: auto; image-rendering: pixelated; }
.surf-ride button { min-width: 44px; min-height: 44px; }
.surf-ride [data-surf-status] { font-size: .8rem; }
