:root {
  color-scheme: dark;
  --bg: #061b31;
  --panel: rgba(1, 12, 24, 0.84);
  --panel-strong: rgba(2, 18, 34, 0.94);
  --line: rgba(61, 221, 221, 0.22);
  --line-strong: rgba(61, 221, 221, 0.54);
  --text: #d7e6ec;
  --muted: #6f98a6;
  --green: #3ddddd;
  --green-deep: #227fd4;
  --amber: #ffd76a;
  --red: #ff6b7a;
  --blue: #6aa8ff;
  --coral: #ff9868;
  --shadow: rgba(2, 10, 24, 0.46);
  --console-cyan: #3ddddd;
  --console-muted: #5a8090;
  --console-red: #ff4d5d;
  --console-text: #c8d8e0;
  --console-plate: rgba(2, 9, 21, 0.9);
  --console-recess: rgba(0, 5, 12, 0.72);
  --console-border: rgba(90, 128, 144, 0.5);
}

/* iPhone landscape targeting override. This selector is intentionally more
   specific than the broad mobile rules later in the file. */
@media (max-width: 980px) and (orientation: landscape) {
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    grid-template-rows: clamp(34px, 8dvh, 44px) minmax(0, 1fr) clamp(34px, 7.2dvh, 40px) auto !important;
    row-gap: clamp(4px, 0.9dvh, 6px) !important;
    padding: clamp(7px, 1.45dvh, 10px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    grid-template-rows: minmax(116px, 1.28fr) minmax(74px, 0.72fr) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: clamp(30px, 6.6dvh, 38px) minmax(76px, 1fr) !important;
    gap: clamp(4px, 0.85dvh, 6px) !important;
    padding: clamp(6px, 1.15dvh, 8px) !important;
    align-content: stretch !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    grid-template-rows: minmax(0, 1fr) !important;
    padding: clamp(6px, 1.15dvh, 8px) !important;
    align-content: stretch !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    grid-template-columns: clamp(20px, 4dvh, 26px) minmax(0, 1fr) !important;
    gap: 1px clamp(5px, 1.05dvh, 7px) !important;
    align-content: start !important;
    visibility: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    font-size: clamp(0.62rem, 1.95dvh, 0.82rem) !important;
    line-height: 1.05 !important;
    visibility: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    font-size: clamp(0.46rem, 1.38dvh, 0.6rem) !important;
    line-height: 1.12 !important;
    letter-spacing: 0.12em !important;
    white-space: nowrap !important;
    visibility: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    font-size: clamp(0.34rem, 1dvh, 0.44rem) !important;
    line-height: 1.15 !important;
    letter-spacing: 0.045em !important;
    visibility: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    display: grid !important;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.2fr) !important;
    grid-template-rows: auto minmax(44px, 1fr) !important;
    align-self: stretch !important;
    min-height: 76px !important;
    height: 100% !important;
    padding: clamp(5px, 0.95dvh, 7px) clamp(7px, 1.3dvh, 9px) !important;
    border-color: rgba(61, 221, 221, 0.62) !important;
    background:
      linear-gradient(180deg, rgba(0, 23, 25, 0.96), rgba(0, 6, 8, 0.98)),
      radial-gradient(circle at 50% 45%, rgba(61, 221, 221, 0.12), transparent 64%) !important;
    box-shadow:
      inset 0 0 0 1px rgba(200, 216, 224, 0.06),
      inset 0 0 22px rgba(61, 221, 221, 0.1) !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    font-size: clamp(0.4rem, 1.12dvh, 0.5rem) !important;
    letter-spacing: 0.12em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    height: clamp(40px, 8.4dvh, 50px) !important;
    min-height: 40px !important;
    padding-top: clamp(16px, 3.2dvh, 20px) !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(12px, 2.6dvh, 15px) !important;
    height: 6px !important;
    background:
      linear-gradient(90deg, rgba(61, 221, 221, 0.34), rgba(61, 221, 221, 0.62)),
      rgba(61, 221, 221, 0.14) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(12px, 2.6dvh, 15px) !important;
    width: 10px !important;
    height: clamp(27px, 6.2dvh, 34px) !important;
    box-shadow:
      0 0 14px rgba(61, 221, 221, 0.72),
      inset 0 0 7px rgba(239, 255, 255, 0.58) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    font-size: clamp(0.3rem, 0.86dvh, 0.38rem) !important;
    opacity: 0.72 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    grid-template-columns: clamp(20px, 4dvh, 26px) minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(36px, 1fr) !important;
    align-content: center !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main strong {
    align-self: end !important;
    font-size: clamp(0.48rem, 1.42dvh, 0.62rem) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    align-self: stretch !important;
    min-height: 34px !important;
    margin-top: 3px !important;
    padding: clamp(6px, 1.1dvh, 8px) clamp(7px, 1.3dvh, 9px) !important;
    font-size: clamp(0.4rem, 1.12dvh, 0.5rem) !important;
    line-height: 1.18 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-height: clamp(34px, 7.2dvh, 40px) !important;
    padding-top: clamp(9px, 1.7dvh, 12px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    min-height: clamp(30px, 6.2dvh, 38px) !important;
    font-size: clamp(0.4rem, 1.12dvh, 0.52rem) !important;
    color: rgba(224, 250, 250, 0.9) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(38px, 7.8dvh, 46px) !important;
    margin-top: clamp(3px, 0.75dvh, 5px) !important;
  }
}

/* Mobile targeting repair: final compact layout for depth + target solution. */
@media (max-width: 980px) {
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto auto !important;
    row-gap: clamp(4px, 1.1dvh, 7px) !important;
    padding: clamp(8px, 1.8dvh, 12px) !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    min-height: clamp(34px, 9dvh, 48px) !important;
    margin: 0 !important;
    padding: clamp(6px, 1.5dvh, 9px) clamp(8px, 1.8dvh, 11px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading span {
    font-size: clamp(0.56rem, 1.85dvh, 0.72rem) !important;
    letter-spacing: 0.2em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    display: grid !important;
    grid-template-rows: minmax(94px, 1fr) minmax(64px, auto) !important;
    gap: clamp(5px, 1.15dvh, 7px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .sub-selector-line {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    display: grid !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-color: rgba(61, 221, 221, 0.42) !important;
    background:
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, rgba(4, 21, 24, 0.93), rgba(0, 6, 8, 0.98)) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: auto minmax(56px, 1fr) !important;
    gap: clamp(3px, 0.75dvh, 5px) !important;
    padding: clamp(6px, 1.35dvh, 8px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    align-content: center !important;
    padding: clamp(7px, 1.5dvh, 9px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    display: grid !important;
    grid-template-columns: clamp(22px, 4.4dvh, 30px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 1px clamp(6px, 1.4dvh, 9px) !important;
    align-items: start !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / span 2 !important;
    align-self: start !important;
    justify-self: center !important;
    padding: 0 !important;
    color: rgba(93, 235, 216, 0.94) !important;
    font-size: clamp(0.72rem, 2.35dvh, 0.98rem) !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: rgba(242, 255, 255, 0.94) !important;
    font-size: clamp(0.48rem, 1.55dvh, 0.66rem) !important;
    letter-spacing: 0.13em !important;
    line-height: 1.05 !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: rgba(196, 225, 225, 0.72) !important;
    font-size: clamp(0.38rem, 1.16dvh, 0.5rem) !important;
    letter-spacing: 0.055em !important;
    line-height: 1.12 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: clamp(3px, 0.8dvh, 5px) clamp(6px, 1.2dvh, 8px) !important;
    align-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 58px !important;
    height: auto !important;
    margin: 0 !important;
    padding: clamp(5px, 1.1dvh, 7px) clamp(7px, 1.45dvh, 9px) !important;
    border: 1px solid rgba(61, 221, 221, 0.36) !important;
    background: linear-gradient(180deg, rgba(0, 17, 19, 0.94), rgba(0, 5, 7, 0.98)) !important;
    box-sizing: border-box !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator::before {
    display: none !important;
    content: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    min-width: 0 !important;
    overflow: hidden !important;
    font-size: clamp(0.36rem, 1.04dvh, 0.46rem) !important;
    letter-spacing: 0.1em !important;
    line-height: 1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    justify-self: end !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    height: clamp(32px, 7.4dvh, 42px) !important;
    min-height: 32px !important;
    padding: clamp(13px, 2.9dvh, 17px) 0 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.2) !important;
    border-left: 0 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(9px, 2.35dvh, 13px) !important;
    right: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: 5px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(9px, 2.35dvh, 13px) !important;
    left: var(--depth-pos) !important;
    width: 8px !important;
    height: clamp(22px, 5.6dvh, 30px) !important;
    transform: translate(-50%, -50%) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    display: flex !important;
    align-items: end !important;
    justify-content: center !important;
    min-width: 0 !important;
    width: auto !important;
    overflow: visible !important;
    opacity: 0.66 !important;
    color: rgba(200, 216, 224, 0.62) !important;
    font-size: clamp(0.3rem, 0.92dvh, 0.38rem) !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i:nth-of-type(even) {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    grid-template-rows: auto minmax(0, 1fr) !important;
    align-items: center !important;
    min-height: 0 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    display: grid !important;
    align-items: center !important;
    min-height: clamp(30px, 7.4dvh, 42px) !important;
    margin: clamp(2px, 0.55dvh, 4px) 0 0 !important;
    padding: clamp(5px, 1.1dvh, 7px) clamp(6px, 1.4dvh, 8px) !important;
    border: 1px solid rgba(61, 221, 221, 0.22) !important;
    background: linear-gradient(180deg, rgba(0, 16, 18, 0.88), rgba(0, 4, 6, 0.96)) !important;
    color: rgba(217, 248, 248, 0.86) !important;
    font-size: clamp(0.4rem, 1.22dvh, 0.52rem) !important;
    letter-spacing: 0.08em !important;
    line-height: 1.14 !important;
    text-transform: uppercase !important;
    white-space: normal !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: clamp(5px, 1.15dvh, 7px) !important;
    margin: 0 !important;
    padding-top: clamp(10px, 2.2dvh, 13px) !important;
    border-top: 1px solid rgba(61, 221, 221, 0.24) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before {
    top: 1px !important;
    font-size: clamp(0.3rem, 0.9dvh, 0.4rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    min-height: clamp(28px, 6.4dvh, 34px) !important;
    padding: 0 clamp(5px, 1.2dvh, 8px) !important;
    font-size: clamp(0.38rem, 1.12dvh, 0.5rem) !important;
    letter-spacing: 0.095em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(39px, 8.8dvh, 48px) !important;
    margin: clamp(4px, 1.1dvh, 7px) 0 0 !important;
    font-size: clamp(0.6rem, 1.72dvh, 0.78rem) !important;
    letter-spacing: 0.17em !important;
  }
}

/* Mobile targeting stability pass: keep depth + target readable on short phone viewports. */
@media (max-width: 980px) {
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    display: grid !important;
    grid-template-rows: clamp(32px, 7.6dvh, 42px) minmax(0, 1fr) clamp(34px, 7.4dvh, 42px) auto !important;
    row-gap: clamp(4px, 0.9dvh, 6px) !important;
    padding: clamp(7px, 1.45dvh, 10px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    min-height: 0 !important;
    height: clamp(32px, 7.6dvh, 42px) !important;
    margin: 0 !important;
    padding: clamp(5px, 1dvh, 7px) clamp(7px, 1.4dvh, 9px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .sub-selector-line {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    display: grid !important;
    grid-template-rows: minmax(96px, 1.12fr) minmax(66px, 0.76fr) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    display: grid !important;
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-color: rgba(61, 221, 221, 0.4) !important;
    background: linear-gradient(180deg, rgba(0, 14, 18, 0.86), rgba(0, 4, 7, 0.96)) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: clamp(26px, 5.8dvh, 34px) minmax(58px, 1fr) !important;
    padding: clamp(5px, 1dvh, 7px) !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    grid-template-rows: minmax(0, 1fr) !important;
    padding: clamp(6px, 1.1dvh, 8px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    display: grid !important;
    grid-template-columns: clamp(20px, 3.8dvh, 26px) minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 1px clamp(6px, 1.1dvh, 8px) !important;
    align-content: start !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / span 2 !important;
    color: rgba(129, 244, 233, 0.96) !important;
    font-size: clamp(0.64rem, 1.8dvh, 0.84rem) !important;
    line-height: 1 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    color: rgba(235, 248, 246, 0.9) !important;
    font-size: clamp(0.48rem, 1.32dvh, 0.6rem) !important;
    letter-spacing: 0.13em !important;
    line-height: 1.05 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    color: rgba(188, 213, 216, 0.68) !important;
    font-size: clamp(0.34rem, 0.96dvh, 0.44rem) !important;
    letter-spacing: 0.045em !important;
    line-height: 1.12 !important;
    white-space: normal !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto minmax(40px, 1fr) !important;
    align-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: clamp(5px, 0.95dvh, 7px) clamp(7px, 1.25dvh, 9px) !important;
    border: 1px solid rgba(61, 221, 221, 0.52) !important;
    background: linear-gradient(180deg, rgba(0, 22, 24, 0.96), rgba(0, 5, 8, 0.98)) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator::before {
    display: none !important;
    content: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    min-width: 0 !important;
    font-size: clamp(0.38rem, 1.06dvh, 0.48rem) !important;
    letter-spacing: 0.1em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    justify-self: end !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    height: clamp(34px, 7dvh, 42px) !important;
    min-height: 34px !important;
    padding: clamp(14px, 2.7dvh, 18px) 0 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.2) !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(10px, 2.25dvh, 13px) !important;
    right: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: 6px !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(10px, 2.25dvh, 13px) !important;
    left: var(--depth-pos) !important;
    width: 10px !important;
    height: clamp(24px, 5.4dvh, 32px) !important;
    transform: translate(-50%, -50%) !important;
    box-shadow: 0 0 16px rgba(61, 221, 221, 0.72), inset 0 0 7px rgba(239, 255, 255, 0.58) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    display: flex !important;
    align-items: end !important;
    justify-content: center !important;
    font-size: clamp(0.28rem, 0.82dvh, 0.36rem) !important;
    opacity: 0.66 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i:nth-of-type(even) {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    align-content: center !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    display: grid !important;
    align-items: center !important;
    min-height: clamp(30px, 6.4dvh, 40px) !important;
    margin-top: clamp(2px, 0.45dvh, 3px) !important;
    padding: clamp(5px, 1dvh, 7px) clamp(6px, 1.25dvh, 8px) !important;
    border: 1px solid rgba(61, 221, 221, 0.24) !important;
    background: linear-gradient(180deg, rgba(0, 16, 18, 0.88), rgba(0, 4, 6, 0.96)) !important;
    color: rgba(217, 248, 248, 0.86) !important;
    font-size: clamp(0.4rem, 1.1dvh, 0.5rem) !important;
    letter-spacing: 0.07em !important;
    line-height: 1.12 !important;
    text-transform: uppercase !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: clamp(5px, 1.05dvh, 7px) !important;
    min-height: clamp(32px, 7dvh, 40px) !important;
    margin: 0 !important;
    padding-top: clamp(9px, 1.7dvh, 12px) !important;
    border-top: 1px solid rgba(61, 221, 221, 0.24) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backPlaneBtn {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn {
    display: inline-grid !important;
    place-items: center !important;
    min-height: clamp(30px, 6.6dvh, 38px) !important;
    padding: 0 clamp(5px, 1.15dvh, 8px) !important;
    border: 1px solid rgba(78, 210, 204, 0.55) !important;
    background: linear-gradient(180deg, rgba(0, 32, 34, 0.9), rgba(0, 10, 12, 0.98)) !important;
    color: rgba(224, 250, 250, 0.9) !important;
    font-size: clamp(0.4rem, 1.12dvh, 0.52rem) !important;
    letter-spacing: 0.12em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    opacity: 0.36 !important;
    filter: grayscale(0.4) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(38px, 8dvh, 46px) !important;
    margin: 0 !important;
    font-size: clamp(0.6rem, 1.62dvh, 0.76rem) !important;
    letter-spacing: 0.17em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution:not(.mobile-target-armed) .primary.fire {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    grid-template-rows: clamp(34px, 8.4dvh, 44px) minmax(0, 1fr) clamp(34px, 7.6dvh, 42px) auto !important;
    row-gap: clamp(4px, 0.95dvh, 6px) !important;
    padding: clamp(7px, 1.55dvh, 10px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    min-height: 0 !important;
    height: clamp(34px, 8.4dvh, 44px) !important;
    padding: clamp(5px, 1.05dvh, 7px) clamp(7px, 1.5dvh, 9px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    grid-template-rows: minmax(112px, 1.28fr) minmax(74px, 0.72fr) !important;
    gap: clamp(5px, 1.05dvh, 7px) !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: clamp(31px, 6.9dvh, 39px) minmax(70px, 1fr) !important;
    align-content: stretch !important;
    gap: clamp(4px, 0.9dvh, 6px) !important;
    padding: clamp(6px, 1.2dvh, 8px) !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    grid-template-rows: minmax(0, 1fr) !important;
    align-content: stretch !important;
    padding: clamp(6px, 1.25dvh, 8px) !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    grid-template-columns: clamp(20px, 4dvh, 26px) minmax(0, 1fr) !important;
    gap: 1px clamp(5px, 1.1dvh, 7px) !important;
    align-content: start !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    font-size: clamp(0.62rem, 2dvh, 0.84rem) !important;
    line-height: 1.05 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    font-size: clamp(0.46rem, 1.42dvh, 0.6rem) !important;
    line-height: 1.15 !important;
    letter-spacing: 0.12em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    font-size: clamp(0.34rem, 1dvh, 0.44rem) !important;
    line-height: 1.16 !important;
    letter-spacing: 0.045em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    display: grid !important;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr) !important;
    grid-template-rows: auto minmax(40px, 1fr) !important;
    align-self: stretch !important;
    min-height: 70px !important;
    height: 100% !important;
    padding: clamp(5px, 1dvh, 7px) clamp(7px, 1.35dvh, 9px) !important;
    border-color: rgba(61, 221, 221, 0.56) !important;
    background:
      linear-gradient(180deg, rgba(0, 23, 25, 0.96), rgba(0, 6, 8, 0.98)),
      radial-gradient(circle at 50% 45%, rgba(61, 221, 221, 0.1), transparent 64%) !important;
    box-shadow:
      inset 0 0 0 1px rgba(200, 216, 224, 0.06),
      inset 0 0 22px rgba(61, 221, 221, 0.08) !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    font-size: clamp(0.4rem, 1.15dvh, 0.5rem) !important;
    letter-spacing: 0.12em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    height: clamp(38px, 8dvh, 48px) !important;
    min-height: 38px !important;
    padding-top: clamp(15px, 3.2dvh, 19px) !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(11px, 2.65dvh, 14px) !important;
    height: 6px !important;
    background:
      linear-gradient(90deg, rgba(61, 221, 221, 0.34), rgba(61, 221, 221, 0.62)),
      rgba(61, 221, 221, 0.14) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(11px, 2.65dvh, 14px) !important;
    width: 10px !important;
    height: clamp(26px, 6.1dvh, 34px) !important;
    box-shadow:
      0 0 14px rgba(61, 221, 221, 0.72),
      inset 0 0 7px rgba(239, 255, 255, 0.58) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    font-size: clamp(0.3rem, 0.9dvh, 0.38rem) !important;
    opacity: 0.72 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    grid-template-columns: clamp(20px, 4dvh, 26px) minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(36px, 1fr) !important;
    align-content: center !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main strong {
    align-self: end !important;
    font-size: clamp(0.48rem, 1.45dvh, 0.62rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    align-self: stretch !important;
    min-height: 34px !important;
    margin-top: 3px !important;
    padding: clamp(6px, 1.15dvh, 8px) clamp(7px, 1.35dvh, 9px) !important;
    font-size: clamp(0.4rem, 1.16dvh, 0.5rem) !important;
    line-height: 1.18 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-height: clamp(34px, 7.6dvh, 42px) !important;
    padding-top: clamp(9px, 1.8dvh, 12px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    min-height: clamp(30px, 6.6dvh, 38px) !important;
    font-size: clamp(0.4rem, 1.14dvh, 0.52rem) !important;
    color: rgba(224, 250, 250, 0.88) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(38px, 8dvh, 46px) !important;
    margin-top: clamp(3px, 0.8dvh, 5px) !important;
  }
}

/* Final iPhone targeting solution override: depth/target/edit/fire stay distinct. */
@media (max-width: 980px) and (orientation: landscape) {
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    display: grid !important;
    grid-template-rows: clamp(32px, 7.6dvh, 42px) minmax(0, 1fr) clamp(34px, 7.4dvh, 42px) auto !important;
    row-gap: clamp(4px, 0.9dvh, 6px) !important;
    padding: clamp(7px, 1.45dvh, 10px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    min-height: 0 !important;
    height: clamp(32px, 7.6dvh, 42px) !important;
    margin: 0 !important;
    padding: clamp(5px, 1dvh, 7px) clamp(7px, 1.4dvh, 9px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .sub-selector-line {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    display: grid !important;
    grid-template-rows: minmax(96px, 1.12fr) minmax(66px, 0.76fr) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    display: grid !important;
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-color: rgba(61, 221, 221, 0.4) !important;
    background: linear-gradient(180deg, rgba(0, 14, 18, 0.86), rgba(0, 4, 7, 0.96)) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: clamp(26px, 5.8dvh, 34px) minmax(58px, 1fr) !important;
    padding: clamp(5px, 1dvh, 7px) !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    grid-template-rows: minmax(0, 1fr) !important;
    padding: clamp(6px, 1.1dvh, 8px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    display: grid !important;
    grid-template-columns: clamp(20px, 3.8dvh, 26px) minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 1px clamp(6px, 1.1dvh, 8px) !important;
    align-content: start !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / span 2 !important;
    color: rgba(129, 244, 233, 0.96) !important;
    font-size: clamp(0.64rem, 1.8dvh, 0.84rem) !important;
    line-height: 1 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: rgba(235, 248, 246, 0.9) !important;
    font-size: clamp(0.48rem, 1.32dvh, 0.6rem) !important;
    letter-spacing: 0.13em !important;
    line-height: 1.05 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    color: rgba(188, 213, 216, 0.68) !important;
    font-size: clamp(0.34rem, 0.96dvh, 0.44rem) !important;
    letter-spacing: 0.045em !important;
    line-height: 1.12 !important;
    white-space: normal !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto minmax(40px, 1fr) !important;
    align-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: clamp(5px, 0.95dvh, 7px) clamp(7px, 1.25dvh, 9px) !important;
    border: 1px solid rgba(61, 221, 221, 0.52) !important;
    background: linear-gradient(180deg, rgba(0, 22, 24, 0.96), rgba(0, 5, 8, 0.98)) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator::before {
    display: none !important;
    content: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    min-width: 0 !important;
    font-size: clamp(0.38rem, 1.06dvh, 0.48rem) !important;
    letter-spacing: 0.1em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    justify-self: end !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    height: clamp(34px, 7dvh, 42px) !important;
    min-height: 34px !important;
    padding: clamp(14px, 2.7dvh, 18px) 0 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.2) !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(10px, 2.25dvh, 13px) !important;
    right: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: 6px !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(10px, 2.25dvh, 13px) !important;
    left: var(--depth-pos) !important;
    width: 10px !important;
    height: clamp(24px, 5.4dvh, 32px) !important;
    transform: translate(-50%, -50%) !important;
    box-shadow: 0 0 16px rgba(61, 221, 221, 0.72), inset 0 0 7px rgba(239, 255, 255, 0.58) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    display: flex !important;
    align-items: end !important;
    justify-content: center !important;
    font-size: clamp(0.28rem, 0.82dvh, 0.36rem) !important;
    opacity: 0.66 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i:nth-of-type(even) {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    align-content: center !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    display: grid !important;
    align-items: center !important;
    min-height: clamp(30px, 6.4dvh, 40px) !important;
    margin-top: clamp(2px, 0.45dvh, 3px) !important;
    padding: clamp(5px, 1dvh, 7px) clamp(6px, 1.25dvh, 8px) !important;
    border: 1px solid rgba(61, 221, 221, 0.24) !important;
    background: linear-gradient(180deg, rgba(0, 16, 18, 0.88), rgba(0, 4, 6, 0.96)) !important;
    color: rgba(217, 248, 248, 0.86) !important;
    font-size: clamp(0.4rem, 1.1dvh, 0.5rem) !important;
    letter-spacing: 0.07em !important;
    line-height: 1.12 !important;
    text-transform: uppercase !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: clamp(5px, 1.05dvh, 7px) !important;
    min-height: clamp(32px, 7dvh, 40px) !important;
    margin: 0 !important;
    padding-top: clamp(9px, 1.7dvh, 12px) !important;
    border-top: 1px solid rgba(61, 221, 221, 0.24) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backPlaneBtn {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn {
    display: inline-grid !important;
    place-items: center !important;
    min-height: clamp(30px, 6.6dvh, 38px) !important;
    padding: 0 clamp(5px, 1.15dvh, 8px) !important;
    border: 1px solid rgba(78, 210, 204, 0.55) !important;
    background: linear-gradient(180deg, rgba(0, 32, 34, 0.9), rgba(0, 10, 12, 0.98)) !important;
    color: rgba(224, 250, 250, 0.9) !important;
    font-size: clamp(0.4rem, 1.12dvh, 0.52rem) !important;
    letter-spacing: 0.12em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    opacity: 0.36 !important;
    filter: grayscale(0.4) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(38px, 8dvh, 46px) !important;
    margin: 0 !important;
    font-size: clamp(0.6rem, 1.62dvh, 0.76rem) !important;
    letter-spacing: 0.17em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution:not(.mobile-target-armed) .primary.fire {
    display: none !important;
  }
}

/* Final mobile targeting solution override.
   Keep this at the bottom so older mobile passes cannot hide the depth rail. */
@media (max-width: 980px) and (orientation: landscape) {
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    display: grid !important;
    grid-template-rows: clamp(32px, 7.5dvh, 42px) minmax(0, 1fr) clamp(32px, 7dvh, 40px) auto !important;
    row-gap: clamp(4px, 0.9dvh, 6px) !important;
    padding: clamp(7px, 1.35dvh, 10px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    min-height: 0 !important;
    height: clamp(32px, 7.5dvh, 42px) !important;
    margin: 0 !important;
    padding: clamp(5px, 1dvh, 7px) clamp(7px, 1.3dvh, 10px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .sub-selector-line {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    display: grid !important;
    grid-template-rows: minmax(100px, 1.25fr) minmax(68px, 0.75fr) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    display: grid !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-color: rgba(61, 221, 221, 0.42) !important;
    background: linear-gradient(180deg, rgba(1, 20, 22, 0.84), rgba(0, 4, 7, 0.94)) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: clamp(28px, 6.4dvh, 36px) minmax(68px, 1fr) !important;
    gap: clamp(3px, 0.75dvh, 5px) !important;
    padding: clamp(5px, 1dvh, 7px) !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    grid-template-rows: minmax(0, 1fr) !important;
    padding: clamp(6px, 1.15dvh, 8px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    display: grid !important;
    grid-template-columns: clamp(22px, 4.4dvh, 28px) minmax(0, 1fr) !important;
    gap: 1px clamp(6px, 1.1dvh, 8px) !important;
    align-content: start !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / 3 !important;
    align-self: start !important;
    font-size: clamp(0.66rem, 1.95dvh, 0.86rem) !important;
    line-height: 1 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    grid-column: 2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: clamp(0.48rem, 1.34dvh, 0.62rem) !important;
    letter-spacing: 0.13em !important;
    line-height: 1.05 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    grid-column: 2 !important;
    color: rgba(200, 216, 224, 0.76) !important;
    font-size: clamp(0.33rem, 0.95dvh, 0.43rem) !important;
    letter-spacing: 0.045em !important;
    line-height: 1.12 !important;
    text-transform: uppercase !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) !important;
    grid-template-rows: auto minmax(40px, 1fr) !important;
    align-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 68px !important;
    height: 100% !important;
    margin: 0 !important;
    padding: clamp(5px, 0.95dvh, 7px) clamp(7px, 1.3dvh, 9px) !important;
    border: 1px solid rgba(61, 221, 221, 0.58) !important;
    background:
      linear-gradient(180deg, rgba(0, 23, 25, 0.96), rgba(0, 6, 8, 0.98)),
      radial-gradient(circle at 50% 45%, rgba(61, 221, 221, 0.12), transparent 64%) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    pointer-events: auto !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator::before {
    display: none !important;
    content: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    min-width: 0 !important;
    overflow: hidden !important;
    color: rgba(61, 221, 221, 0.9) !important;
    font-size: clamp(0.38rem, 1.02dvh, 0.48rem) !important;
    letter-spacing: 0.11em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    justify-self: end !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    position: relative !important;
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    height: clamp(38px, 7.6dvh, 48px) !important;
    min-height: 38px !important;
    padding: clamp(15px, 3dvh, 18px) 0 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.2) !important;
    border-left: 0 !important;
    overflow: visible !important;
    touch-action: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(11px, 2.45dvh, 14px) !important;
    right: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: 6px !important;
    background:
      linear-gradient(90deg, rgba(61, 221, 221, 0.34), rgba(61, 221, 221, 0.64)),
      rgba(61, 221, 221, 0.14) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(11px, 2.45dvh, 14px) !important;
    left: var(--depth-pos) !important;
    width: 10px !important;
    height: clamp(26px, 5.8dvh, 34px) !important;
    transform: translate(-50%, -50%) !important;
    box-shadow:
      0 0 14px rgba(61, 221, 221, 0.72),
      inset 0 0 7px rgba(239, 255, 255, 0.58) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    display: flex !important;
    align-items: end !important;
    justify-content: center !important;
    min-width: 0 !important;
    width: auto !important;
    opacity: 0.65 !important;
    color: rgba(200, 216, 224, 0.62) !important;
    font-size: clamp(0.28rem, 0.82dvh, 0.36rem) !important;
    line-height: 1 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i:nth-of-type(even) {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    align-content: center !important;
    grid-template-rows: auto minmax(34px, 1fr) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    display: grid !important;
    align-items: center !important;
    min-height: clamp(32px, 6.4dvh, 42px) !important;
    margin-top: clamp(3px, 0.55dvh, 4px) !important;
    padding: clamp(5px, 1dvh, 7px) clamp(7px, 1.3dvh, 9px) !important;
    border: 1px solid rgba(61, 221, 221, 0.26) !important;
    background: linear-gradient(180deg, rgba(0, 16, 18, 0.9), rgba(0, 4, 6, 0.96)) !important;
    color: rgba(217, 248, 248, 0.88) !important;
    font-size: clamp(0.4rem, 1.1dvh, 0.5rem) !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution.mobile-target-armed .coords-line .command-line-main small {
    border-color: rgba(61, 221, 221, 0.44) !important;
    color: rgba(232, 255, 255, 0.96) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    min-height: clamp(32px, 7dvh, 40px) !important;
    margin: 0 !important;
    padding-top: clamp(8px, 1.55dvh, 11px) !important;
    border-top: 1px solid rgba(61, 221, 221, 0.24) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before {
    top: 1px !important;
    font-size: clamp(0.28rem, 0.8dvh, 0.38rem) !important;
    color: rgba(90, 128, 144, 0.86) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backPlaneBtn {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn {
    display: grid !important;
    place-items: center !important;
    min-height: clamp(30px, 6.4dvh, 38px) !important;
    padding: 0 clamp(5px, 1.15dvh, 8px) !important;
    border-color: rgba(61, 221, 221, 0.48) !important;
    color: rgba(224, 250, 250, 0.9) !important;
    background: linear-gradient(180deg, rgba(0, 29, 31, 0.72), rgba(0, 8, 10, 0.92)) !important;
    font-size: clamp(0.38rem, 1.05dvh, 0.5rem) !important;
    letter-spacing: 0.11em !important;
    white-space: nowrap !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    opacity: 0.4 !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(38px, 7.8dvh, 46px) !important;
    margin: clamp(3px, 0.75dvh, 5px) 0 0 !important;
    font-size: clamp(0.6rem, 1.62dvh, 0.78rem) !important;
    letter-spacing: 0.18em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution:not(.mobile-target-armed) .primary.fire {
    display: none !important;
  }
}

/* EOF mobile targeting solution pass: keep phone targeting clear and tap-safe. */
@media (max-width: 980px) and (orientation: landscape) {
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    left: max(7px, env(safe-area-inset-left)) !important;
    top: 7px !important;
    bottom: auto !important;
    width: clamp(292px, 36vw, 360px) !important;
    height: calc(100dvh - 14px) !important;
    max-height: calc(100dvh - 14px) !important;
    display: grid !important;
    grid-template-rows: clamp(34px, 8dvh, 44px) minmax(0, 1fr) auto auto !important;
    gap: clamp(5px, 1.05dvh, 7px) !important;
    padding: clamp(6px, 1.25dvh, 8px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 clamp(8px, 1.6dvh, 11px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading span {
    font-size: clamp(0.58rem, 1.45dvh, 0.72rem) !important;
    letter-spacing: 0.2em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .sub-selector-line {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    min-height: 0 !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows: minmax(110px, 1.34fr) minmax(76px, 0.66fr) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    display: grid !important;
    min-height: 0 !important;
    border-color: rgba(61, 221, 221, 0.46) !important;
    background:
      linear-gradient(180deg, rgba(2, 18, 20, 0.9), rgba(1, 7, 9, 0.96)),
      repeating-linear-gradient(180deg, rgba(117, 232, 232, 0.06) 0 1px, transparent 1px 5px) !important;
    box-shadow:
      inset 0 0 0 1px rgba(200, 255, 255, 0.04),
      inset 0 0 18px rgba(61, 221, 221, 0.06) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: clamp(30px, 6.3dvh, 36px) minmax(72px, 1fr) !important;
    gap: clamp(3px, 0.7dvh, 5px) !important;
    padding: clamp(5px, 1dvh, 7px) clamp(7px, 1.35dvh, 9px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    grid-template-rows: minmax(0, 1fr) !important;
    padding: clamp(6px, 1.15dvh, 8px) clamp(7px, 1.35dvh, 9px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: clamp(22px, 4.2dvh, 28px) minmax(0, 1fr) !important;
    gap: 0 clamp(7px, 1.35dvh, 10px) !important;
    align-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    justify-self: center !important;
    font-size: clamp(0.72rem, 2.35dvh, 0.98rem) !important;
    line-height: 1 !important;
    color: rgba(126, 244, 230, 0.92) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    align-self: end !important;
    white-space: nowrap !important;
    font-size: clamp(0.58rem, 1.78dvh, 0.76rem) !important;
    letter-spacing: 0.16em !important;
    line-height: 1.05 !important;
    color: rgba(230, 250, 248, 0.92) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    align-self: start !important;
    margin-top: 2px !important;
    white-space: normal !important;
    font-size: clamp(0.39rem, 1.16dvh, 0.5rem) !important;
    line-height: 1.16 !important;
    letter-spacing: 0.07em !important;
    color: rgba(192, 216, 220, 0.74) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr) !important;
    grid-template-rows: auto minmax(44px, 1fr) !important;
    align-self: stretch !important;
    height: 100% !important;
    min-height: 72px !important;
    width: 100% !important;
    padding: clamp(5px, 1dvh, 7px) clamp(8px, 1.45dvh, 10px) !important;
    overflow: visible !important;
    border-color: rgba(61, 221, 221, 0.62) !important;
    background:
      linear-gradient(180deg, rgba(0, 20, 22, 0.94), rgba(0, 6, 8, 0.98)),
      radial-gradient(circle at 50% 42%, rgba(61, 221, 221, 0.13), transparent 62%) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    font-size: clamp(0.42rem, 1.22dvh, 0.54rem) !important;
    line-height: 1.05 !important;
    letter-spacing: 0.13em !important;
    white-space: nowrap !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    justify-self: end !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    position: relative !important;
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: end !important;
    justify-content: space-between !important;
    height: clamp(42px, 8.8dvh, 52px) !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: clamp(20px, 4.1dvh, 24px) 0 0 !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(13px, 3dvh, 17px) !important;
    height: 6px !important;
    box-shadow: 0 0 13px rgba(61, 221, 221, 0.32) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(13px, 3dvh, 17px) !important;
    width: 12px !important;
    height: clamp(29px, 6.4dvh, 36px) !important;
    border-radius: 999px !important;
    box-shadow:
      0 0 17px rgba(61, 221, 221, 0.78),
      0 0 30px rgba(61, 221, 221, 0.28),
      inset 0 0 8px rgba(239, 255, 255, 0.64) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    flex: 1 1 0 !important;
    text-align: center !important;
    min-width: 0 !important;
    font-size: clamp(0.31rem, 0.94dvh, 0.4rem) !important;
    line-height: 1 !important;
    opacity: 0.74 !important;
    transform: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    grid-template-rows: auto minmax(42px, 1fr) !important;
    height: 100% !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    display: flex !important;
    align-items: center !important;
    min-height: 42px !important;
    margin-top: 5px !important;
    padding: clamp(7px, 1.35dvh, 9px) clamp(8px, 1.55dvh, 11px) !important;
    border: 1px solid rgba(61, 221, 221, 0.28) !important;
    background: rgba(0, 12, 16, 0.72) !important;
    font-size: clamp(0.47rem, 1.38dvh, 0.58rem) !important;
    line-height: 1.18 !important;
    color: rgba(222, 240, 240, 0.84) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution.mobile-target-armed .coords-line .command-line-main small {
    border-color: rgba(61, 221, 221, 0.55) !important;
    color: rgba(232, 252, 252, 0.96) !important;
    box-shadow: inset 0 0 14px rgba(61, 221, 221, 0.08) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    min-height: clamp(32px, 7dvh, 39px) !important;
    padding: 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.22) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backPlaneBtn {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn {
    min-height: clamp(32px, 7dvh, 39px) !important;
    padding: 0 clamp(5px, 1.1dvh, 7px) !important;
    font-size: clamp(0.46rem, 1.32dvh, 0.58rem) !important;
    letter-spacing: 0.15em !important;
    color: rgba(226, 252, 250, 0.9) !important;
    border-color: rgba(91, 214, 204, 0.62) !important;
    background: linear-gradient(180deg, rgba(8, 45, 43, 0.72), rgba(0, 14, 17, 0.94)) !important;
    box-shadow: inset 0 0 18px rgba(61, 221, 221, 0.08) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    opacity: 0.45 !important;
    color: rgba(178, 205, 205, 0.52) !important;
    border-color: rgba(91, 214, 204, 0.22) !important;
    background: rgba(0, 10, 12, 0.6) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(42px, 8.7dvh, 52px) !important;
    margin: 0 !important;
    font-size: clamp(0.7rem, 2.05dvh, 0.92rem) !important;
    letter-spacing: 0.18em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution:not(.mobile-target-armed) .primary.fire {
    display: none !important;
  }
}

/* Final mobile targeting solution pass: depth + target stay readable, editing controls stay away from fire. */
@media (max-width: 980px) and (orientation: landscape) {
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    left: max(7px, env(safe-area-inset-left)) !important;
    top: 7px !important;
    bottom: auto !important;
    width: clamp(292px, 36vw, 360px) !important;
    height: calc(100dvh - 14px) !important;
    max-height: calc(100dvh - 14px) !important;
    display: grid !important;
    grid-template-rows: clamp(34px, 8dvh, 44px) minmax(0, 1fr) auto auto !important;
    gap: clamp(5px, 1.05dvh, 7px) !important;
    padding: clamp(6px, 1.25dvh, 8px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 clamp(8px, 1.6dvh, 11px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading span {
    font-size: clamp(0.58rem, 1.45dvh, 0.72rem) !important;
    letter-spacing: 0.2em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .sub-selector-line {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    min-height: 0 !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows: minmax(110px, 1.34fr) minmax(76px, 0.66fr) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    display: grid !important;
    min-height: 0 !important;
    border-color: rgba(61, 221, 221, 0.46) !important;
    background:
      linear-gradient(180deg, rgba(2, 18, 20, 0.9), rgba(1, 7, 9, 0.96)),
      repeating-linear-gradient(180deg, rgba(117, 232, 232, 0.06) 0 1px, transparent 1px 5px) !important;
    box-shadow:
      inset 0 0 0 1px rgba(200, 255, 255, 0.04),
      inset 0 0 18px rgba(61, 221, 221, 0.06) !important;
    overflow: hidden !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: clamp(30px, 6.3dvh, 36px) minmax(72px, 1fr) !important;
    gap: clamp(3px, 0.7dvh, 5px) !important;
    padding: clamp(5px, 1dvh, 7px) clamp(7px, 1.35dvh, 9px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    grid-template-rows: minmax(0, 1fr) !important;
    padding: clamp(6px, 1.15dvh, 8px) clamp(7px, 1.35dvh, 9px) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: clamp(22px, 4.2dvh, 28px) minmax(0, 1fr) !important;
    gap: 0 clamp(7px, 1.35dvh, 10px) !important;
    align-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    justify-self: center !important;
    font-size: clamp(0.72rem, 2.35dvh, 0.98rem) !important;
    line-height: 1 !important;
    color: rgba(126, 244, 230, 0.92) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    align-self: end !important;
    white-space: nowrap !important;
    font-size: clamp(0.58rem, 1.78dvh, 0.76rem) !important;
    letter-spacing: 0.16em !important;
    line-height: 1.05 !important;
    color: rgba(230, 250, 248, 0.92) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    align-self: start !important;
    margin-top: 2px !important;
    white-space: normal !important;
    font-size: clamp(0.39rem, 1.16dvh, 0.5rem) !important;
    line-height: 1.16 !important;
    letter-spacing: 0.07em !important;
    color: rgba(192, 216, 220, 0.74) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr) !important;
    grid-template-rows: auto minmax(44px, 1fr) !important;
    align-self: stretch !important;
    height: 100% !important;
    min-height: 72px !important;
    width: 100% !important;
    padding: clamp(5px, 1dvh, 7px) clamp(8px, 1.45dvh, 10px) !important;
    overflow: visible !important;
    border-color: rgba(61, 221, 221, 0.62) !important;
    background:
      linear-gradient(180deg, rgba(0, 20, 22, 0.94), rgba(0, 6, 8, 0.98)),
      radial-gradient(circle at 50% 42%, rgba(61, 221, 221, 0.13), transparent 62%) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    font-size: clamp(0.42rem, 1.22dvh, 0.54rem) !important;
    line-height: 1.05 !important;
    letter-spacing: 0.13em !important;
    white-space: nowrap !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    justify-self: end !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    position: relative !important;
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: end !important;
    justify-content: space-between !important;
    height: clamp(42px, 8.8dvh, 52px) !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: clamp(20px, 4.1dvh, 24px) 0 0 !important;
    overflow: visible !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(13px, 3dvh, 17px) !important;
    height: 6px !important;
    box-shadow: 0 0 13px rgba(61, 221, 221, 0.32) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(13px, 3dvh, 17px) !important;
    width: 12px !important;
    height: clamp(29px, 6.4dvh, 36px) !important;
    border-radius: 999px !important;
    box-shadow:
      0 0 17px rgba(61, 221, 221, 0.78),
      0 0 30px rgba(61, 221, 221, 0.28),
      inset 0 0 8px rgba(239, 255, 255, 0.64) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    flex: 1 1 0 !important;
    text-align: center !important;
    min-width: 0 !important;
    font-size: clamp(0.31rem, 0.94dvh, 0.4rem) !important;
    line-height: 1 !important;
    opacity: 0.74 !important;
    transform: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    grid-template-rows: auto minmax(42px, 1fr) !important;
    height: 100% !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    display: flex !important;
    align-items: center !important;
    min-height: 42px !important;
    margin-top: 5px !important;
    padding: clamp(7px, 1.35dvh, 9px) clamp(8px, 1.55dvh, 11px) !important;
    border: 1px solid rgba(61, 221, 221, 0.28) !important;
    background: rgba(0, 12, 16, 0.72) !important;
    font-size: clamp(0.47rem, 1.38dvh, 0.58rem) !important;
    line-height: 1.18 !important;
    color: rgba(222, 240, 240, 0.84) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution.mobile-target-armed .coords-line .command-line-main small {
    border-color: rgba(61, 221, 221, 0.55) !important;
    color: rgba(232, 252, 252, 0.96) !important;
    box-shadow: inset 0 0 14px rgba(61, 221, 221, 0.08) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(5px, 1dvh, 7px) !important;
    min-height: clamp(32px, 7dvh, 39px) !important;
    padding: 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.22) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backPlaneBtn {
    display: none !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn {
    min-height: clamp(32px, 7dvh, 39px) !important;
    padding: 0 clamp(5px, 1.1dvh, 7px) !important;
    font-size: clamp(0.46rem, 1.32dvh, 0.58rem) !important;
    letter-spacing: 0.15em !important;
    color: rgba(226, 252, 250, 0.9) !important;
    border-color: rgba(91, 214, 204, 0.62) !important;
    background: linear-gradient(180deg, rgba(8, 45, 43, 0.72), rgba(0, 14, 17, 0.94)) !important;
    box-shadow: inset 0 0 18px rgba(61, 221, 221, 0.08) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    opacity: 0.45 !important;
    color: rgba(178, 205, 205, 0.52) !important;
    border-color: rgba(91, 214, 204, 0.22) !important;
    background: rgba(0, 10, 12, 0.6) !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(42px, 8.7dvh, 52px) !important;
    margin: 0 !important;
    font-size: clamp(0.7rem, 2.05dvh, 0.92rem) !important;
    letter-spacing: 0.18em !important;
  }

  html body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution:not(.mobile-target-armed) .primary.fire {
    display: none !important;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -18%, rgba(86, 142, 158, 0.42), transparent 38%),
    linear-gradient(180deg, #0a2a3a 0%, #061722 52%, #02080f 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(102deg, transparent 0 16%, rgba(136, 187, 204, 0.06) 18%, transparent 31%),
    linear-gradient(76deg, transparent 0 55%, rgba(91, 144, 164, 0.05) 57%, transparent 68%),
    radial-gradient(ellipse at 50% 106%, rgba(0, 0, 0, 0.38), transparent 52%);
  opacity: 0.72;
}

button,
input,
select {
  font: inherit;
}

button {
  color: var(--text);
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.main-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: center;
  justify-items: start;
  min-height: 100vh;
  padding: clamp(14px, 3.4vw, 48px) clamp(14px, 5vw, 96px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  isolation: isolate;
  background-color: #000;
  transition: opacity 0.36s ease, visibility 0.36s ease;
}

body.main-menu-active .main-menu {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

body.main-menu-active #scene,
body.main-menu-active .topbar,
body.main-menu-active .hud,
body.main-menu-active .pregame-screen,
body.main-menu-active .bottom-strip,
body.main-menu-active .pass-screen,
body.main-menu-active .end-screen,
body.main-menu-active .dg.ac {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.main-menu-video,
.main-menu-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.main-menu-video {
  z-index: 0;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.28);
  transform-origin: center center;
  filter: saturate(1.24) contrast(1.08) brightness(1.42);
}

.main-menu-shade {
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 73% 45%, rgba(68, 145, 160, 0.22), transparent 39%),
    radial-gradient(ellipse at 58% 72%, rgba(33, 92, 108, 0.16), transparent 34%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.2) 48%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.12) 45%, rgba(0, 0, 0, 0.28));
}

.main-menu::after {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(ellipse at 76% 46%, rgba(58, 139, 156, 0.08), transparent 38%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.16));
}

.sonar-menu-panel {
  position: relative;
  z-index: 6;
  width: min(clamp(660px, 52vw, 860px), calc((100vh + 54px) * 1123 / 1401));
  aspect-ratio: 1123 / 1401;
  color: #d8f7ff;
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  filter: drop-shadow(0 0 18px rgba(45, 216, 229, 0.18)) drop-shadow(0 24px 60px rgba(0, 0, 0, 0.58));
  transition: opacity 0.36s ease, transform 0.36s ease, filter 0.36s ease;
}

.sonar-menu-panel::before {
  position: absolute;
  inset: 1.6% 2.2% 1.6% 2.2%;
  z-index: 1;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 22%, rgba(21, 63, 72, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(0, 10, 14, 0.56), rgba(0, 5, 9, 0.7) 58%, rgba(0, 4, 7, 0.78));
  clip-path: polygon(7% 0, 89% 0, 99% 10%, 99% 93%, 94% 99%, 6% 99%, 0 91%, 0 4%);
}

.main-menu.main-menu-exiting .sonar-menu-panel {
  opacity: 0;
  transform: scale(0.965);
  filter: drop-shadow(0 0 8px rgba(45, 216, 229, 0.1)) drop-shadow(0 18px 42px rgba(0, 0, 0, 0.5));
}

.sonar-menu-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: brightness(0.68) contrast(1.18) saturate(0.96);
}

.sonar-menu-logo {
  position: absolute;
  z-index: 4;
  top: -5.8%;
  left: 55.2%;
  width: 127.5%;
  height: auto;
  transform: translateX(-50%);
  max-width: none;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(12, 24, 28, 0.46));
}

.sonar-menu-items {
  position: absolute;
  z-index: 2;
  top: 45.4%;
  left: 12.8%;
  right: 12.1%;
  display: grid;
  gap: clamp(8px, 0.82vw, 13px);
}

.sonar-menu-item {
  position: relative;
  display: grid;
  grid-template-columns: 17% minmax(0, 1fr) 32px;
  align-items: center;
  min-height: clamp(60px, 4.4vw, 76px);
  padding: 0 clamp(17px, 1.6vw, 24px);
  border: 1px solid rgba(61, 221, 221, 0.2);
  border-radius: 0;
  color: rgba(195, 239, 246, 0.82);
  background:
    linear-gradient(90deg, rgba(7, 25, 31, 0.42), rgba(10, 42, 52, 0.22)),
    rgba(2, 10, 16, 0.18);
  box-shadow: inset 0 0 16px rgba(61, 221, 221, 0.045);
  letter-spacing: 0.15em;
  font-size: clamp(1.08rem, 1.08vw, 1.34rem);
  text-align: left;
  cursor: pointer;
  transform: translateZ(0);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    background-color 0.18s ease;
}

.sonar-menu-item:hover,
.sonar-menu-item:focus-visible {
  border-color: rgba(61, 221, 221, 0.72);
  color: #efffff;
  outline: none;
  transform: scale(1.018);
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.16),
    inset 0 0 18px rgba(61, 221, 221, 0.12);
}

.sonar-menu-item span {
  min-width: 0;
  white-space: nowrap;
}

.sonar-menu-item.active {
  border-color: rgba(255, 77, 93, 0.88);
  color: #eaffff;
  box-shadow:
    0 0 22px rgba(255, 77, 93, 0.24),
    inset 0 0 18px rgba(255, 77, 93, 0.18),
    inset 0 0 1px rgba(255, 225, 230, 0.9);
  animation: sonar-menu-active-pulse 3s ease-in-out infinite;
}

.sonar-menu-icon {
  width: clamp(24px, 2.4vw, 32px);
  height: clamp(24px, 2.4vw, 32px);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.sonar-menu-item.active .sonar-menu-icon,
.sonar-menu-item.active .sonar-menu-arrow {
  color: #ff4d5d;
  opacity: 1;
}

.sonar-menu-arrow {
  justify-self: end;
  color: rgba(255, 77, 93, 0.9);
  font-size: clamp(1.55rem, 2.2vw, 2.05rem);
  line-height: 1;
}

.sonar-menu-panel.engagement-open .sonar-menu-logo {
  top: -4.8%;
  left: 53.2%;
  width: 78%;
  opacity: 0.72;
}

.sonar-engagement-panel {
  position: absolute;
  inset: 21.5% 10.8% 8.4%;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: clamp(9px, 0.72vw, 13px);
  color: #c8d8e0;
}

.sonar-engagement-title {
  display: grid;
  gap: 4px;
  margin-bottom: 1px;
}

.sonar-engagement-title span,
.sonar-section-label,
.sonar-engagement-group > span,
.sonar-engagement-field > span,
.sonar-engagement-lan > span {
  color: #5a8090;
  font-size: clamp(0.64rem, 0.64vw, 0.78rem);
  letter-spacing: 0.22em;
}

.sonar-engagement-title h2 {
  margin: 0;
  color: #efffff;
  font-size: clamp(1.05rem, 1.2vw, 1.35rem);
  letter-spacing: 0.16em;
  line-height: 1;
}

.sonar-engagement-group,
.sonar-engagement-field,
.sonar-engagement-lan {
  display: grid;
  gap: 7px;
}

.sonar-settings-section {
  display: grid;
  gap: clamp(8px, 0.7vw, 12px);
  padding-top: clamp(8px, 0.62vw, 11px);
  border-top: 1px solid rgba(90, 128, 144, 0.24);
}

.sonar-settings-section:first-of-type {
  border-top-color: rgba(61, 221, 221, 0.18);
}

.sonar-section-label {
  display: block;
  color: #5a8090;
  text-transform: uppercase;
}

.sonar-settings-section-join.hidden {
  display: none;
}

.sonar-engagement-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sonar-select-card[data-engagement-mode="convoy"] {
  grid-column: 1 / -1;
}

.sonar-engagement-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sonar-toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.sonar-toggle-row.commander-counts,
.option-grid.commander-counts {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.sonar-select-card,
.sonar-mini-select,
.sonar-mode-option,
.sonar-menu-back,
.sonar-menu-launch,
.sonar-engagement-field select,
.sonar-engagement-lan input {
  border: 1px solid rgba(61, 221, 221, 0.2);
  color: rgba(207, 242, 247, 0.86);
  background:
    linear-gradient(180deg, rgba(8, 30, 39, 0.56), rgba(2, 11, 17, 0.48)),
    rgba(2, 10, 16, 0.22);
  box-shadow: inset 0 0 14px rgba(61, 221, 221, 0.05);
  font: inherit;
  text-transform: uppercase;
}

.sonar-select-card {
  display: grid;
  gap: 5px;
  min-height: clamp(58px, 4.1vw, 74px);
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
}

.sonar-select-card strong {
  color: #f3feff;
  font-size: clamp(0.86rem, 0.86vw, 1rem);
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.sonar-select-card small {
  color: #8fb8c4;
  font: 600 clamp(0.64rem, 0.64vw, 0.76rem) Inter, system-ui, sans-serif;
  letter-spacing: 0.01em;
  text-transform: none;
}

.sonar-mini-select,
.sonar-menu-back,
.sonar-menu-launch {
  min-height: 38px;
  padding: 0 10px;
  letter-spacing: 0.13em;
  white-space: nowrap;
  cursor: pointer;
}

.sonar-select-card:hover,
.sonar-mini-select:hover,
.sonar-menu-back:hover,
.sonar-menu-launch:hover,
.sonar-engagement-field select:focus,
.sonar-engagement-lan input:focus {
  border-color: rgba(61, 221, 221, 0.68);
  outline: none;
  box-shadow:
    0 0 16px rgba(61, 221, 221, 0.14),
    inset 0 0 16px rgba(61, 221, 221, 0.11);
}

.sonar-select-card.selected,
.sonar-mini-select.selected,
.sonar-menu-launch {
  border-color: rgba(255, 77, 93, 0.84);
  color: #efffff;
  background:
    linear-gradient(180deg, rgba(50, 16, 25, 0.62), rgba(6, 12, 19, 0.52)),
    rgba(255, 77, 93, 0.06);
  box-shadow:
    0 0 20px rgba(255, 77, 93, 0.2),
    inset 0 0 18px rgba(255, 77, 93, 0.16);
}

.sonar-mini-select:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.sonar-engagement-field select,
.sonar-engagement-lan input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 0;
  letter-spacing: 0.08em;
}

.sonar-engagement-lan {
  padding: 10px;
  border: 1px solid rgba(61, 221, 221, 0.16);
  background: rgba(1, 12, 18, 0.34);
}

.sonar-engagement-roster {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(61, 221, 221, 0.18);
  background:
    linear-gradient(180deg, rgba(4, 24, 30, 0.62), rgba(1, 10, 15, 0.62)),
    repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.026) 0 1px, transparent 1px 4px);
  box-shadow: inset 0 0 18px rgba(61, 221, 221, 0.045);
}

.sonar-roster-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.sonar-roster-team {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.sonar-roster-team > span {
  color: rgba(143, 184, 196, 0.86);
  font-size: clamp(0.58rem, 0.56vw, 0.68rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sonar-roster-team.team-red > span {
  color: rgba(255, 129, 142, 0.82);
}

.sonar-roster-team.team-gold > span {
  color: rgba(245, 214, 132, 0.82);
}

.sonar-roster-slot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sonar-roster-slot > strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid rgba(61, 221, 221, 0.2);
  color: #3ddddd;
  background: rgba(1, 12, 18, 0.5);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.sonar-seat-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

.sonar-seat-fixed,
.sonar-seat-toggle {
  display: grid;
  place-items: center;
  min-height: 28px;
  border: 1px solid rgba(61, 221, 221, 0.18);
  color: rgba(200, 216, 224, 0.8);
  background: rgba(1, 10, 16, 0.5);
  font: inherit;
  font-size: clamp(0.58rem, 0.58vw, 0.68rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sonar-seat-toggle {
  cursor: pointer;
}

.sonar-seat-toggle:hover,
.sonar-seat-toggle.selected {
  border-color: rgba(61, 221, 221, 0.72);
  color: #efffff;
  background: rgba(20, 95, 105, 0.28);
  box-shadow:
    0 0 13px rgba(61, 221, 221, 0.12),
    inset 0 0 12px rgba(61, 221, 221, 0.1);
}

.sonar-roster-slot.seat-ai .sonar-seat-toggle.selected {
  border-color: rgba(255, 77, 93, 0.72);
  background: rgba(72, 18, 28, 0.34);
  box-shadow:
    0 0 13px rgba(255, 77, 93, 0.14),
    inset 0 0 12px rgba(255, 77, 93, 0.1);
}

.sonar-seat-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.sonar-seat-toggle:disabled:hover {
  border-color: rgba(61, 221, 221, 0.18);
  color: rgba(200, 216, 224, 0.8);
  background: rgba(1, 10, 16, 0.5);
  box-shadow: none;
}

.sonar-roster-slot.seat-locked-ai .sonar-seat-toggle.selected:disabled {
  opacity: 0.95;
  border-color: rgba(255, 77, 93, 0.82);
  color: #f5c8ce;
  background: rgba(88, 19, 31, 0.5);
  box-shadow:
    0 0 14px rgba(255, 77, 93, 0.18),
    inset 0 0 12px rgba(255, 77, 93, 0.14);
}

.sonar-seat-fixed {
  grid-column: 1 / -1;
  color: #3ddddd;
  border-color: rgba(61, 221, 221, 0.46);
}

.sonar-engagement-roster small {
  color: rgba(143, 184, 196, 0.86);
  font: 600 clamp(0.62rem, 0.58vw, 0.72rem) Inter, system-ui, sans-serif;
  line-height: 1.18;
  letter-spacing: 0;
  text-transform: none;
}

.sonar-engagement-lan strong {
  color: #d8f7ff;
  font: 600 0.78rem Inter, system-ui, sans-serif;
  line-height: 1.25;
  text-transform: none;
}

.sonar-engagement-lan div {
  display: grid;
  grid-template-columns: 1fr 0.84fr 0.7fr;
  gap: 7px;
}

.sonar-engagement-lan em,
.sonar-engagement-summary {
  color: #8fb8c4;
  font-size: clamp(0.68rem, 0.68vw, 0.78rem);
  font-style: normal;
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}

.sonar-mode-options {
  display: grid;
  gap: 8px;
}

.sonar-mode-option {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  min-height: 54px;
  padding: 10px 12px;
  text-align: left;
  cursor: not-allowed;
  opacity: 0.62;
}

.sonar-mode-option:not(:disabled) {
  cursor: pointer;
  opacity: 0.86;
}

.sonar-mode-option:not(:disabled):hover,
.sonar-mode-option:not(:disabled):focus-visible {
  border-color: rgba(61, 221, 221, 0.72);
  box-shadow: inset 0 0 20px rgba(61, 221, 221, 0.08), 0 0 18px rgba(61, 221, 221, 0.1);
}

.sonar-mode-option.selected {
  opacity: 1;
  border-color: rgba(255, 77, 93, 0.92);
  background: linear-gradient(180deg, rgba(255, 77, 93, 0.14), rgba(4, 16, 20, 0.9));
  box-shadow: inset 0 0 24px rgba(255, 77, 93, 0.14), 0 0 18px rgba(255, 77, 93, 0.16);
}

.sonar-mode-option strong {
  color: rgba(239, 255, 255, 0.86);
  font-size: clamp(0.78rem, 0.78vw, 0.92rem);
  letter-spacing: 0.12em;
}

.sonar-mode-option small {
  grid-column: 1 / -1;
  color: #8fb8c4;
  font: 600 clamp(0.62rem, 0.62vw, 0.74rem) Inter, system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.sonar-mode-option em {
  align-self: start;
  color: rgba(255, 77, 93, 0.82);
  font-size: 0.62rem;
  font-style: normal;
  letter-spacing: 0.12em;
}

.sonar-mode-option:not(.selected):not(:disabled) em {
  color: rgba(90, 128, 144, 0.9);
}

.sonar-timer-options {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.sonar-timer-options.is-active {
  display: grid;
}

.sonar-timer-options button {
  min-height: 32px;
  border: 1px solid rgba(61, 221, 221, 0.36);
  background: linear-gradient(180deg, rgba(4, 25, 31, 0.92), rgba(0, 9, 13, 0.96));
  color: #9edbe0;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sonar-timer-options button:hover,
.sonar-timer-options button:focus-visible,
.sonar-timer-options button.selected {
  border-color: rgba(61, 221, 221, 0.88);
  color: #eaffff;
  box-shadow: inset 0 0 18px rgba(61, 221, 221, 0.12), 0 0 14px rgba(61, 221, 221, 0.12);
}

.sonar-engagement-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.3fr;
  gap: 8px;
  margin-top: 2px;
}

.sonar-engagement-summary {
  margin: 0;
  text-align: center;
  line-height: 1.25;
}

.menu-toast {
  position: absolute;
  left: 12.7%;
  right: 12%;
  bottom: 2.9%;
  z-index: 5;
  min-height: 28px;
  padding: 7px 13px;
  border: 1px solid rgba(61, 221, 221, 0.28);
  color: #c8d8e0;
  background: rgba(2, 12, 18, 0.84);
  box-shadow: 0 0 16px rgba(61, 221, 221, 0.12), inset 0 0 12px rgba(61, 221, 221, 0.08);
  font-size: clamp(0.62rem, 0.64vw, 0.78rem);
  letter-spacing: 0.15em;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.menu-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.menu-settings-modal {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 5, 9, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.menu-settings-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.menu-settings-card {
  width: min(430px, 86vw);
  max-height: min(780px, calc(100dvh - 44px));
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(61, 221, 221, 0.4);
  color: #c8d8e0;
  background:
    linear-gradient(180deg, rgba(10, 42, 58, 0.94), rgba(2, 10, 16, 0.96));
  box-shadow:
    0 0 24px rgba(61, 221, 221, 0.2),
    inset 0 0 22px rgba(61, 221, 221, 0.08);
}

.menu-settings-card h2 {
  margin: 0 0 18px;
  color: #eaffff;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
}

.menu-settings-card h3 {
  margin: 18px 0 10px;
  color: rgba(90, 128, 144, 0.94);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.menu-settings-card h2 + h3 {
  margin-top: 0;
}

.menu-volume-row {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #8fb8c4;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.menu-volume-row input {
  width: 100%;
  accent-color: #3ddddd;
}

.menu-select-row select {
  min-height: 36px;
  border: 1px solid rgba(61, 221, 221, 0.26);
  color: #d7e6ec;
  background:
    linear-gradient(180deg, rgba(1, 17, 29, 0.92), rgba(0, 4, 10, 0.96)),
    rgba(0, 5, 10, 0.9);
  font: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-settings-reset {
  width: 100%;
  min-height: 36px;
  margin: 0 0 8px;
  border: 1px solid rgba(61, 221, 221, 0.32);
  color: #b8dbe4;
  background: rgba(61, 221, 221, 0.06);
  box-shadow: inset 0 0 14px rgba(61, 221, 221, 0.08);
  font: inherit;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-settings-reset:hover {
  border-color: rgba(61, 221, 221, 0.64);
  color: #f2fbff;
}

.menu-settings-close {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid rgba(255, 77, 93, 0.72);
  color: #f2fbff;
  background: rgba(255, 77, 93, 0.12);
  box-shadow: inset 0 0 14px rgba(255, 77, 93, 0.16);
  font: inherit;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

@keyframes sonar-menu-active-pulse {
  0%,
  100% {
    box-shadow:
      0 0 18px rgba(255, 77, 93, 0.2),
      inset 0 0 16px rgba(255, 77, 93, 0.15),
      inset 0 0 1px rgba(255, 225, 230, 0.86);
  }
  50% {
    box-shadow:
      0 0 28px rgba(255, 77, 93, 0.34),
      inset 0 0 24px rgba(255, 77, 93, 0.24),
      inset 0 0 1px rgba(255, 225, 230, 1);
  }
}

.topbar {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}

.brand,
.phase-tabs,
.panel,
.bottom-strip,
.pass-box,
.pregame-shell,
.end-shell {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 60px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  border-radius: 8px;
}

.brand {
  min-width: 282px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 13px 9px;
  pointer-events: auto;
}

.brand-mark,
.scope {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(139, 218, 255, 0.76);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 48%, rgba(139, 218, 255, 0.7) 49%, rgba(139, 218, 255, 0.7) 51%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(139, 218, 255, 0.7) 49%, rgba(139, 218, 255, 0.7) 51%, transparent 52%),
    radial-gradient(circle, transparent 43%, rgba(255, 215, 106, 0.34) 44%, transparent 48%);
}

.brand-logo {
  display: block;
  width: 156px;
  max-width: 38vw;
  height: auto;
  margin: -20px 0 -22px;
  filter: drop-shadow(0 0 10px rgba(93, 204, 221, 0.14));
}

.pass-box h2 {
  margin: 0;
  color: #eefffb;
  font-size: 1.15rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.brand p,
.pass-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.phase-tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  pointer-events: auto;
  max-width: calc(100vw - 32px);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(118, 198, 255, 0.3);
  background: rgba(11, 48, 88, 0.58);
  border-radius: 8px;
  cursor: pointer;
}

.view-button {
  width: auto;
  min-width: clamp(92px, 7.4vw, 132px);
  grid-template-columns: 20px minmax(0, auto);
  gap: 8px;
  padding: 0 12px;
  color: rgba(200, 232, 240, 0.86);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.view-button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button:hover,
.icon-button.active,
.chip:hover,
.chip.selected,
.command:hover,
.command.selected,
.secondary:hover {
  border-color: var(--line-strong);
  background: rgba(40, 116, 184, 0.52);
}

.icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.icon.radar {
  border: 2px solid var(--green);
  border-radius: 50%;
}

.icon.radar::before,
.icon.radar::after {
  position: absolute;
  content: "";
  inset: 5px;
  border: 1px solid rgba(139, 218, 255, 0.68);
  border-radius: 50%;
}

.icon.radar::after {
  inset: auto;
  left: 9px;
  top: 2px;
  width: 2px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: var(--green);
  transform: rotate(-45deg);
  transform-origin: bottom;
}

.icon.crosshair::before,
.icon.crosshair::after {
  position: absolute;
  content: "";
  background: var(--green);
}

.icon.crosshair::before {
  left: 9px;
  top: 0;
  width: 2px;
  height: 20px;
}

.icon.crosshair::after {
  top: 9px;
  left: 0;
  width: 20px;
  height: 2px;
}

.icon.layers::before,
.icon.layers::after {
  position: absolute;
  left: 2px;
  width: 16px;
  height: 10px;
  border: 2px solid var(--green);
  content: "";
  transform: skewY(-18deg);
}

.icon.layers::before {
  top: 2px;
  background: rgba(74, 196, 255, 0.14);
}

.icon.layers::after {
  bottom: 2px;
  border-color: rgba(139, 218, 255, 0.72);
}

.icon.menu,
.icon.menu::before,
.icon.menu::after {
  height: 2px;
  border-radius: 999px;
  background: var(--green);
}

.icon.menu {
  width: 20px;
}

.icon.menu::before,
.icon.menu::after {
  position: absolute;
  left: 0;
  width: 20px;
  content: "";
}

.icon.menu::before {
  top: 5px;
}

.icon.menu::after {
  bottom: 5px;
}

.hud {
  position: fixed;
  inset: 96px 18px 76px;
  z-index: 7;
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 12px;
  pointer-events: none;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 14px;
  pointer-events: auto;
}

.pregame-screen {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 96px 18px 72px;
  background:
    radial-gradient(ellipse at 50% 16%, rgba(54, 156, 190, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(1, 10, 20, 0.58), rgba(0, 3, 8, 0.86));
  pointer-events: auto;
}

.pregame-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(95deg, transparent 0 20%, rgba(136, 187, 204, 0.05) 22%, transparent 34%),
    linear-gradient(73deg, transparent 0 60%, rgba(73, 139, 167, 0.04) 62%, transparent 74%),
    radial-gradient(ellipse at 50% 105%, rgba(0, 0, 0, 0.54), transparent 58%);
}

.pregame-shell {
  --console-text: #d7e6ec;
  --console-muted: #6f98a6;
  --console-active: #3ddddd;
  --console-plate: #020915;
  --console-recess: #01050c;
  position: relative;
  width: min(820px, calc(100vw - 36px));
  max-height: calc(100vh - 138px);
  overflow: auto;
  padding: 18px;
  border: 2px solid rgba(0, 3, 8, 0.96);
  background:
    linear-gradient(180deg, rgba(6, 33, 58, 0.96), rgba(1, 8, 20, 0.98)),
    rgba(3, 18, 38, 0.96);
  box-shadow:
    0 26px 76px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(0, 0, 0, 0.92),
    inset 0 0 0 1px rgba(141, 184, 196, 0.42),
    inset 0 2px 0 rgba(215, 230, 236, 0.1),
    inset 0 -24px 48px rgba(0, 0, 0, 0.32);
  color: var(--console-text);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.pregame-shell::before,
.pregame-shell::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.pregame-shell::before {
  inset: 0;
  z-index: 4;
  border-radius: 6px;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(200, 216, 224, 0.04) 0,
    rgba(200, 216, 224, 0.04) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
}

.pregame-shell::after {
  inset: 10px;
  z-index: 5;
  background:
    radial-gradient(circle at 2px 2px, rgba(133, 168, 178, 0.58) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 2px) 2px, rgba(133, 168, 178, 0.58) 0 2px, transparent 2.5px),
    radial-gradient(circle at 2px calc(100% - 2px), rgba(133, 168, 178, 0.58) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 2px) calc(100% - 2px), rgba(133, 168, 178, 0.58) 0 2px, transparent 2.5px);
}

.pregame-shell > * {
  position: relative;
  z-index: 3;
}

.pregame-title {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(111, 152, 166, 0.22);
  padding-bottom: 12px;
}

.pregame-title p,
.pregame-card span {
  margin: 0;
  color: var(--console-muted);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pregame-title h2 {
  margin: 3px 0 0;
  color: #edf8fb;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.05;
  text-transform: uppercase;
}

.pregame-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pregame-card {
  min-height: 132px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid rgba(90, 128, 144, 0.5);
  background:
    linear-gradient(180deg, rgba(7, 32, 52, 0.84), rgba(1, 7, 17, 0.92)),
    rgba(3, 18, 35, 0.9);
  color: var(--console-text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(215, 230, 236, 0.05),
    inset 0 0 16px rgba(0, 0, 0, 0.62),
    0 1px 0 rgba(215, 230, 236, 0.05);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pregame-card:hover {
  border-color: rgba(111, 152, 166, 0.82);
  background:
    linear-gradient(180deg, rgba(9, 48, 70, 0.74), rgba(2, 14, 28, 0.9)),
    rgba(4, 24, 43, 0.94);
  transform: translateY(-1px);
}

.pregame-card.selected {
  border-color: rgba(61, 221, 221, 0.88);
  background:
    linear-gradient(180deg, rgba(12, 71, 82, 0.82), rgba(1, 20, 31, 0.96)),
    rgba(4, 26, 42, 0.96);
  box-shadow:
    0 0 22px rgba(61, 221, 221, 0.18),
    inset 0 0 24px rgba(61, 221, 221, 0.24),
    inset 0 1px 0 rgba(215, 230, 236, 0.12);
  animation: pregame-console-pulse 4s ease-in-out infinite;
}

.pregame-card[data-pregame-mode="convoy"] {
  grid-column: span 2;
}

.pregame-card strong {
  color: var(--console-text);
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.05;
  text-transform: uppercase;
}

.pregame-card small {
  color: #c8d8e0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.34;
}

.pregame-settings-section {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(90, 128, 144, 0.28);
}

.pregame-section-label {
  color: #5a8090;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pregame-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.pregame-lan {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 110px minmax(180px, 1fr) 110px;
  align-items: center;
  gap: 9px;
  margin-top: 0;
  border: 1px solid rgba(90, 128, 144, 0.44);
  background:
    linear-gradient(180deg, rgba(2, 15, 29, 0.82), rgba(0, 5, 13, 0.9)),
    rgba(3, 18, 38, 0.72);
  padding: 10px;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(215, 230, 236, 0.05),
    inset 0 0 16px rgba(0, 0, 0, 0.55);
}

.pregame-join-section.hidden {
  display: none;
}

.pregame-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 10px;
  margin-top: 12px;
}

.pregame-actions .secondary,
.pregame-actions .primary {
  min-height: 42px;
  margin-top: 0;
}

.pregame-actions .hidden + .primary {
  grid-column: 1 / -1;
}

.pregame-note {
  margin: 12px 0 0;
  color: #5a8090;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.pregame-statusbar {
  margin-top: 18px;
  border: 0;
  background: transparent;
  padding: 0;
  color: #5a8090;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}

.pregame-shell .option-block > span,
.pregame-shell .field > span,
.pregame-shell .lan-copy span,
.pregame-shell .room-code {
  color: var(--console-muted);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pregame-shell .lan-copy strong,
.pregame-shell input {
  color: var(--console-text);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.pregame-shell select {
  color: var(--console-text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.pregame-shell input,
.pregame-shell select {
  border-color: rgba(90, 128, 144, 0.52);
  background: rgba(0, 7, 16, 0.92);
  box-shadow:
    inset 0 1px 9px rgba(0, 0, 0, 0.62),
    0 1px 0 rgba(215, 230, 236, 0.04);
}

.pregame-shell input:focus,
.pregame-shell select:focus {
  border-color: rgba(90, 128, 144, 0.76);
}

.pregame-shell .command,
.pregame-shell .secondary,
.pregame-shell .primary {
  position: relative;
  overflow: hidden;
  border-color: rgba(90, 128, 144, 0.52);
  background:
    linear-gradient(180deg, rgba(7, 32, 52, 0.82), rgba(1, 7, 17, 0.92)),
    rgba(3, 18, 35, 0.9);
  color: var(--console-text);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(215, 230, 236, 0.05),
    inset 0 0 15px rgba(0, 0, 0, 0.62),
    0 1px 0 rgba(215, 230, 236, 0.04);
}

.pregame-shell .command {
  padding-left: 14px;
  padding-right: 14px;
}

.pregame-shell .primary {
  padding-left: 24px;
  padding-right: 24px;
}

.pregame-shell .command:hover,
.pregame-shell .secondary:hover {
  border-color: rgba(111, 152, 166, 0.86);
  background:
    linear-gradient(180deg, rgba(9, 48, 70, 0.72), rgba(2, 14, 28, 0.9)),
    rgba(4, 24, 43, 0.94);
}

.pregame-shell .command.selected,
.pregame-actions .primary {
  border-color: rgba(61, 221, 221, 0.92);
  background:
    linear-gradient(180deg, rgba(13, 81, 88, 0.86), rgba(2, 26, 35, 0.96)),
    rgba(4, 26, 42, 0.96);
  color: var(--console-active);
  box-shadow:
    0 0 22px rgba(61, 221, 221, 0.2),
    inset 0 0 24px rgba(61, 221, 221, 0.24),
    inset 0 1px 0 rgba(215, 230, 236, 0.12);
  animation: pregame-console-pulse 4s ease-in-out infinite;
}

@keyframes pregame-console-pulse {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(61, 221, 221, 0.1),
      inset 0 0 14px rgba(61, 221, 221, 0.14),
      inset 0 1px 0 rgba(200, 216, 224, 0.08);
  }

  50% {
    box-shadow:
      0 0 22px rgba(61, 221, 221, 0.18),
      inset 0 0 22px rgba(61, 221, 221, 0.24),
      inset 0 1px 0 rgba(200, 216, 224, 0.1);
  }
}

body.pregame .hud,
body.pregame .bottom-strip,
body.pregame .dg.ac {
  opacity: 0;
  pointer-events: none;
}

.panel::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.025);
}

.attack-panel {
  grid-column: 1;
}

.mode-panel {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 7;
  width: min(340px, calc(100vw - 36px));
  background: rgba(8, 35, 68, 0.96);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  visibility: hidden;
}

.mode-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.fleet-panel,
.log-panel {
  grid-column: 3;
}

.fleet-panel {
  grid-row: 1;
}

.log-panel {
  grid-row: 2;
  align-self: end;
  max-height: min(42vh, 360px);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #eefffb;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-heading strong {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
}

.panel-toggle {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(118, 198, 255, 0.3);
  background: rgba(7, 31, 61, 0.68);
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  line-height: 1;
}

.panel-toggle:hover {
  border-color: rgba(182, 229, 255, 0.72);
  background: rgba(40, 116, 184, 0.48);
}

.panel.collapsed {
  padding-bottom: 10px;
}

.panel.collapsed .panel-heading {
  margin-bottom: 0;
}

.panel.collapsed > :not(.panel-heading) {
  display: none;
}

.dg.ac {
  top: 92px !important;
  right: 18px !important;
  z-index: 6 !important;
}

.dg.main {
  border: 1px solid rgba(118, 198, 255, 0.28);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 60px var(--shadow);
}

.dg.main,
.dg.main .close-button {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif !important;
}

.dg.main .close-button {
  background: rgba(8, 35, 68, 0.94) !important;
  color: #c8efff !important;
  border-top: 1px solid rgba(118, 198, 255, 0.24);
}

.mode-grid,
.option-grid,
.button-row {
  display: grid;
  gap: 8px;
}

.mode-grid {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.mode-settings-section {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(118, 198, 255, 0.18);
}

.mode-settings-section:first-of-type {
  margin-top: 0;
}

.mode-section-label {
  color: #5a8090;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.option-block {
  display: grid;
  gap: 7px;
  margin-top: 0;
}

.option-block > span {
  color: #9bdfff;
  font-size: 0.68rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.option-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.button-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.lan-card {
  display: grid;
  gap: 9px;
  margin-top: 0;
  border: 1px solid rgba(118, 198, 255, 0.22);
  background: rgba(3, 18, 38, 0.46);
  padding: 10px;
  border-radius: 8px;
}

.lan-copy {
  display: grid;
  gap: 3px;
}

.lan-copy span,
.room-code {
  color: #9bdfff;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lan-copy strong {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
}

.lan-join {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

.room-code {
  display: grid;
  min-height: 30px;
  place-items: center;
  border: 1px dashed rgba(118, 198, 255, 0.28);
  background: rgba(5, 25, 51, 0.54);
  letter-spacing: 0.12em;
}

.command,
.chip,
.secondary,
.primary {
  min-height: 38px;
  border: 1px solid rgba(118, 198, 255, 0.28);
  background: rgba(7, 31, 61, 0.7);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  border-radius: 8px;
}

.secondary {
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.secondary:hover {
  border-color: rgba(182, 229, 255, 0.72);
  background: rgba(40, 116, 184, 0.48);
}

.secondary:disabled {
  cursor: not-allowed;
  filter: saturate(0.55);
  opacity: 0.62;
}

.command:disabled {
  cursor: not-allowed;
  filter: saturate(0.45);
  opacity: 0.44;
}

.primary {
  width: 100%;
  margin-top: 11px;
  border-color: rgba(157, 224, 255, 0.78);
  background: linear-gradient(180deg, rgba(115, 207, 255, 0.96), rgba(38, 126, 216, 0.96));
  color: #041830;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 8px;
}

.primary:hover {
  transform: translateY(-1px);
}

.primary.fire {
  border-color: rgba(255, 221, 140, 0.86);
  background: linear-gradient(180deg, rgba(255, 220, 106, 0.98), rgba(255, 139, 86, 0.96));
}

.primary:disabled {
  cursor: not-allowed;
  filter: saturate(0.55);
  opacity: 0.62;
  transform: none;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(118, 198, 255, 0.28);
  background: rgba(5, 25, 51, 0.86);
  color: var(--text);
  padding: 0 9px;
  outline: 0;
}

input:focus,
select:focus {
  border-color: rgba(182, 229, 255, 0.78);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--green);
}

.fleet-list,
.fleet-status,
.bearing-log {
  display: grid;
  gap: 8px;
}

.fleet-status {
  max-height: min(62vh, 560px);
  overflow: auto;
  padding-right: 2px;
}

.ship-health-section {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(118, 198, 255, 0.18);
  background: rgba(4, 22, 48, 0.45);
  padding: 9px;
  border-radius: 8px;
}

.ship-health-section.player {
  border-color: rgba(82, 188, 255, 0.36);
  background: linear-gradient(180deg, rgba(18, 74, 124, 0.44), rgba(4, 22, 48, 0.5));
}

.ship-health-section.enemy {
  border-color: rgba(255, 102, 118, 0.36);
  background: linear-gradient(180deg, rgba(106, 28, 42, 0.38), rgba(31, 8, 22, 0.45));
}

.ship-health-section.enemy.team-green {
  border-color: rgba(83, 229, 143, 0.4);
  background: linear-gradient(180deg, rgba(24, 94, 64, 0.34), rgba(4, 28, 30, 0.45));
}

.ship-health-section.enemy.team-red {
  border-color: rgba(255, 94, 104, 0.42);
  background: linear-gradient(180deg, rgba(110, 25, 36, 0.4), rgba(31, 8, 22, 0.45));
}

.ship-health-section.enemy.team-gold {
  border-color: rgba(255, 205, 84, 0.42);
  background: linear-gradient(180deg, rgba(119, 81, 21, 0.38), rgba(38, 26, 8, 0.45));
}

.ship-health-heading,
.ship-health-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ship-health-heading {
  color: #eefffb;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ship-health-heading strong,
.ship-health-label em {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  white-space: nowrap;
}

.ship-health-section.player .ship-health-heading strong {
  color: #7bd7ff;
}

.ship-health-section.enemy .ship-health-heading strong {
  color: #ff8690;
}

.ship-health-section.enemy.team-green .ship-health-heading strong {
  color: #70ec9d;
}

.ship-health-section.enemy.team-gold .ship-health-heading strong {
  color: #ffd869;
}

.ship-health-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(118, 198, 255, 0.16);
  background: rgba(1, 12, 28, 0.32);
  border-radius: 8px;
}

.ship-health-item.selected {
  border-color: rgba(255, 221, 140, 0.82);
  box-shadow: inset 0 0 18px rgba(255, 215, 106, 0.1);
}

.ship-health-label span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-health-item.sunk .ship-health-label span {
  color: #ffb8bd;
}

.ship-health-meter {
  --damage: 0%;
  --ship-icon: none;
  position: relative;
  height: 30px;
  overflow: hidden;
}

.ship-meter-base,
.ship-meter-damage,
.ship-meter-line {
  position: absolute;
  inset: 0;
  display: block;
  background: currentColor;
  mask-image: var(--ship-icon);
  mask-position: left center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-image: var(--ship-icon);
  -webkit-mask-position: left center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.ship-health-item.player .ship-meter-base {
  color: rgba(91, 194, 255, 0.34);
}

.ship-health-item.enemy .ship-meter-base {
  color: rgba(255, 98, 112, 0.22);
}

.ship-meter-damage {
  clip-path: inset(0 calc(100% - var(--damage)) 0 0);
  color: rgba(255, 52, 68, 0.82);
}

.ship-meter-line {
  color: rgba(230, 252, 255, 0.18);
  filter:
    drop-shadow(0 0 2px rgba(173, 235, 255, 0.3))
    drop-shadow(0 0 5px rgba(14, 125, 180, 0.2));
}

.ship-health-item.enemy .ship-meter-line {
  color: rgba(255, 210, 215, 0.2);
  filter:
    drop-shadow(0 0 2px rgba(255, 112, 126, 0.28))
    drop-shadow(0 0 5px rgba(120, 20, 34, 0.22));
}

.ship-health-item.enemy.hidden-contact {
  border-color: rgba(255, 86, 98, 0.22);
  background: linear-gradient(180deg, rgba(54, 10, 22, 0.42), rgba(14, 4, 13, 0.5));
}

.ship-health-item.enemy.hidden-contact .ship-health-label span {
  color: #ffb7be;
}

.ship-health-item.enemy.hidden-contact .ship-health-label em {
  color: rgba(255, 170, 180, 0.72);
}

.enemy-contact-blocks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  height: 24px;
}

.enemy-contact-blocks span {
  display: block;
  border: 1px solid rgba(255, 102, 118, 0.34);
  background: linear-gradient(180deg, rgba(112, 20, 34, 0.42), rgba(38, 6, 15, 0.66));
  border-radius: 4px;
  box-shadow: inset 0 0 10px rgba(255, 64, 78, 0.08);
}

.ship-health-item.enemy.revealed {
  border-color: rgba(126, 18, 34, 0.72);
  background: linear-gradient(180deg, rgba(72, 10, 22, 0.62), rgba(20, 3, 10, 0.62));
  box-shadow: inset 0 0 18px rgba(100, 10, 24, 0.18);
}

.ship-health-item.enemy.revealed .ship-health-label span {
  color: #ff9aa7;
}

.ship-health-item.enemy.revealed .ship-health-label em {
  color: rgba(255, 124, 136, 0.86);
}

.ship-health-item.enemy.revealed .ship-meter-base {
  color: rgba(73, 9, 22, 0.72);
}

.ship-health-item.enemy.revealed .ship-meter-damage {
  color: rgba(105, 10, 27, 0.94);
}

.ship-health-item.enemy.revealed .ship-meter-line {
  color: rgba(188, 48, 64, 0.44);
  filter:
    drop-shadow(0 0 2px rgba(255, 84, 98, 0.24))
    drop-shadow(0 0 7px rgba(92, 8, 24, 0.28));
}

.order-banner {
  display: grid;
  gap: 5px;
  margin-top: 4px;
  border: 1px solid rgba(255, 221, 140, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 215, 106, 0.2), rgba(38, 126, 216, 0.36)),
    rgba(6, 31, 63, 0.84);
  padding: 12px;
  border-radius: 8px;
}

.order-banner span,
.order-banner small {
  color: #bfe5ff;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.order-banner strong {
  color: #fff6cf;
  font-size: 1rem;
  line-height: 1.05;
}

.order-banner.aim-target {
  border-color: rgba(118, 198, 255, 0.46);
}

.order-banner.choose-z {
  border-color: rgba(255, 255, 255, 0.42);
}

.order-banner.target-locked {
  border-color: rgba(255, 221, 140, 0.82);
  box-shadow: inset 0 0 18px rgba(255, 215, 106, 0.1);
}

.back-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.back-controls button {
  min-height: 34px;
  min-width: 0;
  border: 1px solid rgba(118, 198, 255, 0.24);
  background: rgba(8, 38, 78, 0.72);
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.back-controls button:hover:not(:disabled) {
  border-color: rgba(255, 221, 140, 0.7);
  background: rgba(64, 118, 180, 0.58);
}

.back-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.fleet-list {
  max-height: 172px;
  overflow: auto;
  padding-right: 2px;
}

.fleet-item,
.status-item,
.bearing-item {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(118, 198, 255, 0.2);
  background: rgba(5, 27, 57, 0.52);
  padding: 9px;
  color: var(--text);
  text-align: left;
  border-radius: 8px;
}

.bearing-item.enemy {
  border-color: rgba(255, 102, 118, 0.34);
  background: linear-gradient(90deg, rgba(95, 18, 34, 0.58), rgba(5, 27, 57, 0.48));
}

.bearing-item.friendly {
  border-color: rgba(82, 188, 255, 0.36);
  background: linear-gradient(90deg, rgba(16, 83, 132, 0.58), rgba(5, 27, 57, 0.48));
}

.bearing-item.enemy .bearing-title,
.bearing-item.enemy em {
  color: #ff9aa7;
}

.bearing-item.friendly .bearing-title,
.bearing-item.friendly em {
  color: #7bd7ff;
}

.bearing-title {
  color: var(--text);
}

.fleet-item {
  cursor: pointer;
}

button.status-item {
  width: 100%;
  cursor: pointer;
}

button.status-item:hover,
.status-item.selected {
  border-color: rgba(255, 221, 140, 0.82);
  background: rgba(64, 118, 180, 0.58);
}

.status-item.selected strong {
  color: var(--amber);
}

.fleet-item.selected {
  border-color: rgba(182, 229, 255, 0.64);
  background: rgba(47, 119, 188, 0.42);
}

.fleet-item.placed {
  color: var(--muted);
}

.fleet-item strong,
.status-item strong,
.bearing-item strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
}

.fleet-item span,
.status-item span,
.bearing-item span {
  color: var(--muted);
  font-size: 0.72rem;
}

.health-row {
  display: flex;
  gap: 4px;
}

.health-dot {
  width: 100%;
  height: 5px;
  background: rgba(118, 198, 255, 0.22);
}

.health-dot.live {
  background: var(--green);
}

.health-dot.hurt {
  background: var(--amber);
}

.health-dot.dead {
  background: var(--red);
}

.bearing-log {
  max-height: 292px;
  overflow: auto;
}

.hidden {
  display: none !important;
}

.bottom-strip {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  color: #d8fff4;
  font-size: 0.82rem;
}

.meter {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(118, 198, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
}

.meter span {
  display: block;
  height: 100%;
  width: 44%;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
  transition: width 240ms ease;
}

.pass-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(12, 46, 58, 0.36), transparent 34%),
    linear-gradient(180deg, rgba(0, 8, 12, 0.985), rgba(0, 4, 9, 0.992));
  backdrop-filter: blur(14px);
}

.pass-box {
  width: min(390px, calc(100vw - 34px));
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.end-screen {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: grid;
  place-items: center;
  padding: 86px 18px 62px;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(92, 204, 221, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(0, 8, 18, 0.34), rgba(0, 4, 10, 0.78));
  backdrop-filter: blur(8px);
}

.end-shell {
  width: min(900px, calc(100vw - 36px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(12, 58, 96, 0.92), rgba(3, 18, 38, 0.94)),
    rgba(8, 35, 68, 0.92);
}

.end-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.end-hero p,
.end-highlights span,
.end-card-heading span,
.end-stat span {
  margin: 0;
  color: #9bdfff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.end-hero h2 {
  margin: 3px 0;
  color: #f0fbff;
  font-size: 1.62rem;
  line-height: 1.05;
}

.end-hero small {
  color: var(--muted);
  font-size: 0.78rem;
}

.end-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.end-highlights div,
.end-player-card {
  border: 1px solid rgba(118, 198, 255, 0.22);
  background: rgba(2, 17, 36, 0.55);
  border-radius: 8px;
}

.end-highlights div {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.end-highlights strong {
  color: #f0fbff;
  font-size: 1.05rem;
}

.end-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.end-player-card {
  display: grid;
  gap: 10px;
  padding: 11px;
}

.end-player-card.winner {
  border-color: rgba(255, 221, 140, 0.62);
  box-shadow: inset 0 0 22px rgba(255, 215, 106, 0.08);
}

.end-player-card.team-green {
  background: linear-gradient(180deg, rgba(16, 82, 62, 0.5), rgba(2, 17, 36, 0.58));
}

.end-player-card.team-red {
  background: linear-gradient(180deg, rgba(92, 22, 38, 0.5), rgba(2, 17, 36, 0.58));
}

.end-player-card.team-gold {
  background: linear-gradient(180deg, rgba(98, 70, 20, 0.42), rgba(2, 17, 36, 0.58));
}

.end-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.end-card-heading strong {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.end-player-card.winner .end-card-heading strong {
  color: var(--amber);
}

.end-ship-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.end-ship-strip span {
  height: 8px;
  border: 1px solid rgba(118, 198, 255, 0.22);
  background: rgba(92, 204, 221, 0.28);
}

.end-ship-strip span.sunk {
  border-color: rgba(255, 101, 110, 0.48);
  background: rgba(131, 22, 32, 0.72);
}

.end-stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.end-stat {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.end-stat strong {
  color: #f0fbff;
  font-size: 0.88rem;
}

.end-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 10px;
  margin-top: 13px;
}

.end-actions .secondary,
.end-actions .primary {
  min-height: 42px;
  margin-top: 0;
}

/* In-game command-console skin: mirrors the main menu's slate, cyan frame, and red active language. */
.topbar,
.hud,
.bottom-strip,
.pass-screen,
.end-screen,
.pregame-screen {
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.brand,
.phase-tabs,
.panel,
.bottom-strip,
.pass-box,
.pregame-shell,
.end-shell,
.menu-settings-card {
  position: relative;
  border: 1px solid rgba(90, 128, 144, 0.54);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(5, 28, 49, 0.9), rgba(0, 7, 18, 0.94)),
    rgba(2, 9, 21, 0.88);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(0, 3, 8, 0.9),
    inset 0 0 0 1px rgba(200, 216, 224, 0.14),
    inset 0 20px 36px rgba(61, 221, 221, 0.035),
    inset 0 -22px 44px rgba(0, 0, 0, 0.38);
  color: var(--console-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand::before,
.phase-tabs::before,
.panel::before,
.bottom-strip::before,
.pass-box::before,
.end-shell::before,
.menu-settings-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      180deg,
      rgba(200, 216, 224, 0.035) 0,
      rgba(200, 216, 224, 0.035) 1px,
      transparent 1px,
      transparent 5px
    ),
    radial-gradient(circle at 10px 10px, rgba(133, 168, 178, 0.58) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 10px) 10px, rgba(133, 168, 178, 0.58) 0 2px, transparent 2.5px),
    radial-gradient(circle at 10px calc(100% - 10px), rgba(133, 168, 178, 0.5) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), rgba(133, 168, 178, 0.5) 0 2px, transparent 2.5px);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.brand > *,
.phase-tabs > *,
.panel > *,
.bottom-strip > *,
.pass-box > *,
.end-shell > *,
.menu-settings-card > * {
  position: relative;
  z-index: 1;
}

.brand {
  min-width: 292px;
  padding: 10px 14px;
}

.brand p,
.pass-box p,
.end-hero small,
.fleet-item span,
.status-item span,
.bearing-item span,
.ship-health-heading strong,
.ship-health-label em,
.pregame-note,
.pregame-statusbar,
.menu-volume-row {
  color: var(--console-muted);
  letter-spacing: 0.09em;
}

.brand-logo {
  width: 150px;
  margin: -19px 0 -22px;
  filter:
    drop-shadow(0 0 8px rgba(93, 204, 221, 0.15))
    saturate(0.92)
    brightness(0.88);
}

.brand-mark,
.scope {
  border-color: rgba(61, 221, 221, 0.76);
  border-radius: 50%;
  box-shadow:
    0 0 16px rgba(61, 221, 221, 0.14),
    inset 0 0 12px rgba(61, 221, 221, 0.08);
}

.phase-tabs {
  padding: 7px;
  gap: 7px;
}

.icon-button,
.panel-toggle {
  border-color: rgba(61, 221, 221, 0.34);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(8, 36, 55, 0.82), rgba(0, 7, 16, 0.9));
  box-shadow:
    inset 0 0 14px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(200, 216, 224, 0.08);
}

.icon-button:hover,
.icon-button.active,
.panel-toggle:hover {
  border-color: rgba(61, 221, 221, 0.88);
  background:
    linear-gradient(180deg, rgba(12, 73, 84, 0.82), rgba(1, 22, 32, 0.96));
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.18),
    inset 0 0 18px rgba(61, 221, 221, 0.16);
}

.icon-button.active {
  color: #efffff;
}

.panel {
  padding: 13px;
}

.panel::after {
  border-color: rgba(61, 221, 221, 0.08);
}

.mode-panel {
  background:
    linear-gradient(180deg, rgba(5, 28, 49, 0.96), rgba(0, 7, 18, 0.98)),
    rgba(2, 9, 21, 0.96);
}

.panel-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(90, 128, 144, 0.24);
  color: #efffff;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.panel-heading span,
.option-block > span,
.field > span,
.lan-copy span,
.room-code,
.end-hero p,
.end-highlights span,
.end-card-heading span,
.end-stat span,
.ship-health-heading,
.pregame-title p,
.pregame-card span {
  color: var(--console-muted);
  font-weight: 400;
  letter-spacing: 0.2em;
}

.panel-heading strong {
  color: var(--console-cyan);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.command,
.chip,
.secondary,
.primary,
.back-controls button,
input,
select,
.pregame-card,
.ship-health-section,
.ship-health-item,
.fleet-item,
.status-item,
.bearing-item,
.end-highlights div,
.end-player-card,
.lan-card,
.pregame-lan,
.room-code,
.menu-settings-close {
  border-radius: 0;
}

.command,
.chip,
.secondary,
.back-controls button,
input,
select,
.room-code,
.menu-settings-close {
  border-color: rgba(90, 128, 144, 0.5);
  background:
    linear-gradient(180deg, rgba(7, 32, 52, 0.82), rgba(1, 7, 17, 0.92)),
    rgba(3, 18, 35, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(215, 230, 236, 0.05),
    inset 0 0 14px rgba(0, 0, 0, 0.58);
}

.command:hover,
.command.selected,
.chip:hover,
.chip.selected,
.secondary:hover,
.back-controls button:hover:not(:disabled),
input:focus,
select:focus {
  border-color: rgba(61, 221, 221, 0.84);
  background:
    linear-gradient(180deg, rgba(12, 73, 84, 0.78), rgba(1, 22, 32, 0.94));
  box-shadow:
    0 0 17px rgba(61, 221, 221, 0.14),
    inset 0 0 18px rgba(61, 221, 221, 0.16);
}

.command.selected,
.chip.selected {
  border-color: rgba(255, 77, 93, 0.86);
  color: #efffff;
  background:
    linear-gradient(180deg, rgba(58, 15, 24, 0.82), rgba(9, 10, 18, 0.94)),
    rgba(255, 77, 93, 0.08);
  box-shadow:
    0 0 18px rgba(255, 77, 93, 0.16),
    inset 0 0 18px rgba(255, 77, 93, 0.16);
  animation: sonar-menu-active-pulse 4s ease-in-out infinite;
}

.primary {
  border-color: rgba(61, 221, 221, 0.9);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(13, 81, 88, 0.86), rgba(2, 26, 35, 0.96)),
    rgba(4, 26, 42, 0.96);
  color: #efffff;
  box-shadow:
    0 0 20px rgba(61, 221, 221, 0.18),
    inset 0 0 22px rgba(61, 221, 221, 0.22),
    inset 0 1px 0 rgba(215, 230, 236, 0.12);
  letter-spacing: 0.12em;
}

.primary.fire,
.primary.fire:hover {
  border-color: rgba(255, 77, 93, 0.88);
  background:
    linear-gradient(180deg, rgba(58, 15, 24, 0.88), rgba(9, 10, 18, 0.96)),
    rgba(255, 77, 93, 0.08);
  color: #fff4f6;
  box-shadow:
    0 0 22px rgba(255, 77, 93, 0.2),
    inset 0 0 18px rgba(255, 77, 93, 0.18),
    inset 0 0 1px rgba(255, 225, 230, 0.8);
  animation: sonar-menu-active-pulse 4s ease-in-out infinite;
}

.order-banner {
  border-color: rgba(61, 221, 221, 0.36);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(6, 34, 51, 0.8), rgba(1, 9, 18, 0.92)),
    rgba(2, 13, 25, 0.84);
  box-shadow:
    inset 0 0 18px rgba(61, 221, 221, 0.08),
    inset 0 1px 0 rgba(200, 216, 224, 0.08);
}

.order-banner span,
.order-banner small {
  color: var(--console-muted);
  letter-spacing: 0.12em;
}

.order-banner strong {
  color: #efffff;
  letter-spacing: 0.02em;
}

.order-banner.choose-z {
  border-color: rgba(61, 221, 221, 0.78);
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.12),
    inset 0 0 20px rgba(61, 221, 221, 0.13);
}

.order-banner.target-locked {
  border-color: rgba(255, 77, 93, 0.86);
  box-shadow:
    0 0 20px rgba(255, 77, 93, 0.18),
    inset 0 0 18px rgba(255, 77, 93, 0.16);
}

.ship-health-section,
.fleet-item,
.status-item,
.bearing-item,
.end-highlights div,
.end-player-card,
.lan-card,
.pregame-lan {
  background:
    linear-gradient(180deg, rgba(4, 25, 42, 0.72), rgba(1, 8, 18, 0.82)),
    rgba(1, 11, 24, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(200, 216, 224, 0.05),
    inset 0 0 16px rgba(0, 0, 0, 0.45);
}

.ship-health-section.player {
  border-color: rgba(61, 221, 221, 0.46);
  background:
    linear-gradient(180deg, rgba(7, 50, 70, 0.64), rgba(1, 10, 22, 0.82));
}

.ship-health-section.enemy,
.bearing-item.enemy {
  border-color: rgba(255, 77, 93, 0.42);
  background:
    linear-gradient(180deg, rgba(64, 12, 25, 0.62), rgba(11, 4, 12, 0.82));
}

.ship-health-item {
  border-color: rgba(90, 128, 144, 0.3);
  background:
    linear-gradient(180deg, rgba(2, 20, 34, 0.72), rgba(0, 7, 16, 0.84));
}

.ship-health-item.selected,
button.status-item:hover,
.status-item.selected {
  border-color: rgba(255, 77, 93, 0.82);
  box-shadow:
    0 0 18px rgba(255, 77, 93, 0.14),
    inset 0 0 18px rgba(255, 77, 93, 0.14);
}

.ship-health-label span,
.fleet-item strong,
.status-item strong,
.bearing-item strong,
.end-highlights strong,
.end-stat strong,
.end-hero h2,
.pregame-title h2,
.pregame-card strong {
  color: #efffff;
  font-weight: 700;
}

.ship-health-item.enemy.hidden-contact {
  border-color: rgba(255, 77, 93, 0.3);
  background:
    linear-gradient(180deg, rgba(44, 8, 19, 0.6), rgba(8, 3, 10, 0.82));
}

.pregame-card.selected,
.pregame-shell .command.selected,
.pregame-actions .primary {
  border-color: rgba(255, 77, 93, 0.86);
  background:
    linear-gradient(180deg, rgba(58, 15, 24, 0.82), rgba(9, 10, 18, 0.94)),
    rgba(255, 77, 93, 0.08);
  color: #efffff;
  box-shadow:
    0 0 20px rgba(255, 77, 93, 0.18),
    inset 0 0 20px rgba(255, 77, 93, 0.16),
    inset 0 1px 0 rgba(255, 225, 230, 0.08);
  animation: sonar-menu-active-pulse 4s ease-in-out infinite;
}

.enemy-contact-blocks span {
  border-color: rgba(255, 77, 93, 0.34);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(96, 16, 31, 0.5), rgba(28, 5, 13, 0.78));
}

.bearing-item.friendly {
  border-color: rgba(61, 221, 221, 0.42);
  background:
    linear-gradient(180deg, rgba(7, 56, 76, 0.6), rgba(1, 10, 22, 0.78));
}

.bottom-strip {
  grid-template-columns: minmax(0, 1fr) 174px;
  min-height: 38px;
  color: var(--console-text);
}

.meter {
  border-color: rgba(90, 128, 144, 0.42);
  background: rgba(0, 3, 8, 0.68);
}

.meter span {
  background: linear-gradient(90deg, var(--console-cyan), #f7d96b, var(--console-red));
}

.pass-screen,
.end-screen,
.pregame-screen {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(61, 221, 221, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(0, 8, 18, 0.46), rgba(0, 4, 10, 0.86));
}

.pass-box,
.end-shell,
.pregame-shell {
  border-radius: 0;
}

.end-player-card.winner {
  border-color: rgba(255, 77, 93, 0.78);
  box-shadow:
    0 0 20px rgba(255, 77, 93, 0.14),
    inset 0 0 22px rgba(255, 77, 93, 0.14);
}

.menu-settings-modal {
  background: rgba(0, 5, 9, 0.68);
}

.turn-callout {
  position: fixed;
  top: clamp(104px, 15dvh, 162px);
  left: 50%;
  z-index: 8;
  display: grid;
  gap: 6px;
  width: min(430px, calc(100vw - 48px));
  padding: 14px 18px 15px;
  border: 1px solid rgba(255, 77, 93, 0.82);
  background:
    linear-gradient(180deg, rgba(42, 8, 17, 0.78), rgba(3, 4, 8, 0.94)),
    rgba(0, 4, 8, 0.86);
  box-shadow:
    0 0 18px rgba(255, 77, 93, 0.18),
    0 22px 64px rgba(0, 0, 0, 0.46),
    inset 0 0 18px rgba(255, 77, 93, 0.12),
    inset 0 0 0 1px rgba(255, 225, 230, 0.08);
  color: var(--console-text);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  animation: turn-callout-in 180ms ease-out, turn-callout-pulse 4s ease-in-out infinite;
}

.turn-callout.hidden {
  display: none;
}

.turn-callout::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(200, 216, 224, 0.035) 0,
    rgba(200, 216, 224, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
}

.turn-callout > * {
  position: relative;
  z-index: 1;
}

.turn-callout span {
  color: var(--console-muted);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
}

.turn-callout strong {
  color: #efffff;
  font-size: clamp(1.08rem, 2.1vw, 1.42rem);
  line-height: 1;
}

.turn-callout small {
  color: #8fb8c4;
  font-size: 0.72rem;
  line-height: 1.35;
  letter-spacing: 0.06em;
}

body.main-menu-active .turn-callout,
body.pregame .turn-callout {
  display: none;
}

@keyframes turn-callout-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes turn-callout-pulse {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(255, 77, 93, 0.14),
      0 22px 64px rgba(0, 0, 0, 0.46),
      inset 0 0 15px rgba(255, 77, 93, 0.1),
      inset 0 0 0 1px rgba(255, 225, 230, 0.06);
  }

  50% {
    box-shadow:
      0 0 23px rgba(255, 77, 93, 0.24),
      0 22px 64px rgba(0, 0, 0, 0.46),
      inset 0 0 22px rgba(255, 77, 93, 0.17),
      inset 0 0 0 1px rgba(255, 225, 230, 0.1);
  }
}

/* Dark console tuning: use the engagement setup slate as the model for every interface surface. */
.sonar-menu-panel::before {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(18, 48, 55, 0.08), transparent 46%),
    linear-gradient(180deg, rgba(0, 5, 9, 0.82), rgba(0, 3, 7, 0.9) 58%, rgba(0, 2, 5, 0.94));
}

.sonar-menu-frame {
  filter: brightness(0.58) contrast(1.22) saturate(0.9);
}

.sonar-menu-item,
.sonar-select-card,
.sonar-mini-select,
.sonar-menu-back,
.sonar-menu-launch,
.sonar-engagement-field select,
.sonar-engagement-lan input {
  border-color: rgba(61, 221, 221, 0.24);
  background:
    linear-gradient(180deg, rgba(1, 19, 26, 0.72), rgba(0, 4, 8, 0.9)),
    rgba(0, 4, 8, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(200, 216, 224, 0.035),
    inset 0 0 16px rgba(0, 0, 0, 0.68);
}

.sonar-menu-item:hover,
.sonar-menu-item:focus-visible,
.sonar-select-card:hover,
.sonar-mini-select:hover,
.sonar-menu-back:hover,
.sonar-menu-launch:hover {
  border-color: rgba(61, 221, 221, 0.56);
  background:
    linear-gradient(180deg, rgba(2, 30, 38, 0.72), rgba(0, 6, 10, 0.92)),
    rgba(0, 5, 9, 0.8);
  box-shadow:
    0 0 12px rgba(61, 221, 221, 0.09),
    inset 0 0 18px rgba(61, 221, 221, 0.08);
}

.sonar-menu-item.active,
.sonar-select-card.selected,
.sonar-mini-select.selected,
.sonar-menu-launch {
  border-color: rgba(255, 77, 93, 0.84);
  background:
    linear-gradient(180deg, rgba(42, 8, 17, 0.76), rgba(3, 4, 8, 0.94)),
    rgba(255, 77, 93, 0.045);
  box-shadow:
    0 0 16px rgba(255, 77, 93, 0.18),
    inset 0 0 18px rgba(255, 77, 93, 0.13),
    inset 0 0 1px rgba(255, 225, 230, 0.54);
}

.sonar-engagement-lan,
.menu-toast {
  border-color: rgba(61, 221, 221, 0.18);
  background: rgba(0, 5, 9, 0.84);
}

.brand,
.phase-tabs,
.panel,
.bottom-strip,
.pass-box,
.pregame-shell,
.end-shell,
.menu-settings-card {
  border-color: rgba(61, 221, 221, 0.24);
  background:
    linear-gradient(180deg, rgba(1, 17, 29, 0.86), rgba(0, 4, 10, 0.94)),
    rgba(0, 4, 8, 0.86);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(0, 2, 5, 0.94),
    inset 0 0 0 1px rgba(200, 216, 224, 0.08),
    inset 0 18px 34px rgba(61, 221, 221, 0.02),
    inset 0 -24px 48px rgba(0, 0, 0, 0.5);
}

.brand::before,
.phase-tabs::before,
.panel::before,
.bottom-strip::before,
.pass-box::before,
.end-shell::before,
.menu-settings-card::before {
  opacity: 0.68;
}

.brand-logo {
  filter:
    drop-shadow(0 0 6px rgba(93, 204, 221, 0.09))
    saturate(0.84)
    brightness(0.74);
}

.icon-button,
.panel-toggle,
.command,
.chip,
.secondary,
.back-controls button,
input,
select,
.room-code,
.menu-settings-close {
  border-color: rgba(61, 221, 221, 0.2);
  background:
    linear-gradient(180deg, rgba(1, 19, 29, 0.74), rgba(0, 4, 9, 0.9)),
    rgba(0, 5, 10, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(215, 230, 236, 0.035),
    inset 0 0 15px rgba(0, 0, 0, 0.7);
}

.icon-button:hover,
.icon-button.active,
.panel-toggle:hover,
.command:hover,
.chip:hover,
.secondary:hover,
.back-controls button:hover:not(:disabled),
input:focus,
select:focus {
  border-color: rgba(61, 221, 221, 0.55);
  background:
    linear-gradient(180deg, rgba(2, 31, 39, 0.78), rgba(0, 6, 10, 0.94)),
    rgba(0, 6, 10, 0.84);
  box-shadow:
    0 0 12px rgba(61, 221, 221, 0.08),
    inset 0 0 17px rgba(61, 221, 221, 0.08);
}

.command.selected,
.chip.selected,
.pregame-card.selected,
.pregame-shell .command.selected,
.pregame-actions .primary,
.primary.fire,
.primary.fire:hover {
  border-color: rgba(255, 77, 93, 0.84);
  background:
    linear-gradient(180deg, rgba(42, 8, 17, 0.78), rgba(3, 4, 8, 0.95)),
    rgba(255, 77, 93, 0.045);
  box-shadow:
    0 0 16px rgba(255, 77, 93, 0.16),
    inset 0 0 18px rgba(255, 77, 93, 0.12),
    inset 0 1px 0 rgba(255, 225, 230, 0.045);
}

.primary {
  border-color: rgba(61, 221, 221, 0.58);
  background:
    linear-gradient(180deg, rgba(2, 42, 49, 0.78), rgba(0, 8, 12, 0.95)),
    rgba(0, 8, 12, 0.88);
  box-shadow:
    0 0 14px rgba(61, 221, 221, 0.1),
    inset 0 0 18px rgba(61, 221, 221, 0.1),
    inset 0 1px 0 rgba(215, 230, 236, 0.06);
}

.order-banner,
.ship-health-section,
.ship-health-item,
.fleet-item,
.status-item,
.bearing-item,
.end-highlights div,
.end-player-card,
.lan-card,
.pregame-lan {
  background:
    linear-gradient(180deg, rgba(1, 17, 29, 0.72), rgba(0, 4, 10, 0.88)),
    rgba(0, 5, 10, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(200, 216, 224, 0.035),
    inset 0 0 18px rgba(0, 0, 0, 0.62);
}

.order-banner {
  border-color: rgba(61, 221, 221, 0.24);
}

.order-banner.choose-z {
  border-color: rgba(61, 221, 221, 0.56);
  box-shadow:
    0 0 12px rgba(61, 221, 221, 0.08),
    inset 0 0 18px rgba(61, 221, 221, 0.08);
}

.order-banner.target-locked,
.ship-health-item.selected,
button.status-item:hover,
.status-item.selected {
  border-color: rgba(255, 77, 93, 0.72);
  box-shadow:
    0 0 14px rgba(255, 77, 93, 0.12),
    inset 0 0 16px rgba(255, 77, 93, 0.1);
}

.ship-health-section.player,
.bearing-item.friendly {
  border-color: rgba(61, 221, 221, 0.32);
  background:
    linear-gradient(180deg, rgba(1, 24, 34, 0.72), rgba(0, 5, 10, 0.88));
}

.ship-health-section.enemy,
.bearing-item.enemy {
  border-color: rgba(255, 77, 93, 0.34);
  background:
    linear-gradient(180deg, rgba(36, 6, 16, 0.7), rgba(4, 2, 7, 0.9));
}

.ship-health-item.enemy.hidden-contact,
.enemy-contact-blocks span {
  background:
    linear-gradient(180deg, rgba(46, 7, 18, 0.58), rgba(8, 2, 8, 0.88));
}

.pass-screen,
.end-screen,
.pregame-screen {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(61, 221, 221, 0.055), transparent 42%),
    linear-gradient(180deg, rgba(0, 6, 13, 0.66), rgba(0, 2, 6, 0.9));
}

.bottom-strip,
.meter {
  background: rgba(0, 3, 7, 0.82);
}

/* Viewport-aware placement: keep selection controls usable in browser windows, not just fullscreen. */
.main-menu {
  align-items: center;
  padding:
    clamp(10px, 2.2dvh, 28px)
    clamp(12px, 4.4vw, 76px);
}

.sonar-menu-panel {
  width: min(
    clamp(560px, 45vw, 780px),
    calc((100dvh - clamp(20px, 4.4dvh, 42px)) * 1123 / 1401),
    calc(100vw - clamp(24px, 8vw, 152px))
  );
  max-height: calc(100dvh - clamp(20px, 4.4dvh, 42px));
}

.sonar-menu-logo {
  top: 1.1%;
  width: clamp(104%, 17.2dvh, 127.5%);
}

.sonar-menu-items {
  top: clamp(40.5%, 43.6dvh, 45.4%);
  gap: clamp(5px, 1.05dvh, 12px);
}

.sonar-menu-item {
  min-height: clamp(46px, 7.1dvh, 70px);
  padding-inline: clamp(13px, 1.3vw, 22px);
  font-size: clamp(0.92rem, 1.9dvh, 1.26rem);
}

.sonar-menu-icon {
  width: clamp(20px, 3dvh, 30px);
  height: clamp(20px, 3dvh, 30px);
}

.sonar-menu-arrow {
  font-size: clamp(1.25rem, 3.2dvh, 1.9rem);
}

.topbar {
  top: clamp(8px, 1.8dvh, 18px);
  left: clamp(8px, 1.4vw, 18px);
  right: clamp(8px, 1.4vw, 18px);
}

.brand {
  min-width: clamp(220px, 18vw, 292px);
  padding: clamp(7px, 1dvh, 10px) clamp(9px, 1vw, 14px);
}

.brand-logo {
  width: clamp(118px, 8.2vw, 150px);
}

.phase-tabs {
  padding: clamp(5px, 0.8dvh, 7px);
}

.icon-button {
  width: clamp(34px, 4.7dvh, 42px);
  height: clamp(34px, 4.7dvh, 42px);
}

.view-button {
  width: auto;
  min-width: clamp(88px, 7.8vw, 132px);
  height: clamp(34px, 4.7dvh, 42px);
  padding-inline: clamp(8px, 0.85vw, 12px);
  font-size: clamp(0.62rem, 1.1dvh, 0.72rem);
}

.hud {
  inset:
    clamp(72px, 10.4dvh, 96px)
    clamp(8px, 1.4vw, 18px)
    clamp(48px, 7.2dvh, 76px);
  grid-template-columns:
    minmax(220px, clamp(230px, 16vw, 300px))
    minmax(0, 1fr)
    minmax(240px, clamp(250px, 16vw, 300px));
  gap: clamp(8px, 1vw, 12px);
}

.panel {
  max-height: 100%;
  overflow: auto;
  padding: clamp(10px, 1.5dvh, 13px);
}

.attack-panel {
  max-height: min(42dvh, 330px);
}

.fleet-panel {
  max-height: min(58dvh, calc(100dvh - 210px));
}

.log-panel {
  max-height: min(28dvh, 260px);
}

.fleet-status {
  max-height: min(48dvh, calc(100dvh - 300px));
}

.bearing-log {
  max-height: min(20dvh, 210px);
}

.mode-panel {
  top: clamp(62px, 8.8dvh, 84px);
  right: clamp(8px, 1.4vw, 18px);
  max-height: calc(100dvh - clamp(78px, 12dvh, 112px));
  overflow: auto;
}

.bottom-strip {
  left: clamp(8px, 1.4vw, 18px);
  right: clamp(8px, 1.4vw, 18px);
  bottom: clamp(8px, 1.6dvh, 18px);
  min-height: clamp(34px, 4.4dvh, 42px);
  padding: clamp(7px, 1dvh, 10px) clamp(9px, 1vw, 12px);
}

.pregame-screen,
.end-screen {
  padding:
    clamp(52px, 8dvh, 86px)
    clamp(10px, 1.6vw, 18px)
    clamp(48px, 7dvh, 72px);
}

.pregame-shell,
.end-shell {
  max-height: calc(100dvh - clamp(96px, 15dvh, 138px));
}

/* Compact squadron console: denser, calmer rows for the right-side status panel. */
.fleet-panel {
  width: min(330px, 100%);
}

.fleet-panel .panel-heading {
  margin-bottom: 8px;
  padding-bottom: 7px;
}

.fleet-panel .panel-heading span {
  letter-spacing: 0.16em;
}

.fleet-status {
  gap: 7px;
  padding-right: 4px;
}

.ship-health-section {
  gap: 5px;
  padding: 7px;
  border-color: rgba(61, 221, 221, 0.18);
  background:
    linear-gradient(180deg, rgba(0, 10, 17, 0.74), rgba(0, 3, 7, 0.9)),
    rgba(0, 4, 8, 0.74);
}

.ship-health-section.player {
  border-color: rgba(61, 221, 221, 0.28);
  background:
    linear-gradient(180deg, rgba(0, 18, 25, 0.72), rgba(0, 4, 8, 0.9));
}

.ship-health-section.enemy {
  border-color: rgba(255, 77, 93, 0.3);
  background:
    linear-gradient(180deg, rgba(27, 4, 13, 0.68), rgba(3, 2, 6, 0.9));
}

.ship-health-heading {
  padding: 0 2px 4px;
  border-bottom: 1px solid rgba(90, 128, 144, 0.16);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
}

.ship-health-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-health-heading strong {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.ship-health-item {
  grid-template-columns: minmax(0, 1fr) minmax(72px, 37%);
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 5px 7px;
  border-color: rgba(90, 128, 144, 0.18);
  background:
    linear-gradient(180deg, rgba(0, 12, 19, 0.6), rgba(0, 3, 7, 0.82));
}

.ship-health-label {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.ship-health-label span {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  line-height: 1.08;
}

.ship-health-label em {
  justify-self: start;
  color: rgba(143, 184, 196, 0.82);
  font-size: 0.56rem;
  letter-spacing: 0.09em;
}

.ship-health-meter {
  height: 22px;
  opacity: 0.84;
}

.ship-meter-line {
  color: rgba(196, 239, 247, 0.12);
  filter: drop-shadow(0 0 3px rgba(61, 221, 221, 0.12));
}

.ship-health-item.player .ship-meter-base {
  color: rgba(91, 194, 255, 0.22);
}

.ship-health-item.enemy .ship-meter-base {
  color: rgba(255, 77, 93, 0.18);
}

.ship-health-item.selected {
  border-color: rgba(255, 77, 93, 0.62);
  background:
    linear-gradient(180deg, rgba(35, 7, 15, 0.62), rgba(0, 4, 8, 0.88));
}

.ship-health-item.enemy.hidden-contact {
  grid-template-columns: minmax(0, 1fr) minmax(70px, 34%);
  border-color: rgba(255, 77, 93, 0.22);
  background:
    linear-gradient(180deg, rgba(30, 5, 14, 0.54), rgba(4, 2, 7, 0.86));
}

.ship-health-item.enemy.hidden-contact .ship-health-label span {
  color: rgba(255, 205, 211, 0.9);
}

.ship-health-item.enemy.hidden-contact .ship-health-label em {
  color: rgba(255, 146, 157, 0.66);
}

.enemy-contact-blocks {
  height: 18px;
  gap: 3px;
}

.enemy-contact-blocks span {
  border-color: rgba(255, 77, 93, 0.28);
  background:
    linear-gradient(180deg, rgba(80, 12, 27, 0.42), rgba(20, 3, 10, 0.72));
}

/* Readability pass for compact command and bearing consoles. */
.attack-panel,
.log-panel {
  width: min(340px, 100%);
}

.attack-panel .panel-heading,
.log-panel .panel-heading {
  margin-bottom: 8px;
  padding-bottom: 7px;
}

.attack-panel .panel-heading span,
.log-panel .panel-heading span {
  color: rgba(150, 190, 202, 0.86);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.attack-panel .panel-heading strong,
.log-panel .panel-heading strong {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.order-banner {
  gap: 6px;
  padding: 10px 12px;
  border-color: rgba(61, 221, 221, 0.22);
  background:
    linear-gradient(180deg, rgba(0, 13, 20, 0.74), rgba(0, 4, 8, 0.9));
}

.order-banner span {
  color: rgba(143, 184, 196, 0.88);
  font-size: 0.6rem;
  letter-spacing: 0.11em;
}

.order-banner strong {
  color: #f2fbff;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.order-banner small {
  max-width: 28ch;
  color: rgba(188, 215, 224, 0.82);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-transform: none;
}

.back-controls {
  gap: 5px;
  margin-top: 8px;
}

.back-controls button {
  min-height: 31px;
  padding: 0 6px;
  color: rgba(200, 232, 240, 0.82);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.attack-panel .primary {
  min-height: 34px;
  margin-top: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

.bearing-log {
  gap: 6px;
}

.bearing-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-color: rgba(61, 221, 221, 0.18);
  background:
    linear-gradient(180deg, rgba(0, 11, 18, 0.68), rgba(0, 4, 8, 0.86));
}

.bearing-item strong {
  display: contents;
}

.bearing-title {
  min-width: 0;
  overflow: hidden;
  color: #f0fbff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bearing-item em {
  justify-self: end;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.bearing-item > span:last-child {
  grid-column: 1 / -1;
  color: rgba(188, 215, 224, 0.78);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-transform: none;
}

.bearing-item.enemy {
  border-color: rgba(255, 77, 93, 0.34);
  background:
    linear-gradient(180deg, rgba(34, 5, 15, 0.62), rgba(4, 2, 7, 0.88));
}

.bearing-item.friendly {
  border-color: rgba(61, 221, 221, 0.28);
  background:
    linear-gradient(180deg, rgba(0, 18, 25, 0.66), rgba(0, 4, 8, 0.86));
}

.bearing-item.enemy .bearing-title,
.bearing-item.enemy em {
  color: rgba(255, 133, 145, 0.95);
}

.bearing-item.friendly .bearing-title,
.bearing-item.friendly em {
  color: rgba(103, 224, 232, 0.95);
}

@media (max-height: 760px) {
  .turn-callout {
    top: 76px;
    width: min(360px, calc(100vw - 32px));
    padding: 10px 14px 11px;
  }

  .turn-callout small {
    display: none;
  }

  .sonar-menu-panel {
    width: min(600px, calc((100dvh - 18px) * 1123 / 1401), calc(100vw - 24px));
  }

  .sonar-menu-logo {
    top: 1.8%;
    width: 106%;
  }

  .sonar-menu-items {
    top: 41.2%;
    gap: 5px;
  }

  .sonar-menu-item {
    min-height: clamp(40px, 7dvh, 52px);
    font-size: clamp(0.78rem, 2dvh, 1rem);
    letter-spacing: 0.11em;
  }

  .hud {
    inset: 62px 8px 46px;
  }

  .brand p {
    display: none;
  }

  .attack-panel {
    max-height: min(46dvh, 300px);
  }
}

@media (max-width: 960px) {
  .main-menu {
    justify-items: center;
    padding: 20px;
  }

  .sonar-menu-panel {
    width: min(720px, 94vw, calc((100dvh - 20px) * 1123 / 1401));
    max-height: calc(100dvh - 20px);
  }

  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .brand {
    min-width: 0;
    max-width: calc(100vw - 170px);
  }

  .hud {
    inset: auto 10px 62px;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    align-items: end;
  }

  .panel {
    max-height: 42vh;
    overflow: auto;
  }

  .attack-panel,
  .fleet-panel,
  .log-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .mode-panel {
    top: 74px;
    right: 10px;
    width: min(340px, calc(100vw - 20px));
    max-height: calc(100vh - 92px);
  }

  .pregame-screen {
    padding: 76px 10px 62px;
  }

  .pregame-shell {
    width: min(820px, calc(100vw - 20px));
    max-height: calc(100vh - 100px);
  }

  .end-screen {
    padding: 74px 10px 58px;
  }

  .end-shell {
    max-height: calc(100vh - 92px);
    width: min(680px, calc(100vw - 20px));
  }

  .pregame-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .end-highlights,
  .end-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pregame-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pregame-lan {
    grid-template-columns: 1fr;
  }

  .log-panel {
    display: none;
  }

  .fleet-panel {
    max-height: 32vh;
  }

  .fleet-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 24vh;
  }

  .ship-health-section {
    gap: 5px;
    padding: 7px;
  }

  .ship-health-item {
    gap: 3px;
    padding: 5px 6px;
  }

  .ship-health-meter {
    height: 22px;
  }

  .ship-health-label span {
    font-size: 0.66rem;
  }

  .bottom-strip {
    left: 10px;
    right: 10px;
    bottom: 10px;
    grid-template-columns: 1fr;
  }

  .meter {
    display: none;
  }
}

@media (max-width: 760px) {
  .pregame-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pregame-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pregame-grid,
  .pregame-actions,
  .end-highlights,
  .end-stats-grid,
  .end-actions {
    grid-template-columns: 1fr;
  }

  .pregame-card {
    min-height: 104px;
  }

  .fleet-status {
    grid-template-columns: 1fr;
  }
}

/* Larger command identity plate for the gameplay HUD. */
.topbar .brand {
  min-width: clamp(340px, 24vw, 430px);
  min-height: clamp(86px, 9.2dvh, 112px);
  gap: clamp(14px, 1.1vw, 20px);
  padding: clamp(14px, 1.55dvh, 20px) clamp(18px, 1.7vw, 26px);
}

.topbar .brand-mark {
  width: clamp(46px, 5dvh, 58px);
  height: clamp(46px, 5dvh, 58px);
  border-color: rgba(61, 221, 221, 0.82);
}

.topbar .brand-logo {
  width: clamp(210px, 14vw, 285px);
  max-width: none;
  margin: clamp(-42px, -4dvh, -30px) 0 clamp(-43px, -4.1dvh, -31px);
  filter:
    drop-shadow(0 0 8px rgba(93, 204, 221, 0.12))
    saturate(0.86)
    brightness(0.82);
}

.topbar .brand p {
  display: block;
  margin: clamp(8px, 1.2dvh, 13px) 0 0;
  color: rgba(143, 184, 196, 0.88);
  font-size: clamp(0.72rem, 1.25dvh, 0.9rem);
  letter-spacing: 0.16em;
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .topbar .brand {
    min-width: clamp(270px, 50vw, 360px);
    max-width: calc(100vw - 164px);
    min-height: 76px;
  }

  .topbar .brand-logo {
    width: clamp(160px, 30vw, 220px);
  }

  .view-button {
    min-width: 0;
  }

  .view-button span:last-child {
    display: none;
  }
}

/* The old result rail was too cramped for the command-console layout. */
.bottom-strip {
  display: none !important;
}

.hud {
  inset:
    clamp(72px, 10.4dvh, 96px)
    clamp(8px, 1.4vw, 18px)
    clamp(8px, 1.6dvh, 18px) !important;
}

@media (max-height: 760px) {
  .hud {
    inset: 62px 8px 8px !important;
  }
}

@media (max-width: 960px) {
  .hud {
    inset: auto 10px 10px !important;
  }
}

/* Larger tactical HUD pass: command and squadron controls should read at browser scale. */
.topbar .brand {
  min-width: clamp(510px, 38vw, 645px);
  min-height: clamp(129px, 13.8dvh, 168px);
  gap: clamp(20px, 1.65vw, 30px);
  padding: clamp(21px, 2.3dvh, 30px) clamp(27px, 2.55vw, 39px);
}

.topbar .brand-mark {
  width: clamp(69px, 7.5dvh, 87px);
  height: clamp(69px, 7.5dvh, 87px);
}

.topbar .brand-logo {
  width: clamp(357px, 23.8vw, 485px);
  margin: clamp(-72px, -6.8dvh, -50px) 0 clamp(-74px, -7dvh, -52px);
}

.topbar .brand p {
  margin-top: clamp(12px, 1.8dvh, 20px);
  font-size: clamp(0.86rem, 1.45dvh, 1.08rem);
}

.phase-tabs {
  gap: clamp(8px, 0.75vw, 12px);
  padding: clamp(8px, 1.2dvh, 11px);
}

.lens-label {
  display: grid;
  align-items: center;
  min-height: clamp(51px, 7dvh, 63px);
  padding: 0 clamp(14px, 1.1vw, 20px);
  border-right: 1px solid rgba(61, 221, 221, 0.2);
  color: rgba(90, 128, 144, 0.98);
  font-size: clamp(0.66rem, 1.2dvh, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.icon-button {
  width: clamp(51px, 7dvh, 63px);
  height: clamp(51px, 7dvh, 63px);
}

.view-button {
  min-width: clamp(132px, 11.7vw, 198px);
  height: clamp(51px, 7dvh, 63px);
  padding-inline: clamp(12px, 1.25vw, 18px);
  font-size: clamp(0.82rem, 1.5dvh, 1.02rem);
}

.hud {
  inset:
    clamp(118px, 15.5dvh, 156px)
    clamp(10px, 1.55vw, 22px)
    clamp(10px, 1.8dvh, 22px) !important;
  grid-template-columns:
    minmax(330px, clamp(345px, 24vw, 450px))
    minmax(0, 1fr)
    minmax(360px, clamp(375px, 27vw, 480px));
  gap: clamp(12px, 1.45vw, 18px);
}

.panel {
  padding: clamp(18px, 1.55vw, 24px);
}

.attack-panel,
.fleet-panel,
.log-panel {
  font-size: clamp(0.9rem, 1.05vw, 1.05rem);
}

.attack-panel .panel-heading,
.fleet-panel .panel-heading,
.log-panel .panel-heading {
  margin-bottom: clamp(12px, 1.25dvh, 16px);
}

.attack-panel .panel-heading span,
.fleet-panel .panel-heading span,
.log-panel .panel-heading span {
  font-size: clamp(0.82rem, 1.15vw, 1rem);
}

.attack-panel .panel-heading strong,
.fleet-panel .panel-heading strong,
.log-panel .panel-heading strong {
  font-size: clamp(0.8rem, 1.05vw, 0.96rem);
}

.order-banner {
  gap: clamp(9px, 1.15dvh, 13px);
  padding: clamp(18px, 1.65vw, 24px);
}

.order-banner span,
.order-banner small {
  font-size: clamp(0.82rem, 1.1vw, 1rem);
}

.order-banner strong {
  font-size: clamp(1.18rem, 1.55vw, 1.5rem);
}

.back-controls {
  gap: clamp(8px, 0.75vw, 12px);
  margin-top: clamp(13px, 1.35dvh, 18px);
}

.back-controls button,
.attack-panel .primary {
  min-height: clamp(48px, 5.8dvh, 60px);
  font-size: clamp(0.78rem, 1.05vw, 0.96rem);
}

.attack-panel .primary {
  margin-top: clamp(13px, 1.45dvh, 18px);
}

.fleet-status {
  gap: clamp(10px, 1.15dvh, 14px);
}

.ship-health-section {
  gap: clamp(10px, 1.1dvh, 13px);
  padding: clamp(12px, 1.1vw, 16px);
}

.ship-health-heading {
  font-size: clamp(0.82rem, 1.05vw, 1rem);
}

.ship-health-heading strong,
.ship-health-label em {
  font-size: clamp(0.72rem, 0.92vw, 0.86rem);
}

.ship-health-item {
  gap: clamp(7px, 0.8dvh, 10px);
  min-height: clamp(64px, 7.6dvh, 82px);
  padding: clamp(10px, 0.95vw, 14px);
}

.ship-health-label span {
  font-size: clamp(0.82rem, 1.02vw, 1rem);
}

.ship-health-meter {
  height: clamp(32px, 4.2dvh, 42px);
}

@media (max-width: 1220px) {
  .topbar .brand {
    min-width: clamp(420px, 42vw, 560px);
  }

  .topbar .brand-logo {
    width: clamp(300px, 31vw, 410px);
  }

  .view-button {
    min-width: clamp(112px, 10.5vw, 152px);
  }

  .lens-label {
    padding-inline: clamp(10px, 0.9vw, 14px);
    letter-spacing: 0.16em;
  }

  .hud {
    grid-template-columns:
      minmax(300px, 32vw)
      minmax(0, 1fr)
      minmax(320px, 35vw);
  }
}

@media (max-width: 960px) {
  .topbar .brand {
    min-width: clamp(300px, 52vw, 420px);
    max-width: calc(100vw - 250px);
    min-height: 92px;
  }

  .topbar .brand-mark {
    width: 54px;
    height: 54px;
  }

  .topbar .brand-logo {
    width: clamp(230px, 38vw, 320px);
  }

  .lens-label {
    display: none;
  }

  .hud {
    inset: auto 10px 10px !important;
    grid-template-columns: 1fr;
  }
}

/* Tactical HUD refinement pass from playtest notes. */
.topbar .brand {
  min-width: clamp(270px, 21vw, 360px);
  min-height: clamp(64px, 8dvh, 86px);
  gap: clamp(10px, 0.9vw, 14px);
  padding: clamp(8px, 1dvh, 12px) clamp(12px, 1.15vw, 16px);
  overflow: visible;
}

.topbar .brand-mark {
  width: clamp(43px, 5.2dvh, 58px);
  height: clamp(43px, 5.2dvh, 58px);
}

.topbar .brand-logo {
  width: clamp(320px, 24vw, 420px);
  max-width: none;
  margin: clamp(-58px, -5.7dvh, -42px) 0 clamp(-60px, -5.9dvh, -44px);
  transform: translateX(8px);
}

.topbar .brand p {
  margin-top: clamp(5px, 0.8dvh, 8px);
  font-size: clamp(0.64rem, 1dvh, 0.78rem);
}

.turn-callout {
  top: clamp(118px, 17dvh, 188px);
  gap: clamp(10px, 1.2dvh, 14px);
  width: min(860px, calc(100vw - 72px));
  padding: clamp(24px, 2.4dvh, 30px) clamp(30px, 3vw, 44px);
}

.turn-callout span {
  font-size: clamp(0.82rem, 1.15vw, 1rem);
}

.turn-callout strong {
  font-size: clamp(1.9rem, 3.9vw, 2.84rem);
}

.turn-callout small {
  font-size: clamp(0.94rem, 1.35vw, 1.2rem);
}

.phase-tabs {
  gap: clamp(5px, 0.55vw, 8px);
  padding: clamp(5px, 0.82dvh, 8px);
}

.lens-label {
  min-height: clamp(42px, 5.8dvh, 52px);
  padding-inline: clamp(9px, 0.85vw, 14px);
  font-size: clamp(0.58rem, 1dvh, 0.72rem);
}

.icon-button {
  width: clamp(42px, 5.8dvh, 52px);
  height: clamp(42px, 5.8dvh, 52px);
}

.view-button {
  min-width: clamp(108px, 9.6vw, 158px);
  height: clamp(42px, 5.8dvh, 52px);
  padding-inline: clamp(9px, 1vw, 14px);
  font-size: clamp(0.7rem, 1.18dvh, 0.86rem);
}

.hud {
  inset:
    clamp(96px, 13.5dvh, 132px)
    clamp(12px, 2vw, 28px)
    clamp(10px, 1.8dvh, 22px) !important;
  grid-template-columns:
    minmax(300px, clamp(320px, 23vw, 410px))
    minmax(0, 1fr)
    minmax(340px, clamp(360px, 28vw, 430px));
}

.fleet-panel,
.log-panel {
  justify-self: end;
  width: min(430px, 100%);
  max-width: 100%;
}

.fleet-panel {
  max-height: calc(100dvh - clamp(126px, 17dvh, 172px));
}

.fleet-status {
  max-height: calc(100dvh - clamp(226px, 29dvh, 310px));
  overflow-x: hidden;
  overflow-y: auto;
}

.ship-health-heading,
.ship-health-label,
.ship-health-label span {
  min-width: 0;
}

.ship-health-heading span,
.ship-health-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-health-item,
.ship-health-item.enemy.hidden-contact {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 34%);
}

.enemy-contact-blocks {
  min-width: 0;
}

.order-banner {
  width: 100%;
  appearance: none;
  border-radius: 0;
  color: var(--console-text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-transform: uppercase;
}

.order-banner:hover,
.order-banner:focus-visible {
  border-color: rgba(255, 77, 93, 0.82);
  outline: none;
  box-shadow:
    0 0 18px rgba(255, 77, 93, 0.14),
    inset 0 0 18px rgba(255, 77, 93, 0.12);
}

.order-banner:active {
  transform: translateY(1px);
}

@media (max-width: 1220px) {
  .topbar .brand {
    min-width: clamp(240px, 24vw, 320px);
  }

  .topbar .brand-logo {
    width: clamp(270px, 27vw, 360px);
  }

  .fleet-panel,
  .log-panel {
    width: min(390px, 100%);
  }
}

@media (max-width: 960px) {
  .topbar .brand {
    min-width: clamp(230px, 44vw, 300px);
    max-width: calc(100vw - 196px);
    min-height: 74px;
  }

  .topbar .brand-logo {
    width: clamp(230px, 43vw, 310px);
  }

  .turn-callout {
    width: min(640px, calc(100vw - 32px));
    padding: 20px 24px;
  }

  .turn-callout strong {
    font-size: clamp(1.5rem, 6vw, 2.1rem);
  }

  .fleet-panel,
  .log-panel {
    justify-self: stretch;
    width: 100%;
  }
}

/* HUD balance patch: smaller cards, floating logo, calmer right-side instruments. */
.topbar .brand {
  display: block;
  width: clamp(172px, 13.5vw, 220px);
  min-width: 0;
  height: clamp(58px, 6.8dvh, 74px);
  min-height: 0;
  padding: 0;
  overflow: visible;
}

.topbar .brand-mark {
  position: absolute;
  top: 50%;
  left: clamp(9px, 0.8vw, 13px);
  width: clamp(31px, 3.8dvh, 42px);
  height: clamp(31px, 3.8dvh, 42px);
  transform: translateY(-50%);
}

.topbar .brand > div {
  position: absolute;
  inset: 0;
}

.topbar .brand-logo {
  position: absolute;
  top: 41%;
  left: 57%;
  width: clamp(280px, 22vw, 390px);
  max-width: none;
  margin: 0;
  transform: translate(-50%, -50%);
}

.topbar .brand p {
  position: absolute;
  right: 8px;
  bottom: 7px;
  left: 8px;
  margin: 0;
  overflow: hidden;
  font-size: clamp(0.42rem, 0.7dvh, 0.56rem);
  letter-spacing: 0.16em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud {
  inset:
    clamp(82px, 11.5dvh, 112px)
    clamp(12px, 2vw, 28px)
    clamp(10px, 1.8dvh, 22px) !important;
  grid-template-columns:
    minmax(260px, clamp(270px, 19vw, 330px))
    minmax(0, 1fr)
    minmax(250px, clamp(270px, 20vw, 320px));
}

.attack-panel {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: start;
  width: min(300px, 100%);
  max-height: min(36dvh, 270px);
}

.fleet-panel {
  width: min(300px, 100%);
  max-height: min(54dvh, 520px);
}

.log-panel {
  width: min(270px, 100%);
  max-height: min(24dvh, 210px);
}

.fleet-status {
  max-height: min(43dvh, 410px);
  gap: 6px;
}

.fleet-panel,
.log-panel {
  justify-self: end;
}

.fleet-panel .panel-heading,
.log-panel .panel-heading {
  margin-bottom: 7px;
  padding-bottom: 6px;
}

.ship-health-section {
  gap: 5px;
  padding: 7px;
}

.ship-health-heading {
  font-size: 0.58rem;
}

.ship-health-heading strong,
.ship-health-label em {
  font-size: 0.52rem;
}

.ship-health-item,
.ship-health-item.enemy.hidden-contact {
  grid-template-columns: minmax(0, 1fr) minmax(72px, 34%);
  min-height: 42px;
  padding: 6px 7px;
}

.ship-health-label span {
  font-size: 0.62rem;
  line-height: 1.08;
}

.ship-health-meter {
  height: 22px;
}

.enemy-contact-blocks {
  height: 17px;
}

.bearing-log {
  max-height: min(15dvh, 130px);
}

.bearing-item {
  padding: 6px 7px;
}

.bearing-title {
  font-size: 0.58rem;
}

.bearing-item > span:last-child {
  font-size: 0.6rem;
}

@media (max-width: 1220px) {
  .topbar .brand {
    width: clamp(158px, 15vw, 205px);
  }

  .topbar .brand-logo {
    width: clamp(250px, 24vw, 340px);
  }

  .hud {
    grid-template-columns:
      minmax(250px, 25vw)
      minmax(0, 1fr)
      minmax(240px, 27vw);
  }

  .fleet-panel {
    width: min(280px, 100%);
  }

  .log-panel {
    width: min(250px, 100%);
  }
}

@media (max-width: 960px) {
  .topbar .brand {
    width: clamp(150px, 34vw, 210px);
    max-width: none;
  }

  .topbar .brand-logo {
    width: clamp(230px, 50vw, 320px);
  }

  .attack-panel,
  .fleet-panel,
  .log-panel {
    justify-self: stretch;
    width: 100%;
  }
}

/* Optical centering for the large turn callout copy. */
.turn-callout {
  align-content: center;
  justify-items: center;
  text-align: center;
}

.turn-callout span,
.turn-callout strong,
.turn-callout small {
  display: block;
  width: 100%;
  text-align: center;
}

.turn-callout span,
.turn-callout strong {
  transform: translateX(0.04em);
}

.turn-callout small {
  max-width: none;
  transform: translateX(0.03em);
}

/* Primary command console: this is a control surface, not a scroll panel. */
.attack-panel {
  display: grid;
  grid-template-rows: auto minmax(clamp(190px, 22dvh, 270px), 1fr) auto auto;
  gap: clamp(12px, 1.25dvh, 18px);
  width: min(390px, 100%) !important;
  min-height: clamp(360px, 43dvh, 500px);
  max-height: none !important;
  overflow: visible !important;
  padding: clamp(16px, 1.6vw, 24px);
}

.attack-panel .panel-heading {
  margin-bottom: 0;
}

.order-banner {
  position: relative;
  display: grid;
  align-content: center;
  gap: clamp(12px, 1.45dvh, 18px);
  min-height: clamp(190px, 22dvh, 270px);
  padding: clamp(22px, 2.2vw, 34px);
  border: 1px solid rgba(255, 77, 93, 0.82);
  border-top-color: rgba(255, 172, 184, 0.64);
  border-left-color: rgba(255, 105, 123, 0.72);
  border-right-color: rgba(102, 17, 34, 0.9);
  border-bottom-color: rgba(42, 5, 15, 0.96);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(105, 18, 34, 0.78) 0%, rgba(40, 6, 16, 0.96) 43%, rgba(5, 4, 9, 0.99) 100%),
    radial-gradient(circle at 22% 12%, rgba(255, 151, 160, 0.2), transparent 42%),
    rgba(0, 4, 8, 0.96);
  box-shadow:
    0 9px 0 rgba(6, 2, 6, 0.96),
    0 16px 26px rgba(0, 0, 0, 0.46),
    0 0 24px rgba(255, 77, 93, 0.18),
    inset 0 2px 0 rgba(255, 218, 224, 0.18),
    inset 2px 0 0 rgba(255, 122, 138, 0.08),
    inset 0 -12px 22px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(255, 225, 230, 0.05);
  overflow: hidden;
  transform: translateY(-4px);
  transition: border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease, transform 90ms ease;
}

.order-banner::before,
.order-banner::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.order-banner::before {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 16%, transparent 74%, rgba(0, 0, 0, 0.46)),
    linear-gradient(90deg, rgba(255, 115, 132, 0.1), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.36));
  mix-blend-mode: screen;
}

.order-banner::after {
  inset: 7px;
  border: 1px solid rgba(255, 77, 93, 0.28);
  border-radius: 3px;
  box-shadow:
    inset 0 0 18px rgba(255, 77, 93, 0.1),
    0 0 10px rgba(255, 77, 93, 0.08);
}

.order-banner > * {
  position: relative;
  z-index: 1;
}

.order-banner span {
  font-size: clamp(0.8rem, 0.92vw, 1rem);
  letter-spacing: 0.18em;
}

.order-banner strong {
  max-width: 11ch;
  font-size: clamp(1.72rem, 2.15vw, 2.35rem);
  line-height: 0.96;
  letter-spacing: 0.055em;
}

.order-banner small {
  max-width: 27ch;
  font-size: clamp(0.92rem, 1vw, 1.1rem);
  line-height: 1.28;
}

.attack-panel .primary {
  min-height: clamp(52px, 6dvh, 68px);
  margin-top: 0;
  border-color: rgba(255, 77, 93, 0.78);
  background:
    linear-gradient(180deg, rgba(64, 8, 20, 0.96), rgba(12, 3, 8, 0.98));
  box-shadow:
    0 0 20px rgba(255, 77, 93, 0.18),
    inset 0 0 18px rgba(255, 77, 93, 0.12);
}

.order-banner:hover,
.order-banner:focus-visible {
  border-color: rgba(255, 116, 132, 0.95);
  filter: brightness(1.08);
  box-shadow:
    0 9px 0 rgba(6, 2, 6, 0.96),
    0 18px 32px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(255, 77, 93, 0.28),
    inset 0 2px 0 rgba(255, 232, 235, 0.24),
    inset 2px 0 0 rgba(255, 122, 138, 0.1),
    inset 0 -12px 22px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px rgba(255, 225, 230, 0.08);
}

.order-banner:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 rgba(6, 2, 6, 0.98),
    0 8px 18px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(255, 77, 93, 0.18),
    inset 0 1px 0 rgba(255, 218, 224, 0.1),
    inset 0 8px 18px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(255, 225, 230, 0.04);
}

@media (max-height: 760px) {
  .attack-panel {
    grid-template-rows: auto minmax(160px, 1fr) auto auto;
    min-height: 320px;
  }

  .order-banner {
    min-height: 160px;
  }
}

/* Squadron console scale pass: bring the right-side tactical readout up 15%. */
.fleet-panel {
  width: min(345px, 100%);
  max-height: min(62dvh, 598px);
}

.fleet-status {
  max-height: min(49dvh, 472px);
  gap: 7px;
}

.ship-health-section {
  gap: 6px;
  padding: 8px;
}

.ship-health-heading {
  font-size: 0.66rem;
}

.ship-health-heading strong,
.ship-health-label em {
  font-size: 0.6rem;
}

.ship-health-item,
.ship-health-item.enemy.hidden-contact {
  grid-template-columns: minmax(0, 1fr) minmax(83px, 35%);
  min-height: 48px;
  padding: 7px 8px;
}

.ship-health-label span {
  font-size: 0.7rem;
}

.ship-health-meter {
  height: 25px;
}

.enemy-contact-blocks {
  height: 20px;
}

/* Hide developer tuning controls from the player-facing interface. */
.dg.ac {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Periscope lens selector: header strip above maritime lens controls. */
.phase-tabs {
  position: fixed;
  top: clamp(8px, 1.8dvh, 18px);
  right: clamp(8px, 1.4vw, 18px);
  display: grid;
  grid-template-columns:
    minmax(82px, 0.85fr)
    minmax(82px, 0.85fr)
    minmax(166px, 1.45fr)
    clamp(42px, 5.8dvh, 52px);
  grid-template-rows: minmax(24px, auto) clamp(42px, 5.8dvh, 52px);
  gap: 5px;
  align-items: stretch;
  padding: 6px;
  width: min(520px, calc(100vw - 360px));
}

.lens-label {
  display: grid !important;
  grid-column: 1 / 4;
  grid-row: 1;
  min-height: 24px;
  padding: 0 14px;
  place-items: center;
  border: 1px solid rgba(61, 221, 221, 0.24);
  border-bottom-color: rgba(61, 221, 221, 0.12);
  background:
    linear-gradient(180deg, rgba(0, 15, 24, 0.82), rgba(0, 6, 12, 0.96));
  color: rgba(137, 185, 198, 0.92);
  font-size: clamp(0.56rem, 0.86dvh, 0.68rem);
  letter-spacing: 0.28em;
}

#attackViewBtn {
  grid-column: 1;
  grid-row: 2;
}

#ownViewBtn {
  grid-column: 2;
  grid-row: 2;
}

#combinedViewBtn {
  grid-column: 3;
  grid-row: 2;
}

#matchMenuBtn {
  grid-column: 4;
  grid-row: 1 / 3;
  width: 100%;
  height: 100%;
}

.view-button {
  width: 100%;
  min-width: 0;
  height: 100%;
  grid-template-columns: 24px minmax(0, auto);
  gap: 7px;
  padding-inline: 9px;
  font-size: clamp(0.64rem, 1.05dvh, 0.78rem);
}

.view-button span:last-child {
  display: block !important;
  min-width: 0;
  letter-spacing: 0.07em;
}

.icon.torpedo-mark,
.icon.sonar-shield,
.icon.periscope-frame {
  width: 24px;
  height: 22px;
}

.icon.torpedo-mark::before,
.icon.torpedo-mark::after,
.icon.sonar-shield::before,
.icon.sonar-shield::after,
.icon.periscope-frame::before,
.icon.periscope-frame::after {
  position: absolute;
  content: "";
}

.icon.torpedo-mark::before {
  top: 8px;
  left: 2px;
  width: 20px;
  height: 7px;
  background: var(--green);
  clip-path: polygon(0 20%, 68% 20%, 100% 50%, 68% 80%, 0 80%, 10% 50%);
  filter: drop-shadow(0 0 6px rgba(61, 221, 221, 0.34));
}

.icon.torpedo-mark::after {
  top: 5px;
  left: 1px;
  width: 5px;
  height: 13px;
  border-top: 2px solid rgba(139, 218, 255, 0.72);
  border-bottom: 2px solid rgba(139, 218, 255, 0.72);
  transform: skewX(-18deg);
}

.icon.sonar-shield {
  border: 1px solid rgba(61, 221, 221, 0.78);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 4px rgba(61, 221, 221, 0.08),
    0 0 8px rgba(61, 221, 221, 0.18);
}

.icon.sonar-shield::before {
  inset: 5px 6px 3px;
  background: rgba(61, 221, 221, 0.62);
  clip-path: polygon(50% 0, 88% 18%, 78% 70%, 50% 100%, 22% 70%, 12% 18%);
}

.icon.sonar-shield::after {
  top: 5px;
  left: 5px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(191, 229, 255, 0.42);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(-22deg);
}

.icon.periscope-frame::before {
  inset: 3px 2px;
  border: 2px solid var(--green);
  background:
    linear-gradient(155deg, transparent 46%, rgba(61, 221, 221, 0.5) 47% 53%, transparent 54%),
    rgba(61, 221, 221, 0.07);
  clip-path: polygon(12% 18%, 100% 0, 88% 82%, 0 100%);
  filter: drop-shadow(0 0 6px rgba(61, 221, 221, 0.24));
}

.icon.periscope-frame::after {
  top: 10px;
  left: 5px;
  width: 15px;
  height: 2px;
  background: rgba(191, 229, 255, 0.72);
  transform: rotate(-10deg);
}

@media (max-width: 960px) {
  .phase-tabs {
    grid-template-columns: repeat(3, minmax(78px, 1fr)) 42px;
    grid-template-rows: 20px 42px;
    right: 10px;
    width: min(100%, calc(100vw - 20px));
  }

  .lens-label {
    font-size: 0.5rem;
    letter-spacing: 0.2em;
  }

  .view-button {
    grid-template-columns: 20px minmax(0, auto);
    font-size: 0.6rem;
  }
}

/* Match the composition the user approved while reviewing Chrome at 75% zoom. */
:root {
  --approved-interface-scale: 0.75;
  --approved-game-interface-scale: 0.84;
}

@media (min-width: 961px) {
  .sonar-menu-panel {
    transform: scale(var(--approved-interface-scale));
    transform-origin: center left;
  }

  .main-menu.main-menu-exiting .sonar-menu-panel {
    transform: scale(calc(var(--approved-interface-scale) * 0.965));
  }

  .pregame-shell,
  .pass-box,
  .end-shell {
    transform: scale(var(--approved-interface-scale));
    transform-origin: center center;
  }

  .topbar .brand {
    transform: scale(var(--approved-game-interface-scale));
    transform-origin: top left;
  }

  .phase-tabs {
    transform: scale(var(--approved-game-interface-scale));
    transform-origin: top right;
  }

  .attack-panel {
    transform: scale(var(--approved-game-interface-scale));
    transform-origin: top left;
  }

  .fleet-panel,
  .log-panel {
    transform: scale(var(--approved-game-interface-scale));
    transform-origin: top right;
  }

  .turn-callout {
    transform: translateX(-50%) scale(var(--approved-game-interface-scale));
    transform-origin: top center;
  }
}

/* Final brand plaque balance: compact, legible, and centered after interface scaling. */
.topbar .brand {
  width: clamp(250px, 18vw, 310px);
  height: clamp(86px, 9.8dvh, 112px);
  overflow: visible;
}

.topbar .brand-mark {
  left: clamp(13px, 1vw, 18px);
  width: clamp(38px, 4.5dvh, 50px);
  height: clamp(38px, 4.5dvh, 50px);
}

.topbar .brand-logo {
  top: 38%;
  left: 63%;
  width: clamp(260px, 21vw, 360px);
  transform: translate(-50%, -50%);
}

.topbar .brand p {
  bottom: clamp(9px, 1.1dvh, 13px);
  left: clamp(14px, 1vw, 18px);
  right: clamp(14px, 1vw, 18px);
  font-size: clamp(0.5rem, 0.82dvh, 0.64rem);
  letter-spacing: 0.18em;
}

/* End screen tactical debrief: stats plus final team-colored submarine positions. */
.end-shell {
  width: min(1180px, calc(100vw - 40px));
  padding: clamp(16px, 1.8vw, 22px);
  background:
    linear-gradient(180deg, rgba(0, 17, 27, 0.95), rgba(0, 4, 10, 0.98)),
    rgba(0, 6, 12, 0.94);
}

.end-hero {
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(61, 221, 221, 0.16);
}

.end-highlights div,
.end-player-card,
.end-disposition-panel {
  border-radius: 0;
  border-color: rgba(61, 221, 221, 0.24);
  background:
    linear-gradient(180deg, rgba(0, 13, 23, 0.84), rgba(0, 3, 8, 0.94)),
    rgba(0, 5, 10, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(190, 230, 235, 0.05),
    inset 0 14px 30px rgba(61, 221, 221, 0.025);
}

.end-debrief-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.82fr);
  gap: 14px;
  align-items: stretch;
}

.end-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.end-player-card {
  min-height: 0;
}

.end-disposition-panel {
  display: grid;
  grid-template-rows: auto minmax(230px, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

.end-disposition-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(61, 221, 221, 0.14);
}

.end-disposition-heading span {
  color: var(--console-muted);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
}

.end-disposition-heading strong {
  color: #e8fbff;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
}

.end-disposition-map {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(61, 221, 221, 0.18);
  background:
    radial-gradient(ellipse at 50% 42%, rgba(61, 221, 221, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(0, 16, 26, 0.72), rgba(0, 4, 9, 0.94));
}

.end-disposition-map::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(200, 216, 224, 0.035) 0,
    rgba(200, 216, 224, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
}

.end-map-svg {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
}

.end-map-basin {
  fill: url(#endMapPool);
}

.end-map-edge {
  fill: none;
  stroke: rgba(61, 221, 221, 0.42);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
}

.end-map-depth-label {
  fill: rgba(151, 205, 216, 0.58);
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.end-map-ship.alive {
  filter: drop-shadow(0 0 8px rgba(155, 240, 255, 0.16));
}

.end-map-ship.sunk {
  filter: saturate(0.8) brightness(0.82);
}

.end-disposition-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.end-team-chip,
.end-disposition-key {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--team-color, #3ddddd) 48%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--team-color, #3ddddd) 14%, transparent), rgba(0, 5, 10, 0.86)),
    rgba(0, 4, 8, 0.82);
}

.end-team-swatch {
  flex: 0 0 22px;
  width: 22px;
  height: 14px;
  border: 1px solid var(--team-color, #3ddddd);
  background: var(--team-color, #3ddddd);
  box-shadow: 0 0 12px color-mix(in srgb, var(--team-color, #3ddddd) 42%, transparent);
}

.end-team-chip strong,
.end-team-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.end-team-chip strong {
  color: #f1feff;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.end-team-chip small {
  color: rgba(200, 216, 224, 0.72);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.end-disposition-key {
  grid-column: 1 / -1;
  justify-content: center;
  border-color: rgba(90, 128, 144, 0.24);
  color: rgba(200, 216, 224, 0.72);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.end-disposition-key span {
  width: 20px;
  height: 8px;
  border: 1px solid rgba(93, 204, 221, 0.48);
  background: rgba(93, 204, 221, 0.72);
}

.end-disposition-key span.sunk {
  border-color: rgba(255, 77, 93, 0.42);
  background: rgba(24, 5, 8, 0.86);
}

@media (max-width: 960px) {
  .end-shell {
    width: min(760px, calc(100vw - 20px));
  }

  .end-debrief-layout {
    grid-template-columns: 1fr;
  }

  .end-disposition-panel {
    grid-template-rows: auto auto auto;
  }

  .end-disposition-map,
  .end-map-svg {
    min-height: 230px;
  }
}

.depth-indicator,
.camera-controls,
.controls-help-overlay {
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.depth-indicator {
  --depth-pos: 44.4%;
  position: fixed;
  top: 50%;
  left: clamp(8px, 1vw, 16px);
  z-index: 7;
  display: grid;
  gap: 8px;
  width: 74px;
  padding: 11px 9px;
  border: 1px solid rgba(61, 221, 221, 0.22);
  background:
    linear-gradient(180deg, rgba(1, 17, 29, 0.84), rgba(0, 4, 10, 0.92)),
    rgba(0, 4, 8, 0.8);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(200, 216, 224, 0.08),
    inset 0 18px 32px rgba(61, 221, 221, 0.02);
  color: rgba(200, 216, 224, 0.78);
  pointer-events: auto;
  transform: translateY(-50%);
}

.depth-indicator span {
  color: rgba(90, 128, 144, 0.94);
  font-size: 0.58rem;
}

.depth-indicator strong {
  color: #3ddddd;
  font-size: 0.62rem;
  line-height: 1.1;
}

.depth-track {
  position: relative;
  display: grid;
  grid-template-rows: repeat(10, 1fr);
  height: min(290px, 38dvh);
  min-height: 190px;
  padding-left: 22px;
  border-left: 1px solid rgba(61, 221, 221, 0.36);
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.depth-track:hover,
.depth-track:focus-visible {
  border-left-color: rgba(61, 221, 221, 0.76);
}

.depth-track:hover::before,
.depth-track:focus-visible::before {
  filter: drop-shadow(0 0 8px rgba(61, 221, 221, 0.42));
}

.depth-track::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 6px;
  content: "";
  background:
    linear-gradient(180deg, rgba(61, 221, 221, 0.18), rgba(255, 77, 93, 0.05)),
    repeating-linear-gradient(180deg, rgba(61, 221, 221, 0.32) 0 1px, transparent 1px 19px);
}

.depth-track i {
  display: flex;
  align-items: center;
  color: rgba(200, 216, 224, 0.46);
  font-style: normal;
  font-size: 0.56rem;
}

.depth-track b {
  position: absolute;
  left: -5px;
  width: 20px;
  height: 4px;
  border-radius: 999px;
  background: #3ddddd;
  box-shadow:
    0 0 10px rgba(61, 221, 221, 0.82),
    0 0 22px rgba(61, 221, 221, 0.3);
  transform: translateY(-50%);
  transition: top 0.22s ease;
}

.camera-controls {
  position: fixed;
  right: clamp(10px, 1.4vw, 18px);
  bottom: clamp(18px, 4dvh, 34px);
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(3, minmax(40px, 1fr));
  gap: 7px;
  width: min(226px, calc(100vw - 24px));
  padding: 9px;
  border: 1px solid rgba(61, 221, 221, 0.22);
  background:
    linear-gradient(180deg, rgba(1, 17, 29, 0.9), rgba(0, 4, 10, 0.94)),
    rgba(0, 4, 8, 0.88);
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(200, 216, 224, 0.08);
}

.camera-controls button,
.controls-help-overlay button {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid rgba(61, 221, 221, 0.32);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(2, 24, 38, 0.94), rgba(0, 5, 11, 0.96)),
    rgba(0, 9, 18, 0.9);
  color: #c8d8e0;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(200, 216, 224, 0.06),
    inset 0 -10px 18px rgba(0, 0, 0, 0.38);
  cursor: pointer;
}

.camera-controls button:hover,
.camera-controls button:focus-visible,
.controls-help-overlay button:hover,
.controls-help-overlay button:focus-visible {
  border-color: rgba(61, 221, 221, 0.82);
  color: #f0feff;
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.16),
    inset 0 0 16px rgba(61, 221, 221, 0.08),
    inset 0 1px 0 rgba(200, 216, 224, 0.08);
}

.camera-controls button:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 6px 18px rgba(0, 0, 0, 0.56),
    inset 0 0 12px rgba(61, 221, 221, 0.06);
}

.camera-controls button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.camera-controls .wide {
  grid-column: span 1;
  font-size: 0.62rem;
}

.camera-controls {
  grid-template-columns: 1fr;
  gap: 8px;
}

.click-commands-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 34px !important;
  padding: 8px 10px !important;
  text-align: left;
}

.click-commands-toggle span {
  overflow: hidden;
  color: rgba(200, 216, 224, 0.88);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-commands-toggle strong {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(61, 221, 221, 0.26);
  color: rgba(93, 235, 216, 0.9);
  font-size: 0.72rem;
  line-height: 1;
}

.camera-command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(40px, 1fr));
  gap: 7px;
}

.camera-controls.collapsed {
  width: min(214px, calc(100vw - 24px));
  padding: 7px;
}

.camera-controls.collapsed .camera-command-grid {
  display: none;
}

.controls-help-overlay {
  position: fixed;
  right: clamp(10px, 1.4vw, 18px);
  bottom: clamp(210px, 24dvh, 280px);
  z-index: 10;
  width: min(420px, calc(100vw - 24px));
  padding: 13px;
  border: 1px solid rgba(61, 221, 221, 0.25);
  background:
    linear-gradient(180deg, rgba(1, 17, 29, 0.94), rgba(0, 4, 10, 0.97)),
    rgba(0, 4, 8, 0.92);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.58),
    inset 0 0 0 1px rgba(200, 216, 224, 0.08);
}

.controls-help-overlay .panel-heading {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(61, 221, 221, 0.16);
}

.controls-help-grid {
  display: grid;
  grid-template-columns: minmax(82px, 0.72fr) minmax(0, 1.5fr);
  gap: 8px 12px;
  color: rgba(200, 216, 224, 0.78);
  font-size: 0.68rem;
  line-height: 1.35;
}

.controls-help-grid strong {
  color: #3ddddd;
  font-weight: 400;
}

.controls-help-grid h3 {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(61, 221, 221, 0.14);
  color: rgba(200, 216, 224, 0.86);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.2em;
}

.controls-help-grid h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

body.main-menu-active .camera-controls,
body.main-menu-active .depth-indicator,
body.main-menu-active .controls-help-overlay,
body.main-menu-active .tutorial-layer,
body.pregame .camera-controls,
body.pregame .depth-indicator,
body.pregame .controls-help-overlay,
body.pregame .tutorial-layer {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 1599px) {
  .depth-indicator {
    width: 66px;
    padding: 9px 7px;
  }

  .depth-track {
    height: min(238px, 34dvh);
    min-height: 172px;
  }

  .camera-controls {
    width: 204px;
    gap: 6px;
    padding: 8px;
  }

  .camera-controls button {
    min-width: 40px;
    min-height: 40px;
    font-size: 0.72rem;
  }
}

@media (max-width: 1023px) {
  .depth-indicator {
    top: auto;
    bottom: 94px;
    transform: none;
  }

  .controls-help-overlay {
    right: 10px;
    bottom: 176px;
  }
}

/* Firing vessel selector: center the vessel, split torpedo count and change-vessel into separate console bars. */
body:not(.main-menu-active):not(.pregame) .attack-panel .command-line.sub-selector-line {
  min-height: clamp(210px, 25dvh, 238px) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .command-line .sub-selector-console {
  grid-template-rows: 20px minmax(166px, auto) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout {
  grid-template-columns: 28px minmax(0, 1fr) 28px !important;
  grid-template-rows: minmax(92px, auto) 30px 30px !important;
  gap: 6px !important;
  min-height: 164px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active {
  grid-column: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  grid-template-rows: minmax(48px, 1fr) auto 4px !important;
  min-height: 92px !important;
  padding: 8px 10px 7px !important;
  align-content: center !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
  justify-self: center !important;
  width: min(154px, 94%) !important;
  height: clamp(48px, 6.4dvh, 64px) !important;
  margin: 0 auto !important;
  background-position: center !important;
  background-size: contain !important;
  opacity: 0.86 !important;
  filter:
    brightness(1.08)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.42)
    drop-shadow(0 0 12px rgba(61, 221, 221, 0.28)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout.active .sub-select-hero,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active .sub-select-hero {
  opacity: 1 !important;
  filter:
    brightness(1.25)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.65)
    drop-shadow(0 0 16px rgba(61, 221, 221, 0.42)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-name {
  justify-self: center !important;
  color: rgba(93, 235, 216, 0.98) !important;
  font-size: clamp(0.64rem, 1.05dvh, 0.84rem) !important;
  letter-spacing: 0.13em !important;
  text-align: center !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage .sub-select-damage {
  width: min(72px, 54%) !important;
  height: 4px !important;
  margin-top: 3px !important;
  opacity: 0.34 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  min-height: 30px !important;
  padding: 5px 9px !important;
  grid-template-columns: 32px minmax(0, 1fr) auto !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout {
  grid-template-columns: minmax(0, 1fr) auto !important;
  cursor: default;
  border-color: rgba(61, 221, 221, 0.22);
  background:
    linear-gradient(180deg, rgba(4, 24, 27, 0.94), rgba(0, 5, 8, 0.98)),
    rgba(0, 8, 10, 0.92);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout span {
  display: none;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout strong {
  justify-self: start !important;
  color: rgba(93, 235, 216, 0.88) !important;
  font-size: clamp(0.5rem, 0.8dvh, 0.62rem) !important;
  letter-spacing: 0.13em !important;
  overflow: visible !important;
  text-align: left !important;
  white-space: nowrap !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout em {
  justify-self: end;
  color: rgba(200, 216, 224, 0.86);
  font-size: clamp(0.48rem, 0.76dvh, 0.58rem);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  grid-template-columns: 32px minmax(0, 1fr) 0 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button strong {
  justify-self: start !important;
  font-size: clamp(0.52rem, 0.82dvh, 0.64rem) !important;
  letter-spacing: 0.14em !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  filter: grayscale(0.85);
  border-color: rgba(90, 128, 144, 0.14);
  color: rgba(90, 128, 144, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.035),
    inset 0 -10px 16px rgba(0, 0, 0, 0.38);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled strong {
  color: rgba(90, 128, 144, 0.62) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled span::before,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled span::after {
  opacity: 0.42;
}

/* Final endgame debrief placement: wider fixed board, shifted left, no shell scrollbar. */
body:not(.main-menu-active):not(.pregame) .end-screen {
  inset: clamp(52px, 6.5dvh, 72px) auto auto clamp(4px, 0.7vw, 12px) !important;
  width: min(620px, calc(100vw - 28px)) !important;
  max-height: none !important;
  overflow: visible !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell {
  max-height: none !important;
  overflow: visible !important;
  padding: clamp(16px, 1.7dvh, 20px) !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero {
  margin-bottom: 13px !important;
  padding-bottom: 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero h2 {
  font-size: clamp(1.72rem, 2.5dvh, 2.28rem) !important;
  line-height: 1 !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero p,
body:not(.main-menu-active):not(.pregame) .end-hero small {
  font-size: clamp(0.82rem, 1.18dvh, 0.98rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 11px !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights div {
  min-height: 60px;
  padding: 11px 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights span,
body:not(.main-menu-active):not(.pregame) .end-stat span,
body:not(.main-menu-active):not(.pregame) .end-card-heading span {
  font-size: clamp(0.76rem, 1.02dvh, 0.92rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights strong {
  font-size: clamp(1.36rem, 2dvh, 1.74rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-stats-grid {
  gap: 10px !important;
}

body:not(.main-menu-active):not(.pregame) .end-player-card {
  gap: 10px !important;
  padding: 13px !important;
}

body:not(.main-menu-active):not(.pregame) .end-card-heading strong {
  font-size: clamp(0.82rem, 1.12dvh, 1rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat-list {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat strong {
  font-size: clamp(1.02rem, 1.45dvh, 1.24rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-actions {
  margin-top: 11px !important;
}

body:not(.main-menu-active):not(.pregame) .end-actions button {
  min-height: 46px !important;
  font-size: clamp(0.92rem, 1.26dvh, 1.08rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell::-webkit-scrollbar {
  display: none !important;
}

/* Vessel rack final interaction pass: arrows browse, center display commits, colors stay dark-blue-green. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage {
  cursor: pointer !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
  width: min(140px, 78%) !important;
  height: clamp(38px, 5.6dvh, 50px) !important;
  opacity: 0.72 !important;
  filter:
    brightness(0.5)
    sepia(1)
    hue-rotate(132deg)
    saturate(1.75)
    drop-shadow(0 0 8px rgba(61, 221, 198, 0.22)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout.active .sub-select-hero,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active .sub-select-hero {
  width: min(140px, 78%) !important;
  height: clamp(38px, 5.6dvh, 50px) !important;
  opacity: 0.84 !important;
  filter:
    brightness(0.58)
    sepia(1)
    hue-rotate(132deg)
    saturate(1.95)
    drop-shadow(0 0 12px rgba(61, 221, 198, 0.34)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage:hover .sub-select-hero,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage:focus-visible .sub-select-hero {
  opacity: 0.9 !important;
  filter:
    brightness(0.68)
    sepia(1)
    hue-rotate(132deg)
    saturate(2.05)
    drop-shadow(0 0 14px rgba(61, 221, 198, 0.38)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  grid-template-columns: 42px minmax(0, 1fr) !important;
  min-height: 32px !important;
  border-color: rgba(61, 221, 198, 0.26) !important;
  background:
    linear-gradient(180deg, rgba(4, 32, 31, 0.9), rgba(0, 7, 9, 0.98)),
    rgba(0, 10, 11, 0.94) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span {
  display: block !important;
  width: 34px;
  height: 12px;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span::before {
  top: 3px !important;
  left: 6px !important;
  width: 24px !important;
  height: 6px !important;
  border-radius: 999px 12px 12px 999px !important;
  background:
    radial-gradient(circle at 80% 50%, rgba(213, 255, 248, 0.58), transparent 20%),
    linear-gradient(90deg, rgba(61, 221, 198, 0.34), rgba(93, 235, 216, 0.72)) !important;
  box-shadow: 0 0 9px rgba(61, 221, 198, 0.18) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span::after {
  top: 1px !important;
  left: 2px !important;
  right: auto !important;
  width: 8px !important;
  height: 10px !important;
  border: 0 !important;
  clip-path: polygon(0 0, 100% 35%, 100% 65%, 0 100%, 34% 50%) !important;
  background: rgba(93, 235, 216, 0.54) !important;
  content: "" !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button strong {
  justify-self: start !important;
  color: rgba(202, 236, 232, 0.88) !important;
  font-size: clamp(0.48rem, 0.74dvh, 0.58rem) !important;
  letter-spacing: 0.1em !important;
  overflow: hidden !important;
  text-align: left !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled {
  opacity: 0.34 !important;
  filter: grayscale(0.9) brightness(0.72) !important;
}

/* Coordinate lock polish: keep the title on one line and move unlock out of the torpedo-red family. */
body:not(.main-menu-active):not(.pregame) .attack-panel .coords-line .command-line-main {
  grid-template-columns: 38px minmax(0, 1fr) !important;
  padding-right: 13px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .coords-line .command-line-main strong {
  white-space: nowrap !important;
  font-size: clamp(0.68rem, 0.92dvh, 0.82rem) !important;
  letter-spacing: 0.095em !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .coords-line .command-line-main small {
  max-width: none !important;
  padding-right: 0 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .coords-line .command-line-action {
  border-color: rgba(61, 221, 191, 0.42) !important;
  background:
    linear-gradient(180deg, rgba(2, 43, 44, 0.94), rgba(0, 12, 16, 0.98)),
    rgba(0, 18, 20, 0.92) !important;
  color: rgba(204, 255, 240, 0.9) !important;
  box-shadow:
    inset 0 1px 0 rgba(213, 255, 248, 0.12),
    inset 0 -10px 16px rgba(0, 0, 0, 0.4),
    0 0 16px rgba(61, 221, 191, 0.11) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .coords-line .command-line-action:hover:not(:disabled),
body:not(.main-menu-active):not(.pregame) .attack-panel .coords-line .command-line-action:focus-visible:not(:disabled) {
  border-color: rgba(93, 235, 216, 0.7) !important;
  color: #efffff !important;
  box-shadow:
    inset 0 1px 0 rgba(213, 255, 248, 0.16),
    inset 0 -10px 16px rgba(0, 0, 0, 0.36),
    0 0 22px rgba(61, 221, 191, 0.22) !important;
}

/* Game Settings redesign: separate player setup from match style so Convoy can combine with AI/local/LAN/online. */
body.main-menu-active .sonar-menu-panel.engagement-open {
  width: min(1180px, calc(100vw - clamp(36px, 6vw, 116px))) !important;
  aspect-ratio: 16 / 10 !important;
  max-height: calc(100dvh - clamp(28px, 5dvh, 58px)) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-menu-frame {
  object-fit: fill !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open::before {
  inset: 2.8% 2.8% 2.8% 2.8% !important;
  clip-path: polygon(5% 0, 92% 0, 99% 11%, 99% 92%, 95% 99%, 5% 99%, 0 91%, 0 4%) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-menu-logo {
  top: -7.4% !important;
  left: 50% !important;
  width: min(54%, 560px) !important;
  opacity: 0.78 !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
  inset: 21% 7.2% 6.2% !important;
  gap: clamp(8px, 1dvh, 13px) !important;
}

.sonar-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(12px, 1.25vw, 20px);
  min-height: 0;
}

.sonar-settings-column {
  display: grid;
  align-content: start;
  gap: clamp(9px, 1dvh, 14px);
  min-width: 0;
  padding: clamp(10px, 1vw, 14px);
  border: 1px solid rgba(61, 221, 221, 0.18);
  background:
    linear-gradient(180deg, rgba(3, 18, 24, 0.8), rgba(1, 7, 12, 0.88)),
    repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.025) 0 1px, transparent 1px 4px);
  box-shadow:
    inset 0 0 18px rgba(61, 221, 221, 0.045),
    0 0 18px rgba(0, 0, 0, 0.22);
}

.sonar-settings-player {
  border-color: rgba(93, 235, 216, 0.24);
}

.sonar-settings-style {
  border-color: rgba(255, 77, 93, 0.18);
}

.sonar-settings-column > .sonar-section-label {
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(90, 128, 144, 0.22);
  color: rgba(200, 216, 224, 0.72);
  font-size: clamp(0.66rem, 0.92dvh, 0.8rem);
}

.sonar-format-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.main-menu-active .sonar-engagement-modes {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

body.main-menu-active .sonar-select-card {
  min-height: clamp(66px, 7.1dvh, 82px) !important;
  padding: 11px 12px !important;
}

body.main-menu-active .sonar-select-card strong {
  font-size: clamp(0.9rem, 1.2dvh, 1.08rem) !important;
}

body.main-menu-active .sonar-select-card small,
body.main-menu-active .sonar-mode-option small,
body.main-menu-active .sonar-engagement-field small {
  color: rgba(177, 214, 224, 0.82);
  font: 600 clamp(0.66rem, 0.96dvh, 0.78rem) Inter, system-ui, sans-serif;
  line-height: 1.18;
  letter-spacing: 0.01em;
  text-transform: none;
}

body.main-menu-active .sonar-engagement-group,
body.main-menu-active .sonar-engagement-field {
  gap: 7px !important;
}

body.main-menu-active .sonar-toggle-row.commander-counts {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(40px, 1fr)) !important;
  gap: 7px !important;
}

body.main-menu-active .sonar-toggle-row.commander-counts .sonar-mini-select {
  min-width: 0;
  padding-inline: 6px;
  font-size: clamp(0.84rem, 1.15dvh, 1rem);
}

body.main-menu-active .sonar-mode-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.main-menu-active .sonar-mode-option {
  min-height: clamp(68px, 7dvh, 84px);
  padding: 11px 12px;
}

body.main-menu-active .sonar-settings-section-join {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

body.main-menu-active .sonar-settings-section-join.hidden {
  display: none;
}

body.main-menu-active .sonar-engagement-lan {
  padding: 10px !important;
}

body.main-menu-active .sonar-engagement-actions {
  grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1fr) !important;
  justify-self: stretch;
  margin-top: 0 !important;
}

body.main-menu-active .sonar-engagement-summary {
  color: rgba(143, 184, 196, 0.9);
  font-size: clamp(0.72rem, 1dvh, 0.86rem) !important;
}

@media (min-width: 961px) {
  body.main-menu-active .sonar-menu-panel.engagement-open {
    transform: scale(0.78) !important;
    transform-origin: center center !important;
  }

  body.main-menu-active .main-menu.main-menu-exiting .sonar-menu-panel.engagement-open {
    transform: scale(0.7527) !important;
  }
}

@media (max-width: 900px) {
  body.main-menu-active .sonar-menu-panel.engagement-open {
    width: min(720px, calc(100vw - 28px)) !important;
    aspect-ratio: 1123 / 1401 !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
    inset: 20.5% 9.2% 7.2% !important;
  }

  .sonar-settings-layout {
    grid-template-columns: 1fr;
  }

  body.main-menu-active .sonar-mode-options {
    grid-template-columns: 1fr;
  }
}

/* Final source-order override for the vessel selector width. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout {
  position: relative !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(102px, auto) 30px 30px !important;
  min-height: 174px !important;
  padding-inline: 0 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav {
  position: absolute !important;
  top: 33px !important;
  z-index: 3 !important;
  width: 24px !important;
  min-width: 24px !important;
  height: 44px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav.prev {
  left: 5px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav.next {
  right: 5px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active {
  grid-column: 1 !important;
  width: calc(100% - 58px) !important;
  justify-self: center !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
  width: min(184px, 100%) !important;
  height: clamp(54px, 7dvh, 72px) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-name {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Periscope lens label pass: enlarge the words without increasing the button boxes. */
body:not(.main-menu-active):not(.pregame) .view-button span:last-child {
  font-size: clamp(0.86rem, 1.05vw, 1.05rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.085em !important;
  line-height: 1 !important;
  text-align: center !important;
}

@media (min-width: 1024px) and (max-width: 1599px) {
  body:not(.main-menu-active):not(.pregame) .view-button span:last-child {
    font-size: clamp(0.78rem, 0.92vw, 0.92rem) !important;
    letter-spacing: 0.075em !important;
  }
}

@media (max-width: 1023px) {
body:not(.main-menu-active):not(.pregame) .view-button span:last-child {
  font-size: clamp(0.66rem, 2.2vw, 0.82rem) !important;
  letter-spacing: 0.055em !important;
  }
}

/* Endgame board visibility pass: fixed left debrief, no internal scrolling, wider readable stats. */
body:not(.main-menu-active):not(.pregame) .end-screen {
  inset: clamp(52px, 6.5dvh, 72px) auto auto clamp(4px, 0.7vw, 12px) !important;
  width: min(620px, calc(100vw - 28px)) !important;
  max-height: none !important;
  overflow: visible !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell {
  max-height: none !important;
  overflow: visible !important;
  padding: clamp(16px, 1.7dvh, 20px) !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero {
  margin-bottom: 13px !important;
  padding-bottom: 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero h2 {
  font-size: clamp(1.72rem, 2.5dvh, 2.28rem) !important;
  line-height: 1 !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero p,
body:not(.main-menu-active):not(.pregame) .end-hero small {
  font-size: clamp(0.82rem, 1.18dvh, 0.98rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 11px !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights div {
  min-height: 60px;
  padding: 11px 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights span,
body:not(.main-menu-active):not(.pregame) .end-stat span,
body:not(.main-menu-active):not(.pregame) .end-card-heading span {
  font-size: clamp(0.76rem, 1.02dvh, 0.92rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights strong {
  font-size: clamp(1.36rem, 2dvh, 1.74rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-stats-grid {
  gap: 10px !important;
}

body:not(.main-menu-active):not(.pregame) .end-player-card {
  gap: 10px !important;
  padding: 13px !important;
}

body:not(.main-menu-active):not(.pregame) .end-card-heading strong {
  font-size: clamp(0.82rem, 1.12dvh, 1rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat-list {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat strong {
  font-size: clamp(1.02rem, 1.45dvh, 1.24rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-actions {
  margin-top: 11px !important;
}

body:not(.main-menu-active):not(.pregame) .end-actions button {
  min-height: 46px !important;
  font-size: clamp(0.92rem, 1.26dvh, 1.08rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell::-webkit-scrollbar {
  display: none !important;
}

/* Vessel display width fix: arrows float at the sides so the submarine remains the centerpiece. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout {
  position: relative !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(102px, auto) 30px 30px !important;
  min-height: 174px !important;
  padding-inline: 0 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav {
  position: absolute !important;
  top: 33px !important;
  z-index: 3 !important;
  width: 24px !important;
  min-width: 24px !important;
  height: 44px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav.prev {
  left: 5px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav.next {
  right: 5px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active {
  grid-column: 1 !important;
  width: calc(100% - 58px) !important;
  justify-self: center !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
  width: min(184px, 100%) !important;
  height: clamp(54px, 7dvh, 72px) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-name {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (min-width: 1024px) and (max-width: 1599px) {
  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line.sub-selector-line {
    min-height: clamp(196px, 25dvh, 224px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout {
    min-height: 152px !important;
    grid-template-rows: minmax(84px, auto) 28px 28px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage,
  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active {
    min-height: 84px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
    height: clamp(42px, 6dvh, 56px) !important;
  }
}

/* Phase 1 spacing tune: keep the command, depth, lens, and camera controls in separate lanes. */
body:not(.main-menu-active):not(.pregame) .topbar {
  top: clamp(22px, 3dvh, 34px);
  left: clamp(18px, 2vw, 36px);
  right: clamp(18px, 2vw, 36px);
}

body:not(.main-menu-active):not(.pregame) .topbar .brand-logo {
  top: 55%;
}

body:not(.main-menu-active):not(.pregame) .topbar .brand p {
  bottom: clamp(7px, 0.9dvh, 11px);
}

body:not(.main-menu-active):not(.pregame) .hud {
  inset:
    clamp(108px, 13.6dvh, 142px)
    clamp(24px, 2.4vw, 42px)
    clamp(18px, 2.4dvh, 34px) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel {
  margin-top: clamp(18px, 2.6dvh, 34px);
}

body:not(.main-menu-active):not(.pregame) .fleet-panel {
  margin-top: clamp(20px, 2.6dvh, 34px);
}

body:not(.main-menu-active):not(.pregame) .depth-indicator {
  left: clamp(350px, 27vw, 430px);
  top: 55%;
}

body:not(.main-menu-active):not(.pregame) .camera-controls {
  right: clamp(24px, 2.4vw, 42px);
  bottom: clamp(28px, 4.2dvh, 46px);
}

body:not(.main-menu-active):not(.pregame) .controls-help-overlay {
  right: clamp(24px, 2.4vw, 42px);
  bottom: clamp(236px, 26dvh, 310px);
}

@media (max-width: 1366px) {
  body:not(.main-menu-active):not(.pregame) .depth-indicator {
    left: 338px;
  }
}

/* The depth selector belongs to targeting, so dock it to the command console instead of moving the camera view. */
.attack-panel .depth-indicator {
  position: relative;
  top: auto;
  left: auto;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  width: 100%;
  min-height: 0;
  padding: 11px 12px 12px;
  transform: none;
}

.attack-panel .depth-indicator span {
  align-self: center;
}

.attack-panel .depth-indicator strong {
  align-self: center;
  justify-self: end;
}

.attack-panel .depth-track {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: none;
  height: 44px;
  min-height: 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(61, 221, 221, 0.36);
  border-left: 0;
}

.attack-panel .depth-track:hover,
.attack-panel .depth-track:focus-visible {
  border-top-color: rgba(61, 221, 221, 0.78);
  border-left-color: transparent;
}

.attack-panel .depth-track::before {
  top: 14px;
  right: 0;
  bottom: auto;
  left: 0;
  width: auto;
  height: 6px;
  background:
    linear-gradient(90deg, rgba(61, 221, 221, 0.22), rgba(255, 77, 93, 0.06)),
    repeating-linear-gradient(90deg, rgba(61, 221, 221, 0.34) 0 1px, transparent 1px calc(11.111% - 1px));
}

.attack-panel .depth-track i {
  justify-content: center;
  align-items: end;
  font-size: 0.54rem;
}

.attack-panel .depth-track b {
  top: 17px;
  left: var(--depth-pos);
  width: 4px;
  height: 22px;
  transform: translate(-50%, -50%);
}

/* Phase 2 declutter: the center instruction banner is removed from play. */
.turn-callout {
  display: none !important;
}

.opponent-turn-pill {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 3dvh, 34px);
  z-index: 8;
  padding: 7px 14px;
  border: 1px solid rgba(61, 221, 221, 0.18);
  background:
    linear-gradient(180deg, rgba(1, 17, 29, 0.72), rgba(0, 4, 10, 0.86)),
    rgba(0, 4, 8, 0.74);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.36),
    inset 0 0 0 1px rgba(200, 216, 224, 0.05);
  color: rgba(90, 128, 144, 0.96);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  pointer-events: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.hud-tooltip {
  position: fixed;
  z-index: 60;
  max-width: min(260px, calc(100vw - 28px));
  padding: 9px 11px;
  border: 1px solid rgba(61, 221, 221, 0.42);
  background:
    linear-gradient(180deg, rgba(0, 17, 27, 0.95), rgba(0, 4, 10, 0.98)),
    rgba(0, 5, 10, 0.94);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(61, 221, 221, 0.1),
    inset 0 0 0 1px rgba(200, 216, 224, 0.06);
  color: #c8d8e0;
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  line-height: 1.35;
  pointer-events: none;
  text-transform: uppercase;
  white-space: pre-line;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 140ms ease, transform 140ms ease;
}

.hud-tooltip.hidden {
  display: block !important;
  opacity: 0;
  transform: translateY(5px);
  visibility: hidden;
}

.panel,
.fleet-status,
.bearing-log,
.pregame-shell,
.sonar-engagement-panel,
.menu-settings-card,
.controls-help-overlay {
  scrollbar-color: rgba(61, 221, 221, 0.46) rgba(0, 5, 10, 0.72);
  scrollbar-width: thin;
}

.panel::-webkit-scrollbar,
.fleet-status::-webkit-scrollbar,
.bearing-log::-webkit-scrollbar,
.pregame-shell::-webkit-scrollbar,
.sonar-engagement-panel::-webkit-scrollbar,
.menu-settings-card::-webkit-scrollbar,
.controls-help-overlay::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.panel::-webkit-scrollbar-track,
.fleet-status::-webkit-scrollbar-track,
.bearing-log::-webkit-scrollbar-track,
.pregame-shell::-webkit-scrollbar-track,
.sonar-engagement-panel::-webkit-scrollbar-track,
.menu-settings-card::-webkit-scrollbar-track,
.controls-help-overlay::-webkit-scrollbar-track {
  background: rgba(0, 5, 10, 0.7);
  border-left: 1px solid rgba(61, 221, 221, 0.08);
}

.panel::-webkit-scrollbar-thumb,
.fleet-status::-webkit-scrollbar-thumb,
.bearing-log::-webkit-scrollbar-thumb,
.pregame-shell::-webkit-scrollbar-thumb,
.sonar-engagement-panel::-webkit-scrollbar-thumb,
.menu-settings-card::-webkit-scrollbar-thumb,
.controls-help-overlay::-webkit-scrollbar-thumb {
  border: 1px solid rgba(61, 221, 221, 0.32);
  background: rgba(61, 221, 221, 0.22);
}

body.dev-controls-visible .dg.ac {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

/* Command console integration: depth is a built-in control plate, not a floating gauge. */
.attack-panel {
  position: relative;
  overflow: hidden;
  padding: 18px 15px 17px 58px !important;
  border: 1px solid rgba(126, 170, 166, 0.24);
  background:
    linear-gradient(180deg, rgba(8, 24, 25, 0.95), rgba(0, 7, 11, 0.98)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    rgba(0, 7, 10, 0.96);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.58),
    0 0 0 2px rgba(0, 0, 0, 0.72),
    inset 0 0 0 1px rgba(190, 229, 218, 0.1),
    inset 0 18px 28px rgba(116, 161, 143, 0.035),
    inset 0 -18px 36px rgba(0, 0, 0, 0.48);
}

.attack-panel::before {
  position: absolute;
  top: 72px;
  bottom: 22px;
  left: 27px;
  width: 1px;
  content: "";
  background: rgba(126, 170, 166, 0.44);
  box-shadow:
    -8px 0 0 rgba(126, 170, 166, 0.08),
    8px 0 0 rgba(126, 170, 166, 0.08);
}

.attack-panel::after {
  position: absolute;
  top: 82px;
  left: 13px;
  width: 30px;
  height: calc(100% - 112px);
  min-height: 244px;
  content: "";
  pointer-events: none;
  background:
    url("./assets/ui/button-off.png") 50% 8% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 35% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 63% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 91% / 34px 34px no-repeat;
  filter: none;
  opacity: 0.92;
}

.attack-panel .panel-heading {
  position: relative;
  z-index: 1;
  justify-content: center;
  margin: 0 0 13px;
  padding: 10px 12px;
  border: 1px solid rgba(126, 170, 166, 0.22);
  background:
    linear-gradient(180deg, rgba(10, 27, 26, 0.9), rgba(1, 8, 10, 0.96)),
    rgba(4, 15, 16, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(217, 236, 225, 0.09),
    inset 0 -10px 20px rgba(0, 0, 0, 0.34);
}

.attack-panel .panel-heading span {
  color: rgba(93, 235, 216, 0.92);
  font-size: clamp(0.78rem, 1.55vw, 1.02rem);
  letter-spacing: 0.26em;
  text-shadow: 0 0 12px rgba(61, 221, 221, 0.36);
}

.attack-panel .panel-actions {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
}

.attack-panel .order-banner,
.attack-panel .depth-indicator,
.attack-panel .back-controls,
.attack-panel .primary.fire {
  position: relative;
  z-index: 1;
}

.attack-panel .order-banner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 5px 12px;
  min-height: 118px;
  margin: 0 0 12px;
  padding: 20px 18px 18px;
  text-align: left;
  border: 1px solid rgba(126, 170, 166, 0.28);
  background:
    linear-gradient(180deg, rgba(8, 22, 22, 0.9), rgba(0, 6, 8, 0.96)),
    rgba(0, 8, 10, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(216, 232, 220, 0.08),
    inset 0 -18px 36px rgba(0, 0, 0, 0.42),
    0 1px 0 rgba(126, 170, 166, 0.12);
}

.attack-panel .order-banner::before,
.attack-panel .order-banner::after {
  display: none;
}

.attack-panel .order-banner span {
  grid-row: 1 / 3;
  display: block;
  width: 44px;
  color: rgba(93, 235, 216, 0.6);
  font-size: clamp(1.35rem, 2.6vw, 2.05rem);
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.attack-panel .order-banner strong {
  color: rgba(215, 226, 220, 0.9);
  font-size: clamp(1rem, 1.95vw, 1.36rem);
  letter-spacing: 0.16em;
  line-height: 1.08;
  text-shadow:
    0 0 12px rgba(61, 221, 221, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.08);
}

.attack-panel .order-banner small {
  max-width: 24ch;
  color: rgba(200, 216, 224, 0.78);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  line-height: 1.34;
  text-transform: none;
}

.attack-panel .depth-indicator {
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  margin: 0 0 12px;
  padding: 15px 16px 16px;
  border: 1px solid rgba(126, 170, 166, 0.28);
  background:
    linear-gradient(180deg, rgba(7, 22, 22, 0.9), rgba(0, 6, 8, 0.97)),
    rgba(0, 8, 10, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(216, 232, 220, 0.08),
    inset 0 -16px 28px rgba(0, 0, 0, 0.4);
}

.attack-panel .depth-indicator::before {
  grid-column: 1 / -1;
  content: "2  Select Depth";
  color: rgba(200, 216, 224, 0.64);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
}

.attack-panel .depth-indicator span {
  color: rgba(93, 235, 216, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.attack-panel .depth-indicator strong {
  color: rgba(93, 235, 216, 0.95);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-shadow: 0 0 12px rgba(61, 221, 221, 0.36);
}

.attack-panel .depth-track {
  height: 58px;
  padding-top: 26px;
  border-top: 0;
}

.attack-panel .depth-track::before {
  top: 18px;
  height: 7px;
  border: 1px solid rgba(61, 221, 221, 0.18);
  background:
    linear-gradient(90deg, rgba(61, 221, 221, 0.38), rgba(61, 221, 221, 0.16)),
    repeating-linear-gradient(90deg, rgba(200, 216, 224, 0.44) 0 1px, transparent 1px calc(11.111% - 1px));
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.6),
    0 0 14px rgba(61, 221, 221, 0.09);
}

.attack-panel .depth-track b {
  top: 21px;
  width: 9px;
  height: 34px;
  border-radius: 5px;
  box-shadow:
    0 0 12px rgba(61, 221, 221, 0.9),
    0 0 28px rgba(61, 221, 221, 0.44),
    inset 0 0 0 1px rgba(233, 255, 255, 0.45);
}

.attack-panel .depth-track i {
  color: rgba(200, 216, 224, 0.68);
  font-size: 0.72rem;
}

.attack-panel .back-controls {
  gap: 7px;
  margin-bottom: 12px;
}

.attack-panel .back-controls button {
  min-height: 38px;
  border-color: rgba(126, 170, 166, 0.25);
  background:
    linear-gradient(180deg, rgba(6, 24, 26, 0.82), rgba(0, 6, 8, 0.96)),
    rgba(0, 6, 8, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(216, 232, 220, 0.06),
    inset 0 -10px 18px rgba(0, 0, 0, 0.38);
}

.attack-panel .primary.fire {
  min-height: 52px;
  border: 1px solid rgba(255, 77, 93, 0.58);
  background:
    linear-gradient(180deg, rgba(91, 22, 19, 0.78), rgba(19, 4, 5, 0.98)),
    rgba(48, 7, 8, 0.9);
  color: rgba(237, 226, 214, 0.88);
  box-shadow:
    0 0 22px rgba(255, 77, 93, 0.12),
    inset 0 2px 0 rgba(255, 190, 166, 0.09),
    inset 0 -16px 28px rgba(0, 0, 0, 0.42),
    inset 0 0 0 2px rgba(0, 0, 0, 0.72);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .depth-indicator {
  position: relative;
  top: auto;
  left: auto;
  z-index: 1;
  width: 100%;
  transform: none;
}

/* Command console as three distinct checklist plates. */
.attack-panel .command-step-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.attack-panel .command-line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-height: 82px;
  padding-left: 33px;
  border: 1px solid rgba(126, 170, 166, 0.26);
  background:
    linear-gradient(180deg, rgba(6, 19, 20, 0.92), rgba(0, 6, 8, 0.98)),
    rgba(0, 7, 9, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(216, 232, 220, 0.07),
    inset 0 -18px 30px rgba(0, 0, 0, 0.38);
}

.attack-panel .command-line::before {
  position: absolute;
  top: 50%;
  left: 10px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(126, 170, 166, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(12, 26, 24, 0.9) 0 48%, rgba(0, 0, 0, 0.92) 50%),
    rgba(0, 0, 0, 0.8);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(0, 0, 0, 0.36);
  color: rgba(126, 170, 166, 0.64);
  content: "";
  font-size: 0.62rem;
  transform: translateY(-50%);
}

.attack-panel .command-line[data-state="active"]::before {
  border-color: rgba(61, 221, 221, 0.82);
  background:
    radial-gradient(circle, rgba(93, 235, 216, 0.98) 0 28%, rgba(27, 109, 103, 0.74) 44%, rgba(0, 11, 10, 0.92) 72%),
    rgba(0, 0, 0, 0.82);
  box-shadow:
    0 0 12px rgba(61, 221, 221, 0.72),
    0 0 28px rgba(61, 221, 221, 0.24),
    inset 0 1px 2px rgba(255, 255, 255, 0.22);
}

.attack-panel .command-line[data-state="complete"]::before {
  border-color: rgba(90, 128, 144, 0.32);
  background:
    radial-gradient(circle, rgba(5, 14, 15, 0.96), rgba(0, 0, 0, 0.94)),
    rgba(0, 0, 0, 0.88);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.05),
    0 0 0 3px rgba(0, 0, 0, 0.42);
  color: rgba(90, 128, 144, 0.72);
  content: "✓";
}

.attack-panel .command-line[data-state="locked"] {
  opacity: 0.44;
}

.attack-panel .command-line[data-state="active"] {
  border-color: rgba(61, 221, 221, 0.54);
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.08),
    inset 0 0 0 1px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(216, 232, 220, 0.09),
    inset 0 -18px 30px rgba(0, 0, 0, 0.34);
}

.attack-panel .command-line-main,
.attack-panel .command-line .order-banner {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 5px 10px;
  align-content: center;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 13px 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(200, 216, 224, 0.8);
  text-align: left;
}

.attack-panel .command-line .order-banner:hover,
.attack-panel .command-line .order-banner:focus-visible {
  background: rgba(61, 221, 221, 0.035);
  box-shadow: inset 0 0 18px rgba(61, 221, 221, 0.05);
}

.attack-panel .command-line[data-command-step="sub"][data-state="complete"] .order-banner,
.attack-panel .command-line[data-command-step="coords"][data-state="complete"] .command-line-main {
  padding-right: 100px;
}

.attack-panel .command-line-main span,
.attack-panel .command-line .order-banner span {
  grid-row: 1 / 3;
  align-self: start;
  width: auto;
  color: rgba(93, 235, 216, 0.58);
  font-size: 1.45rem;
  letter-spacing: 0;
  line-height: 0.95;
  text-align: center;
}

.attack-panel .command-line-main strong,
.attack-panel .command-line .order-banner strong {
  color: rgba(215, 226, 220, 0.88);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  line-height: 1.05;
}

.attack-panel .command-line-main small,
.attack-panel .command-line .order-banner small {
  max-width: none;
  color: rgba(200, 216, 224, 0.76);
  font-size: 0.72rem;
  line-height: 1.25;
}

.attack-panel .command-line-action {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  align-self: auto;
  min-width: 78px;
  min-height: 32px;
  border: 0;
  border: 1px solid rgba(126, 170, 166, 0.24);
  background:
    linear-gradient(180deg, rgba(6, 24, 26, 0.82), rgba(0, 6, 8, 0.96)),
    rgba(0, 6, 8, 0.88);
  color: rgba(200, 216, 224, 0.78);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.attack-panel .command-line-action:hover:not(:disabled),
.attack-panel .command-line-action:focus-visible:not(:disabled) {
  color: #efffff;
  box-shadow: inset 0 0 18px rgba(61, 221, 221, 0.1);
}

.attack-panel .command-line-action:disabled {
  opacity: 0;
  cursor: not-allowed;
  pointer-events: none;
  visibility: hidden;
}

.attack-panel .command-line-action:not(.is-visible)#unlockTargetBtn {
  visibility: hidden;
  pointer-events: none;
}

.attack-panel .depth-line {
  grid-template-columns: 1fr;
  padding-bottom: 12px;
}

.attack-panel .depth-line .command-line-main {
  padding-bottom: 5px;
}

.attack-panel .depth-line[data-state="locked"] .depth-track {
  pointer-events: none;
}

.attack-panel .depth-line .depth-indicator {
  margin: 0 12px;
  padding: 9px 11px 11px;
  border-color: rgba(126, 170, 166, 0.18);
  background:
    linear-gradient(180deg, rgba(0, 9, 11, 0.86), rgba(0, 3, 5, 0.92)),
    rgba(0, 5, 7, 0.84);
}

.attack-panel .depth-line .depth-indicator::before {
  display: none;
}

.attack-panel .command-hidden-action {
  display: none !important;
}

.attack-panel .primary.fire {
  width: 100%;
  margin-top: 2px;
}

.attack-panel .primary.fire:disabled {
  border-color: rgba(126, 170, 166, 0.2);
  background:
    linear-gradient(180deg, rgba(40, 14, 16, 0.42), rgba(7, 4, 5, 0.92)),
    rgba(23, 5, 7, 0.86);
  color: rgba(200, 216, 224, 0.42);
  opacity: 0.72;
  filter: none;
}

/* Command board polish: one command title, one side lamp per step, physical fire controls. */
.attack-panel {
  --lamp-line: rgba(90, 128, 144, 0.22);
  padding: 17px 15px 18px 58px !important;
}

.attack-panel[data-stage="select-sub"] {
  --lamp-line: rgba(61, 221, 221, 0.26);
}

.attack-panel[data-stage="choose-z"] {
  --lamp-line: rgba(255, 185, 67, 0.23);
}

.attack-panel[data-stage="aim-target"] {
  --lamp-line: rgba(255, 185, 67, 0.18);
}

.attack-panel[data-stage="target-locked"] {
  --lamp-line: rgba(255, 77, 93, 0.22);
}

.attack-panel::before {
  top: 84px;
  bottom: 68px;
  left: 26px;
  background: linear-gradient(180deg, transparent, var(--lamp-line) 9%, var(--lamp-line) 91%, transparent);
  box-shadow:
    -8px 0 0 rgba(126, 170, 166, 0.045),
    8px 0 0 rgba(126, 170, 166, 0.045);
}

.attack-panel::after {
  top: 82px;
  left: 8px;
  width: 38px;
  height: calc(100% - 146px);
  min-height: 262px;
  background:
    url("./assets/ui/button-off.png") 50% 8% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 36% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 64% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 92% / 34px 34px no-repeat;
  filter: none;
  opacity: 0.98;
}

.attack-panel .panel-heading {
  min-height: 48px;
  justify-content: center;
  padding: 11px 42px 10px 16px;
}

.attack-panel .panel-heading span {
  color: rgba(93, 235, 216, 0.95);
  font-size: clamp(0.9rem, 1.7vw, 1.18rem);
  letter-spacing: 0.28em;
  text-align: center;
}

.attack-panel .panel-actions strong {
  display: none;
}

.attack-panel .command-step-list {
  gap: 10px;
  margin-bottom: 13px;
}

.attack-panel .command-line {
  min-height: 84px;
  padding: 0;
  border-color: rgba(126, 170, 166, 0.22);
}

.attack-panel .command-line::before,
.attack-panel .command-line[data-state="active"]::before,
.attack-panel .command-line[data-state="complete"]::before {
  display: none;
  content: none;
}

.attack-panel .command-line[data-state="active"] {
  border-color: rgba(61, 221, 221, 0.46);
  background:
    linear-gradient(180deg, rgba(7, 31, 32, 0.86), rgba(0, 7, 9, 0.97)),
    rgba(0, 8, 10, 0.92);
}

.attack-panel .command-line[data-state="complete"] {
  border-color: rgba(126, 170, 166, 0.18);
  background:
    linear-gradient(180deg, rgba(4, 16, 17, 0.88), rgba(0, 5, 7, 0.97)),
    rgba(0, 6, 8, 0.9);
}

.attack-panel .command-line[data-state="locked"] {
  opacity: 0.52;
}

.attack-panel .command-line-main,
.attack-panel .command-line .order-banner {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 4px 11px;
  padding: 14px 13px;
}

.attack-panel .command-line-main span,
.attack-panel .command-line .order-banner span {
  align-self: center;
  color: rgba(93, 235, 216, 0.72);
  font-size: 1.34rem;
}

.attack-panel .command-line-main strong,
.attack-panel .command-line .order-banner strong {
  font-size: 0.78rem;
  letter-spacing: 0.13em;
}

.attack-panel .command-line-main small,
.attack-panel .command-line .order-banner small {
  color: rgba(200, 216, 224, 0.74);
  font-size: 0.72rem;
  max-width: 15rem;
}

.attack-panel .command-line-action {
  top: 13px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 94px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(61, 221, 221, 0.28);
  background:
    linear-gradient(180deg, rgba(7, 35, 37, 0.9), rgba(0, 5, 7, 0.98)),
    rgba(0, 7, 9, 0.92);
  color: rgba(199, 231, 230, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.1),
    inset 0 -10px 16px rgba(0, 0, 0, 0.36),
    0 0 14px rgba(61, 221, 221, 0.04);
  text-shadow: 0 0 8px rgba(61, 221, 221, 0.2);
}

.attack-panel .command-line-action::before {
  width: 16px;
  height: 16px;
  content: "";
  background: url("./assets/ui/button-off.png") center / contain no-repeat;
  opacity: 0.92;
}

.attack-panel .command-line-action.launch-change {
  min-width: 108px;
}

.attack-panel .command-line-action.launch-change::before {
  background-image: url("./assets/ui/button-on.png");
}

.attack-panel .command-line-action:hover:not(:disabled)::before,
.attack-panel .command-line-action:focus-visible:not(:disabled)::before {
  background-image: url("./assets/ui/button-on.png");
  opacity: 1;
}

.attack-panel .command-line-action:hover:not(:disabled),
.attack-panel .command-line-action:focus-visible:not(:disabled) {
  border-color: rgba(61, 221, 221, 0.48);
  color: rgba(239, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.14),
    inset 0 -10px 16px rgba(0, 0, 0, 0.34),
    0 0 18px rgba(61, 221, 221, 0.1);
}

.attack-panel .depth-line {
  min-height: 168px;
  padding-bottom: 12px;
}

.attack-panel .depth-line .command-line-main {
  padding-bottom: 3px;
}

.attack-panel .depth-line .depth-indicator {
  width: min(100% - 24px, 230px);
  margin: 0 auto;
  padding: 10px 12px 12px;
  border-color: rgba(61, 221, 221, 0.18);
  background:
    linear-gradient(180deg, rgba(0, 13, 15, 0.92), rgba(0, 4, 6, 0.96)),
    rgba(0, 5, 7, 0.88);
}

.attack-panel .depth-line .depth-indicator span,
.attack-panel .depth-line .depth-indicator strong {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
}

.attack-panel .depth-track {
  height: 54px;
  padding-top: 24px;
}

.attack-panel .depth-track::before {
  top: 16px;
}

.attack-panel .depth-track b {
  top: 17px;
  width: 10px;
  height: 36px;
}

.attack-panel .depth-track i {
  font-size: 0.52rem;
  letter-spacing: 0;
}

.attack-panel .primary.fire {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 0;
  background:
    url("./assets/ui/fire-button-on.png") center / 100% 100% no-repeat,
    rgba(68, 8, 8, 0.88);
  color: rgba(255, 241, 224, 0.94);
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.8),
    0 0 12px rgba(255, 77, 93, 0.42);
  box-shadow: none;
}

.attack-panel .primary.fire:hover:not(:disabled),
.attack-panel .primary.fire:focus-visible:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(1.08);
}

.attack-panel .primary.fire:disabled {
  background:
    url("./assets/ui/fire-button-off.png") center / 100% 100% no-repeat,
    rgba(18, 5, 7, 0.88);
  color: rgba(200, 216, 224, 0.4);
  opacity: 0.9;
}

@media (min-width: 1024px) and (max-width: 1599px) {
  .attack-panel .depth-line .depth-indicator {
    width: min(100% - 18px, 220px);
  }

  .attack-panel .command-line-main small,
  .attack-panel .command-line .order-banner small {
    max-width: 13.6rem;
  }
}

/* Step lamps use the provided physical button assets only. */
.attack-panel::after {
  background:
    url("./assets/ui/button-off.png") 50% 8% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 36% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 64% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 92% / 34px 34px no-repeat;
  filter: none;
}

.attack-panel[data-stage="select-sub"]::after {
  background:
    url("./assets/ui/button-on.png") 50% 8% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 36% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 64% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 92% / 34px 34px no-repeat;
}

.attack-panel[data-stage="choose-z"]::after {
  background:
    url("./assets/ui/button-on.png") 50% 8% / 34px 34px no-repeat,
    url("./assets/ui/button-on.png") 50% 36% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 64% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 92% / 34px 34px no-repeat;
}

.attack-panel[data-stage="aim-target"]::after {
  background:
    url("./assets/ui/button-on.png") 50% 8% / 34px 34px no-repeat,
    url("./assets/ui/button-on.png") 50% 36% / 34px 34px no-repeat,
    url("./assets/ui/button-on.png") 50% 64% / 34px 34px no-repeat,
    url("./assets/ui/button-off.png") 50% 92% / 34px 34px no-repeat;
}

.attack-panel[data-stage="target-locked"]::after {
  background:
    url("./assets/ui/button-on.png") 50% 8% / 34px 34px no-repeat,
    url("./assets/ui/button-on.png") 50% 36% / 34px 34px no-repeat,
    url("./assets/ui/button-on.png") 50% 64% / 34px 34px no-repeat,
    url("./assets/ui/button-on.png") 50% 92% / 34px 34px no-repeat;
}

/* Inline firing-vessel selector: the status display is the control. */
.attack-panel .sub-selector-line {
  min-height: 126px;
}

.attack-panel .sub-selector-line[data-state="complete"] .order-banner,
.attack-panel .sub-selector-line .order-banner {
  padding-right: 13px;
}

.attack-panel .sub-selector-console {
  align-content: start;
  grid-template-rows: auto minmax(64px, 1fr);
}

.attack-panel .sub-selector-console > strong {
  align-self: end;
}

.attack-panel .sub-selector-row {
  position: relative;
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  min-height: 68px;
}

.attack-panel .sub-selector-row::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px);
  opacity: 0.35;
  mix-blend-mode: screen;
}

.attack-panel .sub-select-button {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 66px;
  padding: 5px 4px 6px;
  border: 1px solid rgba(90, 128, 144, 0.28);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(5, 25, 28, 0.86), rgba(0, 6, 8, 0.98)),
    rgba(0, 8, 10, 0.94);
  color: rgba(200, 216, 224, 0.78);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.06),
    inset 0 -12px 18px rgba(0, 0, 0, 0.32),
    0 9px 18px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    color 160ms ease;
}

.attack-panel .sub-select-button::after {
  position: absolute;
  inset: auto 7px 0;
  height: 1px;
  content: "";
  background: rgba(61, 221, 221, 0.22);
  box-shadow: 0 0 10px rgba(61, 221, 221, 0.16);
}

.attack-panel .sub-select-button:hover,
.attack-panel .sub-select-button:focus-visible {
  border-color: rgba(61, 221, 221, 0.46);
  color: rgba(239, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.1),
    inset 0 -12px 18px rgba(0, 0, 0, 0.32),
    0 0 18px rgba(61, 221, 221, 0.08);
}

.attack-panel .sub-select-button.active {
  border-color: rgba(61, 221, 221, 0.82);
  color: #efffff;
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(9, 48, 50, 0.9), rgba(0, 9, 12, 0.98)),
    rgba(0, 16, 18, 0.96);
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.18),
    inset 0 0 18px rgba(61, 221, 221, 0.08),
    inset 0 1px 0 rgba(215, 255, 246, 0.14),
    inset 0 -12px 18px rgba(0, 0, 0, 0.3);
  animation: sub-select-active-pulse 3.6s ease-in-out infinite;
}

.attack-panel .sub-select-button.sunk {
  color: rgba(90, 128, 144, 0.56);
  cursor: not-allowed;
  filter: grayscale(0.85);
  opacity: 0.58;
}

.attack-panel .sub-select-button.sunk .sub-select-code {
  text-decoration: line-through;
}

.attack-panel .sub-select-lost {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  color: rgba(255, 77, 93, 0.86);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
}

.attack-panel .sub-select-button.sunk .sub-select-lost {
  opacity: 1;
}

.attack-panel .sub-select-code {
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

.attack-panel .sub-select-icon {
  width: 26px;
  height: 22px;
  background: var(--ship-icon) center / contain no-repeat;
  filter:
    brightness(0.9)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.4)
    drop-shadow(0 0 5px rgba(61, 221, 221, 0.16));
  opacity: 0.78;
}

.attack-panel .sub-select-button.active .sub-select-icon {
  opacity: 1;
  filter:
    brightness(1.2)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.7)
    drop-shadow(0 0 8px rgba(61, 221, 221, 0.34));
}

.attack-panel .sub-select-damage {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(4px, 1fr);
  gap: 2px;
  width: min(100%, 34px);
  height: 5px;
}

.attack-panel .sub-select-damage i {
  display: block;
  border: 1px solid rgba(61, 221, 221, 0.26);
  background: rgba(61, 221, 221, 0.32);
}

.attack-panel .sub-select-damage i.damaged {
  border-color: rgba(255, 184, 68, 0.4);
  background: rgba(255, 184, 68, 0.46);
}

.attack-panel .sub-select-damage i.lost {
  border-color: rgba(255, 77, 93, 0.3);
  background: rgba(80, 13, 18, 0.74);
}

@keyframes sub-select-active-pulse {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(61, 221, 221, 0.12),
      inset 0 0 16px rgba(61, 221, 221, 0.07),
      inset 0 1px 0 rgba(215, 255, 246, 0.14),
      inset 0 -12px 18px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      0 0 24px rgba(61, 221, 221, 0.24),
      inset 0 0 22px rgba(61, 221, 221, 0.11),
      inset 0 1px 0 rgba(215, 255, 246, 0.16),
      inset 0 -12px 18px rgba(0, 0, 0, 0.26);
  }
}

@media (min-width: 1024px) and (max-width: 1599px) {
  .attack-panel .sub-selector-row {
    gap: 4px;
  }

  .attack-panel .sub-select-button {
    min-height: 62px;
    padding-inline: 3px;
  }

  .attack-panel .sub-select-icon {
    width: 23px;
    height: 20px;
  }

  .attack-panel .sub-select-code {
    font-size: 0.58rem;
  }
}

/* Mounted firing-vessel readout, styled after a submarine equipment selector. */
.attack-panel .sub-selector-line {
  min-height: 172px;
}

.attack-panel .sub-selector-console {
  grid-template-rows: auto minmax(118px, 1fr);
}

.attack-panel .sub-selector-row.vessel-readout {
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  grid-template-rows: minmax(76px, auto) 34px;
  gap: 6px;
  min-height: 120px;
}

.attack-panel .sub-selector-row.vessel-readout::before {
  inset: 0;
  border: 1px solid rgba(61, 221, 221, 0.12);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(11, 37, 39, 0.2), transparent 60%);
  opacity: 0.65;
}

.attack-panel .sub-select-nav {
  position: relative;
  z-index: 1;
  align-self: center;
  display: grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  height: 38px;
  border: 1px solid rgba(61, 221, 221, 0.24);
  border-radius: 1px;
  background:
    linear-gradient(180deg, rgba(8, 36, 39, 0.82), rgba(0, 7, 10, 0.96)),
    rgba(0, 10, 12, 0.92);
  color: rgba(93, 235, 216, 0.86);
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.08),
    inset 0 -10px 14px rgba(0, 0, 0, 0.36);
}

.attack-panel .sub-select-nav:hover,
.attack-panel .sub-select-nav:focus-visible {
  border-color: rgba(61, 221, 221, 0.52);
  color: #efffff;
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.14),
    inset 0 -10px 14px rgba(0, 0, 0, 0.34),
    0 0 14px rgba(61, 221, 221, 0.12);
}

.attack-panel .sub-select-stage,
.attack-panel .sub-select-stage.active {
  z-index: 1;
  grid-column: 2;
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  min-height: 76px;
  padding: 7px 8px 6px;
  border-color: rgba(61, 221, 221, 0.22);
  background:
    linear-gradient(180deg, rgba(6, 26, 29, 0.84), rgba(0, 7, 10, 0.96)),
    rgba(0, 8, 10, 0.92);
  transform: none;
  animation: none;
}

.attack-panel .sub-selector-row.vessel-readout.active .sub-select-stage {
  border-color: rgba(61, 221, 221, 0.58);
  box-shadow:
    0 0 15px rgba(61, 221, 221, 0.12),
    inset 0 0 18px rgba(61, 221, 221, 0.08),
    inset 0 1px 0 rgba(215, 255, 246, 0.12),
    inset 0 -12px 18px rgba(0, 0, 0, 0.28);
}

.attack-panel .sub-select-hero {
  width: 100%;
  height: 30px;
  background: var(--ship-icon) center / contain no-repeat;
  filter:
    brightness(0.9)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.15)
    drop-shadow(0 0 8px rgba(61, 221, 221, 0.18));
  opacity: 0.62;
}

.attack-panel .sub-selector-row.vessel-readout.active .sub-select-hero {
  opacity: 0.82;
  filter:
    brightness(1.04)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.35)
    drop-shadow(0 0 10px rgba(61, 221, 221, 0.26));
}

.attack-panel .sub-select-name {
  color: rgba(200, 216, 224, 0.9);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.attack-panel .sub-select-role {
  color: rgba(93, 235, 216, 0.62);
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: uppercase;
}

.attack-panel .sub-select-stage .sub-select-damage {
  margin-top: 5px;
  width: min(82px, 76%);
  height: 4px;
}

.attack-panel .sub-torpedo-count {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid rgba(61, 221, 221, 0.16);
  background:
    linear-gradient(180deg, rgba(3, 18, 21, 0.9), rgba(0, 4, 7, 0.96)),
    rgba(0, 6, 9, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.06),
    inset 0 -10px 16px rgba(0, 0, 0, 0.34);
}

.attack-panel .sub-torpedo-count span {
  position: relative;
  height: 9px;
}

.attack-panel .sub-torpedo-count span::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 31px;
  height: 3px;
  content: "";
  background: rgba(93, 235, 216, 0.5);
  box-shadow: 0 0 8px rgba(61, 221, 221, 0.16);
}

.attack-panel .sub-torpedo-count span::after {
  position: absolute;
  top: 0;
  right: 2px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 8px solid rgba(93, 235, 216, 0.5);
  content: "";
}

.attack-panel .sub-torpedo-count strong {
  color: rgba(200, 216, 224, 0.74);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.attack-panel .sub-torpedo-count em {
  color: rgba(93, 235, 216, 0.72);
  font-size: 0.55rem;
  font-style: normal;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

@media (min-width: 1024px) and (max-width: 1599px) {
  .attack-panel .sub-selector-line {
    min-height: 160px;
  }

  .attack-panel .sub-selector-row.vessel-readout {
    min-height: 112px;
  }

  .attack-panel .sub-select-name {
    font-size: 0.68rem;
  }

  .attack-panel .sub-select-hero {
    height: 27px;
  }
}

/* Squadron comparison board: all vessels visible at once, paired for fast reading. */
@media (min-width: 1024px) {
  body:not(.main-menu-active):not(.pregame) .hud {
    grid-template-columns:
      minmax(260px, clamp(270px, 19vw, 330px))
      minmax(0, 1fr)
      minmax(380px, clamp(390px, 30vw, 460px));
  }
}

body:not(.main-menu-active):not(.pregame) .fleet-panel {
  width: clamp(380px, 30vw, 460px);
  max-height: none;
}

.fleet-status.squadron-compare {
  display: block;
  max-height: none !important;
  overflow: visible !important;
}

.squadron-compare-board {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(61, 221, 221, 0.18);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(0, 19, 28, 0.84), rgba(0, 5, 9, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.06),
    inset 0 -16px 26px rgba(0, 0, 0, 0.28);
}

.squadron-compare-head,
.squadron-compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
}

.squadron-compare-head {
  align-items: center;
  min-height: 20px;
  color: rgba(90, 128, 144, 0.94);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.squadron-compare-head span:last-child {
  color: rgba(255, 128, 143, 0.76);
}

.squadron-compare-rows {
  display: grid;
  gap: 5px;
}

.squadron-compare-row {
  min-height: 40px;
}

.squadron-cell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 44px;
  gap: 6px;
  align-items: center;
  min-height: 40px;
  padding: 5px 6px 5px 8px;
  border: 1px solid rgba(61, 221, 221, 0.14);
  background:
    linear-gradient(180deg, rgba(2, 17, 23, 0.86), rgba(0, 4, 8, 0.95)),
    rgba(0, 8, 12, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.05),
    inset 0 -10px 18px rgba(0, 0, 0, 0.22);
  cursor: default;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.squadron-cell.enemy {
  border-color: rgba(255, 77, 93, 0.2);
  background:
    linear-gradient(180deg, rgba(35, 5, 12, 0.74), rgba(5, 0, 4, 0.94)),
    rgba(17, 1, 5, 0.86);
}

.squadron-cell::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 5px);
  opacity: 0.36;
}

.squadron-cell:hover {
  border-color: rgba(61, 221, 221, 0.34);
  box-shadow:
    0 0 16px rgba(61, 221, 221, 0.08),
    inset 0 1px 0 rgba(215, 255, 246, 0.08),
    inset 0 -10px 18px rgba(0, 0, 0, 0.2);
}

.squadron-cell.enemy:hover {
  border-color: rgba(255, 77, 93, 0.42);
  box-shadow:
    0 0 16px rgba(255, 77, 93, 0.08),
    inset 0 1px 0 rgba(215, 255, 246, 0.06),
    inset 0 -10px 18px rgba(0, 0, 0, 0.22);
}

.squadron-cell.selected,
.squadron-compare-row.selected-pair .squadron-cell.enemy {
  border-color: rgba(61, 221, 221, 0.6);
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.13),
    inset 0 0 18px rgba(61, 221, 221, 0.07),
    inset 0 1px 0 rgba(215, 255, 246, 0.1);
}

.squadron-compare-row.selected-pair .squadron-cell.enemy {
  border-color: rgba(255, 77, 93, 0.56);
  box-shadow:
    0 0 18px rgba(255, 77, 93, 0.11),
    inset 0 0 16px rgba(255, 77, 93, 0.06);
}

.squadron-cell.sunk {
  opacity: 0.82;
}

.squadron-cell-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.squadron-cell-copy strong {
  overflow: hidden;
  color: rgba(226, 248, 252, 0.86);
  font-size: 0.57rem;
  letter-spacing: 0.09em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.squadron-cell.enemy .squadron-cell-copy strong {
  color: rgba(255, 180, 188, 0.86);
}

.squadron-cell-copy em {
  overflow: hidden;
  color: rgba(93, 235, 216, 0.66);
  font-size: 0.49rem;
  font-style: normal;
  letter-spacing: 0.1em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.squadron-cell.enemy .squadron-cell-copy em {
  color: rgba(255, 128, 143, 0.66);
}

.squadron-cell-icon {
  width: 28px;
  height: 21px;
  background: var(--ship-icon) center / contain no-repeat;
  filter:
    brightness(0.82)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.1)
    drop-shadow(0 0 6px rgba(61, 221, 221, 0.14));
  opacity: 0.72;
}

.squadron-cell.enemy .squadron-cell-icon {
  filter:
    brightness(0.9)
    sepia(1)
    hue-rotate(305deg)
    saturate(1.45)
    drop-shadow(0 0 6px rgba(255, 77, 93, 0.13));
}

.squadron-cell-icon.unknown {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 77, 93, 0.28);
  background: rgba(38, 5, 11, 0.5);
  color: rgba(255, 128, 143, 0.78);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 77, 93, 0.22);
}

.squadron-segments {
  display: grid;
  grid-template-columns: repeat(5, minmax(4px, 1fr));
  gap: 3px;
  align-items: center;
  min-width: 38px;
}

.squadron-segments i {
  display: block;
  height: 10px;
  border: 1px solid rgba(61, 221, 221, 0.26);
  background: rgba(61, 221, 221, 0.1);
  box-shadow: inset 0 1px 0 rgba(215, 255, 246, 0.05);
}

.squadron-cell.enemy .squadron-segments i {
  border-color: rgba(255, 77, 93, 0.34);
  background: rgba(255, 77, 93, 0.08);
}

.squadron-segments i.operational {
  border-color: rgba(93, 235, 216, 0.42);
  background: rgba(93, 235, 216, 0.58);
  box-shadow: 0 0 8px rgba(61, 221, 221, 0.16);
}

.squadron-cell.enemy .squadron-segments i.operational {
  border-color: rgba(255, 128, 143, 0.42);
  background: rgba(255, 77, 93, 0.44);
  box-shadow: 0 0 8px rgba(255, 77, 93, 0.12);
}

.squadron-segments i.damaged {
  border-color: rgba(255, 185, 67, 0.56);
  background: rgba(255, 185, 67, 0.3);
}

.squadron-segments i.lost {
  border-color: rgba(255, 77, 93, 0.54);
  background: rgba(255, 77, 93, 0.16);
}

.squadron-cell.enemy .squadron-segments i.lost {
  background: rgba(255, 77, 93, 0.52);
}

.squadron-segments i.unknown {
  border-color: rgba(255, 77, 93, 0.3);
  background: rgba(58, 10, 10, 0.18);
}

.squadron-segments i.absent {
  border-color: rgba(90, 128, 144, 0.09);
  background: transparent;
  opacity: 0.28;
}

@media (min-width: 1024px) and (max-width: 1366px) {
  body:not(.main-menu-active):not(.pregame) .fleet-panel {
    width: 380px;
  }

  .squadron-cell {
    grid-template-columns: minmax(0, 1fr) 24px 38px;
    gap: 5px;
    padding-inline: 6px;
  }

  .squadron-cell-copy strong {
    font-size: 0.52rem;
    letter-spacing: 0.07em;
  }

  .squadron-cell-copy em {
    font-size: 0.46rem;
  }

  .squadron-cell-icon {
    width: 24px;
    height: 19px;
  }
}

@media (max-width: 1023px) {
  body:not(.main-menu-active):not(.pregame) .fleet-panel {
    width: 100%;
  }

  .squadron-compare-head,
  .squadron-compare-row {
    grid-template-columns: 1fr;
  }

  .squadron-compare-head span:last-child {
    margin-top: 4px;
  }
}

/* Squadron board fallback: familiar single-column board with a clear view selector. */
@media (min-width: 1024px) {
  body:not(.main-menu-active):not(.pregame) .hud {
    grid-template-columns:
      minmax(260px, clamp(270px, 19vw, 330px))
      minmax(0, 1fr)
      minmax(250px, clamp(270px, 20vw, 320px));
  }
}

body:not(.main-menu-active):not(.pregame) .fleet-panel {
  width: min(300px, 100%);
  max-height: min(54dvh, 520px);
}

.fleet-status.squadron-toggle-status {
  display: grid;
  gap: 8px;
  max-height: none !important;
  overflow: visible !important;
}

.squadron-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(61, 221, 221, 0.16);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(0, 14, 20, 0.92), rgba(0, 4, 8, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.06),
    inset 0 -12px 18px rgba(0, 0, 0, 0.22);
}

.squadron-view-toggle button {
  display: grid;
  gap: 2px;
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid rgba(61, 221, 221, 0.16);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(2, 19, 24, 0.78), rgba(0, 5, 8, 0.94)),
    rgba(0, 8, 12, 0.82);
  color: rgba(200, 216, 224, 0.72);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.04),
    inset 0 -8px 14px rgba(0, 0, 0, 0.22);
}

.squadron-view-toggle button:last-child {
  border-color: rgba(255, 77, 93, 0.18);
}

.squadron-view-toggle button span {
  overflow: hidden;
  font-size: 0.54rem;
  letter-spacing: 0.14em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.squadron-view-toggle button strong {
  color: rgba(93, 235, 216, 0.72);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.squadron-view-toggle button:last-child strong {
  color: rgba(255, 128, 143, 0.72);
}

.squadron-view-toggle button:hover,
.squadron-view-toggle button:focus-visible {
  border-color: rgba(61, 221, 221, 0.42);
  color: rgba(235, 255, 255, 0.86);
}

.squadron-view-toggle button:last-child:hover,
.squadron-view-toggle button:last-child:focus-visible {
  border-color: rgba(255, 77, 93, 0.46);
}

.squadron-view-toggle button.active {
  border-color: rgba(61, 221, 221, 0.72);
  background:
    linear-gradient(180deg, rgba(5, 40, 43, 0.78), rgba(0, 9, 13, 0.98)),
    rgba(0, 14, 17, 0.92);
  color: #efffff;
  box-shadow:
    0 0 16px rgba(61, 221, 221, 0.12),
    inset 0 0 18px rgba(61, 221, 221, 0.08),
    inset 0 1px 0 rgba(215, 255, 246, 0.1);
}

.squadron-view-toggle button:last-child.active {
  border-color: rgba(255, 77, 93, 0.72);
  background:
    linear-gradient(180deg, rgba(54, 6, 15, 0.82), rgba(7, 0, 4, 0.98)),
    rgba(28, 2, 8, 0.92);
  box-shadow:
    0 0 16px rgba(255, 77, 93, 0.12),
    inset 0 0 18px rgba(255, 77, 93, 0.08),
    inset 0 1px 0 rgba(215, 255, 246, 0.08);
}

.fleet-status.squadron-toggle-status .ship-health-section {
  margin: 0;
}

.enemy-squadron-view {
  display: grid;
  gap: 8px;
}

.enemy-contact-blocks span.lost {
  background: rgba(255, 77, 93, 0.52);
  box-shadow: 0 0 8px rgba(255, 77, 93, 0.14);
}

.enemy-contact-blocks span.damaged {
  border-color: rgba(255, 185, 67, 0.52);
  background: rgba(255, 185, 67, 0.25);
}

@media (min-width: 1024px) and (max-width: 1366px) {
  body:not(.main-menu-active):not(.pregame) .fleet-panel {
    width: min(286px, 100%);
  }

  .squadron-view-toggle button {
    min-height: 36px;
    padding: 6px 7px;
  }

  .squadron-view-toggle button span {
    font-size: 0.49rem;
    letter-spacing: 0.1em;
  }
}

/* Compact vessel display: the selected firing vessel reads as an icon console, not a text carousel. */
.attack-panel .sub-selector-line {
  min-height: 154px;
}

.attack-panel .sub-selector-console {
  grid-template-rows: auto minmax(104px, 1fr);
}

.attack-panel .sub-selector-row.vessel-readout {
  grid-template-columns: 25px minmax(108px, 1fr) 25px;
  grid-template-rows: minmax(72px, auto) 30px;
  gap: 5px;
  min-height: 108px;
  align-items: center;
}

.attack-panel .sub-select-nav {
  width: 25px;
  min-width: 25px;
  height: 42px;
  align-self: center;
  font-size: 0.58rem;
}

.attack-panel .sub-select-stage,
.attack-panel .sub-select-stage.active {
  display: grid;
  grid-template-rows: minmax(38px, 1fr) auto;
  place-items: center;
  min-height: 72px;
  padding: 7px 8px 6px;
}

.attack-panel .sub-select-hero {
  width: 100%;
  height: 38px;
  background-position: center;
  background-size: contain;
  opacity: 0.74;
}

.attack-panel .sub-selector-row.vessel-readout.active .sub-select-hero {
  opacity: 0.9;
}

.attack-panel .sub-select-name {
  width: 100%;
  overflow: hidden;
  color: rgba(93, 235, 216, 0.92);
  font-size: clamp(0.66rem, 0.95vw, 0.78rem);
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(61, 221, 221, 0.22);
  white-space: nowrap;
}

.attack-panel .sub-selector-row.vessel-readout .sub-select-role,
.attack-panel .sub-selector-row.vessel-readout .sub-select-damage {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.attack-panel .sub-torpedo-count {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  min-height: 30px;
  padding: 5px 9px;
}

.attack-panel .sub-torpedo-count span::before {
  width: 23px;
}

.attack-panel .sub-torpedo-count span::after {
  border-left-width: 7px;
}

.attack-panel .sub-torpedo-count strong {
  overflow: hidden;
  color: rgba(93, 235, 216, 0.84);
  font-size: clamp(0.54rem, 0.78vw, 0.62rem);
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1024px) and (max-width: 1366px) {
  .attack-panel .sub-selector-line {
    min-height: 148px;
  }

  .attack-panel .sub-selector-row.vessel-readout {
    grid-template-columns: 23px minmax(96px, 1fr) 23px;
    min-height: 102px;
  }

  .attack-panel .sub-select-nav {
    width: 23px;
    min-width: 23px;
    height: 39px;
  }

  .attack-panel .sub-select-hero {
    height: 34px;
  }

  .attack-panel .sub-select-name {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }
}

/* Command Deck final layout: step lamps belong to each plate, and the fire control stands alone. */
.attack-panel {
  padding-left: 58px !important;
  overflow: hidden;
}

.attack-panel::before {
  top: 79px !important;
  bottom: 76px !important;
  left: 26px !important;
  display: block !important;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(90, 128, 144, 0.2) 8%,
    rgba(90, 128, 144, 0.2) 92%,
    transparent 100%
  ) !important;
}

.attack-panel::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

.attack-panel .command-line {
  overflow: visible;
}

.attack-panel .command-line::before,
.attack-panel .command-line[data-state="active"]::before,
.attack-panel .command-line[data-state="complete"]::before {
  position: absolute !important;
  top: 50% !important;
  left: -48px !important;
  display: block !important;
  width: 36px !important;
  height: 36px !important;
  border: 0 !important;
  border-radius: 0 !important;
  content: "" !important;
  background: url("./assets/ui/button-off.png") center / contain no-repeat !important;
  box-shadow: none !important;
  color: transparent !important;
  filter: none !important;
  opacity: 0.96 !important;
  transform: translateY(-50%) !important;
}

.attack-panel .command-line[data-state="active"]::before,
.attack-panel .command-line[data-state="complete"]::before {
  background-image: url("./assets/ui/button-on.png") !important;
  opacity: 1 !important;
}

.attack-panel .sub-selector-line {
  min-height: 174px;
}

.attack-panel .sub-selector-console {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto minmax(112px, auto);
  gap: 9px 10px;
  align-content: start;
  padding: 13px 12px 14px;
}

.attack-panel .sub-selector-console > span {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.attack-panel .sub-selector-console > strong {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  overflow: visible;
  font-size: clamp(0.66rem, 0.9vw, 0.78rem);
  letter-spacing: 0.11em;
  line-height: 1;
  white-space: nowrap;
}

.attack-panel .sub-selector-row.vessel-readout {
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: 27px minmax(0, 1fr) 27px;
  grid-template-rows: minmax(76px, auto) 33px;
  gap: 6px;
  width: 100%;
  min-height: 116px;
}

.attack-panel .sub-select-stage,
.attack-panel .sub-select-stage.active {
  grid-template-rows: minmax(42px, 1fr) auto;
  min-height: 76px;
}

.attack-panel .sub-select-hero {
  height: 42px;
}

.attack-panel .sub-select-name {
  color: rgba(93, 235, 216, 0.93);
  font-size: clamp(0.64rem, 0.84vw, 0.76rem);
  letter-spacing: 0.1em;
  text-align: center;
}

.attack-panel .sub-torpedo-count {
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 33px;
}

.attack-panel .sub-torpedo-count strong {
  color: rgba(93, 235, 216, 0.86);
  font-size: clamp(0.53rem, 0.76vw, 0.61rem);
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.attack-panel .depth-line {
  min-height: 168px;
}

.attack-panel .depth-line .command-line-main {
  grid-template-columns: 38px minmax(0, 1fr);
  padding-bottom: 3px;
}

.attack-panel .depth-line .command-line-main span {
  align-self: center;
}

.attack-panel .depth-line .depth-indicator {
  width: min(100% - 24px, 232px);
  margin: 0 auto 12px;
}

.attack-panel .coords-line {
  gap: 0;
}

.attack-panel .coords-line .command-line-main {
  grid-template-columns: 38px minmax(0, 1fr);
  padding-bottom: 11px;
}

.attack-panel .coords-line .command-line-main span {
  align-self: center;
}

.attack-panel .coords-line .command-line-action {
  position: relative;
  top: auto;
  right: auto;
  z-index: 1;
  display: none;
  width: calc(100% - 24px);
  min-height: 34px;
  margin: 0 12px 12px;
  padding: 0 12px;
  border-color: rgba(255, 77, 93, 0.34);
  background:
    linear-gradient(180deg, rgba(50, 9, 12, 0.9), rgba(8, 2, 4, 0.98)),
    rgba(22, 4, 5, 0.9);
  color: rgba(255, 204, 202, 0.85);
  letter-spacing: 0.12em;
  box-shadow:
    inset 0 1px 0 rgba(255, 190, 166, 0.09),
    inset 0 -10px 16px rgba(0, 0, 0, 0.4),
    0 0 14px rgba(255, 77, 93, 0.08);
}

.attack-panel .coords-line .command-line-action.is-visible {
  display: inline-flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.attack-panel .coords-line .command-line-action::before {
  background-image: url("./assets/ui/button-off.png");
}

.attack-panel .coords-line .command-line-action:hover:not(:disabled),
.attack-panel .coords-line .command-line-action:focus-visible:not(:disabled) {
  border-color: rgba(255, 77, 93, 0.58);
  color: #fff1f1;
  box-shadow:
    inset 0 1px 0 rgba(255, 190, 166, 0.13),
    inset 0 -10px 16px rgba(0, 0, 0, 0.38),
    0 0 22px rgba(255, 77, 93, 0.16);
}

.attack-panel .primary.fire {
  margin-top: 0;
}

.attack-panel.collapsed {
  padding: 12px 15px !important;
}

.attack-panel.collapsed::before,
.attack-panel.collapsed::after {
  display: none !important;
}

.attack-panel.collapsed > :not(.panel-heading):not(.primary.fire) {
  display: none !important;
}

.attack-panel.collapsed .primary.fire {
  display: grid !important;
  min-height: 30px !important;
  margin-top: 9px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

@media (min-width: 1024px) and (max-width: 1366px) {
  .attack-panel .sub-selector-line {
    min-height: 166px;
  }

  .attack-panel .sub-selector-console > strong {
    font-size: 0.62rem;
    letter-spacing: 0.09em;
  }

  .attack-panel .sub-selector-row.vessel-readout {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    min-height: 108px;
  }

  .attack-panel .sub-select-hero {
    height: 37px;
  }

  .attack-panel .sub-torpedo-count strong {
    font-size: 0.52rem;
  }
}

/* Specificity guard for the selected-vessel plate title row. */
.attack-panel .command-line .sub-selector-console {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto minmax(112px, auto);
  gap: 9px 10px;
}

.attack-panel .command-line .sub-selector-console > span {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  width: auto;
  color: rgba(93, 235, 216, 0.76);
  font-size: 1.28rem;
  line-height: 1;
  text-align: center;
}

.attack-panel .command-line .sub-selector-console > strong {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: rgba(215, 226, 220, 0.9);
  font-size: clamp(0.56rem, 0.76vw, 0.66rem);
  letter-spacing: 0.07em;
  line-height: 1;
  white-space: nowrap;
}

.attack-panel .command-line .sub-selector-console > .sub-selector-row.vessel-readout {
  grid-column: 1 / -1;
  grid-row: 2;
}

.attack-panel .command-line .sub-torpedo-count strong {
  font-size: clamp(0.46rem, 0.66vw, 0.56rem);
  letter-spacing: 0.045em;
}

/* Brand plaque cleanup: the logo plate should read as branding, not another instruction card. */
body:not(.main-menu-active):not(.pregame) .topbar .brand {
  width: clamp(280px, 20.2vw, 347px);
  height: clamp(96px, 11dvh, 125px);
}

body:not(.main-menu-active):not(.pregame) .topbar .brand-logo {
  top: 50%;
  width: clamp(291px, 23.5vw, 403px);
}

body:not(.main-menu-active):not(.pregame) .topbar .brand p {
  display: none !important;
}

/* Readability pass: make the periscope lens and compact HUD text easier to read at laptop size. */
body:not(.main-menu-active):not(.pregame) .phase-tabs {
  width: min(590px, calc(100vw - 340px));
  grid-template-columns:
    minmax(96px, 0.9fr)
    minmax(96px, 0.9fr)
    minmax(180px, 1.45fr)
    clamp(46px, 6.2dvh, 56px);
  grid-template-rows: minmax(28px, auto) clamp(48px, 6.4dvh, 58px);
}

body:not(.main-menu-active):not(.pregame) .lens-label {
  min-height: 28px;
  font-size: clamp(0.66rem, 1.04dvh, 0.78rem);
  letter-spacing: 0.24em;
}

body:not(.main-menu-active):not(.pregame) .view-button {
  grid-template-columns: 27px minmax(0, auto);
  gap: 9px;
  padding-inline: 12px;
  font-size: clamp(0.76rem, 1.2dvh, 0.9rem);
  letter-spacing: 0.08em;
}

body:not(.main-menu-active):not(.pregame) .icon.torpedo-mark,
body:not(.main-menu-active):not(.pregame) .icon.sonar-shield,
body:not(.main-menu-active):not(.pregame) .icon.periscope-frame {
  width: 27px;
  height: 24px;
}

body:not(.main-menu-active):not(.pregame) .fleet-panel .panel-heading span,
body:not(.main-menu-active):not(.pregame) .log-panel .panel-heading span {
  font-size: clamp(0.8rem, 1.18dvh, 0.96rem);
}

body:not(.main-menu-active):not(.pregame) .ship-health-heading {
  font-size: 0.66rem;
}

body:not(.main-menu-active):not(.pregame) .ship-health-heading strong,
body:not(.main-menu-active):not(.pregame) .ship-health-label em {
  font-size: 0.58rem;
}

body:not(.main-menu-active):not(.pregame) .ship-health-label span {
  font-size: 0.7rem;
}

body:not(.main-menu-active):not(.pregame) .squadron-view-toggle button span {
  font-size: 0.58rem;
}

body:not(.main-menu-active):not(.pregame) .squadron-view-toggle button strong {
  font-size: 0.68rem;
}

body:not(.main-menu-active):not(.pregame) .bearing-title {
  font-size: 0.66rem;
}

body:not(.main-menu-active):not(.pregame) .bearing-item em {
  font-size: 0.62rem;
}

body:not(.main-menu-active):not(.pregame) .bearing-item > span:last-child {
  font-size: 0.68rem;
}

@media (max-width: 1366px) {
  body:not(.main-menu-active):not(.pregame) .phase-tabs {
    width: min(520px, calc(100vw - 320px));
    grid-template-columns:
      minmax(88px, 0.9fr)
      minmax(88px, 0.9fr)
      minmax(154px, 1.35fr)
      46px;
  }

  body:not(.main-menu-active):not(.pregame) .view-button {
    padding-inline: 9px;
    font-size: 0.7rem;
  }
}

/* Endgame debrief: keep the arena interactive and move results into the command-deck lane. */
body:not(.main-menu-active):not(.pregame) .end-screen {
  inset: clamp(78px, 9.5dvh, 118px) auto clamp(14px, 2dvh, 24px) clamp(18px, 2.2vw, 36px) !important;
  z-index: 8;
  display: block;
  width: clamp(430px, 30vw, 560px);
  padding: 0 !important;
  pointer-events: none;
  background: none !important;
  backdrop-filter: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-screen.hidden {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell {
  width: 100% !important;
  max-height: 100% !important;
  overflow: auto;
  padding: clamp(18px, 2dvh, 25px);
  pointer-events: auto;
  border: 1px solid rgba(61, 221, 221, 0.48);
  background:
    linear-gradient(180deg, rgba(0, 13, 20, 0.98), rgba(0, 3, 7, 0.995)),
    rgba(0, 4, 8, 0.985);
  box-shadow:
    0 30px 82px rgba(0, 0, 0, 0.68),
    0 0 30px rgba(61, 221, 221, 0.1),
    inset 0 0 0 1px rgba(200, 216, 224, 0.11),
    inset 0 18px 38px rgba(61, 221, 221, 0.035);
}

body:not(.main-menu-active):not(.pregame) .end-hero {
  gap: 15px;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

body:not(.main-menu-active):not(.pregame) .end-hero h2 {
  font-size: clamp(1.58rem, 3dvh, 2.24rem);
  letter-spacing: 0.075em;
  line-height: 1.05;
}

body:not(.main-menu-active):not(.pregame) .end-hero p,
body:not(.main-menu-active):not(.pregame) .end-hero small {
  font-size: clamp(0.78rem, 1.35dvh, 0.94rem);
  letter-spacing: 0.13em;
}

body:not(.main-menu-active):not(.pregame) .end-highlights {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 15px;
}

body:not(.main-menu-active):not(.pregame) .end-highlights div {
  padding: 14px 15px;
  border-color: rgba(61, 221, 221, 0.34);
  background: rgba(0, 12, 22, 0.82);
}

body:not(.main-menu-active):not(.pregame) .end-highlights span,
body:not(.main-menu-active):not(.pregame) .end-stat span,
body:not(.main-menu-active):not(.pregame) .end-card-heading span {
  color: rgba(161, 207, 217, 0.92);
  font-size: clamp(0.76rem, 1.2dvh, 0.9rem);
  letter-spacing: 0.14em;
}

body:not(.main-menu-active):not(.pregame) .end-highlights strong {
  font-size: clamp(1.42rem, 2.4dvh, 1.88rem);
}

body:not(.main-menu-active):not(.pregame) .end-debrief-layout {
  display: block;
}

body:not(.main-menu-active):not(.pregame) .end-stats-grid {
  grid-template-columns: 1fr;
  gap: 13px;
}

body:not(.main-menu-active):not(.pregame) .end-player-card {
  gap: 13px;
  padding: 16px;
  border-color: rgba(61, 221, 221, 0.28);
  border-radius: 0;
}

body:not(.main-menu-active):not(.pregame) .end-player-card.winner {
  border-color: rgba(61, 221, 221, 0.72);
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.12),
    inset 0 0 18px rgba(61, 221, 221, 0.1);
}

body:not(.main-menu-active):not(.pregame) .end-card-heading strong {
  font-size: clamp(0.74rem, 1.15dvh, 0.88rem);
  letter-spacing: 0.15em;
}

body:not(.main-menu-active):not(.pregame) .end-stat-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

body:not(.main-menu-active):not(.pregame) .end-stat strong {
  font-size: clamp(1.02rem, 1.7dvh, 1.28rem);
  line-height: 1.05;
}

body:not(.main-menu-active):not(.pregame) .end-ship-strip {
  gap: 7px;
  min-height: 24px;
}

body:not(.main-menu-active):not(.pregame) .end-ship-strip span {
  height: 12px;
  border-color: rgba(92, 204, 221, 0.44);
}

body:not(.main-menu-active):not(.pregame) .end-disposition-panel {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-actions {
  grid-template-columns: 1fr 1.2fr;
  gap: 11px;
  margin-top: 15px;
}

body:not(.main-menu-active):not(.pregame) .end-actions button {
  min-height: 52px;
  font-size: clamp(0.9rem, 1.45dvh, 1.08rem);
  letter-spacing: 0.16em;
}

body:not(.main-menu-active):not(.pregame) .end-shell::-webkit-scrollbar {
  width: 8px;
}

body:not(.main-menu-active):not(.pregame) .end-shell::-webkit-scrollbar-track {
  background: rgba(0, 3, 7, 0.72);
}

body:not(.main-menu-active):not(.pregame) .end-shell::-webkit-scrollbar-thumb {
  background: rgba(61, 221, 221, 0.42);
  border: 2px solid rgba(0, 3, 7, 0.82);
}

/* Lower-right console stack: Bearings above Click Commands, matching widths. */
body:not(.main-menu-active):not(.pregame) .log-panel {
  position: fixed;
  right: clamp(24px, 2.4vw, 42px);
  bottom: calc(clamp(28px, 4.2dvh, 46px) + 56px);
  z-index: 8;
  width: clamp(250px, 16vw, 300px);
  max-height: min(22dvh, 210px);
}

body:not(.main-menu-active):not(.pregame):has(.camera-controls:not(.collapsed)) .log-panel {
  bottom: calc(clamp(28px, 4.2dvh, 46px) + 212px);
}

body:not(.main-menu-active):not(.pregame) .camera-controls,
body:not(.main-menu-active):not(.pregame) .camera-controls.collapsed {
  width: clamp(250px, 16vw, 300px);
  right: clamp(24px, 2.4vw, 42px);
  bottom: clamp(28px, 4.2dvh, 46px);
}

body:not(.main-menu-active):not(.pregame) .click-commands-toggle {
  min-height: 38px !important;
}

/* Main menu readability pass: keep the approved layout, give the item labels more command presence. */
.sonar-menu-item {
  font-size: clamp(1.14rem, 2.45dvh, 1.58rem) !important;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
}

.sonar-menu-item span:not(.sonar-menu-arrow) {
  transform: translateY(0.02em);
}

@media (max-width: 960px) {
  .sonar-menu-item {
    font-size: clamp(0.96rem, 2.25dvh, 1.18rem) !important;
    letter-spacing: 0.105em;
  }
}

/* Command Deck vessel selector polish: align step 1 with the other plates and make the vessel readout pictorial. */
.attack-panel .command-line.sub-selector-line {
  min-height: 184px;
}

.attack-panel .command-line .sub-selector-console {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) !important;
  grid-template-rows: 20px minmax(124px, auto) !important;
  gap: 10px !important;
  align-content: start !important;
  padding: 13px 12px 14px !important;
}

.attack-panel .command-line .sub-selector-console > span {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: center !important;
  width: 38px !important;
  color: rgba(93, 235, 216, 0.78) !important;
  font-size: 1.28rem !important;
  line-height: 1 !important;
  text-align: center !important;
}

.attack-panel .command-line .sub-selector-console > strong {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: start !important;
  width: 100% !important;
  overflow: visible !important;
  color: rgba(215, 226, 220, 0.92) !important;
  font-size: clamp(0.64rem, 0.84vw, 0.74rem) !important;
  letter-spacing: 0.08em !important;
  line-height: 1 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.attack-panel .command-line .sub-selector-console > .sub-selector-row.vessel-readout {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}

.attack-panel .sub-selector-row.vessel-readout {
  grid-template-columns: 28px minmax(0, 1fr) 28px !important;
  grid-template-rows: minmax(82px, auto) 34px !important;
  gap: 7px !important;
  min-height: 124px !important;
}

.attack-panel .sub-select-stage,
.attack-panel .sub-select-stage.active {
  grid-template-rows: minmax(50px, 1fr) auto 5px !important;
  gap: 5px !important;
  min-height: 82px !important;
  padding: 7px 9px 6px !important;
  justify-items: center !important;
}

.attack-panel .sub-select-hero {
  width: 100% !important;
  height: 51px !important;
  background: var(--ship-icon) center / contain no-repeat !important;
  filter:
    drop-shadow(0 0 7px rgba(61, 221, 221, 0.2))
    brightness(1.08) !important;
  opacity: 0.8 !important;
}

.attack-panel .sub-selector-row.vessel-readout.active .sub-select-hero,
.attack-panel .sub-select-stage.active .sub-select-hero {
  opacity: 0.96 !important;
  filter:
    drop-shadow(0 0 12px rgba(61, 221, 221, 0.34))
    brightness(1.22) !important;
}

.attack-panel .sub-select-name {
  width: 100% !important;
  color: rgba(93, 235, 216, 0.94) !important;
  font-size: clamp(0.62rem, 0.82vw, 0.74rem) !important;
  letter-spacing: 0.12em !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.attack-panel .sub-select-stage .sub-select-damage {
  position: static !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(4px, 1fr)) !important;
  gap: 2px !important;
  width: min(72px, 76%) !important;
  height: 5px !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  opacity: 0.56 !important;
}

.attack-panel .sub-select-stage .sub-select-damage i {
  display: block;
  min-width: 0;
  border: 1px solid rgba(61, 221, 221, 0.22);
  background: rgba(61, 221, 221, 0.36);
}

.attack-panel .sub-select-stage .sub-select-damage i.damaged {
  border-color: rgba(255, 176, 72, 0.36);
  background: rgba(255, 176, 72, 0.48);
}

.attack-panel .sub-select-stage .sub-select-damage i.lost {
  border-color: rgba(255, 77, 93, 0.32);
  background: rgba(255, 77, 93, 0.42);
}

.attack-panel .sub-torpedo-count.change-vessel-button {
  cursor: pointer;
  border-color: rgba(61, 221, 221, 0.24);
  color: rgba(200, 216, 224, 0.82);
  text-align: center;
}

.attack-panel .sub-torpedo-count.change-vessel-button:hover,
.attack-panel .sub-torpedo-count.change-vessel-button:focus-visible {
  border-color: rgba(61, 221, 221, 0.48);
  color: #effcff;
  box-shadow:
    inset 0 1px 0 rgba(200, 216, 224, 0.12),
    inset 0 -10px 16px rgba(0, 0, 0, 0.42),
    0 0 16px rgba(61, 221, 221, 0.14);
}

.attack-panel .sub-torpedo-count.change-vessel-button strong {
  justify-self: center !important;
  color: rgba(200, 216, 224, 0.88) !important;
  font-size: clamp(0.52rem, 0.72vw, 0.6rem) !important;
  letter-spacing: 0.13em !important;
  text-align: center !important;
}

.attack-panel .command-line::before,
.attack-panel .command-line[data-state="active"]::before,
.attack-panel .command-line[data-state="complete"]::before {
  filter:
    brightness(1.32)
    saturate(1.2)
    drop-shadow(0 0 8px rgba(255, 188, 76, 0.28)) !important;
}

.attack-panel .command-line[data-state="active"]::before,
.attack-panel .command-line[data-state="complete"]::before {
  filter:
    brightness(1.52)
    saturate(1.32)
    drop-shadow(0 0 13px rgba(255, 188, 76, 0.5)) !important;
}

@media (min-width: 1024px) and (max-width: 1366px) {
  .attack-panel .command-line.sub-selector-line {
    min-height: 178px;
  }

  .attack-panel .command-line .sub-selector-console > strong {
    font-size: 0.62rem !important;
  }

  .attack-panel .sub-selector-row.vessel-readout {
    min-height: 118px !important;
  }

  .attack-panel .sub-select-hero {
    height: 46px !important;
  }
}

/* Phase 3 tutorial: non-blocking command coaching that points at the real controls. */
.tutorial-layer {
  position: fixed;
  inset: 0;
  z-index: 58;
  pointer-events: none;
}

.tutorial-board-focus {
  position: absolute;
  inset: 15dvh 24vw 17dvh 22vw;
  border: 1px solid rgba(61, 221, 221, 0.42);
  background:
    radial-gradient(circle at 50% 50%, rgba(61, 221, 221, 0.055), transparent 62%),
    linear-gradient(180deg, rgba(61, 221, 221, 0.035), rgba(0, 0, 0, 0));
  box-shadow:
    0 0 36px rgba(61, 221, 221, 0.12),
    inset 0 0 42px rgba(61, 221, 221, 0.08);
  opacity: 0;
  transition: opacity 180ms ease, inset 180ms ease;
}

.tutorial-layer[data-target="board"] .tutorial-board-focus {
  opacity: 1;
}

.tutorial-callout {
  position: fixed;
  width: min(330px, calc(100vw - 32px));
  padding: 16px 17px 15px;
  border: 1px solid rgba(61, 221, 221, 0.34);
  background:
    repeating-linear-gradient(180deg, rgba(200, 216, 224, 0.035) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(1, 17, 29, 0.96), rgba(0, 4, 10, 0.985));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.58),
    0 0 28px rgba(61, 221, 221, 0.11),
    inset 0 0 0 1px rgba(200, 216, 224, 0.07);
  color: #c8d8e0;
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  pointer-events: auto;
  text-transform: uppercase;
  animation: tutorial-callout-in 180ms ease-out;
}

.tutorial-callout::after {
  position: absolute;
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, rgba(61, 221, 221, 0.05), rgba(61, 221, 221, 0.76));
  box-shadow: 0 0 12px rgba(61, 221, 221, 0.22);
  content: "";
}

.tutorial-layer[data-anchor="right"] .tutorial-callout::after,
.tutorial-layer[data-anchor="upper-right"] .tutorial-callout::after {
  right: 100%;
  top: 28px;
}

.tutorial-layer[data-anchor="left"] .tutorial-callout::after,
.tutorial-layer[data-anchor="upper-left"] .tutorial-callout::after {
  left: 100%;
  top: 28px;
  transform: rotate(180deg);
}

.tutorial-layer[data-anchor="right"] .tutorial-callout {
  right: clamp(18px, 2vw, 34px);
  bottom: clamp(136px, 18dvh, 220px);
}

.tutorial-layer[data-anchor="left"] .tutorial-callout {
  left: clamp(18px, 2vw, 34px);
  bottom: clamp(120px, 16dvh, 190px);
}

.tutorial-layer[data-anchor="upper-right"] .tutorial-callout {
  right: clamp(18px, 2vw, 34px);
  top: clamp(118px, 16dvh, 170px);
}

.tutorial-layer[data-anchor="upper-left"] .tutorial-callout {
  left: clamp(18px, 2vw, 34px);
  top: clamp(118px, 16dvh, 170px);
}

.tutorial-kicker {
  display: block;
  margin-bottom: 8px;
  color: #5debd8;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
}

.tutorial-callout h2 {
  margin: 0 0 9px;
  color: #efffff;
  font-size: 1.08rem;
  letter-spacing: 0.14em;
  line-height: 1.1;
}

.tutorial-callout p {
  margin: 0;
  color: rgba(200, 216, 224, 0.82);
  font-size: 0.78rem;
  line-height: 1.45;
  letter-spacing: 0.055em;
}

.tutorial-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 14px;
}

.tutorial-actions button {
  min-height: 38px;
  border: 1px solid rgba(61, 221, 221, 0.35);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(2, 24, 38, 0.96), rgba(0, 5, 11, 0.98)),
    rgba(0, 9, 18, 0.9);
  color: #dffcff;
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
}

.tutorial-actions .secondary {
  flex: 1;
  border-color: rgba(61, 221, 221, 0.72);
  color: #f4ffff;
  box-shadow:
    0 0 18px rgba(61, 221, 221, 0.14),
    inset 0 0 18px rgba(61, 221, 221, 0.08);
}

.tutorial-skip {
  padding: 0 12px;
  color: rgba(200, 216, 224, 0.66) !important;
}

.tutorial-actions button:hover,
.tutorial-actions button:focus-visible {
  border-color: rgba(61, 221, 221, 0.9);
  color: #ffffff !important;
}

.tutorial-highlight {
  outline: 2px solid rgba(61, 221, 221, 0.82) !important;
  outline-offset: 4px;
  box-shadow:
    0 0 24px rgba(61, 221, 221, 0.22),
    inset 0 0 16px rgba(61, 221, 221, 0.08) !important;
}

canvas.tutorial-highlight {
  outline-offset: -8px;
}

body.tutorial-active .sub-select-button:not(.sunk),
body.tutorial-active .sub-select-stage:not(.sunk) {
  animation: tutorial-sub-pulse 2s ease-in-out infinite;
}

.menu-settings-replay {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border: 1px solid rgba(61, 221, 221, 0.34);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(2, 24, 38, 0.95), rgba(0, 5, 11, 0.98)),
    rgba(0, 9, 18, 0.9);
  color: #c8d8e0;
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-settings-replay:hover,
.menu-settings-replay:focus-visible {
  border-color: rgba(61, 221, 221, 0.86);
  color: #efffff;
}

@keyframes tutorial-callout-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tutorial-sub-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(61, 221, 221, 0.12), 0 0 8px rgba(61, 221, 221, 0.04);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(61, 221, 221, 0.58), 0 0 22px rgba(61, 221, 221, 0.22);
  }
}

@media (max-width: 1023px) {
  .tutorial-board-focus {
    inset: 18dvh 8vw 26dvh;
  }

  .tutorial-layer[data-anchor] .tutorial-callout {
    right: 16px;
    left: 16px;
    top: auto;
    bottom: 110px;
    width: auto;
  }
}

/* Phase 4 responsive HUD: formal desktop, laptop, and tablet breakpoints. */
body:not(.main-menu-active):not(.pregame) .panel,
body:not(.main-menu-active):not(.pregame) .fleet-status,
body:not(.main-menu-active):not(.pregame) .bearing-log,
body:not(.main-menu-active):not(.pregame) .controls-help-overlay,
body:not(.main-menu-active):not(.pregame) .end-shell {
  scrollbar-color: rgba(61, 221, 221, 0.42) rgba(0, 3, 7, 0.72);
  scrollbar-width: thin;
}

body:not(.main-menu-active):not(.pregame) .panel::-webkit-scrollbar,
body:not(.main-menu-active):not(.pregame) .fleet-status::-webkit-scrollbar,
body:not(.main-menu-active):not(.pregame) .bearing-log::-webkit-scrollbar,
body:not(.main-menu-active):not(.pregame) .controls-help-overlay::-webkit-scrollbar {
  width: 8px;
}

body:not(.main-menu-active):not(.pregame) .panel::-webkit-scrollbar-track,
body:not(.main-menu-active):not(.pregame) .fleet-status::-webkit-scrollbar-track,
body:not(.main-menu-active):not(.pregame) .bearing-log::-webkit-scrollbar-track,
body:not(.main-menu-active):not(.pregame) .controls-help-overlay::-webkit-scrollbar-track {
  background: rgba(0, 3, 7, 0.72);
}

body:not(.main-menu-active):not(.pregame) .panel::-webkit-scrollbar-thumb,
body:not(.main-menu-active):not(.pregame) .fleet-status::-webkit-scrollbar-thumb,
body:not(.main-menu-active):not(.pregame) .bearing-log::-webkit-scrollbar-thumb,
body:not(.main-menu-active):not(.pregame) .controls-help-overlay::-webkit-scrollbar-thumb {
  border: 2px solid rgba(0, 3, 7, 0.82);
  background: rgba(61, 221, 221, 0.42);
}

@media (min-width: 1600px) {
  body:not(.main-menu-active):not(.pregame) .hud {
    grid-template-columns:
      minmax(280px, clamp(292px, 18vw, 356px))
      minmax(0, 1fr)
      minmax(285px, clamp(300px, 19vw, 360px));
    gap: clamp(16px, 1.8vw, 30px);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel {
    max-height: min(75dvh, 720px);
  }

  body:not(.main-menu-active):not(.pregame) .fleet-panel {
    width: clamp(292px, 19vw, 360px);
    max-height: min(60dvh, 620px);
  }

  body:not(.main-menu-active):not(.pregame) .log-panel,
  body:not(.main-menu-active):not(.pregame) .camera-controls,
  body:not(.main-menu-active):not(.pregame) .camera-controls.collapsed {
    width: clamp(270px, 16vw, 320px);
  }
}

@media (min-width: 1024px) and (max-width: 1599px) {
  body:not(.main-menu-active):not(.pregame) .topbar {
    top: clamp(10px, 1.5dvh, 18px);
    left: clamp(10px, 1.1vw, 18px);
    right: clamp(10px, 1.1vw, 18px);
    gap: clamp(8px, 1vw, 14px);
  }

  body:not(.main-menu-active):not(.pregame) .topbar .brand {
    width: clamp(190px, 17.5vw, 278px);
    height: clamp(62px, 8.5dvh, 94px);
    min-width: 0;
    padding: 7px 9px;
  }

  body:not(.main-menu-active):not(.pregame) .topbar .brand-mark {
    width: clamp(30px, 3.7dvh, 38px);
    height: clamp(30px, 3.7dvh, 38px);
  }

  body:not(.main-menu-active):not(.pregame) .topbar .brand-logo {
    width: clamp(205px, 21vw, 330px);
    max-width: none;
  }

  body:not(.main-menu-active):not(.pregame) .phase-tabs {
    width: clamp(388px, 38vw, 542px);
    grid-template-columns:
      minmax(88px, 0.9fr)
      minmax(88px, 0.9fr)
      minmax(138px, 1.28fr)
      42px;
    grid-template-rows: 20px 42px;
    padding: 5px;
  }

  body:not(.main-menu-active):not(.pregame) .lens-label {
    min-height: 20px;
    font-size: clamp(0.52rem, 0.74dvh, 0.66rem);
    letter-spacing: 0.2em;
  }

  body:not(.main-menu-active):not(.pregame) .view-button {
    min-width: 0;
    height: 42px;
    min-height: 40px;
    grid-template-columns: 22px minmax(0, auto);
    gap: 6px;
    padding-inline: 7px;
    font-size: clamp(0.58rem, 0.86dvh, 0.72rem);
    letter-spacing: 0.075em;
  }

  body:not(.main-menu-active):not(.pregame) .icon-button {
    width: 42px;
    height: 42px;
    min-width: 40px;
    min-height: 40px;
  }

  body:not(.main-menu-active):not(.pregame) .icon.torpedo-mark,
  body:not(.main-menu-active):not(.pregame) .icon.sonar-shield,
  body:not(.main-menu-active):not(.pregame) .icon.periscope-frame {
    width: 22px;
    height: 20px;
  }

  body:not(.main-menu-active):not(.pregame) .hud {
    inset:
      clamp(86px, 11dvh, 118px)
      clamp(10px, 1.15vw, 18px)
      clamp(12px, 1.6dvh, 22px) !important;
    grid-template-columns:
      minmax(216px, clamp(226px, 20vw, 292px))
      minmax(0, 1fr)
      minmax(226px, clamp(238px, 21vw, 292px)) !important;
    gap: clamp(8px, 0.9vw, 14px);
  }

  body:not(.main-menu-active):not(.pregame) .panel {
    padding: clamp(9px, 1.05dvh, 12px);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel {
    width: min(100%, 292px);
    max-height: calc(100dvh - 126px);
    margin-top: clamp(4px, 0.7dvh, 10px);
    padding-left: clamp(48px, 4.2vw, 58px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .panel-heading {
    margin-bottom: 8px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .panel-heading span,
  body:not(.main-menu-active):not(.pregame) .attack-panel .panel-heading strong {
    font-size: clamp(0.68rem, 0.96dvh, 0.82rem);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-step-list {
    gap: clamp(8px, 1dvh, 11px);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line {
    padding: clamp(8px, 1dvh, 11px);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line::before,
  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line[data-state="active"]::before,
  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line[data-state="complete"]::before {
    left: clamp(-44px, -3.8vw, -38px) !important;
    width: clamp(30px, 3.1dvh, 36px) !important;
    height: clamp(30px, 3.1dvh, 36px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line.sub-selector-line {
    min-height: clamp(152px, 20dvh, 178px);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-console {
    padding: 10px 10px 11px !important;
    gap: 7px 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout {
    min-height: clamp(104px, 14.5dvh, 124px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
    height: clamp(37px, 5.3dvh, 50px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-name {
    font-size: clamp(0.58rem, 0.82dvh, 0.72rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .depth-line {
    min-height: clamp(142px, 18dvh, 168px);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .depth-line .depth-indicator {
    width: min(100%, 222px);
    margin-bottom: 8px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .depth-track {
    min-height: 0;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line-main strong,
  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line .order-banner strong {
    font-size: clamp(0.63rem, 0.9dvh, 0.78rem);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line-main small,
  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line .order-banner small {
    font-size: clamp(0.56rem, 0.8dvh, 0.66rem);
    line-height: 1.35;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .primary.fire {
    min-height: clamp(38px, 5.2dvh, 50px);
    font-size: clamp(0.68rem, 1dvh, 0.84rem);
  }

  body:not(.main-menu-active):not(.pregame) .fleet-panel {
    width: clamp(238px, 21vw, 292px);
    max-height: calc(100dvh - 174px);
    margin-top: clamp(0px, 0.6dvh, 8px);
  }

  body:not(.main-menu-active):not(.pregame) .fleet-panel .panel-heading,
  body:not(.main-menu-active):not(.pregame) .log-panel .panel-heading {
    margin-bottom: 7px;
    padding-bottom: 6px;
  }

  body:not(.main-menu-active):not(.pregame) .fleet-panel .panel-heading span,
  body:not(.main-menu-active):not(.pregame) .log-panel .panel-heading span {
    font-size: clamp(0.7rem, 1dvh, 0.86rem);
  }

  body:not(.main-menu-active):not(.pregame) .squadron-view-toggle {
    gap: 5px;
    padding: 3px;
  }

  body:not(.main-menu-active):not(.pregame) .squadron-view-toggle button {
    min-height: 38px;
    padding: 6px;
  }

  body:not(.main-menu-active):not(.pregame) .squadron-view-toggle button span {
    font-size: clamp(0.48rem, 0.68dvh, 0.56rem);
  }

  body:not(.main-menu-active):not(.pregame) .squadron-view-toggle button strong {
    font-size: clamp(0.56rem, 0.78dvh, 0.66rem);
  }

  body:not(.main-menu-active):not(.pregame) .fleet-status {
    max-height: min(50dvh, calc(100dvh - 304px));
    gap: 6px;
    padding-right: 3px;
  }

  body:not(.main-menu-active):not(.pregame) .ship-health-section {
    gap: 4px;
    padding: 6px;
  }

  body:not(.main-menu-active):not(.pregame) .ship-health-heading {
    font-size: clamp(0.52rem, 0.74dvh, 0.62rem);
    letter-spacing: 0.12em;
  }

  body:not(.main-menu-active):not(.pregame) .ship-health-heading strong,
  body:not(.main-menu-active):not(.pregame) .ship-health-label em {
    font-size: clamp(0.48rem, 0.68dvh, 0.56rem);
  }

  body:not(.main-menu-active):not(.pregame) .ship-health-item {
    min-height: 44px;
    padding: 6px;
  }

  body:not(.main-menu-active):not(.pregame) .ship-health-label span {
    font-size: clamp(0.58rem, 0.8dvh, 0.68rem);
  }

  body:not(.main-menu-active):not(.pregame) .ship-health-meter {
    height: clamp(24px, 3.4dvh, 32px);
  }

  body:not(.main-menu-active):not(.pregame) .enemy-contact-blocks {
    height: 20px;
    gap: 3px;
  }

  body:not(.main-menu-active):not(.pregame) .log-panel {
    right: clamp(10px, 1.15vw, 18px);
    bottom: calc(clamp(14px, 2dvh, 28px) + 54px);
    width: clamp(238px, 20vw, 282px);
    max-height: min(20dvh, 178px);
  }

  body:not(.main-menu-active):not(.pregame):has(.camera-controls:not(.collapsed)) .log-panel {
    bottom: calc(clamp(14px, 2dvh, 28px) + 202px);
  }

  body:not(.main-menu-active):not(.pregame) .bearing-log {
    max-height: min(13dvh, 120px);
    gap: 5px;
  }

  body:not(.main-menu-active):not(.pregame) .bearing-item {
    padding: 6px 7px;
  }

  body:not(.main-menu-active):not(.pregame) .bearing-title {
    font-size: clamp(0.54rem, 0.76dvh, 0.64rem);
  }

  body:not(.main-menu-active):not(.pregame) .bearing-item em,
  body:not(.main-menu-active):not(.pregame) .bearing-item > span:last-child {
    font-size: clamp(0.52rem, 0.72dvh, 0.62rem);
  }

  body:not(.main-menu-active):not(.pregame) .camera-controls,
  body:not(.main-menu-active):not(.pregame) .camera-controls.collapsed {
    right: clamp(10px, 1.15vw, 18px);
    bottom: clamp(14px, 2dvh, 28px);
    width: clamp(238px, 20vw, 282px);
    padding: 6px;
  }

  body:not(.main-menu-active):not(.pregame) .turn-pressure-gauge {
    right: clamp(10px, 1.15vw, 18px);
    bottom: calc(clamp(14px, 2dvh, 28px) + 124px);
  }

  body:not(.main-menu-active):not(.pregame):has(.camera-controls:not(.collapsed)) .turn-pressure-gauge {
    bottom: calc(clamp(14px, 2dvh, 28px) + 274px);
  }

  body:not(.main-menu-active):not(.pregame) .camera-command-grid {
    grid-template-columns: repeat(3, minmax(40px, 1fr));
    gap: 6px;
  }

  body:not(.main-menu-active):not(.pregame) .camera-controls button {
    min-width: 40px;
    min-height: 40px;
    font-size: clamp(0.52rem, 0.76dvh, 0.64rem);
  }

  body:not(.main-menu-active):not(.pregame) .click-commands-toggle {
    min-height: 36px !important;
    padding: 7px 9px !important;
  }

  body:not(.main-menu-active):not(.pregame) .bottom-strip {
    left: clamp(10px, 1.15vw, 18px);
    right: clamp(10px, 1.15vw, 18px);
    bottom: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(112px, 11vw, 158px);
    gap: 10px;
    min-height: 30px;
    padding: 7px 10px;
    font-size: clamp(0.56rem, 0.76dvh, 0.66rem);
  }

  body:not(.main-menu-active):not(.pregame) #resultLine {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.main-menu-active):not(.pregame) .bottom-strip .meter {
    width: auto;
    min-width: 110px;
  }

  body:not(.main-menu-active):not(.pregame) .controls-help-overlay {
    right: clamp(10px, 1.15vw, 18px);
    bottom: clamp(220px, 28dvh, 288px);
    width: min(360px, calc(100vw - 28px));
    max-height: min(68dvh, 520px);
    overflow: auto;
    padding: 11px;
  }

  body:not(.main-menu-active):not(.pregame) .hud-tooltip {
    max-width: 220px;
    padding: 8px 9px;
    font-size: clamp(0.58rem, 0.76dvh, 0.66rem);
  }

  body:not(.main-menu-active):not(.pregame) .tutorial-callout {
    width: min(292px, calc(100vw - 32px));
    padding: 13px 14px;
  }

  body:not(.main-menu-active):not(.pregame) .tutorial-callout h2 {
    font-size: clamp(0.86rem, 1.2dvh, 1rem);
  }

  body:not(.main-menu-active):not(.pregame) .tutorial-callout p {
    font-size: clamp(0.66rem, 0.9dvh, 0.76rem);
    line-height: 1.4;
  }
}

@media (max-width: 1023px) {
  body:not(.main-menu-active):not(.pregame) .topbar {
    top: 8px;
    left: 8px;
    right: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body:not(.main-menu-active):not(.pregame) .topbar .brand {
    width: min(360px, 74vw);
    height: 72px;
    min-width: 0;
  }

  body:not(.main-menu-active):not(.pregame) .topbar .brand-logo {
    width: min(330px, 76vw);
  }

  body:not(.main-menu-active):not(.pregame) .phase-tabs {
    justify-self: stretch;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 44px;
    grid-template-rows: 22px 44px;
    padding: 5px;
  }

  body:not(.main-menu-active):not(.pregame) .view-button {
    min-width: 0;
    height: 44px;
    padding-inline: 6px;
    font-size: 0.58rem;
  }

  body:not(.main-menu-active):not(.pregame) .hud {
    inset: 142px 10px 96px !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel,
  body:not(.main-menu-active):not(.pregame) .fleet-panel,
  body:not(.main-menu-active):not(.pregame) .log-panel {
    position: relative;
    inset: auto;
    grid-column: 1;
    width: min(420px, 100%);
    max-height: none;
    margin: 0;
    justify-self: start;
  }

  body:not(.main-menu-active):not(.pregame) .log-panel {
    right: auto;
    bottom: auto;
  }

  body:not(.main-menu-active):not(.pregame):has(.camera-controls:not(.collapsed)) .log-panel {
    bottom: auto;
  }

  body:not(.main-menu-active):not(.pregame) .fleet-status,
  body:not(.main-menu-active):not(.pregame) .bearing-log {
    max-height: none;
  }

  body:not(.main-menu-active):not(.pregame) .bottom-strip {
    left: 10px;
    right: 10px;
    bottom: 8px;
    min-height: 34px;
    padding: 8px 10px;
    font-size: 0.58rem;
  }

  body:not(.main-menu-active):not(.pregame) #resultLine {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.main-menu-active):not(.pregame) .camera-controls,
  body:not(.main-menu-active):not(.pregame) .camera-controls.collapsed {
    right: 10px;
    bottom: 50px;
    width: min(260px, calc(100vw - 20px));
  }

  body:not(.main-menu-active):not(.pregame) .turn-pressure-gauge {
    right: 12px;
    bottom: 178px;
    width: 118px;
  }

  body:not(.main-menu-active):not(.pregame) .pressure-gauge-svg {
    width: 118px;
    height: 130px;
  }

  body:not(.main-menu-active):not(.pregame) .controls-help-overlay {
    right: 10px;
    left: 10px;
    bottom: 170px;
    width: auto;
    max-height: 58dvh;
    overflow: auto;
  }
}

/* Latest command-deck vessel readout pass: keep this after responsive rules so the hero display wins. */
body:not(.main-menu-active):not(.pregame) .attack-panel .command-line.sub-selector-line {
  min-height: clamp(210px, 25dvh, 238px) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .command-line .sub-selector-console {
  grid-template-rows: 20px minmax(166px, auto) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout {
  position: relative !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(102px, auto) 30px 30px !important;
  gap: 6px !important;
  min-height: 174px !important;
  padding-inline: 0 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav {
  position: absolute !important;
  top: 33px !important;
  z-index: 3 !important;
  width: 24px !important;
  min-width: 24px !important;
  height: 44px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav.prev {
  left: 5px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav.next {
  right: 5px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active {
  grid-column: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: calc(100% - 58px) !important;
  justify-self: center !important;
  grid-template-rows: minmax(48px, 1fr) auto 4px !important;
  min-height: 92px !important;
  padding: 8px 10px 7px !important;
  align-content: center !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
  justify-self: center !important;
  width: min(184px, 100%) !important;
  height: clamp(54px, 7dvh, 72px) !important;
  margin: 0 auto !important;
  background-position: center !important;
  background-size: contain !important;
  opacity: 0.86 !important;
  filter:
    brightness(1.08)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.42)
    drop-shadow(0 0 12px rgba(61, 221, 221, 0.28)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout.active .sub-select-hero,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active .sub-select-hero {
  opacity: 1 !important;
  filter:
    brightness(1.25)
    sepia(1)
    hue-rotate(130deg)
    saturate(1.65)
    drop-shadow(0 0 16px rgba(61, 221, 221, 0.42)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-name {
  justify-self: center !important;
  color: rgba(93, 235, 216, 0.98) !important;
  font-size: clamp(0.64rem, 1.05dvh, 0.84rem) !important;
  letter-spacing: 0.13em !important;
  text-align: center !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage .sub-select-damage {
  width: min(72px, 54%) !important;
  height: 4px !important;
  margin-top: 3px !important;
  opacity: 0.34 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  min-height: 30px !important;
  padding: 5px 9px !important;
  grid-template-columns: 32px minmax(0, 1fr) auto !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout {
  grid-template-columns: minmax(0, 1fr) auto !important;
  cursor: default;
  border-color: rgba(61, 221, 221, 0.22);
  background:
    linear-gradient(180deg, rgba(4, 24, 27, 0.94), rgba(0, 5, 8, 0.98)),
    rgba(0, 8, 10, 0.92);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout span {
  display: none;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout strong {
  justify-self: start !important;
  color: rgba(93, 235, 216, 0.88) !important;
  font-size: clamp(0.5rem, 0.8dvh, 0.62rem) !important;
  letter-spacing: 0.13em !important;
  overflow: visible !important;
  text-align: left !important;
  white-space: nowrap !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout em {
  justify-self: end;
  color: rgba(200, 216, 224, 0.86);
  font-size: clamp(0.48rem, 0.76dvh, 0.58rem);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  grid-template-columns: 32px minmax(0, 1fr) 0 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button strong {
  justify-self: start !important;
  font-size: clamp(0.52rem, 0.82dvh, 0.64rem) !important;
  letter-spacing: 0.14em !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  filter: grayscale(0.85);
  border-color: rgba(90, 128, 144, 0.14);
  color: rgba(90, 128, 144, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.035),
    inset 0 -10px 16px rgba(0, 0, 0, 0.38);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled strong {
  color: rgba(90, 128, 144, 0.62) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled span::before,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled span::after {
  opacity: 0.42;
}

/* Final endgame debrief placement: wider fixed board, shifted left, no shell scrollbar. */
body:not(.main-menu-active):not(.pregame) .end-screen {
  inset: clamp(52px, 6.5dvh, 72px) auto auto clamp(4px, 0.7vw, 12px) !important;
  width: min(620px, calc(100vw - 28px)) !important;
  max-height: none !important;
  overflow: visible !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell {
  max-height: none !important;
  overflow: visible !important;
  padding: clamp(16px, 1.7dvh, 20px) !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero {
  margin-bottom: 13px !important;
  padding-bottom: 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero h2 {
  font-size: clamp(1.72rem, 2.5dvh, 2.28rem) !important;
  line-height: 1 !important;
}

body:not(.main-menu-active):not(.pregame) .end-hero p,
body:not(.main-menu-active):not(.pregame) .end-hero small {
  font-size: clamp(0.82rem, 1.18dvh, 0.98rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 11px !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights div {
  min-height: 60px;
  padding: 11px 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights span,
body:not(.main-menu-active):not(.pregame) .end-stat span,
body:not(.main-menu-active):not(.pregame) .end-card-heading span {
  font-size: clamp(0.76rem, 1.02dvh, 0.92rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-highlights strong {
  font-size: clamp(1.36rem, 2dvh, 1.74rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-stats-grid {
  gap: 10px !important;
}

body:not(.main-menu-active):not(.pregame) .end-player-card {
  gap: 10px !important;
  padding: 13px !important;
}

body:not(.main-menu-active):not(.pregame) .end-card-heading strong {
  font-size: clamp(0.82rem, 1.12dvh, 1rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat-list {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat strong {
  font-size: clamp(1.02rem, 1.45dvh, 1.24rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-actions {
  margin-top: 11px !important;
}

body:not(.main-menu-active):not(.pregame) .end-actions button {
  min-height: 46px !important;
  font-size: clamp(0.92rem, 1.26dvh, 1.08rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell::-webkit-scrollbar {
  display: none !important;
}

/* Final vessel preview interaction pass: arrows browse only, the center console commits selection. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage {
  cursor: pointer !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
  width: min(140px, 78%) !important;
  height: clamp(36px, 5.2dvh, 48px) !important;
  opacity: 0.7 !important;
  filter:
    brightness(0.46)
    sepia(1)
    hue-rotate(132deg)
    saturate(1.65)
    drop-shadow(0 0 8px rgba(35, 142, 150, 0.2)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout.active .sub-select-hero,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage.active .sub-select-hero,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage:hover .sub-select-hero,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-stage:focus-visible .sub-select-hero {
  opacity: 0.82 !important;
  filter:
    brightness(0.58)
    sepia(1)
    hue-rotate(132deg)
    saturate(1.85)
    drop-shadow(0 0 10px rgba(61, 221, 221, 0.28)) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-nav:disabled {
  cursor: not-allowed !important;
  opacity: 0.32 !important;
  filter: grayscale(0.8) brightness(0.7) !important;
  box-shadow: inset 0 0 0 1px rgba(90, 128, 144, 0.18) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  grid-template-columns: 42px minmax(0, 1fr) !important;
  min-height: 34px !important;
  padding: 6px 10px !important;
  border-color: rgba(61, 221, 198, 0.26) !important;
  background:
    linear-gradient(180deg, rgba(7, 39, 42, 0.82), rgba(0, 7, 10, 0.96)),
    rgba(0, 8, 10, 0.9) !important;
  color: rgba(200, 246, 242, 0.86) !important;
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.08),
    inset 0 -12px 18px rgba(0, 0, 0, 0.42),
    0 0 10px rgba(61, 221, 198, 0.08) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span {
  position: relative;
  width: 30px;
  height: 10px;
  justify-self: center;
  align-self: center;
  background: linear-gradient(90deg, transparent 0 12%, rgba(95, 232, 225, 0.8) 12% 72%, rgba(95, 232, 225, 0.35) 72% 100%);
  clip-path: polygon(0 50%, 14% 20%, 76% 20%, 100% 50%, 76% 80%, 14% 80%);
  filter: drop-shadow(0 0 6px rgba(61, 221, 221, 0.28));
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span::before,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span::after {
  content: "";
  position: absolute;
  left: -4px;
  width: 8px;
  height: 2px;
  background: rgba(95, 232, 225, 0.72);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span::before {
  top: 1px;
  transform: rotate(-22deg);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span::after {
  bottom: 1px;
  transform: rotate(22deg);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button strong {
  justify-self: start !important;
  color: rgba(200, 246, 242, 0.86) !important;
  font-size: clamp(0.5rem, 0.78dvh, 0.6rem) !important;
  letter-spacing: 0.11em !important;
  overflow: hidden !important;
  text-align: left !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:hover:not(:disabled),
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:focus-visible:not(:disabled) {
  border-color: rgba(93, 235, 216, 0.62) !important;
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.12),
    inset 0 -12px 18px rgba(0, 0, 0, 0.34),
    0 0 16px rgba(61, 221, 198, 0.18) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled {
  cursor: not-allowed !important;
  opacity: 0.34 !important;
  filter: grayscale(0.9) brightness(0.72) !important;
  border-color: rgba(90, 128, 144, 0.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.03),
    inset 0 -10px 16px rgba(0, 0, 0, 0.42) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled strong {
  color: rgba(90, 128, 144, 0.62) !important;
}

/* Post-game stats sit tighter to the left so the revealed arena has more breathing room. */
body:not(.main-menu-active):not(.pregame) .end-screen {
  inset: clamp(48px, 6dvh, 68px) auto auto 0 !important;
  width: min(600px, calc(100vw - 14px)) !important;
}

/* Readability repair for the vessel change control: disabled should mean unavailable, not unreadable. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  grid-template-columns: 34px minmax(0, 1fr) !important;
  min-height: 42px !important;
  padding: 7px 10px !important;
  align-items: center !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button strong {
  color: rgba(204, 248, 242, 0.92) !important;
  display: block !important;
  font-size: clamp(0.54rem, 0.9dvh, 0.68rem) !important;
  letter-spacing: 0.1em !important;
  line-height: 1.14 !important;
  max-width: 100% !important;
  overflow: visible !important;
  text-align: left !important;
  text-overflow: clip !important;
  text-wrap: balance;
  white-space: normal !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled {
  opacity: 0.72 !important;
  filter: grayscale(0.55) brightness(0.82) !important;
  background:
    linear-gradient(180deg, rgba(5, 22, 25, 0.9), rgba(0, 5, 8, 0.98)),
    rgba(0, 7, 9, 0.92) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled strong {
  color: rgba(122, 166, 169, 0.9) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled span {
  opacity: 0.64 !important;
}

/* Larger torpedo count readout for command-deck legibility. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout {
  min-height: 36px !important;
  padding: 7px 10px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout strong {
  font-size: clamp(0.62rem, 1.02dvh, 0.78rem) !important;
  letter-spacing: 0.14em !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout em {
  font-size: clamp(0.62rem, 1.02dvh, 0.78rem) !important;
  letter-spacing: 0.12em !important;
  font-weight: 800 !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout.low-torpedoes {
  border-color: rgba(255, 174, 86, 0.7) !important;
  box-shadow: inset 0 0 18px rgba(255, 174, 86, 0.12), 0 0 12px rgba(255, 174, 86, 0.1) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout.low-torpedoes em {
  color: #ffb66c !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout.out-of-torpedoes {
  border-color: rgba(255, 77, 93, 0.78) !important;
  background: linear-gradient(180deg, rgba(66, 7, 14, 0.58), rgba(4, 10, 12, 0.94)) !important;
  box-shadow: inset 0 0 22px rgba(255, 77, 93, 0.15), 0 0 14px rgba(255, 77, 93, 0.11) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout.out-of-torpedoes strong,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout.out-of-torpedoes em {
  color: #ff4d5d !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout.out-of-torpedoes .sub-select-hero {
  opacity: 0.48 !important;
  filter: drop-shadow(0 0 8px rgba(255, 77, 93, 0.16)) !important;
}

/* Center the Change Selected Vessel label with its torpedo icon. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  justify-content: center !important;
  justify-items: center !important;
  column-gap: 10px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span {
  align-self: center !important;
  justify-self: end !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button strong {
  align-self: center !important;
  justify-self: start !important;
  line-height: 1 !important;
  padding-top: 0.03em !important;
}

/* Convoy turn-choice and team-comms overlay. */
body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .command-step-list,
body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .command-hidden-action,
body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .primary.fire {
  opacity: 0.2;
  pointer-events: none;
  filter: saturate(0.55);
}

body:not(.main-menu-active):not(.pregame) .convoy-action-panel {
  position: absolute;
  z-index: 8;
  inset: 72px 16px 16px;
  display: grid;
  place-items: stretch;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-panel.hidden {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-card {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid rgba(61, 221, 221, 0.68);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 0%, rgba(61, 221, 221, 0.14), transparent 48%),
    linear-gradient(180deg, rgba(2, 16, 20, 0.96), rgba(0, 8, 12, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(154, 255, 246, 0.08),
    inset 0 0 28px rgba(61, 221, 221, 0.09),
    0 0 28px rgba(0, 0, 0, 0.62);
}

body:not(.main-menu-active):not(.pregame) .convoy-kicker {
  color: #5a8090;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-card h3 {
  margin: 0 0 4px;
  color: #e6fbff;
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(1.08rem, 2.1dvh, 1.48rem);
  letter-spacing: 0.14em;
  line-height: 1.08;
  text-transform: uppercase;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-card p {
  margin: 0;
  color: #a9c7d0;
  font-size: 0.82rem;
  line-height: 1.35;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-banner {
  position: fixed;
  left: 50%;
  bottom: 82px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(560px, calc(100vw - 48px));
  min-height: 70px;
  padding: 13px 18px;
  border: 1px solid rgba(61, 221, 122, 0.76);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 16% 50%, rgba(61, 221, 122, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(5, 32, 28, 0.94), rgba(0, 10, 12, 0.97));
  color: #dfffee;
  box-shadow:
    inset 0 0 0 1px rgba(189, 255, 225, 0.08),
    inset 0 0 26px rgba(61, 221, 122, 0.1),
    0 0 34px rgba(36, 220, 132, 0.18),
    0 16px 44px rgba(0, 0, 0, 0.44);
  transform: translate(-50%, 28px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 260ms ease;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-banner.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-banner.exiting {
  transform: translate(-50%, 18px);
  opacity: 0;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-banner > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(61, 221, 122, 0.74);
  border-radius: 50%;
  color: #3ddd7a;
  font-size: 1.45rem;
  line-height: 1;
  text-shadow: 0 0 14px rgba(61, 221, 122, 0.7);
  box-shadow:
    inset 0 0 18px rgba(61, 221, 122, 0.16),
    0 0 18px rgba(61, 221, 122, 0.22);
  animation: convoyPingIconPulse 1.2s ease-in-out infinite;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-banner strong,
body:not(.main-menu-active):not(.pregame) .convoy-ping-banner small {
  display: block;
  font-family: "Share Tech Mono", monospace;
  text-transform: uppercase;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-banner strong {
  color: #f2fff8;
  font-size: clamp(1rem, 1.4vw, 1.28rem);
  letter-spacing: 0.18em;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-banner small {
  margin-top: 4px;
  color: rgba(175, 238, 211, 0.78);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

@keyframes convoyPingIconPulse {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.74;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-areas:
    "icon title"
    "icon sub";
  align-items: center;
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid rgba(61, 221, 221, 0.44);
  background:
    linear-gradient(180deg, rgba(5, 32, 38, 0.92), rgba(0, 10, 14, 0.96));
  color: #d8fff8;
  cursor: pointer;
  text-align: left;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 -16px 28px rgba(61, 221, 221, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice:hover,
body:not(.main-menu-active):not(.pregame) .convoy-action-choice:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(61, 221, 221, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 22px rgba(61, 221, 221, 0.16);
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice.ping-choice {
  border-color: rgba(61, 221, 122, 0.48);
  box-shadow: inset 0 -16px 28px rgba(61, 221, 122, 0.055);
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice.ping-choice:hover,
body:not(.main-menu-active):not(.pregame) .convoy-action-choice.ping-choice:focus-visible {
  border-color: rgba(61, 221, 122, 0.92);
  box-shadow: 0 0 24px rgba(61, 221, 122, 0.15);
}

body:not(.main-menu-active):not(.pregame) .convoy-action-icon {
  grid-area: icon;
  color: #3ddddd;
  font-size: 1.55rem;
  line-height: 1;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice strong {
  grid-area: title;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.96rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice em {
  grid-area: sub;
  color: #8bb9c2;
  font-size: 0.74rem;
  font-style: normal;
  line-height: 1.25;
}

.turn-ready-modal {
  position: fixed;
  inset: 0;
  z-index: 86;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(61, 221, 221, 0.08), transparent 34%),
    rgba(0, 5, 8, 0.66);
  backdrop-filter: blur(3px);
}

.turn-ready-modal.hidden {
  display: none !important;
}

.turn-ready-box {
  width: min(420px, calc(100vw - 48px));
  padding: 26px 30px 28px;
  border: 1px solid rgba(61, 221, 221, 0.65);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(5, 28, 34, 0.98), rgba(0, 8, 12, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 0 34px rgba(61, 221, 221, 0.08),
    0 0 44px rgba(0, 0, 0, 0.72);
  text-align: center;
}

.turn-ready-box span,
.turn-ready-box h2,
.turn-ready-box button {
  font-family: "Share Tech Mono", monospace;
  text-transform: uppercase;
}

.turn-ready-box span {
  display: block;
  margin-bottom: 8px;
  color: #5a8090;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
}

.turn-ready-box h2 {
  margin: 0;
  color: #ecffff;
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  letter-spacing: 0.12em;
}

.turn-ready-box p {
  margin: 14px 0 22px;
  color: #a9cbd3;
  font-size: 0.95rem;
}

.turn-ready-box .primary {
  width: 100%;
  min-height: 48px;
  border-color: rgba(61, 221, 221, 0.9);
  color: #ecffff;
  letter-spacing: 0.18em;
  box-shadow:
    inset 0 0 24px rgba(61, 221, 221, 0.13),
    0 0 22px rgba(61, 221, 221, 0.12);
}

.turn-pressure-gauge {
  position: fixed;
  right: clamp(24px, 2.4vw, 42px);
  bottom: calc(clamp(28px, 4.2dvh, 46px) + 132px);
  z-index: 7;
  width: 132px;
  display: grid;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 18px rgba(61, 221, 221, 0.1));
}

body:not(.main-menu-active):not(.pregame):has(.camera-controls:not(.collapsed)) .turn-pressure-gauge {
  bottom: calc(clamp(28px, 4.2dvh, 46px) + 288px);
}

.turn-pressure-gauge.hidden {
  display: none !important;
}

.turn-pressure-gauge.entering {
  animation: pressure-gauge-in 400ms ease-out both;
}

.turn-pressure-gauge.exiting {
  animation: pressure-gauge-out 300ms ease-in both;
}

.turn-pressure-gauge.timeout-flash .pressure-face,
.turn-pressure-gauge.timeout-flash .pressure-glass {
  animation: pressure-timeout-flash 420ms ease-out;
}

.pressure-gauge-svg {
  width: 132px;
  height: 146px;
  overflow: visible;
}

.pressure-bezel {
  fill: none;
  stroke: url("#pressureBezelGradient");
  stroke-width: 12;
  filter: drop-shadow(0 0 8px rgba(61, 221, 221, 0.16));
}

.pressure-face {
  fill: url("#pressureFaceGradient");
  stroke: rgba(154, 255, 246, 0.18);
  stroke-width: 1.4;
}

.pressure-glass {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.045);
  stroke-width: 1;
}

.pressure-zone {
  fill: none;
  stroke-linecap: round;
  stroke-width: 6;
}

.pressure-zone-green {
  stroke: rgba(61, 221, 122, 0.7);
}

.pressure-zone-yellow {
  stroke: rgba(245, 200, 66, 0.72);
}

.pressure-zone-red {
  stroke: rgba(255, 77, 93, 0.88);
  filter: url("#pressureRedGlow");
}

.pressure-ticks line {
  stroke: rgba(90, 128, 144, 0.88);
  stroke-linecap: round;
}

.pressure-ticks line.major {
  stroke-width: 1.25;
}

.pressure-ticks line.minor {
  stroke-width: 0.62;
  opacity: 0.75;
}

.pressure-scale-label,
.pressure-face-label,
.pressure-maker-label {
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pressure-scale-label {
  fill: rgba(151, 193, 204, 0.58);
  font-size: 5px;
}

.pressure-face-label {
  fill: rgba(90, 128, 144, 0.92);
  font-size: 7.5px;
  letter-spacing: 0.14em;
}

.pressure-maker-label {
  fill: rgba(90, 128, 144, 0.72);
  font-size: 6.2px;
}

.pressure-needle path {
  fill: #3ddddd;
  stroke: rgba(234, 255, 255, 0.75);
  stroke-width: 0.25;
  filter: url("#pressureCyanGlow");
}

.turn-pressure-gauge.is-critical .pressure-needle path {
  fill: #eaffff;
  filter: url("#pressureRedGlow");
}

.pressure-hub-outer {
  fill: #071015;
  stroke: rgba(61, 221, 221, 0.82);
  stroke-width: 1.4;
}

.pressure-hub-inner {
  fill: #3ddddd;
  opacity: 0.92;
}

.pressure-bolt {
  fill: #071015;
  stroke: rgba(154, 255, 246, 0.26);
  stroke-width: 0.8;
}

.turn-pressure-gauge > strong {
  min-height: 16px;
  color: #ff4d5d;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 77, 93, 0.42);
  animation: pressure-critical-pulse 1s ease-in-out infinite;
}

.turn-pressure-gauge > strong.hidden {
  visibility: hidden;
}

body.main-menu-active .turn-pressure-gauge,
body.pregame .turn-pressure-gauge,
body.main-menu-active .turn-ready-modal,
body.pregame .turn-ready-modal {
  display: none !important;
}

@keyframes pressure-gauge-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pressure-gauge-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes pressure-critical-pulse {
  0%, 100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

@keyframes pressure-timeout-flash {
  0% {
    fill: url("#pressureFaceGradient");
  }
  40% {
    fill: rgba(120, 8, 18, 0.88);
  }
  100% {
    fill: url("#pressureFaceGradient");
  }
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "num code"
    "icon icon"
    "bars bars";
  gap: 4px;
  min-height: 88px;
  padding: 8px;
  border: 1px solid rgba(61, 221, 122, 0.34);
  background: linear-gradient(180deg, rgba(4, 28, 26, 0.95), rgba(0, 10, 12, 0.96));
  color: #d8fff8;
  cursor: pointer;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel.active,
body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel:hover,
body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel:focus-visible {
  border-color: rgba(61, 221, 122, 0.94);
  box-shadow: 0 0 18px rgba(61, 221, 122, 0.14), inset 0 0 18px rgba(61, 221, 122, 0.08);
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel span {
  grid-area: num;
  color: #3ddd7a;
  font-family: "Share Tech Mono", monospace;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel strong {
  grid-area: code;
  color: #dff;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.12em;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel b {
  grid-area: icon;
  width: 100%;
  height: 26px;
  background: rgba(144, 216, 226, 0.72);
  mask: var(--ship-icon) center / contain no-repeat;
  -webkit-mask: var(--ship-icon) center / contain no-repeat;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel em {
  grid-area: bars;
  display: flex;
  gap: 3px;
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel em i {
  flex: 1;
  height: 5px;
  border: 1px solid rgba(61, 221, 122, 0.42);
  background: rgba(61, 221, 122, 0.34);
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel em i.damaged {
  background: rgba(255, 184, 72, 0.36);
  border-color: rgba(255, 184, 72, 0.62);
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-vessel em i.lost {
  background: rgba(255, 77, 93, 0.36);
  border-color: rgba(255, 77, 93, 0.68);
}

body:not(.main-menu-active):not(.pregame) .convoy-ping-readout {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(61, 221, 122, 0.3);
  color: #bdeee4;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body:not(.main-menu-active):not(.pregame) .convoy-comms-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

/* Match the Change Selected Vessel label to the command-step title scale. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  grid-template-columns: 32px minmax(0, max-content) !important;
  justify-content: center !important;
  column-gap: 10px !important;
  padding-inline: 12px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button strong {
  max-width: calc(100% - 44px) !important;
  color: rgba(220, 255, 250, 0.96) !important;
  font-size: clamp(0.64rem, 0.84vw, 0.74rem) !important;
  letter-spacing: 0.08em !important;
  line-height: 1 !important;
  overflow: hidden !important;
  text-align: center !important;
  text-overflow: clip !important;
  text-wrap: nowrap !important;
  white-space: nowrap !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button:disabled strong {
  color: rgba(122, 166, 169, 0.92) !important;
}

/* Game Settings placement repair: keep join controls, actions, and summary in separate lanes. */
body.main-menu-active .sonar-menu-panel.engagement-open {
  width: min(1240px, calc(100vw - clamp(24px, 4vw, 76px))) !important;
  max-height: calc(100dvh - clamp(18px, 3dvh, 34px)) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
  inset: 18.8% 6.8% 4.8% !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto auto !important;
  align-content: stretch !important;
  gap: clamp(5px, 0.75dvh, 9px) !important;
  min-height: 0 !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title {
  gap: 3px !important;
  margin-bottom: 0 !important;
}

body.main-menu-active .sonar-settings-layout {
  min-height: 0 !important;
  align-items: stretch !important;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr) !important;
  gap: clamp(12px, 1.1vw, 18px) !important;
}

body.main-menu-active .sonar-settings-column {
  min-height: 0 !important;
  align-content: start !important;
  gap: clamp(6px, 0.72dvh, 10px) !important;
  padding: clamp(8px, 0.82vw, 12px) !important;
}

body.main-menu-active .sonar-settings-column > .sonar-section-label {
  padding-bottom: 5px !important;
}

body.main-menu-active .sonar-engagement-group,
body.main-menu-active .sonar-engagement-field,
body.main-menu-active .sonar-settings-section-join,
body.main-menu-active .sonar-engagement-lan,
body.main-menu-active .sonar-engagement-roster {
  gap: 5px !important;
}

body.main-menu-active .sonar-select-card {
  min-height: clamp(48px, 5.4dvh, 60px) !important;
  padding: 7px 10px !important;
}

body.main-menu-active .sonar-select-card strong {
  font-size: clamp(0.84rem, 1.05dvh, 1rem) !important;
}

body.main-menu-active .sonar-select-card small,
body.main-menu-active .sonar-mode-option small,
body.main-menu-active .sonar-engagement-field small {
  font-size: clamp(0.61rem, 0.84dvh, 0.72rem) !important;
  line-height: 1.14 !important;
}

body.main-menu-active .sonar-mini-select,
body.main-menu-active .sonar-menu-back,
body.main-menu-active .sonar-menu-launch,
body.main-menu-active .sonar-engagement-field select,
body.main-menu-active .sonar-engagement-lan input {
  min-height: 30px !important;
}

body.main-menu-active .sonar-mode-option {
  min-height: clamp(52px, 5.8dvh, 66px) !important;
  padding: 8px 10px !important;
}

body.main-menu-active .sonar-mode-options {
  gap: 7px !important;
}

body.main-menu-active .sonar-engagement-lan {
  padding: 8px !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

body.main-menu-active .sonar-engagement-roster {
  padding: 6px !important;
}

body.main-menu-active .sonar-roster-teams {
  gap: 6px !important;
}

body.main-menu-active .sonar-roster-team {
  gap: 4px !important;
}

body.main-menu-active .sonar-roster-slot {
  gap: 5px !important;
}

body.main-menu-active .sonar-roster-slot > strong,
body.main-menu-active .sonar-seat-fixed,
body.main-menu-active .sonar-seat-toggle {
  min-height: 22px !important;
}

body.main-menu-active .sonar-roster-slot > strong {
  min-width: 22px !important;
  font-size: 0.58rem !important;
}

body.main-menu-active .sonar-seat-fixed,
body.main-menu-active .sonar-seat-toggle {
  font-size: 0.56rem !important;
}

body.main-menu-active .sonar-engagement-roster small {
  display: none !important;
}

body.main-menu-active .sonar-engagement-lan strong {
  grid-column: 1 / -1 !important;
  font-size: 0.72rem !important;
  line-height: 1.18 !important;
}

body.main-menu-active .sonar-engagement-lan div {
  grid-column: 1 / -1 !important;
  grid-template-columns: minmax(74px, 0.8fr) minmax(82px, 0.92fr) minmax(74px, 0.75fr) !important;
  gap: 6px !important;
}

body.main-menu-active .sonar-engagement-lan em {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  font-size: 0.62rem !important;
  text-align: right !important;
}

body.main-menu-active .sonar-engagement-actions {
  position: relative !important;
  z-index: 3 !important;
  display: grid !important;
  grid-template-columns: minmax(180px, 0.82fr) minmax(320px, 1.4fr) !important;
  gap: 10px !important;
  margin-top: 6px !important;
}

body.main-menu-active .sonar-menu-launch {
  width: 100% !important;
}

body.main-menu-active .sonar-engagement-summary {
  position: relative !important;
  z-index: 3 !important;
  margin: 0 !important;
  padding-top: 4px !important;
  border-top: 1px solid rgba(90, 128, 144, 0.18) !important;
  line-height: 1.15 !important;
  text-align: center !important;
}

@media (min-width: 961px) and (max-height: 820px) {
  body.main-menu-active .sonar-menu-panel.engagement-open {
    transform: scale(0.82) !important;
  }

body.main-menu-active .main-menu.main-menu-exiting .sonar-menu-panel.engagement-open {
    transform: scale(0.7913) !important;
  }
}

/* Convoy action chooser: command-deck plate using the existing lamp/button language. */
body:not(.main-menu-active):not(.pregame) .convoy-action-panel {
  inset: 96px auto 12px 8px !important;
  width: min(352px, calc(100vw - 34px)) !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-card.convoy-choice-card {
  position: relative;
  align-content: start !important;
  min-height: 100%;
  gap: 14px !important;
  padding: 18px 13px 18px 48px !important;
  border-color: rgba(126, 170, 166, 0.38) !important;
  background:
    linear-gradient(180deg, rgba(8, 22, 22, 0.96), rgba(0, 6, 8, 0.98)),
    repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.028) 0 1px, transparent 1px 4px) !important;
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.62),
    inset 0 0 0 2px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(216, 232, 220, 0.09),
    inset 0 -24px 42px rgba(0, 0, 0, 0.42),
    0 0 22px rgba(61, 221, 221, 0.08) !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-card.convoy-choice-card::before {
  position: absolute;
  top: 34px;
  bottom: 34px;
  left: 23px;
  width: 1px;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(126, 170, 166, 0.24) 12%, rgba(126, 170, 166, 0.24) 88%, transparent);
  box-shadow:
    -8px 0 0 rgba(126, 170, 166, 0.045),
    8px 0 0 rgba(126, 170, 166, 0.045);
}

body:not(.main-menu-active):not(.pregame) .convoy-action-card.convoy-choice-card::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 34px;
  content: "";
  pointer-events: none;
  background:
    url("./assets/ui/button-on.png") 50% 43% / 34px 34px no-repeat,
    url("./assets/ui/button-on.png") 50% 67% / 34px 34px no-repeat;
  opacity: 0.98;
  filter: drop-shadow(0 0 9px rgba(61, 221, 221, 0.42));
}

body:not(.main-menu-active):not(.pregame) .convoy-choice-title {
  display: grid;
  gap: 14px;
  min-height: 134px;
  padding: 20px 17px;
  border: 1px solid rgba(61, 221, 221, 0.32);
  background:
    repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.032) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(4, 20, 24, 0.92), rgba(0, 7, 10, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.62),
    inset 0 0 22px rgba(61, 221, 221, 0.055);
}

body:not(.main-menu-active):not(.pregame) .convoy-choice-title .convoy-kicker {
  color: rgba(90, 180, 190, 0.78) !important;
  font-size: clamp(0.82rem, 1.42vw, 1.08rem) !important;
  letter-spacing: 0.28em !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-choice-title h3 {
  display: grid;
  gap: 7px;
  margin: 0 !important;
  color: rgba(239, 255, 255, 0.96) !important;
  font-size: clamp(1.42rem, 2.2vw, 1.92rem) !important;
  letter-spacing: 0.18em !important;
  line-height: 1.1 !important;
  text-shadow:
    0 0 16px rgba(61, 221, 221, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.12);
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice {
  position: relative;
  grid-template-columns: 82px minmax(0, 1fr) 22px !important;
  grid-template-areas: "icon copy arrow" !important;
  gap: 14px !important;
  min-height: 124px !important;
  padding: 16px 12px 16px 14px !important;
  border-color: rgba(61, 221, 221, 0.38) !important;
  background:
    repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.026) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(5, 26, 29, 0.94), rgba(0, 8, 10, 0.98)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(216, 232, 220, 0.07),
    inset 0 -18px 30px rgba(0, 0, 0, 0.38),
    0 1px 0 rgba(126, 170, 166, 0.12) !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice::before {
  position: absolute;
  inset: 13px;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(61, 221, 221, 0.18);
  box-shadow: inset 0 0 18px rgba(61, 221, 221, 0.035);
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice:hover,
body:not(.main-menu-active):not(.pregame) .convoy-action-choice:focus-visible {
  transform: translateY(-2px) !important;
  border-color: rgba(61, 221, 221, 0.76) !important;
  box-shadow:
    0 0 22px rgba(61, 221, 221, 0.16),
    inset 0 0 0 1px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(216, 232, 220, 0.1),
    inset 0 -18px 30px rgba(0, 0, 0, 0.34) !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice.ping-choice {
  border-color: rgba(61, 221, 122, 0.36) !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice.ping-choice:hover,
body:not(.main-menu-active):not(.pregame) .convoy-action-choice.ping-choice:focus-visible {
  border-color: rgba(61, 221, 122, 0.72) !important;
  box-shadow:
    0 0 22px rgba(61, 221, 122, 0.14),
    inset 0 0 0 1px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(216, 232, 220, 0.1),
    inset 0 -18px 30px rgba(0, 0, 0, 0.34) !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice.skip-choice {
  min-height: 92px !important;
  border-color: rgba(202, 165, 78, 0.36) !important;
  background:
    repeating-linear-gradient(0deg, rgba(245, 198, 66, 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(20, 20, 13, 0.94), rgba(4, 8, 7, 0.99)) !important;
  opacity: 0.92;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice.skip-choice:hover,
body:not(.main-menu-active):not(.pregame) .convoy-action-choice.skip-choice:focus-visible {
  border-color: rgba(245, 198, 66, 0.72) !important;
  box-shadow:
    0 0 18px rgba(245, 198, 66, 0.12),
    inset 0 0 0 1px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(216, 232, 220, 0.1),
    inset 0 -18px 30px rgba(0, 0, 0, 0.34) !important;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-lamp {
  position: absolute;
  top: 50%;
  left: -40px;
  z-index: 3;
  width: 34px;
  height: 34px;
  pointer-events: none;
  transform: translateY(-50%);
  background: url("./assets/ui/button-on.png") center / contain no-repeat;
}

body:not(.main-menu-active):not(.pregame) .convoy-skip-lamp {
  opacity: 0.62;
  filter:
    sepia(1)
    hue-rotate(354deg)
    saturate(2.15)
    brightness(0.92)
    drop-shadow(0 0 7px rgba(245, 198, 66, 0.34));
}

body:not(.main-menu-active):not(.pregame) .skip-choice:hover .convoy-skip-lamp,
body:not(.main-menu-active):not(.pregame) .skip-choice:focus-visible .convoy-skip-lamp {
  opacity: 1;
  filter:
    sepia(1)
    hue-rotate(354deg)
    saturate(2.6)
    brightness(1.22)
    drop-shadow(0 0 11px rgba(245, 198, 66, 0.56));
}

body:not(.main-menu-active):not(.pregame) .convoy-action-icon {
  position: relative;
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 72px;
  height: 70px;
  color: #3ddddd;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-icon::before,
body:not(.main-menu-active):not(.pregame) .convoy-action-icon::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(#3ddddd, #3ddddd) left top / 13px 1px no-repeat,
    linear-gradient(#3ddddd, #3ddddd) left top / 1px 13px no-repeat,
    linear-gradient(#3ddddd, #3ddddd) right top / 13px 1px no-repeat,
    linear-gradient(#3ddddd, #3ddddd) right top / 1px 13px no-repeat,
    linear-gradient(#3ddddd, #3ddddd) left bottom / 13px 1px no-repeat,
    linear-gradient(#3ddddd, #3ddddd) left bottom / 1px 13px no-repeat,
    linear-gradient(#3ddddd, #3ddddd) right bottom / 13px 1px no-repeat,
    linear-gradient(#3ddddd, #3ddddd) right bottom / 1px 13px no-repeat;
  opacity: 0.42;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-icon svg {
  position: relative;
  z-index: 1;
  width: 62px;
  height: 54px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 3;
  filter: drop-shadow(0 0 10px rgba(61, 221, 221, 0.32));
}

body:not(.main-menu-active):not(.pregame) .convoy-torpedo-icon img {
  position: relative;
  z-index: 1;
  width: 74px;
  max-width: 92%;
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 0 9px rgba(61, 221, 221, 0.42))
    drop-shadow(0 0 18px rgba(61, 221, 221, 0.18));
}

body:not(.main-menu-active):not(.pregame) .convoy-sonar-icon svg {
  width: 64px;
  height: 64px;
  fill: none;
  stroke-width: 4;
}

body:not(.main-menu-active):not(.pregame) .convoy-skip-icon svg {
  width: 54px;
  height: 54px;
  fill: none;
  stroke: rgba(245, 198, 66, 0.82);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 9px rgba(245, 198, 66, 0.22));
}

body:not(.main-menu-active):not(.pregame) .ping-choice .convoy-action-icon {
  color: #3ddd7a;
}

body:not(.main-menu-active):not(.pregame) .ping-choice .convoy-action-icon::before,
body:not(.main-menu-active):not(.pregame) .ping-choice .convoy-action-icon::after {
  filter: hue-rotate(78deg);
}

body:not(.main-menu-active):not(.pregame) .skip-choice .convoy-action-icon {
  color: rgba(245, 198, 66, 0.82);
}

body:not(.main-menu-active):not(.pregame) .skip-choice .convoy-action-icon::before,
body:not(.main-menu-active):not(.pregame) .skip-choice .convoy-action-icon::after {
  background:
    linear-gradient(#f5c642, #f5c642) left top / 13px 1px no-repeat,
    linear-gradient(#f5c642, #f5c642) left top / 1px 13px no-repeat,
    linear-gradient(#f5c642, #f5c642) right top / 13px 1px no-repeat,
    linear-gradient(#f5c642, #f5c642) right top / 1px 13px no-repeat,
    linear-gradient(#f5c642, #f5c642) left bottom / 13px 1px no-repeat,
    linear-gradient(#f5c642, #f5c642) left bottom / 1px 13px no-repeat,
    linear-gradient(#f5c642, #f5c642) right bottom / 13px 1px no-repeat,
    linear-gradient(#f5c642, #f5c642) right bottom / 1px 13px no-repeat;
  opacity: 0.28;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-copy {
  grid-area: copy;
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice strong {
  grid-area: auto !important;
  color: rgba(61, 221, 221, 0.98);
  font-size: clamp(1.02rem, 1.45vw, 1.22rem) !important;
  letter-spacing: 0.13em !important;
  line-height: 1.05;
}

body:not(.main-menu-active):not(.pregame) .ping-choice strong {
  color: rgba(91, 245, 158, 0.96);
}

body:not(.main-menu-active):not(.pregame) .skip-choice strong {
  color: rgba(245, 198, 66, 0.92);
}

body:not(.main-menu-active):not(.pregame) .skip-choice .convoy-action-arrow {
  color: rgba(245, 198, 66, 0.82);
  text-shadow: 0 0 13px rgba(245, 198, 66, 0.22);
}

body:not(.main-menu-active):not(.pregame) .convoy-action-choice em {
  grid-area: auto !important;
  color: rgba(185, 222, 230, 0.9);
  font-size: clamp(0.78rem, 1.05vw, 0.92rem) !important;
  line-height: 1.22 !important;
  text-transform: none;
}

body:not(.main-menu-active):not(.pregame) .convoy-action-arrow {
  grid-area: arrow;
  align-self: center;
  color: rgba(61, 221, 221, 0.9);
  font-size: 3.3rem;
  line-height: 0.7;
  text-shadow: 0 0 14px rgba(61, 221, 221, 0.3);
}

/* Post-match debrief rebuild, Step 1: five-section left-side card frame. */
body:not(.main-menu-active):not(.pregame) .end-screen {
  position: fixed !important;
  top: 0 !important;
  right: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 18 !important;
  display: block !important;
  width: clamp(280px, 20vw, 420px) !important;
  height: 100dvh !important;
  max-height: none !important;
  padding: clamp(10px, 1.15vw, 16px) !important;
  overflow: hidden !important;
  background:
    linear-gradient(180deg, rgba(4, 19, 25, 0.97), rgba(0, 7, 11, 0.99)),
    repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.028) 0 1px, transparent 1px 4px) !important;
  border-right: 1px solid rgba(61, 221, 221, 0.28);
  box-shadow:
    18px 0 44px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(61, 221, 221, 0.22),
    inset 0 0 0 2px rgba(0, 0, 0, 0.66),
    inset 0 1px 0 rgba(216, 232, 220, 0.08) !important;
  backdrop-filter: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-screen.hidden {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell {
  position: relative;
  display: grid !important;
  grid-template-rows: auto minmax(0, 0.96fr) auto minmax(0, 1.2fr) auto;
  gap: clamp(8px, 1dvh, 12px) !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell::before {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-section {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(61, 221, 221, 0.28);
  background:
    repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.026) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(5, 24, 31, 0.88), rgba(0, 8, 12, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(216, 232, 220, 0.07),
    0 0 18px rgba(61, 221, 221, 0.035);
}

body:not(.main-menu-active):not(.pregame) .end-collapse-section {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 32px;
  padding: 0;
  border-color: rgba(61, 221, 221, 0.18);
  background: rgba(0, 8, 12, 0.72);
}

body:not(.main-menu-active):not(.pregame) .end-collapse-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(61, 221, 221, 0.52);
  color: rgba(210, 250, 255, 0.92);
  background:
    linear-gradient(180deg, rgba(10, 44, 50, 0.92), rgba(0, 8, 12, 0.98));
  font: 900 0.82rem/1 var(--mono, "Share Tech Mono", monospace);
  cursor: default;
}

body:not(.main-menu-active):not(.pregame) .end-outcome-section {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(6px, 0.8dvh, 10px);
  padding: clamp(13px, 1.6dvh, 18px) clamp(12px, 1.2vw, 16px);
  text-align: center;
}

body:not(.main-menu-active):not(.pregame) .end-outcome-section .end-kicker,
body:not(.main-menu-active):not(.pregame) .end-key-stat span,
body:not(.main-menu-active):not(.pregame) .end-detail-toggle {
  margin: 0;
  color: rgba(90, 180, 190, 0.82);
  font-family: var(--mono, "Share Tech Mono", monospace);
  font-size: clamp(0.66rem, 0.88vw, 0.78rem) !important;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

body:not(.main-menu-active):not(.pregame) .end-outcome-icon {
  width: 34px;
  height: 34px;
}

body:not(.main-menu-active):not(.pregame) .end-outcome-section h2 {
  margin: 0 !important;
  color: rgba(239, 255, 255, 0.96);
  font-family: var(--mono, "Share Tech Mono", monospace);
  font-size: clamp(1.58rem, 2.2vw, 2rem) !important;
  line-height: 1.04 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:not(.main-menu-active):not(.pregame) .end-outcome-section small,
body:not(.main-menu-active):not(.pregame) .end-story-placeholder,
body:not(.main-menu-active):not(.pregame) .end-key-stat em {
  color: rgba(190, 222, 229, 0.82);
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: clamp(0.78rem, 1vw, 0.92rem) !important;
  font-style: normal;
  line-height: 1.35;
}

body:not(.main-menu-active):not(.pregame) .end-story-placeholder {
  margin: 0;
}

body:not(.main-menu-active):not(.pregame) .end-key-stats-section {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  padding: clamp(10px, 1.1dvh, 13px);
}

body:not(.main-menu-active):not(.pregame) .end-key-stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "meta value";
  gap: 3px 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid rgba(61, 221, 221, 0.22);
  background:
    linear-gradient(180deg, rgba(2, 18, 23, 0.94), rgba(0, 7, 10, 0.98));
  box-shadow: inset 0 0 16px rgba(61, 221, 221, 0.035);
}

body:not(.main-menu-active):not(.pregame) .end-key-stat span {
  grid-area: label;
  font-size: clamp(0.62rem, 0.8vw, 0.72rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-key-stat strong {
  grid-area: value;
  color: rgba(239, 255, 255, 0.98);
  font-family: var(--mono, "Share Tech Mono", monospace);
  font-size: clamp(1.42rem, 2.4vw, 1.9rem) !important;
  line-height: 1;
  letter-spacing: 0.04em;
}

body:not(.main-menu-active):not(.pregame) .end-key-stat em {
  grid-area: meta;
  color: rgba(122, 166, 169, 0.82);
  font-size: clamp(0.66rem, 0.86vw, 0.78rem) !important;
  text-transform: uppercase;
}

body:not(.main-menu-active):not(.pregame) .end-detail-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  min-height: 0;
  padding: clamp(10px, 1.1dvh, 13px);
  overflow: hidden;
}

body:not(.main-menu-active):not(.pregame) .end-detail-toggle {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(61, 221, 221, 0.34);
  background:
    linear-gradient(180deg, rgba(6, 28, 32, 0.94), rgba(0, 8, 10, 0.98));
  color: rgba(208, 246, 250, 0.92);
}

body:not(.main-menu-active):not(.pregame) .end-stats-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

body:not(.main-menu-active):not(.pregame) .end-player-card {
  border-radius: 0 !important;
  padding: 11px !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat-list {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px 10px !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat span {
  font-size: clamp(0.62rem, 0.78vw, 0.7rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat strong {
  font-size: clamp(0.88rem, 1vw, 1rem) !important;
}

body:not(.main-menu-active):not(.pregame) .end-disposition-panel {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
  margin-top: 0 !important;
  padding: clamp(10px, 1.1dvh, 13px);
}

body:not(.main-menu-active):not(.pregame) .end-actions button {
  width: 100%;
  min-height: 44px !important;
  margin: 0 !important;
}

/* Post-match card cleanup: fix row collisions, clipping, and visual hierarchy without changing placement. */
body:not(.main-menu-active):not(.pregame):has(.end-screen:not(.hidden)) .topbar .brand-logo {
  opacity: 0.08;
  filter: saturate(0.65) brightness(0.45);
}

body:not(.main-menu-active):not(.pregame):has(.end-screen:not(.hidden)) .topbar .brand {
  opacity: 0.34;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) {
  animation: end-card-slide-in 600ms cubic-bezier(0.2, 0.72, 0.16, 1) both;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-outcome-section,
body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-detail-toggle,
body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-actions {
  opacity: 0;
  animation: end-section-fade-up 320ms ease-out forwards;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-outcome-section {
  animation-delay: 600ms;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-detail-toggle {
  animation-delay: 2000ms;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-actions {
  animation-delay: 2200ms;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-key-stat {
  opacity: 0;
  animation: end-stat-rise 300ms ease-out forwards;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-key-stat:nth-child(1) {
  animation-delay: 1400ms;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-key-stat:nth-child(2) {
  animation-delay: 1520ms;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-key-stat:nth-child(3) {
  animation-delay: 1640ms;
}

body:not(.main-menu-active):not(.pregame) .end-screen:not(.hidden) .end-key-stat:nth-child(4) {
  animation-delay: 1760ms;
}

body:not(.main-menu-active):not(.pregame) .end-shell {
  grid-template-rows: auto minmax(170px, 0.96fr) auto minmax(170px, 1.18fr) auto;
}

body:not(.main-menu-active):not(.pregame) .end-outcome-section {
  align-content: start;
  gap: clamp(5px, 0.68dvh, 8px);
  padding-top: clamp(11px, 1.4dvh, 16px);
}

body:not(.main-menu-active):not(.pregame) .end-outcome-icon {
  width: 27px;
  height: 27px;
  margin: 0 0 2px;
}

body:not(.main-menu-active):not(.pregame) .end-outcome-section small {
  order: 10;
  margin-top: 2px;
  color: rgba(90, 128, 144, 0.7) !important;
  font-family: var(--mono, "Share Tech Mono", monospace) !important;
  font-size: clamp(0.55rem, 0.72vw, 0.66rem) !important;
  letter-spacing: 0.12em;
  line-height: 1.25;
}

body:not(.main-menu-active):not(.pregame) .end-story-placeholder {
  max-width: 26ch;
  color: rgba(208, 232, 232, 0.86) !important;
  font-size: clamp(0.74rem, 0.92vw, 0.86rem) !important;
  line-height: 1.32 !important;
  text-transform: none;
}

body:not(.main-menu-active):not(.pregame) .end-key-stat {
  grid-template-areas: "label value";
  min-height: 50px;
}

body:not(.main-menu-active):not(.pregame) .end-key-stat em {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-detail-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body:not(.main-menu-active):not(.pregame) .end-detail-toggle {
  align-self: center;
  width: auto;
  min-height: 24px;
  padding: 0 3px 3px;
  border: 0;
  border-bottom: 1px solid rgba(61, 221, 221, 0.34);
  background: transparent;
  color: rgba(122, 184, 190, 0.88);
  box-shadow: none;
  letter-spacing: 0.16em;
}

body:not(.main-menu-active):not(.pregame) .end-detail-toggle::after {
  content: "  ↓";
  color: rgba(61, 221, 221, 0.82);
}

body:not(.main-menu-active):not(.pregame) .end-stats-grid {
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px !important;
  min-height: 0;
  overflow-y: auto;
  padding: 1px 2px 3px 0;
}

body:not(.main-menu-active):not(.pregame) .end-player-card {
  display: grid;
  flex: 0 0 auto;
  gap: 8px !important;
  min-height: 98px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 24, 31, 0.98), rgba(0, 8, 12, 0.99)) !important;
  isolation: isolate;
}

body:not(.main-menu-active):not(.pregame) .end-player-card.team-green {
  background:
    linear-gradient(180deg, rgba(8, 58, 45, 0.96), rgba(0, 10, 12, 0.99)) !important;
}

body:not(.main-menu-active):not(.pregame) .end-player-card.team-red {
  background:
    linear-gradient(180deg, rgba(58, 12, 25, 0.96), rgba(10, 4, 8, 0.99)) !important;
}

body:not(.main-menu-active):not(.pregame) .end-player-card.team-gold {
  background:
    linear-gradient(180deg, rgba(66, 48, 13, 0.94), rgba(10, 8, 4, 0.99)) !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px 9px !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat {
  min-height: 25px;
}

@keyframes end-card-slide-in {
  from {
    opacity: 0;
    transform: translateX(-36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes end-section-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes end-stat-rise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Game Settings readability pass: keep the two-column structure, but make text and hit areas legible. */
body.main-menu-active .sonar-menu-panel.engagement-open {
  width: min(1280px, calc(100vw - clamp(16px, 2.6vw, 52px))) !important;
  max-height: calc(100dvh - clamp(12px, 2dvh, 28px)) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
  inset: clamp(112px, 18.2dvh, 168px) clamp(28px, 5.5vw, 72px) clamp(24px, 4.2dvh, 48px) !important;
  gap: clamp(9px, 1.1dvh, 15px) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title span {
  font-size: clamp(0.74rem, 0.95vw, 0.88rem) !important;
  letter-spacing: 0.18em !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title h2 {
  font-size: clamp(1.36rem, 2.05vw, 1.9rem) !important;
  letter-spacing: 0.14em !important;
  line-height: 1.05 !important;
}

body.main-menu-active .sonar-settings-layout {
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr) !important;
  gap: clamp(18px, 2vw, 28px) !important;
}

body.main-menu-active .sonar-settings-column {
  gap: clamp(12px, 1.45dvh, 18px) !important;
  padding: clamp(13px, 1.25vw, 18px) !important;
}

body.main-menu-active .sonar-settings-column > .sonar-section-label {
  font-size: clamp(0.78rem, 1vw, 0.92rem) !important;
  letter-spacing: 0.16em !important;
  padding-bottom: 8px !important;
}

body.main-menu-active .sonar-engagement-group,
body.main-menu-active .sonar-engagement-field,
body.main-menu-active .sonar-settings-section-join,
body.main-menu-active .sonar-engagement-lan,
body.main-menu-active .sonar-engagement-roster {
  gap: 8px !important;
}

body.main-menu-active .sonar-engagement-group > span,
body.main-menu-active .sonar-engagement-field > span,
body.main-menu-active .sonar-engagement-lan > span {
  color: rgba(122, 184, 190, 0.9) !important;
  font-size: clamp(0.76rem, 0.95vw, 0.88rem) !important;
  letter-spacing: 0.16em !important;
}

body.main-menu-active .sonar-select-card {
  min-height: clamp(68px, 7.1dvh, 84px) !important;
  padding: clamp(11px, 1.05vw, 15px) clamp(13px, 1.2vw, 17px) !important;
}

body.main-menu-active .sonar-select-card strong,
body.main-menu-active .sonar-mode-option strong {
  font-size: clamp(1rem, 1.25vw, 1.18rem) !important;
  letter-spacing: 0.11em !important;
  line-height: 1.05 !important;
}

body.main-menu-active .sonar-select-card small,
body.main-menu-active .sonar-mode-option small,
body.main-menu-active .sonar-engagement-field small,
body.main-menu-active .sonar-engagement-roster small {
  font-size: clamp(0.76rem, 0.92vw, 0.88rem) !important;
  letter-spacing: 0.015em !important;
  line-height: 1.32 !important;
  text-transform: none !important;
}

body.main-menu-active .sonar-mini-select,
body.main-menu-active .sonar-menu-back,
body.main-menu-active .sonar-menu-launch,
body.main-menu-active .sonar-engagement-field select,
body.main-menu-active .sonar-engagement-lan input,
body.main-menu-active .sonar-timer-options button {
  min-height: 42px !important;
  font-size: clamp(0.92rem, 1.1vw, 1.06rem) !important;
  letter-spacing: 0.12em !important;
}

body.main-menu-active .sonar-mode-option {
  min-height: clamp(86px, 8.2dvh, 106px) !important;
  padding: clamp(13px, 1.15vw, 17px) !important;
}

body.main-menu-active .sonar-mode-options {
  gap: 10px !important;
}

body.main-menu-active .sonar-mode-option em {
  font-size: clamp(0.74rem, 0.88vw, 0.82rem) !important;
  letter-spacing: 0.13em !important;
}

body.main-menu-active .sonar-engagement-roster {
  padding: 10px !important;
}

body.main-menu-active .sonar-roster-teams {
  gap: 10px !important;
}

body.main-menu-active .sonar-roster-team {
  gap: 7px !important;
}

body.main-menu-active .sonar-roster-team > span {
  font-size: clamp(0.7rem, 0.88vw, 0.78rem) !important;
  letter-spacing: 0.12em !important;
}

body.main-menu-active .sonar-roster-slot {
  gap: 7px !important;
}

body.main-menu-active .sonar-roster-slot > strong,
body.main-menu-active .sonar-seat-fixed,
body.main-menu-active .sonar-seat-toggle {
  min-height: 32px !important;
}

body.main-menu-active .sonar-roster-slot > strong {
  min-width: 32px !important;
  font-size: 0.76rem !important;
}

body.main-menu-active .sonar-seat-fixed,
body.main-menu-active .sonar-seat-toggle {
  font-size: clamp(0.72rem, 0.85vw, 0.8rem) !important;
  letter-spacing: 0.1em !important;
}

body.main-menu-active .sonar-engagement-roster small {
  display: block !important;
  margin-top: 2px !important;
}

body.main-menu-active .sonar-engagement-lan {
  padding: 12px !important;
}

body.main-menu-active .sonar-engagement-lan strong {
  font-size: clamp(0.8rem, 0.95vw, 0.9rem) !important;
  line-height: 1.3 !important;
}

body.main-menu-active .sonar-engagement-actions {
  grid-template-columns: minmax(200px, 0.8fr) minmax(360px, 1.4fr) !important;
  gap: 12px !important;
}

body.main-menu-active .sonar-engagement-summary {
  color: rgba(168, 217, 224, 0.82) !important;
  font-size: clamp(0.76rem, 0.9vw, 0.86rem) !important;
  letter-spacing: 0.1em !important;
  line-height: 1.25 !important;
}

@media (min-width: 961px) and (max-height: 820px) {
  body.main-menu-active .sonar-menu-panel.engagement-open {
    transform: none !important;
  }

  body.main-menu-active .main-menu.main-menu-exiting .sonar-menu-panel.engagement-open {
    transform: scale(0.98) !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
    overflow-y: auto !important;
    padding-right: 6px !important;
    grid-template-rows: auto auto auto auto !important;
  }

  body.main-menu-active .sonar-settings-layout {
    min-height: max-content !important;
  }
}

@media (max-width: 900px) {
  body.main-menu-active .sonar-settings-layout {
    grid-template-columns: 1fr !important;
  }
}

/* Game Settings containment pass: readable type without letting the frame spill offscreen. */
body.main-menu-active .sonar-menu-panel.engagement-open {
  width: min(1120px, calc(100vw - 36px), calc((100dvh - 24px) * 1.6)) !important;
  max-height: calc(100dvh - 24px) !important;
  transform: none !important;
  transform-origin: center center !important;
}

body.main-menu-active .main-menu.main-menu-exiting .sonar-menu-panel.engagement-open {
  transform: scale(0.98) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
  inset: clamp(92px, 17.2dvh, 148px) clamp(24px, 5.2vw, 64px) clamp(20px, 4dvh, 40px) !important;
  grid-template-rows: auto minmax(0, 1fr) auto auto !important;
  overflow: hidden !important;
}

body.main-menu-active .sonar-settings-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding-right: 6px !important;
}

body.main-menu-active .sonar-settings-layout::-webkit-scrollbar {
  width: 7px;
}

body.main-menu-active .sonar-settings-layout::-webkit-scrollbar-track {
  background: rgba(0, 12, 16, 0.7);
}

body.main-menu-active .sonar-settings-layout::-webkit-scrollbar-thumb {
  border: 1px solid rgba(61, 221, 221, 0.2);
  background: rgba(61, 221, 221, 0.34);
}

@media (max-width: 760px), (max-height: 560px) {
  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
    inset: clamp(76px, 15.5dvh, 118px) clamp(20px, 5vw, 46px) clamp(18px, 3.4dvh, 30px) !important;
  }

  body.main-menu-active .sonar-settings-column {
    padding: 11px !important;
  }

  body.main-menu-active .sonar-select-card {
    min-height: 62px !important;
  }

  body.main-menu-active .sonar-mode-option {
    min-height: 74px !important;
  }
}

/* Change Selected Vessel bar: text-only, centered console control. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button {
  grid-template-columns: 1fr !important;
  justify-content: stretch !important;
  place-items: center !important;
  column-gap: 0 !important;
  padding-inline: 10px !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button span {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.change-vessel-button strong {
  justify-self: center !important;
  max-width: 100% !important;
  text-align: center !important;
}

/* Torpedo count readout: stronger contrast plus an ammo-fill rail for at-a-glance visibility. */
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout {
  isolation: isolate !important;
  min-height: 42px !important;
  padding: 8px 12px 12px !important;
  border-color: rgba(61, 221, 221, 0.44) !important;
  background:
    linear-gradient(90deg, rgba(61, 221, 221, 0.08), transparent 52%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.98), rgba(0, 7, 10, 0.99)) !important;
  box-shadow:
    inset 0 1px 0 rgba(215, 255, 246, 0.12),
    inset 0 -12px 18px rgba(0, 0, 0, 0.42),
    0 0 16px rgba(61, 221, 221, 0.08) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout::before,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout::after {
  position: absolute;
  right: 12px;
  bottom: 6px;
  left: 12px;
  height: 4px;
  content: "";
  pointer-events: none;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout::before {
  border: 1px solid rgba(61, 221, 221, 0.18);
  background: rgba(1, 12, 15, 0.92);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout::after {
  right: auto;
  width: calc((100% - 24px) * var(--torpedo-fill, 1));
  background: linear-gradient(90deg, rgba(61, 221, 221, 0.74), rgba(166, 255, 242, 0.95));
  box-shadow: 0 0 12px rgba(61, 221, 221, 0.32);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout strong,
body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout em {
  position: relative;
  z-index: 1;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout strong {
  color: rgba(128, 244, 238, 0.98) !important;
  font-size: clamp(0.72rem, 0.9vw, 0.86rem) !important;
  letter-spacing: 0.11em !important;
  text-shadow: 0 0 8px rgba(61, 221, 221, 0.18) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout em {
  color: rgba(238, 255, 253, 0.98) !important;
  font-size: clamp(0.78rem, 0.98vw, 0.94rem) !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  text-shadow: 0 0 10px rgba(61, 221, 221, 0.26) !important;
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout.low-torpedoes::after {
  background: linear-gradient(90deg, rgba(255, 174, 86, 0.78), rgba(255, 216, 143, 0.95));
  box-shadow: 0 0 12px rgba(255, 174, 86, 0.32);
}

body:not(.main-menu-active):not(.pregame) .attack-panel .sub-torpedo-count.vessel-torpedo-readout.out-of-torpedoes::after {
  width: 0;
}

/* Post-match stats width pass: give the debrief enough horizontal room for readable labels. */
body:not(.main-menu-active):not(.pregame) .end-screen {
  width: clamp(360px, 27vw, 540px) !important;
}

body:not(.main-menu-active):not(.pregame) .end-shell {
  gap: clamp(10px, 1.1dvh, 14px) !important;
}

body:not(.main-menu-active):not(.pregame) .end-outcome-section {
  padding-inline: clamp(18px, 1.8vw, 26px) !important;
}

body:not(.main-menu-active):not(.pregame) .end-story-placeholder {
  max-width: 34ch !important;
}

body:not(.main-menu-active):not(.pregame) .end-key-stats-section,
body:not(.main-menu-active):not(.pregame) .end-detail-section,
body:not(.main-menu-active):not(.pregame) .end-actions {
  padding-inline: clamp(14px, 1.35vw, 20px) !important;
}

body:not(.main-menu-active):not(.pregame) .end-key-stat {
  gap: 4px 18px !important;
  padding-inline: clamp(14px, 1.35vw, 18px) !important;
}

body:not(.main-menu-active):not(.pregame) .end-key-stat span {
  white-space: nowrap !important;
}

body:not(.main-menu-active):not(.pregame) .end-stats-grid {
  gap: 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-player-card {
  min-height: 118px !important;
  padding: clamp(13px, 1.25vw, 17px) !important;
  overflow: visible !important;
}

body:not(.main-menu-active):not(.pregame) .end-card-heading {
  gap: 12px !important;
}

body:not(.main-menu-active):not(.pregame) .end-card-heading strong,
body:not(.main-menu-active):not(.pregame) .end-card-heading span {
  white-space: nowrap !important;
}

body:not(.main-menu-active):not(.pregame) .end-stat-list {
  grid-template-columns: repeat(2, minmax(130px, 1fr)) !important;
  gap: 8px 16px !important;
}

@media (max-width: 760px) {
  body:not(.main-menu-active):not(.pregame) .end-screen {
    width: calc(100vw - 20px) !important;
  }
}

/* Tutorial pass: red, wide, bottom-centered command board with fewer blocking highlights. */
body:not(.main-menu-active):not(.pregame) .tutorial-board-focus {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .tutorial-layer .tutorial-callout,
body:not(.main-menu-active):not(.pregame) .tutorial-layer[data-anchor] .tutorial-callout {
  top: auto !important;
  right: auto !important;
  bottom: clamp(18px, 3dvh, 34px) !important;
  left: 50% !important;
  width: min(780px, calc(100vw - 520px)) !important;
  min-width: min(520px, calc(100vw - 42px)) !important;
  max-width: calc(100vw - 42px) !important;
  padding: clamp(15px, 1.45vw, 20px) clamp(18px, 2vw, 28px) !important;
  transform: translateX(-50%) !important;
  border-color: rgba(255, 77, 93, 0.72) !important;
  background:
    repeating-linear-gradient(180deg, rgba(255, 160, 170, 0.045) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 14% 50%, rgba(255, 77, 93, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(34, 4, 12, 0.96), rgba(3, 2, 6, 0.985)) !important;
  box-shadow:
    0 22px 72px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(255, 77, 93, 0.18),
    inset 0 0 0 1px rgba(255, 214, 220, 0.08),
    inset 0 0 28px rgba(255, 77, 93, 0.08) !important;
}

body:not(.main-menu-active):not(.pregame) .tutorial-callout::after {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .tutorial-kicker {
  color: rgba(255, 121, 138, 0.95) !important;
}

body:not(.main-menu-active):not(.pregame) .tutorial-callout h2 {
  color: #fff7f8 !important;
  font-size: clamp(1rem, 1.55vw, 1.42rem) !important;
}

body:not(.main-menu-active):not(.pregame) .tutorial-callout p {
  color: rgba(238, 230, 232, 0.86) !important;
  font-size: clamp(0.76rem, 0.95vw, 0.92rem) !important;
}

body:not(.main-menu-active):not(.pregame) .tutorial-actions button {
  border-color: rgba(255, 77, 93, 0.42) !important;
  background:
    linear-gradient(180deg, rgba(42, 8, 16, 0.96), rgba(8, 2, 6, 0.99)),
    rgba(17, 3, 8, 0.95) !important;
}

body:not(.main-menu-active):not(.pregame) .tutorial-actions .secondary {
  border-color: rgba(255, 77, 93, 0.82) !important;
  box-shadow:
    0 0 18px rgba(255, 77, 93, 0.16),
    inset 0 0 18px rgba(255, 77, 93, 0.09) !important;
}

body:not(.main-menu-active):not(.pregame) .tutorial-actions button:hover,
body:not(.main-menu-active):not(.pregame) .tutorial-actions button:focus-visible {
  border-color: rgba(255, 77, 93, 0.95) !important;
}

@media (max-width: 1023px) {
  body:not(.main-menu-active):not(.pregame) .tutorial-layer .tutorial-callout,
  body:not(.main-menu-active):not(.pregame) .tutorial-layer[data-anchor] .tutorial-callout {
    width: calc(100vw - 32px) !important;
    min-width: 0 !important;
    bottom: 18px !important;
  }
}

/* Game Settings compact repair: keep timer duration controls clickable and reduce crowding. */
body.main-menu-active .sonar-menu-panel.engagement-open .sonar-menu-logo {
  top: -5.6% !important;
  width: min(64%, 700px) !important;
  opacity: 0.62 !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
  inset: clamp(84px, 14.4dvh, 132px) clamp(28px, 5vw, 64px) clamp(18px, 3.2dvh, 34px) !important;
  gap: clamp(7px, 0.8dvh, 11px) !important;
}

body.main-menu-active .sonar-settings-layout {
  gap: clamp(14px, 1.6vw, 22px) !important;
  overflow-y: auto !important;
}

body.main-menu-active .sonar-settings-column {
  gap: clamp(8px, 1dvh, 13px) !important;
  padding: clamp(10px, 1vw, 14px) !important;
}

body.main-menu-active .sonar-select-card {
  min-height: clamp(58px, 6.2dvh, 74px) !important;
  padding: clamp(9px, 0.9vw, 12px) clamp(11px, 1vw, 15px) !important;
}

body.main-menu-active .sonar-mode-option {
  min-height: clamp(72px, 7.2dvh, 90px) !important;
  padding: clamp(10px, 1vw, 14px) !important;
}

body.main-menu-active .sonar-mode-options {
  position: relative !important;
  z-index: 8 !important;
  overflow: visible !important;
}

body.main-menu-active .sonar-timer-options,
body.main-menu-active .sonar-timer-options.is-active {
  position: relative !important;
  z-index: 20 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(76px, 1fr)) !important;
  gap: 8px !important;
  pointer-events: auto !important;
}

body.main-menu-active .sonar-timer-options:not(.is-active) {
  display: none !important;
}

body.main-menu-active .sonar-timer-options button {
  position: relative !important;
  z-index: 21 !important;
  min-height: 40px !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  white-space: nowrap !important;
  letter-spacing: 0.08em !important;
}

body.main-menu-active .sonar-engagement-actions {
  margin-top: 4px !important;
}

body.main-menu-active .sonar-engagement-summary {
  padding-top: 2px !important;
  font-size: clamp(0.68rem, 0.78vw, 0.8rem) !important;
}

/* Game Settings breathing-room pass: keep the menu readable while preventing the logo from covering controls. */
body.main-menu-active .sonar-menu-panel.engagement-open {
  width: min(1060px, calc(100vw - clamp(44px, 10vw, 144px)), calc((100dvh - 22px) * 1.58)) !important;
  max-height: calc(100dvh - 22px) !important;
  aspect-ratio: 16 / 10 !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open::before {
  background:
    radial-gradient(ellipse at 50% 6%, rgba(50, 84, 88, 0.12), transparent 31%),
    linear-gradient(180deg, rgba(0, 9, 13, 0.74), rgba(0, 5, 9, 0.86) 62%, rgba(0, 4, 7, 0.92)) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-menu-logo {
  top: -5.2% !important;
  left: 50% !important;
  z-index: 1 !important;
  width: min(38%, 440px) !important;
  opacity: 0.28 !important;
  filter:
    saturate(0.75)
    brightness(0.72)
    drop-shadow(0 0 10px rgba(61, 221, 221, 0.05)) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
  z-index: 5 !important;
  inset: clamp(82px, 12.5dvh, 122px) clamp(34px, 5.2vw, 64px) clamp(18px, 3.1dvh, 34px) !important;
  grid-template-rows: auto minmax(0, 1fr) auto auto !important;
  gap: clamp(8px, 1dvh, 12px) !important;
  overflow: hidden !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title {
  padding: 0 0 4px !important;
  border-bottom: 1px solid rgba(90, 128, 144, 0.2) !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title span {
  font-size: clamp(0.66rem, 0.76vw, 0.78rem) !important;
  letter-spacing: 0.14em !important;
}

body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title h2 {
  font-size: clamp(1.22rem, 1.6vw, 1.58rem) !important;
  letter-spacing: 0.14em !important;
}

body.main-menu-active .sonar-settings-layout {
  align-items: stretch !important;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr) !important;
  gap: clamp(16px, 1.7vw, 24px) !important;
  min-height: 0 !important;
  padding-right: 0 !important;
  overflow: hidden !important;
}

body.main-menu-active .sonar-settings-column {
  display: grid !important;
  align-content: start !important;
  gap: clamp(9px, 1dvh, 13px) !important;
  min-height: 0 !important;
  padding: clamp(11px, 1.05vw, 15px) !important;
  background:
    linear-gradient(180deg, rgba(3, 17, 23, 0.9), rgba(1, 6, 11, 0.94)),
    repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.021) 0 1px, transparent 1px 5px) !important;
}

body.main-menu-active .sonar-settings-column > .sonar-section-label {
  font-size: clamp(0.7rem, 0.82vw, 0.82rem) !important;
  letter-spacing: 0.14em !important;
  padding-bottom: 6px !important;
}

body.main-menu-active .sonar-engagement-group,
body.main-menu-active .sonar-engagement-field,
body.main-menu-active .sonar-settings-section-join,
body.main-menu-active .sonar-engagement-lan,
body.main-menu-active .sonar-engagement-roster {
  gap: 7px !important;
}

body.main-menu-active .sonar-engagement-group > span,
body.main-menu-active .sonar-engagement-field > span,
body.main-menu-active .sonar-engagement-lan > span {
  font-size: clamp(0.68rem, 0.8vw, 0.78rem) !important;
  letter-spacing: 0.14em !important;
}

body.main-menu-active .sonar-engagement-modes,
body.main-menu-active .sonar-format-modes {
  gap: 8px !important;
}

body.main-menu-active .sonar-select-card {
  min-height: clamp(58px, 6dvh, 72px) !important;
  padding: clamp(9px, 0.9vw, 12px) clamp(11px, 1vw, 15px) !important;
}

body.main-menu-active .sonar-select-card strong,
body.main-menu-active .sonar-mode-option strong {
  font-size: clamp(0.92rem, 1.05vw, 1.08rem) !important;
  letter-spacing: 0.1em !important;
  line-height: 1.05 !important;
}

body.main-menu-active .sonar-select-card small,
body.main-menu-active .sonar-mode-option small,
body.main-menu-active .sonar-engagement-field small,
body.main-menu-active .sonar-engagement-roster small {
  font-size: clamp(0.7rem, 0.82vw, 0.8rem) !important;
  line-height: 1.24 !important;
}

body.main-menu-active .sonar-toggle-row.commander-counts {
  gap: 8px !important;
}

body.main-menu-active .sonar-mini-select,
body.main-menu-active .sonar-menu-back,
body.main-menu-active .sonar-menu-launch,
body.main-menu-active .sonar-engagement-field select,
body.main-menu-active .sonar-engagement-lan input,
body.main-menu-active .sonar-timer-options button {
  min-height: 36px !important;
  font-size: clamp(0.82rem, 0.92vw, 0.96rem) !important;
  letter-spacing: 0.11em !important;
}

body.main-menu-active .sonar-engagement-roster {
  padding: 8px !important;
}

body.main-menu-active .sonar-roster-teams,
body.main-menu-active .sonar-roster-slot {
  gap: 6px !important;
}

body.main-menu-active .sonar-seat-fixed,
body.main-menu-active .sonar-seat-toggle,
body.main-menu-active .sonar-roster-slot > strong {
  min-height: 28px !important;
}

body.main-menu-active .sonar-mode-options {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 9px !important;
}

body.main-menu-active .sonar-mode-option {
  min-height: clamp(76px, 7dvh, 90px) !important;
  padding: clamp(10px, 0.95vw, 13px) !important;
}

body.main-menu-active .sonar-timer-options,
body.main-menu-active .sonar-timer-options.is-active {
  grid-column: 1 / -1 !important;
  grid-template-columns: repeat(3, minmax(88px, 1fr)) !important;
  gap: 8px !important;
}

body.main-menu-active .sonar-engagement-actions {
  display: grid !important;
  grid-template-columns: minmax(180px, 0.78fr) minmax(320px, 1.5fr) !important;
  gap: clamp(10px, 1vw, 14px) !important;
  margin-top: 2px !important;
}

body.main-menu-active .sonar-engagement-summary {
  color: rgba(160, 210, 218, 0.78) !important;
  font-size: clamp(0.7rem, 0.78vw, 0.8rem) !important;
  letter-spacing: 0.1em !important;
  line-height: 1.22 !important;
}

body.main-menu-active .sonar-timer-options button.selected {
  border-color: rgba(255, 77, 93, 0.9) !important;
  color: #efffff !important;
  background:
    linear-gradient(180deg, rgba(58, 15, 24, 0.84), rgba(9, 10, 18, 0.96)),
    rgba(255, 77, 93, 0.1) !important;
  box-shadow:
    0 0 18px rgba(255, 77, 93, 0.22),
    inset 0 0 18px rgba(255, 77, 93, 0.18),
    inset 0 1px 0 rgba(255, 225, 230, 0.1) !important;
}

@media (min-width: 901px) and (max-height: 790px) {
  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-menu-logo {
    top: -6.7% !important;
    width: min(32%, 370px) !important;
    opacity: 0.18 !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
    inset: clamp(64px, 9.5dvh, 88px) clamp(30px, 4.8vw, 58px) clamp(15px, 2.6dvh, 26px) !important;
    gap: 7px !important;
  }

  body.main-menu-active .sonar-settings-column {
    gap: 7px !important;
    padding: 10px !important;
  }

  body.main-menu-active .sonar-select-card {
    min-height: 54px !important;
    padding: 8px 10px !important;
  }

  body.main-menu-active .sonar-mode-option {
    min-height: 68px !important;
    padding: 9px 10px !important;
  }

  body.main-menu-active .sonar-select-card small,
  body.main-menu-active .sonar-mode-option small,
  body.main-menu-active .sonar-engagement-field small,
  body.main-menu-active .sonar-engagement-roster small {
    font-size: 0.68rem !important;
    line-height: 1.16 !important;
  }

  body.main-menu-active .sonar-engagement-roster small {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.main-menu-active .sonar-settings-layout,
  body.main-menu-active .sonar-mode-options {
    grid-template-columns: 1fr !important;
    overflow-y: auto !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
    overflow: hidden !important;
  }
}

/* Mobile Game Settings: turn the cinematic menu frame into a functional full-screen sheet. */
@media (max-width: 980px) {
  body.main-menu-active .sonar-menu-panel.engagement-open {
    position: fixed !important;
    inset:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left)) !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    transform: none !important;
    overflow: hidden !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-menu-frame,
  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-menu-logo,
  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-menu-items {
    display: none !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open::before {
    background:
      linear-gradient(180deg, rgba(0, 10, 15, 0.96), rgba(0, 4, 8, 0.985)),
      repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.035) 0 1px, transparent 1px 5px) !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-panel {
    position: absolute !important;
    inset: 0 !important;
    z-index: 8 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 12px !important;
    overflow: hidden !important;
    border: 1px solid rgba(61, 221, 221, 0.48) !important;
    background:
      linear-gradient(180deg, rgba(3, 17, 23, 0.94), rgba(0, 5, 10, 0.98)),
      repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.028) 0 1px, transparent 1px 5px) !important;
    box-shadow:
      0 0 26px rgba(0, 0, 0, 0.72),
      inset 0 0 26px rgba(61, 221, 221, 0.05) !important;
    pointer-events: auto !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title {
    display: grid !important;
    gap: 2px !important;
    padding: 0 0 8px !important;
    border-bottom: 1px solid rgba(90, 128, 144, 0.28) !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title span {
    font-size: clamp(0.66rem, 1.8vw, 0.78rem) !important;
  }

  body.main-menu-active .sonar-menu-panel.engagement-open .sonar-engagement-title h2 {
    font-size: clamp(1.18rem, 4.2vw, 1.62rem) !important;
    line-height: 1 !important;
  }

  body.main-menu-active .sonar-settings-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 12px !important;
    min-height: 0 !important;
    padding: 0 5px 6px 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.main-menu-active .sonar-settings-layout::-webkit-scrollbar {
    width: 8px;
  }

  body.main-menu-active .sonar-settings-layout::-webkit-scrollbar-track {
    background: rgba(3, 14, 20, 0.82);
  }

  body.main-menu-active .sonar-settings-layout::-webkit-scrollbar-thumb {
    background: rgba(61, 221, 221, 0.36);
    border: 1px solid rgba(61, 221, 221, 0.24);
  }

  body.main-menu-active .sonar-settings-column {
    gap: 10px !important;
    min-height: auto !important;
    padding: 11px !important;
  }

  body.main-menu-active .sonar-settings-column > .sonar-section-label {
    font-size: clamp(0.72rem, 2.1vw, 0.86rem) !important;
  }

  body.main-menu-active .sonar-engagement-modes,
  body.main-menu-active .sonar-format-modes,
  body.main-menu-active .sonar-mode-options {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  body.main-menu-active .sonar-select-card,
  body.main-menu-active .sonar-mode-option {
    min-height: 60px !important;
    padding: 11px 12px !important;
  }

  body.main-menu-active .sonar-select-card strong,
  body.main-menu-active .sonar-mode-option strong {
    font-size: clamp(0.96rem, 2.7vw, 1.18rem) !important;
  }

  body.main-menu-active .sonar-select-card small,
  body.main-menu-active .sonar-mode-option small,
  body.main-menu-active .sonar-engagement-field small,
  body.main-menu-active .sonar-engagement-roster small {
    font-size: clamp(0.76rem, 2vw, 0.92rem) !important;
    line-height: 1.25 !important;
  }

  body.main-menu-active .sonar-toggle-row.commander-counts {
    grid-template-columns: repeat(5, minmax(48px, 1fr)) !important;
  }

  body.main-menu-active .sonar-mini-select,
  body.main-menu-active .sonar-menu-back,
  body.main-menu-active .sonar-menu-launch,
  body.main-menu-active .sonar-engagement-field select,
  body.main-menu-active .sonar-engagement-lan input,
  body.main-menu-active .sonar-timer-options button,
  body.main-menu-active .sonar-seat-fixed,
  body.main-menu-active .sonar-seat-toggle {
    min-height: 44px !important;
    font-size: clamp(0.88rem, 2.35vw, 1rem) !important;
  }

  body.main-menu-active .sonar-timer-options,
  body.main-menu-active .sonar-timer-options.is-active {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(70px, 1fr)) !important;
    gap: 8px !important;
  }

  body.main-menu-active .sonar-engagement-actions {
    position: relative !important;
    z-index: 12 !important;
    display: grid !important;
    grid-template-columns: minmax(104px, 0.75fr) minmax(158px, 1.25fr) !important;
    gap: 9px !important;
    margin: 0 !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(90, 128, 144, 0.24) !important;
    background: linear-gradient(180deg, rgba(0, 8, 12, 0), rgba(0, 5, 9, 0.94) 24%) !important;
  }

  body.main-menu-active .sonar-engagement-summary {
    display: none !important;
  }
}

@media (max-width: 680px) {
  body.main-menu-active .sonar-engagement-modes,
  body.main-menu-active .sonar-format-modes,
  body.main-menu-active .sonar-mode-options {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile main menu: keep every option inside the landscape viewport. */
@media (max-width: 980px) {
  body.main-menu-active .main-menu {
    align-items: stretch !important;
    justify-items: stretch !important;
    min-height: 100dvh !important;
    padding:
      max(10px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left)) !important;
    overflow: hidden !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) {
    align-self: stretch !important;
    justify-self: start !important;
    display: grid !important;
    grid-template-rows: minmax(62px, 22dvh) minmax(0, 1fr) !important;
    width: min(520px, calc(100vw - max(24px, env(safe-area-inset-left)) - max(24px, env(safe-area-inset-right)))) !important;
    height: calc(100dvh - max(20px, env(safe-area-inset-top)) - max(20px, env(safe-area-inset-bottom))) !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    padding: clamp(11px, 2dvh, 16px) !important;
    overflow: hidden !important;
    border: 1px solid rgba(61, 221, 221, 0.48) !important;
    background:
      linear-gradient(180deg, rgba(2, 14, 19, 0.9), rgba(0, 4, 8, 0.97)),
      repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.028) 0 1px, transparent 1px 5px) !important;
    box-shadow:
      0 0 32px rgba(0, 0, 0, 0.7),
      inset 0 0 26px rgba(61, 221, 221, 0.06) !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open)::before {
    inset: 8px !important;
    clip-path: none !important;
    border: 1px solid rgba(61, 221, 221, 0.2) !important;
    background:
      radial-gradient(ellipse at 50% 12%, rgba(42, 92, 98, 0.14), transparent 38%),
      linear-gradient(180deg, rgba(0, 8, 12, 0.42), rgba(0, 5, 9, 0.72)) !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-frame {
    display: none !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-logo {
    position: relative !important;
    z-index: 3 !important;
    top: auto !important;
    left: auto !important;
    align-self: center !important;
    justify-self: center !important;
    width: min(84%, 390px) !important;
    transform: none !important;
    opacity: 0.92 !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-items {
    position: relative !important;
    z-index: 4 !important;
    inset: auto !important;
    display: grid !important;
    align-content: center !important;
    gap: clamp(7px, 1.8dvh, 10px) !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-item {
    grid-template-columns: 42px minmax(0, 1fr) 24px !important;
    min-height: clamp(40px, 9dvh, 52px) !important;
    padding: 0 clamp(12px, 2vw, 18px) !important;
    font-size: clamp(0.98rem, 2.8vw, 1.22rem) !important;
    letter-spacing: 0.12em !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-icon {
    width: clamp(22px, 4.8dvh, 28px) !important;
    height: clamp(22px, 4.8dvh, 28px) !important;
  }
}

/* Phone landscape main menu: use the wide viewport instead of a tall desktop slate. */
@media (max-width: 980px) and (orientation: landscape) {
  body.main-menu-active .main-menu {
    align-items: center !important;
    justify-items: start !important;
    padding:
      max(9px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(9px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left)) !important;
  }

  body.main-menu-active .main-menu-video {
    object-position: 68% center !important;
    transform: scale(1.14) !important;
    filter: saturate(1.22) contrast(1.08) brightness(1.34) !important;
  }

  body.main-menu-active .main-menu-shade {
    background:
      radial-gradient(ellipse at 74% 42%, rgba(68, 145, 160, 0.2), transparent 38%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.12) 50%, rgba(0, 0, 0, 0.28) 100%) !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) {
    align-self: center !important;
    justify-self: start !important;
    display: grid !important;
    grid-template-rows: clamp(58px, 20dvh, 86px) auto !important;
    gap: clamp(7px, 1.6dvh, 11px) !important;
    width: min(58vw, 560px) !important;
    height: auto !important;
    max-height: calc(100dvh - max(18px, env(safe-area-inset-top)) - max(18px, env(safe-area-inset-bottom))) !important;
    margin-left: clamp(2px, 1.2vw, 14px) !important;
    padding: clamp(10px, 2.2dvh, 14px) !important;
    overflow: hidden !important;
    border: 1px solid rgba(61, 221, 221, 0.48) !important;
    background:
      linear-gradient(180deg, rgba(1, 12, 17, 0.86), rgba(0, 4, 8, 0.96)),
      repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.025) 0 1px, transparent 1px 5px) !important;
    box-shadow:
      0 0 32px rgba(0, 0, 0, 0.68),
      inset 0 0 24px rgba(61, 221, 221, 0.055) !important;
    filter: drop-shadow(0 0 16px rgba(45, 216, 229, 0.12)) drop-shadow(0 22px 50px rgba(0, 0, 0, 0.54)) !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open)::before {
    inset: 7px !important;
    border: 1px solid rgba(61, 221, 221, 0.18) !important;
    background:
      radial-gradient(ellipse at 50% 20%, rgba(42, 92, 98, 0.13), transparent 44%),
      linear-gradient(180deg, rgba(0, 8, 12, 0.32), rgba(0, 5, 9, 0.62)) !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-logo {
    position: relative !important;
    z-index: 4 !important;
    top: auto !important;
    left: auto !important;
    align-self: center !important;
    justify-self: center !important;
    width: min(56%, 290px) !important;
    max-height: 100% !important;
    object-fit: contain !important;
    transform: none !important;
    opacity: 0.9 !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-items {
    position: relative !important;
    z-index: 5 !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(clamp(42px, 12.5dvh, 58px), auto) !important;
    align-content: start !important;
    gap: clamp(6px, 1.5dvh, 9px) !important;
    min-height: 0 !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-item:first-child {
    grid-column: 1 / -1 !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-item {
    grid-template-columns: clamp(30px, 6vw, 40px) minmax(0, 1fr) clamp(14px, 3vw, 22px) !important;
    min-height: clamp(42px, 12.5dvh, 58px) !important;
    padding: 0 clamp(10px, 1.8vw, 15px) !important;
    font-size: clamp(0.88rem, 2.65vw, 1.08rem) !important;
    letter-spacing: 0.11em !important;
    line-height: 1 !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-item span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-icon {
    width: clamp(20px, 5.2dvh, 28px) !important;
    height: clamp(20px, 5.2dvh, 28px) !important;
  }

  body.main-menu-active .sonar-menu-panel:not(.engagement-open) .sonar-menu-arrow {
    font-size: clamp(1.1rem, 4dvh, 1.5rem) !important;
  }
}

/* iPhone-first gameplay shell: landscape-only, one-step command deck, full-screen tactical overlays. */
.mobile-landscape-lock,
.mobile-hud-actions,
.mobile-overlay-scrim,
.mobile-overlay-close {
  display: none;
}

#scene {
  touch-action: none;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .mobile-landscape-lock {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 35%, rgba(61, 221, 221, 0.09), transparent 42%),
    linear-gradient(180deg, rgba(0, 7, 12, 0.96), rgba(0, 2, 6, 0.99));
  color: var(--console-text);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .mobile-landscape-lock > div {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(320px, 86vw);
  padding: 28px 22px;
  border: 1px solid rgba(255, 77, 93, 0.74);
  background:
    linear-gradient(180deg, rgba(44, 9, 18, 0.72), rgba(0, 5, 10, 0.94)),
    rgba(0, 5, 10, 0.92);
  box-shadow:
    0 0 34px rgba(255, 77, 93, 0.16),
    inset 0 0 22px rgba(255, 77, 93, 0.1);
  text-align: center;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .mobile-landscape-lock .scope {
  width: 44px;
  height: 44px;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .mobile-landscape-lock .landscape-lock-icon {
  width: 48px;
  height: 48px;
  display: block;
  overflow: visible;
  transform: translateZ(0);
  will-change: transform;
  filter:
    drop-shadow(0 0 10px rgba(61, 221, 221, 0.22))
    drop-shadow(0 0 7px rgba(255, 215, 106, 0.1));
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__outer,
body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__middle,
body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__core,
body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__axis {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__outer,
body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__middle,
body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__axis {
  stroke: rgba(139, 236, 245, 0.82);
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__outer {
  stroke-width: 2;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__middle {
  stroke-width: 1.4;
  opacity: 0.56;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__axis {
  stroke-width: 1.8;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .landscape-lock-icon__core {
  stroke: rgba(255, 215, 106, 0.62);
  stroke-width: 2;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .mobile-landscape-lock strong {
  color: #efffff;
  font-size: clamp(1.4rem, 8vw, 2.1rem);
  line-height: 1.05;
}

body.mobile-phone-portrait:not(.main-menu-active):not(.pregame) .mobile-landscape-lock p {
  margin: 0;
  color: rgba(200, 216, 224, 0.82);
  font: 700 0.78rem/1.35 Inter, system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .mobile-landscape-lock {
  display: none !important;
}

@media (max-width: 980px) and (orientation: portrait) {
  body:not(.main-menu-active):not(.pregame) .mobile-landscape-lock {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
      radial-gradient(circle at 50% 35%, rgba(61, 221, 221, 0.09), transparent 42%),
      linear-gradient(180deg, rgba(0, 7, 12, 0.96), rgba(0, 2, 6, 0.99));
    color: var(--console-text);
    font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }

  body:not(.main-menu-active):not(.pregame) .mobile-landscape-lock > div {
    display: grid;
    justify-items: center;
    gap: 14px;
    width: min(320px, 86vw);
    padding: 28px 22px;
    border: 1px solid rgba(255, 77, 93, 0.74);
    background:
      linear-gradient(180deg, rgba(44, 9, 18, 0.72), rgba(0, 5, 10, 0.94)),
      rgba(0, 5, 10, 0.92);
    box-shadow:
      0 0 34px rgba(255, 77, 93, 0.16),
      inset 0 0 22px rgba(255, 77, 93, 0.1);
    text-align: center;
  }

  body:not(.main-menu-active):not(.pregame) .mobile-landscape-lock .scope {
    width: 44px;
    height: 44px;
  }

  body:not(.main-menu-active):not(.pregame) .mobile-landscape-lock .landscape-lock-icon {
    width: 48px;
    height: 48px;
    display: block;
    overflow: visible;
    transform: translateZ(0);
    will-change: transform;
    filter:
      drop-shadow(0 0 10px rgba(61, 221, 221, 0.22))
      drop-shadow(0 0 7px rgba(255, 215, 106, 0.1));
  }

  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__outer,
  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__middle,
  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__core,
  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__axis {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }

  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__outer,
  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__middle,
  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__axis {
    stroke: rgba(139, 236, 245, 0.82);
  }

  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__outer {
    stroke-width: 2;
  }

  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__middle {
    stroke-width: 1.4;
    opacity: 0.56;
  }

  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__axis {
    stroke-width: 1.8;
  }

  body:not(.main-menu-active):not(.pregame) .landscape-lock-icon__core {
    stroke: rgba(255, 215, 106, 0.62);
    stroke-width: 2;
  }

  body:not(.main-menu-active):not(.pregame) .mobile-landscape-lock strong {
    color: #efffff;
    font-size: clamp(1.4rem, 8vw, 2.1rem);
    line-height: 1.05;
  }

  body:not(.main-menu-active):not(.pregame) .mobile-landscape-lock p {
    margin: 0;
    color: rgba(200, 216, 224, 0.82);
    font: 700 0.78rem/1.35 Inter, system-ui, sans-serif;
    letter-spacing: 0;
    text-transform: none;
  }
}

@media (max-width: 980px) {
  :root {
    --mobile-command-deck-width: clamp(246px, 31vw, 310px);
  }

  body:not(.main-menu-active):not(.pregame) #scene {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: var(--mobile-command-deck-width) !important;
    display: block !important;
    width: calc(100vw - var(--mobile-command-deck-width)) !important;
    min-width: calc(100vw - var(--mobile-command-deck-width)) !important;
    height: var(--sonar-visual-vh, 100dvh) !important;
    min-height: var(--sonar-visual-vh, 100dvh) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) #scene {
    left: var(--mobile-command-deck-width) !important;
    width: calc(100vw - var(--mobile-command-deck-width)) !important;
  }

  body.mobile-command-deck-hidden:not(.main-menu-active):not(.pregame) #scene,
  body.mobile-command-deck-hidden.mobile-phone-landscape:not(.main-menu-active):not(.pregame) #scene {
    left: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
  }

  body.mobile-command-deck-hidden:not(.main-menu-active):not(.pregame) .attack-panel {
    display: none !important;
    pointer-events: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .hud-tooltip,
  body:not(.main-menu-active):not(.pregame) .hud-tooltip.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .topbar {
    inset: 0;
    z-index: 24;
    pointer-events: none;
  }

  body:not(.main-menu-active):not(.pregame) .topbar .brand {
    display: none;
  }

  body:not(.main-menu-active):not(.pregame) .mobile-hud-actions {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    z-index: 34;
    display: flex;
    gap: 6px;
    pointer-events: auto;
  }

  body:not(.main-menu-active):not(.pregame) .mobile-hud-actions button,
  body:not(.main-menu-active):not(.pregame) .mobile-overlay-close {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(61, 221, 221, 0.46);
    background:
      linear-gradient(180deg, rgba(1, 21, 28, 0.9), rgba(0, 5, 10, 0.96)),
      rgba(0, 6, 10, 0.88);
    color: #c8f7ff;
    box-shadow:
      0 0 16px rgba(61, 221, 221, 0.09),
      inset 0 0 14px rgba(61, 221, 221, 0.08);
    font: 800 0.7rem/1 "Share Tech Mono", ui-monospace, monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  body:not(.main-menu-active):not(.pregame) .mobile-hud-actions button[aria-expanded="true"] {
    border-color: rgba(255, 77, 93, 0.86);
    color: #efffff;
    background:
      linear-gradient(180deg, rgba(55, 10, 20, 0.82), rgba(0, 5, 10, 0.96)),
      rgba(255, 77, 93, 0.08);
    box-shadow:
      0 0 20px rgba(255, 77, 93, 0.2),
      inset 0 0 16px rgba(255, 77, 93, 0.15);
  }

  body:not(.main-menu-active):not(.pregame) .phase-tabs {
    display: none;
  }

  body:not(.main-menu-active):not(.pregame) .hud {
    inset:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left)) !important;
    grid-template-columns: var(--mobile-command-deck-width) minmax(0, 1fr) !important;
    grid-template-rows: 1fr;
    gap: 8px;
    align-items: stretch;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel {
    grid-column: 1;
    grid-row: 1;
    width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow: hidden auto;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .panel-heading {
    margin-bottom: 8px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .panel-heading span {
    font-size: 0.68rem !important;
    letter-spacing: 0.16em;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .panel-actions {
    gap: 5px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .panel-toggle {
    display: none;
  }

  body:not(.main-menu-active):not(.pregame) .command-step-list {
    gap: 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line {
    display: none;
    min-height: 0 !important;
    padding: 10px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line[data-state="active"],
  body:not(.main-menu-active):not(.pregame) .attack-panel .coords-line[data-state="complete"] {
    display: block;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel[data-stage="choose-z"] .depth-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel[data-stage="choose-z"] .coords-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel[data-stage="aim-target"] .depth-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel[data-stage="aim-target"] .coords-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel[data-stage="target-locked"] .depth-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel[data-stage="target-locked"] .coords-line {
    display: block;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel[data-stage="choose-z"] .coords-line[data-state="locked"] {
    opacity: 0.72;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line::before {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line-main {
    gap: 6px 8px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line-main span,
  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-console > span {
    font-size: 1rem !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line-main strong,
  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-console > strong {
    font-size: 0.78rem !important;
    white-space: nowrap;
    letter-spacing: 0.1em;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line-main small {
    font-size: 0.68rem !important;
    line-height: 1.28;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-console {
    padding: 10px !important;
    gap: 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-row.vessel-readout {
    min-height: 112px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-button {
    min-height: 74px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-hero {
    height: 42px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-select-name {
    font-size: 0.7rem !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .sub-selector-nav {
    min-width: 32px;
    min-height: 54px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .torpedo-count-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel .change-vessel-button {
    min-height: 34px !important;
    font-size: 0.66rem !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .depth-line .depth-indicator {
    width: 100% !important;
    margin-top: 9px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .depth-track {
    min-height: 64px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .command-line-action {
    min-height: 38px;
    font-size: 0.68rem;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .mobile-command-revisions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 7px;
    margin-top: 8px;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .mobile-command-revisions .command-hidden-action {
    display: grid !important;
    place-items: center;
    min-height: 38px;
    border: 1px solid rgba(61, 221, 221, 0.42);
    background:
      linear-gradient(180deg, rgba(3, 28, 31, 0.9), rgba(0, 6, 8, 0.98)),
      rgba(0, 6, 8, 0.9);
    color: rgba(207, 252, 255, 0.88);
    box-shadow:
      inset 0 0 16px rgba(61, 221, 221, 0.07),
      0 0 12px rgba(61, 221, 221, 0.07);
    font: 800 0.66rem/1 "Share Tech Mono", ui-monospace, monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .mobile-command-revisions .command-hidden-action:disabled {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .mobile-command-revisions .command-hidden-action:hover:not(:disabled),
  body:not(.main-menu-active):not(.pregame) .attack-panel .mobile-command-revisions .command-hidden-action:focus-visible:not(:disabled) {
    border-color: rgba(61, 221, 221, 0.82);
    color: #ffffff;
    box-shadow:
      inset 0 0 18px rgba(61, 221, 221, 0.1),
      0 0 16px rgba(61, 221, 221, 0.12);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .primary.fire {
    position: sticky;
    bottom: 0;
    z-index: 4;
    min-height: 44px !important;
    margin-top: 8px;
    font-size: 0.78rem !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel .primary.fire:disabled {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .tutorial-layer .tutorial-callout,
  body:not(.main-menu-active):not(.pregame) .tutorial-layer[data-anchor] .tutorial-callout {
    left: calc(var(--mobile-command-deck-width) + ((100vw - var(--mobile-command-deck-width)) / 2)) !important;
    width: min(560px, calc(100vw - var(--mobile-command-deck-width) - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - var(--mobile-command-deck-width) - 32px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .convoy-action-panel {
    padding: 10px !important;
  }

  body:not(.main-menu-active):not(.pregame) .convoy-action-choice {
    min-height: 76px;
    padding: 9px;
    gap: 9px;
  }

  body:not(.main-menu-active):not(.pregame) .convoy-action-title h3,
  body:not(.main-menu-active):not(.pregame) .convoy-action-choice strong {
    font-size: clamp(1.12rem, 4.4dvh, 1.45rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .convoy-action-copy span {
    font-size: 0.86rem !important;
  }

  body:not(.main-menu-active):not(.pregame) .fleet-panel,
  body:not(.main-menu-active):not(.pregame) .log-panel,
  body:not(.main-menu-active):not(.pregame) .camera-controls,
  body:not(.main-menu-active):not(.pregame) .bottom-strip {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-overlay-open .mobile-overlay-scrim {
    position: fixed;
    inset: 0;
    z-index: 42;
    display: block;
    border: 0;
    background: rgba(0, 3, 8, 0.56);
    backdrop-filter: blur(2px);
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .topbar,
  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .hud {
    z-index: 62;
    pointer-events: auto;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .phase-tabs,
  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-panel {
    position: fixed !important;
    inset:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left)) !important;
    z-index: 64;
    display: grid !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    pointer-events: auto;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .phase-tabs {
    grid-template-columns: 1fr;
    grid-template-rows: auto repeat(3, minmax(62px, 1fr)) auto;
    align-content: stretch;
    gap: 10px;
    padding: 16px;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .lens-label {
    min-height: 34px;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(61, 221, 221, 0.22);
    font-size: 0.88rem;
    text-align: center;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .view-button {
    width: 100%;
    height: auto;
    min-height: 62px;
    grid-template-columns: 42px 1fr;
    justify-content: start;
    gap: 14px;
    padding: 12px 16px;
    font-size: 1.1rem;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .view-button .icon {
    width: 36px;
    height: 32px;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open #matchMenuBtn {
    display: none;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open #mobileCloseLensBtn,
  body:not(.main-menu-active):not(.pregame).mobile-squadron-open #mobileCloseSquadronBtn {
    display: grid;
    place-items: center;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .phase-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 48px !important;
    grid-template-rows: 48px minmax(96px, 25dvh) minmax(0, 1fr) !important;
    align-content: start !important;
    gap: 10px !important;
    padding: 14px !important;
    border: 1px solid rgba(61, 221, 221, 0.5);
    background:
      linear-gradient(180deg, rgba(3, 16, 23, 0.96), rgba(0, 5, 10, 0.985)),
      repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.028) 0 1px, transparent 1px 6px);
    box-shadow:
      0 0 34px rgba(0, 0, 0, 0.68),
      inset 0 0 26px rgba(61, 221, 221, 0.055);
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .lens-label {
    grid-column: 1 / 4 !important;
    grid-row: 1 !important;
    min-height: 48px !important;
    padding: 0 16px !important;
    border: 1px solid rgba(61, 221, 221, 0.3) !important;
    background:
      linear-gradient(180deg, rgba(0, 17, 24, 0.9), rgba(0, 6, 11, 0.98)),
      rgba(0, 6, 11, 0.9) !important;
    color: rgba(198, 235, 240, 0.92) !important;
    font-size: clamp(1rem, 3vw, 1.32rem) !important;
    letter-spacing: 0.28em !important;
    text-align: center !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open #attackViewBtn {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open #ownViewBtn {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open #combinedViewBtn {
    grid-column: 3 !important;
    grid-row: 2 !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .view-button {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(42px, 1fr) auto !important;
    place-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 96px !important;
    height: auto !important;
    gap: 8px !important;
    padding: 12px 10px !important;
    border-color: rgba(61, 221, 221, 0.3);
    background:
      radial-gradient(ellipse at 50% 28%, rgba(61, 221, 221, 0.075), transparent 54%),
      linear-gradient(180deg, rgba(2, 19, 27, 0.92), rgba(0, 5, 10, 0.98));
    color: rgba(208, 248, 255, 0.86);
    font-size: clamp(0.9rem, 2.7vw, 1.1rem) !important;
    letter-spacing: 0.16em !important;
    text-align: center !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .view-button .icon {
    width: clamp(42px, 7.8dvh, 58px) !important;
    height: clamp(38px, 7.2dvh, 52px) !important;
    opacity: 0.9;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open .view-button.active {
    border-color: rgba(255, 77, 93, 0.8) !important;
    color: #efffff !important;
    background:
      radial-gradient(ellipse at 50% 26%, rgba(255, 77, 93, 0.12), transparent 55%),
      linear-gradient(180deg, rgba(42, 13, 23, 0.9), rgba(0, 6, 10, 0.98));
    box-shadow:
      0 0 22px rgba(255, 77, 93, 0.18),
      inset 0 0 18px rgba(255, 77, 93, 0.12);
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open #mobileCloseLensBtn {
    grid-column: 4 !important;
    grid-row: 1 !important;
    width: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border-color: rgba(61, 221, 221, 0.42) !important;
    font-size: 0 !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-lens-open #mobileCloseLensBtn::before {
    content: "×";
    color: rgba(200, 255, 255, 0.92);
    font-size: 1.6rem;
    line-height: 1;
    transform: translateY(-1px);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-panel {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    padding: 14px !important;
    overflow: hidden;
    border-color: rgba(61, 221, 221, 0.5);
    background:
      linear-gradient(180deg, rgba(3, 16, 23, 0.96), rgba(0, 5, 10, 0.985)),
      repeating-linear-gradient(0deg, rgba(125, 240, 255, 0.028) 0 1px, transparent 1px 6px);
    box-shadow:
      0 0 34px rgba(0, 0, 0, 0.68),
      inset 0 0 26px rgba(61, 221, 221, 0.055);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-panel .panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin: 0 !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid rgba(61, 221, 221, 0.26);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-panel .panel-heading > span {
    overflow: hidden;
    color: rgba(200, 235, 240, 0.92);
    font-size: clamp(1.08rem, 3vw, 1.42rem);
    letter-spacing: 0.28em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-panel .panel-actions {
    display: grid;
    grid-template-columns: auto 48px;
    align-items: center;
    gap: 10px;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open #fleetScore {
    color: #7ffff5;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-panel .panel-toggle {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open #mobileCloseSquadronBtn {
    width: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open #mobileCloseSquadronBtn::before {
    content: "×";
    color: rgba(200, 255, 255, 0.92);
    font-size: 1.6rem;
    line-height: 1;
    transform: translateY(-1px);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-status.squadron-toggle-status {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    max-height: none !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .squadron-view-toggle {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    min-height: auto;
    padding: 4px;
    border-color: rgba(61, 221, 221, 0.28);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .squadron-view-toggle button {
    min-height: 60px;
    place-items: center;
    padding: 10px 12px;
    text-align: center;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .squadron-view-toggle button span {
    font-size: clamp(0.82rem, 2.3vw, 1rem);
    letter-spacing: 0.16em;
    white-space: normal;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .squadron-view-toggle button strong {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-status > .ship-health-section,
  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .fleet-status > .enemy-squadron-view {
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .enemy-squadron-view {
    display: grid;
    gap: 10px;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-section {
    gap: 10px;
    padding: 11px;
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(2, 18, 24, 0.86), rgba(0, 5, 10, 0.94)),
      rgba(0, 6, 10, 0.9);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-section.player {
    border-color: rgba(61, 221, 221, 0.42);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-section.enemy {
    border-color: rgba(255, 77, 93, 0.5);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-heading {
    min-height: 36px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(61, 221, 221, 0.16);
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-heading span {
    font-size: clamp(0.82rem, 2.2vw, 1rem);
    letter-spacing: 0.18em;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-heading strong {
    font-size: clamp(0.72rem, 1.9vw, 0.9rem);
    letter-spacing: 0.1em;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-item {
    min-height: 72px;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 0;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-label span {
    font-size: clamp(0.95rem, 2.6vw, 1.15rem);
    letter-spacing: 0.1em;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-label em {
    font-size: clamp(0.78rem, 2.1vw, 0.95rem);
    letter-spacing: 0.08em;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .ship-health-meter {
    height: 40px;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .enemy-contact-blocks {
    height: 30px;
    gap: 7px;
  }

  body:not(.main-menu-active):not(.pregame).mobile-squadron-open .enemy-contact-blocks span {
    border-radius: 0;
  }

  body:not(.main-menu-active):not(.pregame) .turn-pressure-gauge {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: scale(0.86);
    transform-origin: bottom right;
  }
}

/* iPhone landscape Convoy density: keep the whole action flow visible without changing desktop/tablet. */
body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action {
  overflow: hidden auto !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-panel {
  margin-top: 4px !important;
  padding: 0 !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-card {
  gap: 7px !important;
  padding: 7px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-card::before,
body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-card::after {
  display: none !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title {
  min-height: 46px !important;
  padding: 7px 9px !important;
  gap: 3px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title .convoy-kicker,
body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-kicker {
  font-size: clamp(0.48rem, 1.7dvh, 0.58rem) !important;
  letter-spacing: 0.18em !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title h3 {
  display: block !important;
  font-size: clamp(0.72rem, 2.8dvh, 0.94rem) !important;
  line-height: 1.05 !important;
  letter-spacing: 0.11em !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title h3 span {
  display: inline !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice {
  grid-template-columns: 36px minmax(0, 1fr) 14px !important;
  gap: 6px !important;
  min-height: 48px !important;
  padding: 5px 7px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice::before {
  inset: 5px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-icon {
  width: 32px !important;
  height: 32px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-icon::before,
body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-icon::after {
  background:
    linear-gradient(currentColor, currentColor) left top / 8px 1px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 1px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 8px 1px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 1px 8px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 8px 1px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 1px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 8px 1px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 1px 8px no-repeat !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-icon svg {
  width: 27px !important;
  height: 27px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-torpedo-icon img {
  width: 31px !important;
  max-width: 31px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-copy {
  gap: 1px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice strong {
  font-size: clamp(0.58rem, 2.1dvh, 0.72rem) !important;
  letter-spacing: 0.08em !important;
  line-height: 1 !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice em {
  display: none !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-arrow {
  font-size: 1.45rem !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-lamp {
  display: none !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-comms-card {
  align-content: start !important;
  gap: 7px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-comms-card h3 {
  margin: 0 !important;
  font-size: clamp(0.9rem, 3.2dvh, 1.08rem) !important;
  letter-spacing: 0.1em !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-comms-card p {
  display: none !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-vessel {
  min-height: 58px !important;
  padding: 5px !important;
  gap: 2px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-vessel span,
body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-vessel strong {
  font-size: clamp(0.52rem, 1.9dvh, 0.64rem) !important;
  letter-spacing: 0.08em !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-vessel b {
  height: 23px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-vessel em {
  gap: 2px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-vessel em i {
  height: 4px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-readout {
  min-height: 28px !important;
  padding: 6px 8px !important;
  gap: 6px !important;
  font-size: clamp(0.5rem, 1.75dvh, 0.6rem) !important;
  letter-spacing: 0.08em !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-comms-actions {
  grid-template-columns: 0.82fr 1.18fr !important;
  gap: 6px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-comms-actions button {
  min-height: 36px !important;
  font-size: clamp(0.54rem, 1.9dvh, 0.66rem) !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .turn-pressure-gauge {
  right: max(8px, env(safe-area-inset-right)) !important;
  bottom: max(8px, env(safe-area-inset-bottom)) !important;
  width: 82px !important;
  gap: 1px !important;
  transform: none !important;
  filter: drop-shadow(0 0 10px rgba(61, 221, 221, 0.08)) !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .pressure-gauge-svg {
  width: 82px !important;
  height: 91px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .turn-pressure-gauge > strong {
  min-height: 11px !important;
  font-size: 0.48rem !important;
  letter-spacing: 0.08em !important;
}

/* Post-match mobile polish: readable phone debrief with a true minimized rail. */
body:not(.main-menu-active):not(.pregame) .end-collapse-toggle {
  cursor: pointer !important;
}

body:not(.main-menu-active):not(.pregame) .end-detail-section.detail-collapsed {
  grid-template-rows: auto !important;
}

body:not(.main-menu-active):not(.pregame) .end-detail-section.detail-collapsed .end-stats-grid {
  display: none !important;
}

body:not(.main-menu-active):not(.pregame) .end-detail-section.detail-expanded .end-detail-toggle::after {
  content: "  ↑";
}

body:not(.main-menu-active):not(.pregame) .end-screen.minimized {
  width: 52px !important;
  cursor: pointer;
  animation: none !important;
  opacity: 1 !important;
}

body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-shell {
  display: grid !important;
  grid-template-rows: auto 1fr !important;
  gap: 8px !important;
}

body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-shell::after {
  content: "ENGAGEMENT COMPLETE";
  align-self: center;
  justify-self: center;
  color: rgba(199, 242, 246, 0.86);
  font: 800 0.66rem/1 var(--mono, "Share Tech Mono", monospace);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-collapse-section {
  display: grid;
  place-items: center;
  min-height: 40px;
}

body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-collapse-toggle {
  width: 38px;
  height: 38px;
}

body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-outcome-section,
body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-key-stats-section,
body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-detail-section,
body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-actions {
  display: none !important;
}

@media (max-width: 980px) {
  body:not(.main-menu-active):not(.pregame) .end-screen {
    top: max(8px, env(safe-area-inset-top)) !important;
    right: auto !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    z-index: 54 !important;
    width: clamp(268px, 42vw, 346px) !important;
    height: auto !important;
    max-height: none !important;
    padding: 8px !important;
    overflow: hidden !important;
    border: 1px solid rgba(61, 221, 221, 0.34);
    border-right-color: rgba(61, 221, 221, 0.48);
    box-shadow:
      12px 0 34px rgba(0, 0, 0, 0.48),
      inset 0 0 0 1px rgba(61, 221, 221, 0.16),
      inset 0 1px 0 rgba(216, 232, 220, 0.08) !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-shell {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
    gap: 7px !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-collapse-section {
    min-height: 34px;
  }

  body:not(.main-menu-active):not(.pregame) .end-collapse-toggle {
    width: 38px;
    height: 34px;
    font-size: 0.9rem;
  }

  body:not(.main-menu-active):not(.pregame) .end-outcome-section {
    gap: 4px !important;
    padding: 9px 10px !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-outcome-section .end-kicker {
    font-size: clamp(0.54rem, 1.5vw, 0.68rem) !important;
    letter-spacing: 0.18em !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-outcome-icon {
    width: 22px;
    height: 22px;
  }

  body:not(.main-menu-active):not(.pregame) .end-outcome-section h2 {
    font-size: clamp(1.08rem, 3vw, 1.42rem) !important;
    letter-spacing: 0.08em !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-outcome-section small {
    font-size: clamp(0.48rem, 1.25vw, 0.58rem) !important;
    letter-spacing: 0.09em !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-story-placeholder {
    max-width: 30ch;
    font-size: clamp(0.66rem, 1.72vw, 0.78rem) !important;
    line-height: 1.25 !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-key-stats-section {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-key-stat {
    min-height: 46px;
    padding: 8px !important;
    gap: 2px 6px;
  }

  body:not(.main-menu-active):not(.pregame) .end-key-stat span {
    font-size: clamp(0.5rem, 1.36vw, 0.62rem) !important;
    letter-spacing: 0.15em !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-key-stat strong {
    font-size: clamp(1rem, 3vw, 1.35rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-detail-section {
    gap: 6px !important;
    padding: 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-detail-toggle {
    min-height: 30px;
    font-size: clamp(0.55rem, 1.4vw, 0.66rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-stats-grid {
    gap: 7px !important;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.main-menu-active):not(.pregame) .end-player-card {
    min-height: 84px;
    padding: 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-card-heading span,
  body:not(.main-menu-active):not(.pregame) .end-card-heading strong {
    font-size: clamp(0.52rem, 1.34vw, 0.64rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-ship-strip {
    gap: 4px;
  }

  body:not(.main-menu-active):not(.pregame) .end-stat-list {
    gap: 5px 7px !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-stat span {
    font-size: clamp(0.5rem, 1.25vw, 0.58rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-stat strong {
    font-size: clamp(0.72rem, 1.7vw, 0.84rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
    padding: 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-actions button {
    min-height: 40px !important;
    font-size: clamp(0.62rem, 1.6vw, 0.74rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-screen.minimized {
    top: 50% !important;
    bottom: auto !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    width: 50px !important;
    height: min(250px, calc(100dvh - 22px)) !important;
    padding: 6px !important;
    transform: translateY(-50%) !important;
  }

  body:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-shell::after {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
  }
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-screen {
  width: clamp(356px, 44vw, 430px) !important;
  padding: 7px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-shell {
  grid-template-rows: minmax(132px, 0.9fr) auto auto auto !important;
  gap: 6px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-collapse-section {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-collapse-toggle {
  width: 38px;
  height: 34px;
  background:
    linear-gradient(180deg, rgba(9, 39, 45, 0.96), rgba(0, 8, 12, 0.98));
  box-shadow: 0 0 14px rgba(61, 221, 221, 0.12);
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-outcome-section {
  gap: 4px !important;
  align-content: center;
  min-height: 0;
  padding: 11px 46px 11px 12px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-outcome-section .end-kicker {
  font-size: clamp(0.5rem, 1.18vw, 0.62rem) !important;
  letter-spacing: 0.2em !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-outcome-icon {
  width: 20px;
  height: 20px;
  opacity: 0.82;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-outcome-section h2 {
  font-size: clamp(1.05rem, 2.42vw, 1.5rem) !important;
  line-height: 1.02 !important;
  letter-spacing: 0.06em !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-story-placeholder {
  max-width: 36ch;
  font-size: clamp(0.62rem, 1.42vw, 0.76rem) !important;
  line-height: 1.2 !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-outcome-section small {
  max-width: 36ch;
  color: rgba(90, 128, 144, 0.58) !important;
  font-size: clamp(0.42rem, 1vw, 0.52rem) !important;
  letter-spacing: 0.12em !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-key-stats-section {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
  padding: 7px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-key-stat {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label value";
  min-height: 54px;
  padding: 9px 10px !important;
  column-gap: 12px;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-key-stat span {
  min-width: 0;
  font-size: clamp(0.52rem, 1.14vw, 0.64rem) !important;
  line-height: 1.08;
  letter-spacing: 0.14em !important;
  white-space: normal;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-key-stat strong {
  justify-self: end;
  min-width: max-content;
  font-size: clamp(1.06rem, 2.8vw, 1.46rem) !important;
  white-space: nowrap;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-detail-section {
  padding: 6px 7px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-detail-section.detail-expanded {
  min-height: 0;
  max-height: 38dvh;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-actions {
  grid-template-columns: 1fr 1fr !important;
  gap: 7px !important;
  padding: 7px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-actions button {
  min-height: 38px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-screen.minimized {
  width: 50px !important;
  padding: 6px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-shell {
  grid-template-rows: auto 1fr !important;
  gap: 8px !important;
}

body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .end-screen.minimized .end-collapse-section {
  position: static;
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid rgba(61, 221, 221, 0.18);
  background: rgba(0, 8, 12, 0.72);
}

/* Mobile Convoy: keep action choice inside the Command Deck instead of floating over it. */
@media (max-width: 980px) {
  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action {
    overflow: hidden auto;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .command-step-list,
  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .command-hidden-action,
  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .primary.fire {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-panel {
    position: static !important;
    z-index: auto !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin-top: 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-panel.hidden {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-card {
    min-height: 0 !important;
    width: 100% !important;
    padding: 10px !important;
    gap: 9px !important;
    align-content: start !important;
    border-color: rgba(61, 221, 221, 0.48) !important;
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.62),
      inset 0 0 22px rgba(61, 221, 221, 0.07),
      0 0 18px rgba(0, 0, 0, 0.5) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-card::before,
  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-card::after {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title {
    min-height: 0 !important;
    padding: 10px 11px !important;
    gap: 5px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title .convoy-kicker,
  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-kicker {
    font-size: clamp(0.58rem, 1.65vw, 0.68rem) !important;
    letter-spacing: 0.22em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title h3 {
    display: block !important;
    font-size: clamp(1rem, 3.1vw, 1.26rem) !important;
    line-height: 1.08 !important;
    letter-spacing: 0.14em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title h3 span {
    display: inline !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice {
    grid-template-columns: 46px minmax(0, 1fr) 18px !important;
    gap: 8px !important;
    min-height: 64px !important;
    padding: 8px 8px 8px 9px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice::before {
    inset: 7px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-icon {
    width: 42px !important;
    height: 42px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-icon svg {
    width: 36px !important;
    height: 36px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-torpedo-icon img {
    width: 40px !important;
    max-width: 40px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-copy {
    gap: 3px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice strong {
    font-size: clamp(0.72rem, 2.15vw, 0.88rem) !important;
    letter-spacing: 0.1em !important;
    line-height: 1.05 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice em {
    font-size: clamp(0.58rem, 1.55vw, 0.68rem) !important;
    line-height: 1.15 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-arrow {
    font-size: 2rem !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-lamp {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-comms-card h3 {
    font-size: clamp(1rem, 3vw, 1.22rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-comms-card p {
    font-size: clamp(0.62rem, 1.7vw, 0.74rem) !important;
    line-height: 1.2 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-grid {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-ping-vessel {
    min-height: 48px !important;
    padding: 7px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-comms-actions {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }
}

/* iPhone landscape final fit: Convoy action must never clip below the Command Deck. */
@media (max-width: 980px) and (orientation: landscape) {
  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    align-content: stretch !important;
    gap: 5px !important;
    padding: 7px !important;
    overflow: hidden !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action::before {
    top: 48px !important;
    bottom: 8px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action::after {
    top: 55px !important;
    height: calc(100% - 70px) !important;
    min-height: 0 !important;
    background:
      url("./assets/ui/button-on.png") 50% 31% / 27px 27px no-repeat,
      url("./assets/ui/button-on.png") 50% 58% / 27px 27px no-repeat,
      url("./assets/ui/button-off.png") 50% 84% / 27px 27px no-repeat !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .panel-heading {
    min-height: 34px !important;
    margin: 0 !important;
    padding: 6px 34px 5px 12px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .panel-heading span {
    font-size: clamp(0.54rem, 2.15dvh, 0.72rem) !important;
    letter-spacing: 0.22em !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .panel-actions {
    right: 6px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .panel-toggle {
    width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-panel {
    display: block !important;
    min-height: 0 !important;
    height: 100% !important;
    margin-top: 0 !important;
    overflow: hidden !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-card.convoy-choice-card {
    display: grid !important;
    grid-template-rows: minmax(34px, 0.62fr) repeat(3, minmax(39px, 1fr)) !important;
    align-content: stretch !important;
    min-height: 0 !important;
    height: 100% !important;
    gap: 5px !important;
    padding: 6px 6px 6px 33px !important;
    overflow: hidden !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title {
    align-content: center !important;
    min-height: 0 !important;
    padding: 4px 7px !important;
    gap: 1px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title .convoy-kicker,
  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-kicker {
    font-size: clamp(0.38rem, 1.45dvh, 0.5rem) !important;
    letter-spacing: 0.18em !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-choice-title h3 {
    overflow: hidden !important;
    font-size: clamp(0.58rem, 2.2dvh, 0.76rem) !important;
    line-height: 1 !important;
    letter-spacing: 0.09em !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice {
    grid-template-columns: 29px minmax(0, 1fr) 11px !important;
    align-content: center !important;
    min-height: 0 !important;
    height: 100% !important;
    gap: 5px !important;
    padding: 4px 5px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice::before {
    inset: 4px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-icon {
    width: 28px !important;
    height: 28px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-icon svg {
    width: 23px !important;
    height: 23px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-torpedo-icon img {
    width: 27px !important;
    max-width: 27px !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-copy {
    align-content: center !important;
    gap: 0 !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice strong {
    overflow: hidden !important;
    font-size: clamp(0.5rem, 1.85dvh, 0.64rem) !important;
    letter-spacing: 0.08em !important;
    line-height: 1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-choice em {
    display: none !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action .convoy-action-arrow {
    font-size: 1.2rem !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .convoy-ping-banner {
    top: max(58px, calc(env(safe-area-inset-top) + 54px)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: auto !important;
    left: auto !important;
    width: min(360px, calc(100vw - var(--mobile-command-deck-width) - 22px)) !important;
    min-height: 34px !important;
    padding: 6px 9px !important;
    gap: 8px !important;
    border-color: rgba(61, 221, 122, 0.56) !important;
    background:
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, rgba(5, 32, 28, 0.82), rgba(0, 10, 12, 0.9)) !important;
    box-shadow:
      inset 0 0 0 1px rgba(189, 255, 225, 0.06),
      inset 0 0 18px rgba(61, 221, 122, 0.08),
      0 0 20px rgba(36, 220, 132, 0.12),
      0 10px 24px rgba(0, 0, 0, 0.34) !important;
    transform: translateY(-10px) !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .convoy-ping-banner.visible {
    transform: translateY(0) !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .convoy-ping-banner.exiting {
    transform: translateY(-8px) !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .convoy-ping-banner > span {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.92rem !important;
    box-shadow:
      inset 0 0 10px rgba(61, 221, 122, 0.12),
      0 0 12px rgba(61, 221, 122, 0.16) !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .convoy-ping-banner strong {
    font-size: clamp(0.58rem, 2dvh, 0.72rem) !important;
    letter-spacing: 0.14em !important;
  }

  body.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .convoy-ping-banner small {
    max-width: 100%;
    margin-top: 1px !important;
    overflow: hidden;
    color: rgba(175, 238, 211, 0.66) !important;
    font-size: clamp(0.48rem, 1.6dvh, 0.56rem) !important;
    letter-spacing: 0.08em !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Mobile privacy/readability: if it is not the local player's turn, the Command Deck fully yields to the arena. */
body.mobile-command-deck-hidden:not(.main-menu-active):not(.pregame) #scene,
body.mobile-command-deck-hidden.mobile-phone-landscape:not(.main-menu-active):not(.pregame) #scene {
  left: 0 !important;
  width: 100vw !important;
  min-width: 100vw !important;
}

body.mobile-command-deck-hidden:not(.main-menu-active):not(.pregame) .attack-panel,
body.mobile-command-deck-hidden:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action,
body.mobile-command-deck-hidden.mobile-phone-landscape:not(.main-menu-active):not(.pregame) .attack-panel.has-convoy-action {
  display: none !important;
  pointer-events: none !important;
}

/* Mobile Targeting Solution: depth and coordinates share one clear editing page; firing lives alone. */
@media (max-width: 980px) {
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto auto !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    display: grid !important;
    grid-template-rows: minmax(0, auto) minmax(0, auto) !important;
    gap: 8px !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .sub-selector-line {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    display: grid !important;
    min-height: 0 !important;
    padding: 8px !important;
    border-color: rgba(61, 221, 221, 0.36) !important;
    background:
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, rgba(4, 23, 26, 0.9), rgba(0, 6, 8, 0.98)) !important;
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.74),
      inset 0 -16px 22px rgba(0, 0, 0, 0.34),
      0 0 16px rgba(61, 221, 221, 0.05) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    gap: 6px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    align-content: center !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 2px 9px !important;
    padding: 0 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / span 2;
    align-self: start !important;
    justify-self: center;
    padding-top: 2px;
    color: rgba(93, 235, 216, 0.92) !important;
    font-size: clamp(0.92rem, 3.3dvh, 1.16rem) !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    color: rgba(238, 255, 255, 0.94) !important;
    font-size: clamp(0.62rem, 2.05dvh, 0.82rem) !important;
    letter-spacing: 0.14em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    color: rgba(197, 226, 226, 0.7) !important;
    font-size: clamp(0.48rem, 1.6dvh, 0.62rem) !important;
    letter-spacing: 0.05em !important;
    line-height: 1.18 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator {
    width: 100% !important;
    margin: 2px 0 0 !important;
    padding: 7px 8px 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    font-size: clamp(0.46rem, 1.55dvh, 0.58rem) !important;
    letter-spacing: 0.12em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    height: 48px !important;
    min-height: 48px !important;
    padding-top: 20px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: 14px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: 14px !important;
    width: 9px !important;
    height: 32px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    font-size: clamp(0.4rem, 1.25dvh, 0.48rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i:nth-of-type(even) {
    opacity: 0;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    align-items: center !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    margin-top: 4px;
    padding: 7px 8px;
    border: 1px solid rgba(61, 221, 221, 0.2);
    background:
      linear-gradient(180deg, rgba(0, 16, 18, 0.88), rgba(0, 4, 6, 0.96));
    color: rgba(210, 246, 246, 0.86) !important;
    font-size: clamp(0.56rem, 1.8dvh, 0.7rem) !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution[data-stage="target-locked"] .coords-line {
    border-color: rgba(61, 221, 221, 0.48) !important;
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.74),
      inset 0 -16px 22px rgba(0, 0, 0, 0.34),
      0 0 20px rgba(61, 221, 221, 0.12) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-action {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 8px 0 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.16);
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backPlaneBtn {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    display: grid !important;
    place-items: center !important;
    min-height: 34px !important;
    padding: 0 8px !important;
    border: 1px solid rgba(61, 221, 221, 0.42) !important;
    background:
      linear-gradient(180deg, rgba(4, 31, 35, 0.9), rgba(0, 7, 9, 0.98)) !important;
    color: rgba(215, 250, 250, 0.9) !important;
    box-shadow:
      inset 0 0 12px rgba(61, 221, 221, 0.06),
      0 0 10px rgba(61, 221, 221, 0.06) !important;
    font-size: clamp(0.52rem, 1.72dvh, 0.66rem) !important;
    letter-spacing: 0.1em !important;
    text-align: center;
    white-space: nowrap;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    border-color: rgba(90, 128, 144, 0.24) !important;
    color: rgba(90, 128, 144, 0.62) !important;
    opacity: 0.62 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    position: relative !important;
    bottom: auto !important;
    z-index: 3 !important;
    min-height: 47px !important;
    margin: 8px 0 0 !important;
    border-top: 1px solid rgba(255, 77, 93, 0.22) !important;
    font-size: clamp(0.8rem, 2.45dvh, 0.98rem) !important;
    letter-spacing: 0.18em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire:disabled {
    display: none !important;
  }
}

/* Final mobile targeting pass: edit controls stay together; firing gets its own isolated bay. */
@media (max-width: 980px) {
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    grid-template-rows: auto minmax(0, 1fr) auto auto !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    gap: 7px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    padding: 9px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    align-content: start !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    align-content: stretch !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    font-size: clamp(0.64rem, 2.1dvh, 0.84rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    font-size: clamp(0.48rem, 1.55dvh, 0.6rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    min-height: 38px !important;
    display: grid !important;
    align-items: center !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
    margin: 2px 0 0 !important;
    padding: 15px 0 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.28) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before {
    content: "EDIT SOLUTION";
    position: absolute;
    top: 2px;
    left: 0;
    color: rgba(90, 128, 144, 0.85);
    font-family: "Share Tech Mono", monospace;
    font-size: clamp(0.38rem, 1.15dvh, 0.48rem);
    letter-spacing: 0.18em;
    line-height: 1;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    min-height: 36px !important;
    font-size: clamp(0.5rem, 1.62dvh, 0.64rem) !important;
    letter-spacing: 0.12em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:not(:disabled) {
    border-color: rgba(85, 238, 220, 0.62) !important;
    color: rgba(226, 255, 252, 0.95) !important;
    background:
      linear-gradient(180deg, rgba(5, 43, 43, 0.96), rgba(0, 11, 13, 0.98)) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    margin-top: 10px !important;
    min-height: 50px !important;
    border: 1px solid rgba(255, 77, 93, 0.68) !important;
    box-shadow:
      inset 0 0 0 1px rgba(255, 184, 138, 0.18),
      inset 0 -16px 24px rgba(0, 0, 0, 0.4),
      0 0 22px rgba(255, 77, 93, 0.2) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution:not([data-stage="target-locked"]) .primary.fire {
    display: none !important;
  }
}

/* Mobile targeting hotfix: keep the live depth rail visible and align the target readout. */
@media (max-width: 980px) {
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    grid-template-rows: auto auto auto auto !important;
    gap: 6px !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    grid-template-rows: auto auto !important;
    gap: 6px !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: auto auto !important;
    align-content: start !important;
    min-height: 124px !important;
    gap: 4px !important;
    padding: 7px 8px 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    align-content: start !important;
    min-height: 80px !important;
    padding: 7px 8px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    grid-template-columns: 25px minmax(0, 1fr) !important;
    gap: 1px 8px !important;
    align-items: start !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / span 2 !important;
    align-self: start !important;
    justify-self: center !important;
    padding-top: 0 !important;
    font-size: clamp(0.82rem, 2.7dvh, 1rem) !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    font-size: clamp(0.52rem, 1.72dvh, 0.68rem) !important;
    letter-spacing: 0.14em !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    max-width: 100% !important;
    font-size: clamp(0.42rem, 1.32dvh, 0.54rem) !important;
    letter-spacing: 0.06em !important;
    line-height: 1.12 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-template-columns: auto 1fr !important;
    gap: 5px 8px !important;
    width: 100% !important;
    min-height: 68px !important;
    height: auto !important;
    margin: 3px 0 0 !important;
    padding: 6px 8px 7px !important;
    border: 1px solid rgba(61, 221, 221, 0.34) !important;
    background:
      linear-gradient(180deg, rgba(0, 18, 20, 0.92), rgba(0, 6, 8, 0.98)) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator::before {
    display: none !important;
    content: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    font-size: clamp(0.42rem, 1.28dvh, 0.52rem) !important;
    letter-spacing: 0.11em !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    justify-self: end !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    display: grid !important;
    height: 38px !important;
    min-height: 38px !important;
    padding-top: 16px !important;
    border-top: 1px solid rgba(61, 221, 221, 0.16) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: 12px !important;
    height: 5px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: 12px !important;
    width: 8px !important;
    height: 28px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    font-size: clamp(0.34rem, 1.02dvh, 0.42rem) !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i:nth-of-type(even) {
    opacity: 0 !important;
    width: 0 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    grid-template-rows: auto auto !important;
    align-items: start !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    min-height: 0 !important;
    margin-top: 2px !important;
    padding: 6px 7px !important;
    font-size: clamp(0.46rem, 1.42dvh, 0.58rem) !important;
    line-height: 1.18 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    gap: 6px !important;
    padding-top: 12px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before {
    font-size: clamp(0.32rem, 0.95dvh, 0.42rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    min-height: 31px !important;
    font-size: clamp(0.42rem, 1.28dvh, 0.54rem) !important;
    letter-spacing: 0.1em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: 44px !important;
    margin-top: 7px !important;
    font-size: clamp(0.68rem, 2dvh, 0.82rem) !important;
  }
}

/* Mobile targeting repair: this final block intentionally wins over the earlier mobile passes. */
@media (max-width: 980px) {
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto auto !important;
    row-gap: clamp(4px, 1.1dvh, 7px) !important;
    padding: clamp(8px, 1.8dvh, 12px) !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    min-height: clamp(34px, 9dvh, 48px) !important;
    margin: 0 !important;
    padding: clamp(6px, 1.5dvh, 9px) clamp(8px, 1.8dvh, 11px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading span {
    font-size: clamp(0.56rem, 1.85dvh, 0.72rem) !important;
    letter-spacing: 0.2em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    display: grid !important;
    grid-template-rows: minmax(94px, 1fr) minmax(64px, auto) !important;
    gap: clamp(5px, 1.15dvh, 7px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .sub-selector-line {
    display: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    display: grid !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-color: rgba(61, 221, 221, 0.42) !important;
    background:
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, rgba(4, 21, 24, 0.93), rgba(0, 6, 8, 0.98)) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: auto minmax(56px, 1fr) !important;
    gap: clamp(3px, 0.75dvh, 5px) !important;
    padding: clamp(6px, 1.35dvh, 8px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    align-content: center !important;
    padding: clamp(7px, 1.5dvh, 9px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    display: grid !important;
    grid-template-columns: clamp(22px, 4.4dvh, 30px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 1px clamp(6px, 1.4dvh, 9px) !important;
    align-items: start !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    grid-row: 1 / span 2 !important;
    align-self: start !important;
    justify-self: center !important;
    padding: 0 !important;
    color: rgba(93, 235, 216, 0.94) !important;
    font-size: clamp(0.72rem, 2.35dvh, 0.98rem) !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: rgba(242, 255, 255, 0.94) !important;
    font-size: clamp(0.48rem, 1.55dvh, 0.66rem) !important;
    letter-spacing: 0.13em !important;
    line-height: 1.05 !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: rgba(196, 225, 225, 0.72) !important;
    font-size: clamp(0.38rem, 1.16dvh, 0.5rem) !important;
    letter-spacing: 0.055em !important;
    line-height: 1.12 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: clamp(3px, 0.8dvh, 5px) clamp(6px, 1.2dvh, 8px) !important;
    align-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 58px !important;
    height: auto !important;
    margin: 0 !important;
    padding: clamp(5px, 1.1dvh, 7px) clamp(7px, 1.45dvh, 9px) !important;
    border: 1px solid rgba(61, 221, 221, 0.36) !important;
    background: linear-gradient(180deg, rgba(0, 17, 19, 0.94), rgba(0, 5, 7, 0.98)) !important;
    box-sizing: border-box !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator::before {
    display: none !important;
    content: none !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    min-width: 0 !important;
    overflow: hidden !important;
    font-size: clamp(0.36rem, 1.04dvh, 0.46rem) !important;
    letter-spacing: 0.1em !important;
    line-height: 1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    justify-self: end !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    height: clamp(32px, 7.4dvh, 42px) !important;
    min-height: 32px !important;
    padding: clamp(13px, 2.9dvh, 17px) 0 0 !important;
    border-top: 1px solid rgba(61, 221, 221, 0.2) !important;
    border-left: 0 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(9px, 2.35dvh, 13px) !important;
    right: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: 5px !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(9px, 2.35dvh, 13px) !important;
    left: var(--depth-pos) !important;
    width: 8px !important;
    height: clamp(22px, 5.6dvh, 30px) !important;
    transform: translate(-50%, -50%) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    display: flex !important;
    align-items: end !important;
    justify-content: center !important;
    min-width: 0 !important;
    width: auto !important;
    overflow: visible !important;
    opacity: 0.66 !important;
    color: rgba(200, 216, 224, 0.62) !important;
    font-size: clamp(0.3rem, 0.92dvh, 0.38rem) !important;
    line-height: 1 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i:nth-of-type(even) {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    grid-template-rows: auto minmax(0, 1fr) !important;
    align-items: center !important;
    min-height: 0 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    display: grid !important;
    align-items: center !important;
    min-height: clamp(30px, 7.4dvh, 42px) !important;
    margin: clamp(2px, 0.55dvh, 4px) 0 0 !important;
    padding: clamp(5px, 1.1dvh, 7px) clamp(6px, 1.4dvh, 8px) !important;
    border: 1px solid rgba(61, 221, 221, 0.22) !important;
    background: linear-gradient(180deg, rgba(0, 16, 18, 0.88), rgba(0, 4, 6, 0.96)) !important;
    color: rgba(217, 248, 248, 0.86) !important;
    font-size: clamp(0.4rem, 1.22dvh, 0.52rem) !important;
    letter-spacing: 0.08em !important;
    line-height: 1.14 !important;
    text-transform: uppercase !important;
    white-space: normal !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: clamp(5px, 1.15dvh, 7px) !important;
    margin: 0 !important;
    padding-top: clamp(10px, 2.2dvh, 13px) !important;
    border-top: 1px solid rgba(61, 221, 221, 0.24) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions::before {
    top: 1px !important;
    font-size: clamp(0.3rem, 0.9dvh, 0.4rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    min-height: clamp(28px, 6.4dvh, 34px) !important;
    padding: 0 clamp(5px, 1.2dvh, 8px) !important;
    font-size: clamp(0.38rem, 1.12dvh, 0.5rem) !important;
    letter-spacing: 0.095em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(39px, 8.8dvh, 48px) !important;
    margin: clamp(4px, 1.1dvh, 7px) 0 0 !important;
    font-size: clamp(0.6rem, 1.72dvh, 0.78rem) !important;
    letter-spacing: 0.17em !important;
  }
}

/* Mobile targeting stability pass: keep depth + target readable on short phone viewports. */
@media (max-width: 980px) {
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution {
    grid-template-rows: clamp(34px, 8.4dvh, 44px) minmax(0, 1fr) clamp(34px, 7.6dvh, 42px) auto !important;
    row-gap: clamp(4px, 0.95dvh, 6px) !important;
    padding: clamp(7px, 1.55dvh, 10px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .panel-heading {
    height: clamp(34px, 8.4dvh, 44px) !important;
    min-height: 0 !important;
    padding: clamp(5px, 1.05dvh, 7px) clamp(7px, 1.5dvh, 9px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-step-list {
    grid-template-rows: minmax(112px, 1.28fr) minmax(74px, 0.72fr) !important;
    gap: clamp(5px, 1.05dvh, 7px) !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line {
    grid-template-rows: clamp(31px, 6.9dvh, 39px) minmax(70px, 1fr) !important;
    align-content: stretch !important;
    gap: clamp(4px, 0.9dvh, 6px) !important;
    padding: clamp(6px, 1.2dvh, 8px) !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line {
    grid-template-rows: minmax(0, 1fr) !important;
    align-content: stretch !important;
    padding: clamp(6px, 1.25dvh, 8px) !important;
    overflow: hidden !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main {
    grid-template-columns: clamp(20px, 4dvh, 26px) minmax(0, 1fr) !important;
    gap: 1px clamp(5px, 1.1dvh, 7px) !important;
    align-content: start !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main span {
    font-size: clamp(0.62rem, 2dvh, 0.84rem) !important;
    line-height: 1.05 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main strong {
    font-size: clamp(0.46rem, 1.42dvh, 0.6rem) !important;
    letter-spacing: 0.12em !important;
    line-height: 1.15 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .command-line-main small {
    font-size: clamp(0.34rem, 1dvh, 0.44rem) !important;
    letter-spacing: 0.045em !important;
    line-height: 1.16 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.hidden,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator.force-mobile-depth {
    display: grid !important;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr) !important;
    grid-template-rows: auto minmax(40px, 1fr) !important;
    align-self: stretch !important;
    min-height: 70px !important;
    height: 100% !important;
    padding: clamp(5px, 1dvh, 7px) clamp(7px, 1.35dvh, 9px) !important;
    border-color: rgba(61, 221, 221, 0.56) !important;
    background:
      linear-gradient(180deg, rgba(0, 23, 25, 0.96), rgba(0, 6, 8, 0.98)),
      radial-gradient(circle at 50% 45%, rgba(61, 221, 221, 0.1), transparent 64%) !important;
    box-shadow:
      inset 0 0 0 1px rgba(200, 216, 224, 0.06),
      inset 0 0 22px rgba(61, 221, 221, 0.08) !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator span,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-line .depth-indicator strong {
    font-size: clamp(0.4rem, 1.15dvh, 0.5rem) !important;
    letter-spacing: 0.12em !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track {
    grid-column: 1 / -1 !important;
    height: clamp(38px, 8dvh, 48px) !important;
    min-height: 38px !important;
    padding-top: clamp(15px, 3.2dvh, 19px) !important;
    overflow: visible !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track::before {
    top: clamp(11px, 2.65dvh, 14px) !important;
    height: 6px !important;
    background:
      linear-gradient(90deg, rgba(61, 221, 221, 0.34), rgba(61, 221, 221, 0.62)),
      rgba(61, 221, 221, 0.14) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track b {
    top: clamp(11px, 2.65dvh, 14px) !important;
    width: 10px !important;
    height: clamp(26px, 6.1dvh, 34px) !important;
    box-shadow:
      0 0 14px rgba(61, 221, 221, 0.72),
      inset 0 0 7px rgba(239, 255, 255, 0.58) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .depth-track i {
    font-size: clamp(0.3rem, 0.9dvh, 0.38rem) !important;
    opacity: 0.72 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main {
    grid-template-columns: clamp(20px, 4dvh, 26px) minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(36px, 1fr) !important;
    align-content: center !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main strong {
    align-self: end !important;
    font-size: clamp(0.48rem, 1.45dvh, 0.62rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .coords-line .command-line-main small {
    align-self: stretch !important;
    min-height: 34px !important;
    margin-top: 3px !important;
    padding: clamp(6px, 1.15dvh, 8px) clamp(7px, 1.35dvh, 9px) !important;
    font-size: clamp(0.4rem, 1.16dvh, 0.5rem) !important;
    line-height: 1.18 !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .mobile-command-revisions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-height: clamp(34px, 7.6dvh, 42px) !important;
    padding-top: clamp(9px, 1.8dvh, 12px) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #backSubBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn,
  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution #mobileUnlockTargetBtn:disabled {
    min-height: clamp(30px, 6.6dvh, 38px) !important;
    color: rgba(224, 250, 250, 0.88) !important;
    font-size: clamp(0.4rem, 1.14dvh, 0.52rem) !important;
  }

  body:not(.main-menu-active):not(.pregame) .attack-panel.mobile-targeting-solution .primary.fire {
    min-height: clamp(38px, 8dvh, 46px) !important;
    margin-top: clamp(3px, 0.8dvh, 5px) !important;
  }
}
