#harbour-pause {
  --pause-rim: #997d49;
  --pause-type: #fff2ce;
  position: fixed;
  inset: 0;
  width: min(352px, calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto;
  padding: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--pause-type);
  background: linear-gradient(145deg, #203e40, #102a2e 68%);
  border: 1px solid var(--pause-rim);
  border-radius: 15px;
  box-shadow: 0 4px 0 #493a29, 0 18px 48px #00131980, inset 0 1px 0 #f2d79a36;
}
#harbour-pause:not([open]) { display: none; }
#harbour-pause::backdrop { background: rgb(7 24 27 / 44%); }
.pause-card {
  display: grid;
  gap: 12px;
  padding: 23px;
}
#pause-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 2px;
  color: var(--pause-type);
  font: 900 clamp(1.9rem, 6vw, 2.5rem)/1 Barlow, Impact, sans-serif;
}
#pause-title::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 22px;
  border-inline: 4px solid #ffcb68;
  box-sizing: border-box;
}
#harbour-pause :where(button, a, summary) {
  color: inherit;
  font: 700 .9rem/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#harbour-pause :is(button, a):focus-visible,
#harbour-pause summary:focus-visible {
  outline: 3px solid #fff0ba;
  outline-offset: -4px;
}
#pause-resume {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  color: #2d251a;
  border: 1px solid #ffe3a2;
  border-radius: 8px;
  background: linear-gradient(#ffda85, #f7bc52);
  box-shadow: 0 3px 0 #966630;
  font-size: 1.05rem;
  font-weight: 800;
}
#pause-resume::before {
  content: "";
  width: 0;
  height: 0;
  border-block: 6px solid transparent;
  border-left: 9px solid currentColor;
}
#harbour-pause #pause-resume:focus-visible { outline-color: #674a1c; }
.pause-actions, .pause-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}
.pause-actions :is(button, a), #pause-mute {
  min-height: 44px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #71817b;
  border-radius: 7px;
  background: #213e40;
  text-decoration: none;
  text-align: center;
}
.pause-actions > * { flex: 1; }
.pause-tools {
  justify-content: space-between;
  border-top: 1px solid #a18b5d66;
  padding-top: 11px;
}
#pause-mute { padding-inline: 13px; }
#harbour-pause .language-switch { display: inline-flex; min-height: 44px; }
#harbour-pause .language-switch button { min-width: 42px; min-height: 44px; }
#harbour-pause .language-switch [aria-pressed="true"] { color: #163136; }
#harbour-pause #harbour-log { display: block; margin: 0; padding: 0; border: 0; }
#harbour-pause #harbour-log > summary {
  min-height: 44px;
  padding: 12px 4px;
  color: #decea9;
}
#harbour-pause .rack-head h2 { max-width: 70%; font-size: .78rem; }
#harbour-pause #sounds { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; }
#harbour-pause #sounds img { width: 22px; height: 23px; }
#harbour-pause #sounds span { font-size: .67rem; }
#harbour-pause[open] #harbour-log[open] :is(.rack,.instructions) {
  /* Opening the log is an explicit request even when the play HUD is hidden. */
  display: block !important;
  margin: 8px 0;
}
body.harbour-course:has(#harbour-pause[open]) :is(.nav, .heading .actions, .touch, .console>.hint) {
  visibility: hidden;
  pointer-events: none;
}
@media (max-height: 420px) {
  #harbour-pause { width: min(390px, calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right))); }
  .pause-card { gap: 7px; padding: 12px 18px; }
  #pause-title { font-size: 1.8rem; }
  #pause-resume { min-height: 44px; }
  .pause-tools { padding-top: 6px; }
  #harbour-pause #harbour-log > summary { min-height: 44px; padding-block: 8px; }
}
@media (hover: hover) {
  #pause-resume:hover { filter: brightness(1.06); }
  .pause-actions :is(a,button):hover, #pause-mute:hover { background: #315354; }
}

.pause-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#pause-score-time { color: #d3cfb5; font: 700 .78rem/1.2 ui-monospace, monospace; white-space: nowrap; }
.pause-tools { justify-content: flex-start; }
.pause-tools .language-switch { margin-left: auto; }
#harbour-pause[open] #sv-menu-toggle { display: grid; position: static; visibility: visible; pointer-events: auto; }
.harbour-course:has(#pause:enabled) :is(.nav, #mute, #run-purse, .hud .divider, #points, #clock),
.harbour-course:has(#pause:enabled) .heading>div:first-child,
.harbour-course:has(#pause:enabled) main>:is(.rack,.instructions),
body.harbour-course:has(#pause:enabled)>#sv-menu-toggle { display: none; }

@media all {
  .harbour-course:has(#pause:enabled) .console>.hud {
    width: fit-content;
    max-width: calc(100% - var(--left) - var(--right) - 57px);
    right: auto;
    gap: 9px;
    min-height: 32px;
    padding: 6px 9px;
  }
}
/* The framed desktop console is gone: a desktop uses the full-window stage in game.css. */
@media (pointer:fine) and (min-width:721px) and (min-height:541px), (pointer:fine) and (min-width:961px) {
  .harbour-course:has(#pause:enabled) .console>.hud { min-height: 38px; padding: .5em .8em; font-size: clamp(.95rem, .55vw + .45rem, 1.3rem); }
}
