/* The game owns the viewport. Shore's page grid is never used to lay out a dive. */
body.dive {
  --hud-t: max(10px, env(safe-area-inset-top));
  --hud-b: max(13px, env(safe-area-inset-bottom));
  --hud-l: max(14px, env(safe-area-inset-left));
  --hud-r: max(14px, env(safe-area-inset-right));
  position: fixed;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #16434e;
}
.dive main {
  position: absolute;
  inset: 0;
  margin: 0;
  max-width: none;
  padding: 0;
  overflow: hidden;
}
.dive main > header,
.dive aside,
.dive #course {
  display: none;
}
.dive .shell,
.dive .viewport {
  display: contents;
}
.dive #stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  outline-offset: -3px;
}
.dive .instruments {
  position: absolute;
  z-index: 4;
  top: var(--hud-t);
  left: var(--hud-l);
  gap: 10px;
  min-height: 30px;
  line-height: 1;
  pointer-events: none;
  color: #f5faf3;
  border-radius: 15px;
  background: #062e37e8;
  padding: 5px 11px;
  font-family: var(--mono);
}
.dive .instruments b {
  display: none;
}
.dive .instruments span {
  font-size: 0.76rem;
}
.dive #air {
  font-weight: bold;
  color: #abefdb;
}
.dive #air[data-low="true"] {
  color: #ffaf87;
}
#play-ui {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
#play-ui button {
  position: absolute;
  pointer-events: auto;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  border: 1px solid #9ecbbb77;
  border-radius: 24px;
  color: #f2f8ea;
  background: #07323cde;
  font: 700 0.8rem/1.25 var(--mono);
}
#log-toggle {
  top: var(--hud-t);
  right: var(--hud-r);
}
#face {
  left: var(--hud-l);
  top: calc(var(--hud-t) + 35px);
  max-width: min(19rem, calc(100% - var(--hud-l) - var(--hud-r)));
  text-align: left;
  color: #fff0bc !important;
}
#play-ui .dive-action {
  right: var(--hud-r);
  bottom: var(--hud-b);
  padding: 9px 15px;
  color: #263927;
  background: #ffdc8d;
  border-color: #fff2b8;
  font-size: 0.88rem;
  box-shadow: 0 2px 3px #122c2e66;
}
.dive #stick {
  left: var(--hud-l);
  bottom: var(--hud-b);
}
.dive .vertical {
  right: var(--hud-r);
  bottom: var(--hud-b);
}
.dive .vertical button {
  min-width: 64px;
  border-radius: 22px;
}
@media (pointer: coarse), (max-width: 720px) {
  #play-ui .dive-action {
    bottom: calc(var(--hud-b) + 104px);
  }
}
#mouse-hint,
.mouse-setting {
  display: none;
}
@media (pointer: fine) and (min-width: 721px) {
  #mouse-hint {
    display: block;
    position: absolute;
    bottom: var(--hud-b);
    left: var(--hud-l);
    max-width: 55%;
    margin: 0;
    padding: 4px 9px;
    color: #eff8e4;
    background: #082f39ce;
    border-radius: 4px;
    pointer-events: none;
    font: 0.73rem/1.4 var(--mono);
  }
}
@media (any-pointer: fine) {
  .mouse-setting {
    display: grid;
    gap: 2px;
    padding-block: 10px;
    border-top: 1px dashed var(--edge);
  }
  .mouse-setting label {
    font-weight: bold;
    font-size: 0.85rem;
  }
  .mouse-setting output {
    font-family: var(--mono);
  }
  .mouse-setting input {
    accent-color: #185552;
    margin: 0;
    min-height: 28px;
  }
}
#notice {
  margin: 8px 0;
  color: #ffdfac;
  font-weight: bold;
}
#notice:empty {
  display: none;
}
.dive #notice:not(:empty) {
  position: absolute;
  z-index: 4;
  top: calc(var(--hud-t) + 94px);
  left: var(--hud-l);
  margin: 0;
  padding: 6px 10px;
  max-width: min(34ch, calc(100% - var(--hud-l) - var(--hud-r)));
  pointer-events: none;
  color: #f1efd9;
  background: #0a303bdc;
  font-size: 0.8rem;
  border-radius: 4px;
  opacity: 0;
}
.dive #notice[data-visible="true"]:not(:empty) {
  opacity: 1;
}
#logbook {
  color-scheme: light;
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(
    30rem,
    calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))
  );
  max-width: none;
  max-height: calc(
    100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  border: 1px solid #6d8274;
  border-radius: 7px;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
}
#logbook[open] {
  display: flex;
  flex-direction: column;
}
#logbook::backdrop {
  background: #042631ae;
}
.log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--edge);
  flex: none;
}
.log-heading .over {
  margin: 0;
}
.log-heading h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin: 0;
}
#close-log {
  background: #174e51;
  color: #fff1ca;
  white-space: nowrap;
}
.log-pages {
  padding: 15px 18px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.log-pages .commission {
  font:
    700 1.5rem/1.1 Georgia,
    serif;
  margin: 2px 0 6px;
}
.log-pages .utility {
  margin-bottom: 0;
}
.log-pages summary {
  min-height: 44px;
}
