:root {
  color-scheme: dark;
  --ink: #172d30;
  --paper: #f4efdf;
  --muted: #b0c6c2;
  --gold: #efd498;
  --port: #ff9a80;
  --starboard: #91e5bc;
  font-family: 'Outfit', sans-serif;
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  background: #275f62;
  touch-action: none;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
button svg,
a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
button {
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
#sea {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 100px #083c3a30;
}
.topbar {
  position: fixed;
  inset: 0 0 auto;
  min-height: 70px;
  padding: 14px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(#122c30eb, #122c30d9);
  border-bottom: 1px solid #e2d2ab2e;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 23px;
  font-weight: 700;
}
.brand svg {
  color: var(--gold);
  width: 31px;
  height: 31px;
}
.brand b {
  color: var(--gold);
}
.operation {
  text-align: center;
  display: grid;
  gap: 2px;
}
.operation span,
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
}
.operation strong {
  font-size: 15px;
  font-weight: 500;
}
.tools {
  display: flex;
  gap: 6px;
}
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #11282b9c;
  border: 1px solid #b2cfbc40;
  border-radius: 6px;
  width: 38px;
  height: 38px;
  padding: 0;
  flex-shrink: 0;
}
.icon:hover {
  background: #36504d;
  border-color: #e5d4a6;
}
.icon:disabled {
  opacity: 0.3;
}
.timer-tool {
  width: auto;
  min-width: 38px;
  gap: 5px;
  padding: 0 8px;
}
.timer-tool span:empty {
  display: none;
}
.timer-tool span {
  font-size: 10px;
}
.ship-status {
  position: fixed;
  left: 26px;
  top: 96px;
  width: 230px;
  padding: 14px 16px;
  background: #132f32e8;
  border: 1px solid #c5d7c239;
  border-radius: 6px;
  z-index: 3;
}
.ship-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ship-identity > svg {
  width: 25px;
  height: 25px;
  color: var(--gold);
}
.ship-identity > div {
  display: grid;
  gap: 3px;
}
.ship-identity span {
  font-size: 9px;
  color: var(--muted);
}
.ship-identity strong {
  font-size: 19px;
  font-weight: 600;
}
.ship-identity > b {
  font-size: 11px;
  margin-left: auto;
  color: var(--gold);
  white-space: nowrap;
}
.hull-track {
  height: 5px;
  background: #6b8b8945;
  margin-top: 12px;
  overflow: hidden;
}
.hull-track > div {
  height: 100%;
  width: 100%;
  background: var(--starboard);
  transition: width 0.2s;
}
.wind-status {
  border-top: 1px solid #ccd4bd22;
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}
.wind-status > svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}
.wind-status strong {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  color: var(--paper);
}
.chart-panel {
  position: fixed;
  right: 26px;
  top: 96px;
  width: 172px;
  background: #132f32dd;
  border: 1px solid #d1d5b43b;
  padding: 9px;
  border-radius: 6px;
  z-index: 3;
}
.chart-top,
.chart-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
}
.chart-top {
  margin-bottom: 6px;
}
.chart-top > span:last-child {
  color: var(--gold);
}
#chart {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  display: block;
  border: 1px solid #b6d9c52b;
  background: #143a3c;
}
.chart-bottom {
  margin-top: 7px;
  font-size: 9px;
}
.fleet-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--starboard);
  border-radius: 50%;
  margin-right: 2px;
}
.helm-console {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(670px, calc(100% - 40px));
  display: grid;
  grid-template-columns: 1fr 174px 1fr;
  align-items: end;
  gap: 12px;
  z-index: 4;
}
.helm-reference {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid #aec7b342;
  border-radius: 4px;
  background: #142e30ed;
  color: var(--muted);
  white-space: nowrap;
  font-size: 10px;
}
.helm-reference > span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.helm-reference kbd {
  color: var(--gold);
  font: inherit;
}
.text-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 11px;
}
.text-control:hover {
  color: #fff5db;
  text-decoration: underline;
}
.text-control svg {
  width: 15px;
  height: 15px;
}
.harbor-options > .text-control {
  min-height: 32px;
}
.touch-only,
.helm-reference > .touch-only {
  display: none;
}
.battery {
  --side: var(--port);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 153px;
  background: #162e30f2;
  border: 1px solid #e6af8566;
  border-top: 3px solid var(--side);
  border-radius: 6px;
  padding: 15px 18px 14px;
  transition:
    background 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
}
.battery.starboard {
  --side: var(--starboard);
  border-color: #8fc8a773;
  border-top-color: var(--side);
}
.battery:not(:disabled):hover {
  background: #38554e;
  box-shadow: 0 0 24px #dccea21c;
}
.battery:not(:disabled):active {
  transform: translateY(2px);
}
.battery:disabled {
  background: #112c2fe8;
  border-color: #75979460;
  border-top-color: var(--side);
}
.battery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  color: var(--side);
}
.battery-heading strong {
  font-size: 16px;
  font-weight: 600;
}
.battery-heading > svg {
  width: 18px;
  height: 18px;
}
.battery-heading kbd {
  background: none;
  border: 1px solid #dad8bf40;
  color: var(--muted);
  font-size: 10px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 3px;
}
.gun-row {
  display: flex;
  gap: 7px;
  margin: 12px 0 7px;
}
.gun-row > i {
  height: 7px;
  width: 15px;
  border-radius: 2px;
  background: var(--side);
  box-shadow: 0 0 7px #d9e6c51a;
}
.gun-row > i.reloading {
  background: #436260;
  box-shadow: none;
}
.gun-row > i.firing {
  background: #fff2bc;
  box-shadow: 0 0 10px #fbd695;
}
.battery-state {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.battery-detail {
  font-size: 9px;
  color: var(--muted);
  margin-top: 6px;
  min-height: 12px;
}
.reload-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  overflow: hidden;
}
.reload-track > i {
  display: block;
  background: var(--side);
  width: 100%;
  height: 100%;
  transform-origin: left;
}
.helm-center {
  height: 153px;
  background: #142e30ec;
  border: 1px solid #aec7b342;
  border-radius: 6px;
  padding: 13px 12px 8px;
  text-align: center;
}
.sail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
}
.sail-heading strong {
  font-weight: 500;
  font-size: 10px;
  color: var(--gold);
}
#sails {
  width: 100%;
  accent-color: var(--gold);
  margin: 7px 0 4px;
  height: 19px;
  cursor: pointer;
}
.helm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.steer {
  width: 37px;
  height: 39px;
  border-color: #b0c4a838;
}
.steer.held {
  background: #597168;
  border-color: var(--gold);
}
.speed {
  display: grid;
  gap: 0;
  min-width: 42px;
}
.speed strong {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.speed span {
  font-size: 8px;
  color: var(--muted);
}
.compass-heading {
  display: block;
  color: var(--gold);
  font-size: 10px;
  margin-top: 8px;
}
.ship-label {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  transform: translate(-50%, -100%);
  text-align: center;
  white-space: nowrap;
  z-index: 2;
}
.ship-label .name {
  font-size: 11px;
  font-weight: 600;
  color: #fff1d4;
  text-shadow:
    0 1px 3px #092727,
    0 2px 8px #092727;
}
.ship-label .enemy-hull {
  width: 70px;
  height: 4px;
  margin: 4px auto;
  background: #143538;
  box-shadow: 0 0 0 1px #162d3480;
}
.enemy-hull i {
  display: block;
  height: 100%;
  width: 100%;
  background: #ec8d6f;
}
.enemy-batteries {
  display: flex;
  gap: 7px;
  justify-content: center;
  font-size: 8px;
  color: #f6e6c6;
  text-shadow: 0 1px 3px #103332;
}
.enemy-batteries > span {
  background: #173437cc;
  border-radius: 2px;
  padding: 2px 4px;
}
.enemy-batteries .loaded {
  color: var(--starboard);
}
.ship-label .intent {
  font-size: 8px;
  color: #d8e6d7;
  text-shadow: 0 1px 4px #092727;
}
.bearing-notice {
  position: fixed;
  top: 42%;
  right: 20px;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  color: var(--paper);
  padding: 8px 10px;
  background: #15383ad9;
  border-radius: 4px;
  z-index: 4;
}
.bearing-notice svg {
  width: 18px;
  height: 18px;
}
.toast {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(450px, calc(100% - 40px));
  padding: 10px 20px;
  color: var(--paper);
  background: #142e30ec;
  border: 1px solid #c9ceac5c;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
  z-index: 6;
}
.battle-log {
  position: fixed;
  left: 26px;
  bottom: 30px;
  width: 210px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
  font-size: 11px;
  z-index: 3;
  text-shadow: 0 1px 4px #0e3939;
}
.battle-log > div {
  padding-left: 9px;
  border-left: 2px solid var(--gold);
  color: #e1e6d7;
}
.battle-log .port {
  border-color: var(--port);
}
.battle-log .starboard {
  border-color: var(--starboard);
}
.harbor {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding: 95px 45px 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  background: linear-gradient(transparent, #0f2a2bd9 42%, #102729f5);
  pointer-events: none;
}
.harbor > * {
  pointer-events: auto;
}
.harbor-title {
  padding-bottom: 16px;
}
.eyebrow {
  display: block;
}
.harbor h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 66px;
  line-height: 1;
  margin: 12px 0 14px;
}
.harbor p {
  font-size: 15px;
  color: #d7dfce;
  max-width: 370px;
  margin: 0;
  line-height: 1.6;
}
.harbor-options {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.harbor-options > label {
  font-size: 9px;
  color: var(--gold);
}
.harbor select {
  border: 1px solid #aec7b55c;
  color: var(--paper);
  background: #193638;
  border-radius: 4px;
  padding: 11px 12px;
  width: 100%;
  font-size: 14px;
  cursor: pointer;
}
.difficulty {
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  display: flex;
  gap: 0;
  align-items: center;
}
.difficulty legend {
  float: left;
  margin-right: auto;
  font-size: 9px;
  color: var(--muted);
  line-height: 33px;
}
.difficulty label {
  position: relative;
  display: flex;
  cursor: pointer;
}
.difficulty input {
  position: absolute;
  opacity: 0;
}
.difficulty span {
  padding: 8px 20px;
  background: #173134;
  border: 1px solid #97b7a447;
  font-size: 11px;
}
.difficulty label:first-of-type span {
  border-radius: 4px 0 0 4px;
}
.difficulty label:last-of-type span {
  border-radius: 0 4px 4px 0;
}
.difficulty input:checked + span {
  background: #e8d69f;
  color: #153335;
  border-color: #e8d69f;
}
.difficulty input:focus-visible + span {
  outline: 3px solid white;
}
.primary,
.secondary {
  border: 1px solid #e6cf90;
  background: #edd59e;
  color: #203737;
  border-radius: 5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 17px;
  min-height: 47px;
}
.primary:hover {
  background: #f8e5b7;
}
.primary:disabled {
  opacity: 0.7;
}
.primary > svg:last-child:not(:first-child) {
  margin-left: auto;
}
.career {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-top: 3px;
}
.dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 32px;
  width: min(430px, calc(100% - 30px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 1px solid #c9c9a66b;
  border-top: 3px solid var(--gold);
  border-radius: 8px;
  background: #173235;
  color: var(--paper);
  text-align: center;
  box-shadow: 0 20px 100px #071b2799;
  touch-action: pan-y;
}
.dialog::backdrop {
  background: #082628a8;
  backdrop-filter: blur(4px);
}
.dialog h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.1;
  margin: 12px 0 22px;
}
.dialog > .primary {
  width: 100%;
  margin-top: 19px;
}
.dialog-mark {
  display: block;
  margin: 0 auto 16px;
  color: var(--gold);
}
.dialog-mark > svg {
  width: 38px;
  height: 38px;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.secondary {
  flex: 1;
  background: #284647;
  border-color: #b9c7ae54;
  color: var(--paper);
  font-size: 13px;
  padding: 10px 12px;
}
.secondary:hover {
  background: #3e5d59;
}
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
}
.dialog p {
  font-size: 13px;
  line-height: 1.65;
  color: #c3d4c7;
}
.help-dialog {
  width: min(490px, calc(100% - 28px));
  padding: 25px 28px;
}
.help-dialog h2 {
  font-size: 32px;
  margin: 10px 0 12px;
}
.help-dialog p {
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.5;
}
.help-dialog > .primary {
  margin-top: 14px;
}
.orders-diagram {
  display: flex;
  gap: 25px;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
}
.orders-diagram > svg {
  width: 44px;
  height: 44px;
  color: var(--gold);
}
.orders-diagram > span {
  font-size: 10px;
  line-height: 1.8;
}
.orders-diagram b {
  font-size: 14px;
}
.port {
  color: var(--port);
}
.starboard {
  color: var(--starboard);
}
.controls-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  text-align: left;
  margin: 12px 0;
}
.controls-list.touch-only {
  display: none;
}
.controls-list > div {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #cbd5b71c;
}
.controls-list dt {
  display: flex;
  gap: 3px;
  width: 63px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.controls-list dt svg {
  width: 23px;
  height: 23px;
}
.controls-list kbd {
  background: #0f272b;
  border: 1px solid #a9c9b759;
  border-radius: 3px;
  display: inline-block;
  padding: 5px 7px;
  font:
    13px 'Outfit',
    sans-serif;
  min-width: 28px;
  text-align: center;
}
.controls-list dd {
  font-size: 12px;
  color: inherit;
  margin: 0;
}
.controls-list dd strong {
  display: block;
  font-weight: 600;
}
.controls-list dd small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  margin-top: 3px;
}
.help-dialog .help-shortcuts {
  font-size: 11px;
}
.help-shortcuts kbd {
  color: var(--gold);
  font: inherit;
}
.help-shortcuts > span {
  padding: 0 8px;
}
.help-note {
  border-top: 1px solid #cbd5b736;
  padding-top: 12px;
  font-size: 11px !important;
}
.result-stats {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid #c4d8b638;
  border-bottom: 1px solid #c4d8b638;
}
.result-stats > div {
  display: grid;
  gap: 5px;
  flex: 1;
}
.result-stats strong {
  font-size: 27px;
  font-family: 'Barlow Condensed', sans-serif;
  color: var(--gold);
}
.result-stats span {
  font-size: 8px;
  color: var(--muted);
}
.load-error {
  position: fixed;
  z-index: 20;
  inset: 20%;
  background: #173235;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
#kid-timer-btn {
  display: none !important;
}
.timer-overlay {
  z-index: 100 !important;
}
body:has(.timer-overlay.active) .helm-console {
  pointer-events: none;
}
@media (pointer: coarse) {
  .keyboard-only {
    display: none !important;
  }
  .controls-list.touch-only {
    display: grid;
  }
  .helm-reference > .touch-only {
    display: inline;
  }
  .steer {
    position: relative;
  }
  .steer::before {
    content: '';
    position: absolute;
    inset: -7px;
  }
}
@media (min-width: 1500px) {
  .helm-console {
    width: 740px;
    grid-template-columns: 1fr 190px 1fr;
  }
  .battery {
    height: 160px;
  }
  .helm-center {
    height: 160px;
  }
  .chart-panel {
    width: 188px;
  }
  .ship-status {
    width: 250px;
  }
}
@media (max-width: 1120px) {
  .battle-log {
    bottom: 226px;
    left: 20px;
    width: 180px;
    font-size: 10px;
  }
  .topbar {
    padding: 12px 18px;
    gap: 14px;
  }
  .brand {
    font-size: 21px;
  }
  .operation strong {
    font-size: 13px;
  }
  .chart-panel {
    right: 18px;
    width: 146px;
  }
  .ship-status {
    left: 18px;
    width: 206px;
    padding: 12px;
  }
  .ship-identity > b {
    font-size: 10px;
  }
  .toast {
    top: 80px;
  }
  .harbor {
    padding-left: 28px;
    padding-right: 28px;
  }
  .harbor h1 {
    font-size: 58px;
  }
}
@media (max-width: 700px) {
  .helm-reference {
    gap: 9px;
    font-size: 9px;
    padding: 2px 8px;
  }
  .helm-reference .text-control {
    font-size: 10px;
  }
  .help-dialog {
    padding: 22px 20px;
  }
  .help-dialog h2 {
    font-size: 30px;
  }
  .controls-list dt {
    width: 52px;
  }
  .controls-list > div {
    gap: 8px;
  }
  .topbar {
    padding: 9px 12px;
    gap: 10px;
    min-height: 58px;
  }
  .brand {
    font-size: 20px;
    gap: 6px;
  }
  .brand svg {
    width: 24px;
    height: 24px;
  }
  .tools {
    gap: 4px;
  }
  .tools .icon {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }
  .tools svg {
    width: 16px;
    height: 16px;
  }
  .operation {
    position: fixed;
    top: 67px;
    left: 15px;
    align-items: start;
    text-align: left;
    gap: 2px;
  }
  .operation span {
    font-size: 8px;
  }
  .operation strong {
    font-size: 12px;
  }
  .ship-status {
    top: 108px;
    left: 12px;
    width: 175px;
    padding: 10px;
  }
  .ship-identity {
    gap: 7px;
  }
  .ship-identity > svg {
    width: 18px;
    height: 18px;
  }
  .ship-identity strong {
    font-size: 16px;
  }
  .ship-identity span {
    font-size: 8px;
  }
  .ship-identity > b {
    font-size: 9px;
  }
  .hull-track {
    margin-top: 8px;
  }
  .wind-status {
    margin-top: 8px;
    padding-top: 7px;
    font-size: 8px;
    gap: 4px;
  }
  .wind-status strong {
    font-size: 8px;
  }
  .wind-status svg {
    display: none;
  }
  .chart-panel {
    top: 72px;
    right: 12px;
    width: 108px;
    padding: 6px;
  }
  .chart-top,
  .chart-bottom {
    font-size: 7px;
  }
  .chart-bottom {
    gap: 3px;
  }
  .chart-bottom span:first-child {
    display: none;
  }
  .chart-bottom span:last-child {
    margin-left: auto;
  }
  .helm-console {
    width: calc(100% - 24px);
    grid-template-columns: 1fr 130px 1fr;
    gap: 7px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .battery {
    height: 140px;
    padding: 13px 10px 12px;
  }
  .battery-heading {
    gap: 4px;
  }
  .battery-heading strong {
    font-size: 12px;
  }
  .battery-heading kbd {
    display: none;
  }
  .battery-heading svg {
    width: 15px;
    height: 15px;
  }
  .battery-state {
    font-size: 25px;
  }
  .battery-detail {
    font-size: 8px;
  }
  .gun-row {
    gap: 5px;
  }
  .gun-row > i {
    width: 11px;
    height: 6px;
  }
  .helm-center {
    height: 140px;
    padding: 12px 8px 8px;
  }
  .sail-heading {
    font-size: 8px;
  }
  .sail-heading strong {
    font-size: 9px;
  }
  .steer {
    width: 32px;
    height: 38px;
  }
  .speed {
    min-width: 32px;
  }
  .speed strong {
    font-size: 25px;
  }
  .speed span {
    font-size: 7px;
  }
  .compass-heading {
    font-size: 9px;
  }
  .toast {
    top: 220px;
    max-width: calc(100% - 30px);
    font-size: 11px;
    padding: 8px 14px;
  }
  .battle-log {
    left: 14px;
    bottom: 192px;
    font-size: 9px;
    width: 160px;
    gap: 5px;
  }
  .harbor {
    padding: 60px 20px 23px;
    display: block;
  }
  .harbor-title {
    padding-bottom: 16px;
  }
  .harbor h1 {
    font-size: 49px;
    margin: 7px 0 8px;
  }
  .harbor p {
    font-size: 12px;
    max-width: 310px;
  }
  .harbor-options {
    width: 100%;
    gap: 7px;
  }
  .harbor select {
    padding: 10px 12px;
    font-size: 12px;
  }
  .harbor-options > label {
    font-size: 8px;
  }
  .difficulty {
    margin-bottom: 2px;
  }
  .difficulty span {
    padding: 7px 25px;
  }
  .harbor .primary {
    padding: 10px 15px;
    min-height: 44px;
  }
  .career {
    font-size: 9px;
  }
  .timer-tool span {
    display: none;
  }
  .bearing-notice {
    right: 12px;
    top: 46%;
    font-size: 9px;
  }
}
@media (max-width: 390px) {
  .brand {
    font-size: 18px;
  }
  .brand svg {
    display: none;
  }
  .tools {
    gap: 3px;
  }
  .tools .icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
  }
  .helm-console {
    grid-template-columns: 1fr 112px 1fr;
    gap: 5px;
    width: calc(100% - 16px);
  }
  .battery {
    padding: 13px 7px;
  }
  .battery-heading strong {
    font-size: 11px;
  }
  .battery-heading svg {
    width: 12px;
  }
  .battery-detail {
    font-size: 7px;
  }
  .helm-center {
    padding: 12px 6px;
  }
  .steer {
    width: 29px;
  }
  .steer svg {
    width: 17px;
  }
  .gun-row {
    gap: 4px;
  }
  .gun-row > i {
    width: 9px;
  }
  .sail-heading strong {
    font-size: 8px;
  }
  .speed strong {
    font-size: 23px;
  }
  .harbor h1 {
    font-size: 45px;
  }
}
@media (max-height: 550px) and (min-width: 650px) {
  .topbar {
    min-height: 48px;
    padding: 6px 15px;
  }
  .operation strong {
    font-size: 12px;
  }
  .brand {
    font-size: 20px;
  }
  .tools .icon {
    height: 32px;
    width: 32px;
  }
  .ship-status {
    top: 64px;
    left: 14px;
    width: 177px;
    padding: 9px;
  }
  .ship-identity > svg {
    display: none;
  }
  .ship-identity strong {
    font-size: 15px;
  }
  .ship-identity > b {
    font-size: 9px;
  }
  .wind-status {
    font-size: 8px;
    margin-top: 8px;
    padding-top: 6px;
  }
  .wind-status strong {
    font-size: 8px;
  }
  .chart-panel {
    top: 63px;
    right: 14px;
    width: 100px;
    padding: 5px;
  }
  .chart-top,
  .chart-bottom {
    font-size: 7px;
  }
  .chart-bottom span:first-child {
    display: none;
  }
  .helm-console {
    bottom: 8px;
    width: 520px;
    grid-template-columns: 1fr 140px 1fr;
    gap: 8px;
  }
  .battery,
  .helm-center {
    height: 108px;
    padding: 9px 12px;
  }
  .battery-heading strong {
    font-size: 12px;
  }
  .gun-row {
    margin: 8px 0 5px;
    gap: 5px;
  }
  .gun-row > i {
    height: 5px;
    width: 11px;
  }
  .battery-state {
    font-size: 23px;
  }
  .battery-detail {
    font-size: 7px;
    margin-top: 4px;
  }
  .battery-heading kbd {
    height: 16px;
    width: 16px;
  }
  .sail-heading {
    font-size: 8px;
  }
  #sails {
    margin: 3px 0;
    height: 14px;
  }
  .steer {
    width: 30px;
    height: 31px;
  }
  .speed strong {
    font-size: 23px;
  }
  .speed span {
    font-size: 7px;
  }
  .compass-heading {
    margin-top: 4px;
    font-size: 8px;
  }
  .battle-log {
    bottom: 13px;
    left: 13px;
    width: 100px;
    font-size: 8px;
  }
  .toast {
    top: 65px;
    font-size: 10px;
    padding: 7px 13px;
    max-width: 300px;
  }
  .harbor {
    padding: 45px 26px 15px;
    gap: 25px;
  }
  .harbor-title {
    padding-bottom: 4px;
  }
  .harbor h1 {
    font-size: 48px;
    margin: 7px 0;
  }
  .harbor p {
    font-size: 11px;
    max-width: 320px;
  }
  .harbor-options {
    width: 265px;
    gap: 6px;
  }
  .harbor select {
    padding: 8px 10px;
    font-size: 11px;
  }
  .harbor .primary {
    min-height: 36px;
    padding: 8px 12px;
  }
  .difficulty span {
    padding: 5px 22px;
  }
  .difficulty legend {
    line-height: 27px;
  }
  .career {
    font-size: 8px;
  }
  .help-dialog {
    width: min(620px, calc(100% - 28px));
    max-height: calc(100dvh - 16px);
    padding: 20px 27px;
  }
  .help-dialog h2 {
    font-size: 27px;
    margin-bottom: 13px;
  }
  .help-dialog .orders-diagram {
    display: none;
  }
  .help-dialog p {
    font-size: 11px;
    margin: 10px 0;
  }
  .controls-list {
    margin: 15px 0;
    gap: 0 20px;
    grid-template-columns: 1fr 1fr;
  }
  .help-dialog .primary {
    margin-top: 12px;
    min-height: 37px;
    padding: 9px;
  }
  .result-dialog {
    padding: 20px 25px;
  }
  .result-dialog .dialog-mark {
    display: none;
  }
  .result-dialog h2 {
    margin: 10px 0;
    font-size: 30px;
  }
  .result-stats {
    padding: 12px 0;
  }
  .result-dialog > .primary {
    margin-top: 12px;
    min-height: 36px;
    padding: 8px 13px;
  }
  .result-dialog .secondary {
    min-height: 34px;
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .vignette {
    box-shadow: none;
  }
}
