/* Tower view: tower header with camera keys, flight-strip labels and surface minimap.
   It opens from the camera remote's Tower key (airshow_camera_presets.css). */

    .tower-head-icon {
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      border-radius: 7px;
      background: linear-gradient(180deg, #2a1c93 0%, #1D0D78 100%);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 12px rgba(140, 120, 255, 0.35);
      color: #fff;
    }
    .tower-head-icon svg {
      width: 22px;
      height: 22px;
    }
    body.airshow-tower-view-on #cesium-overlay,
    body.airshow-tower-view-on #bearing-indicator,
    body.airshow-tower-view-on #map-zoom-dock,
    body.airshow-tower-view-on #map-mini-topbar-dock,
    body.airshow-tower-view-on #return-home-btn,
    body.airshow-tower-view-on #atmosphere-halo {
      visibility: hidden !important;
    }
    #tower-view {
      position: fixed;
      inset: 0;
      z-index: 990;
      cursor: grab;
      touch-action: none;
      font-family: "Pretendard Variable", Pretendard, ui-sans-serif, sans-serif;
      animation: tower-view-in 0.22s ease both;
    }
    #tower-view:active {
      cursor: grabbing;
    }
    @keyframes tower-view-in {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    .tower-head {
      position: absolute;
      left: 50%;
      top: var(--tower-top, 64px);
      z-index: 5;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 6px;
      border-radius: 10px;
      background: rgba(22, 24, 28, 0.86);
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 8px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      color: #eef1f4;
      transform: translateX(-50%);
      cursor: default;
      white-space: nowrap;
    }
    .tower-head-id {
      display: flex;
      align-items: center;
      gap: 9px;
      padding-right: 4px;
      font-size: 13px;
      color: #c4cbd3;
    }
    .tower-head-id em {
      display: block;
      font-style: normal;
      font-size: 9.5px;
      font-weight: 750;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: #8f98a3;
    }
    .tower-head-id b {
      color: #ffffff;
      font-size: 15px;
      font-weight: 800;
      letter-spacing: 0.04em;
      margin-right: 3px;
    }
    .tower-cams {
      display: flex;
      border-radius: 5px;
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
    }
    .tower-cam {
      height: 34px;
      min-width: 74px;
      padding: 0 12px;
      border: 1px solid rgba(0, 0, 0, 0.52);
      background: rgba(52, 54, 58, 0.9);
      color: rgba(255, 255, 255, 0.82);
      font: 700 12.5px/1 "Pretendard Variable", Pretendard, ui-sans-serif, sans-serif;
      letter-spacing: 0.03em;
      cursor: pointer;
      transition: background-color 0.15s ease, color 0.15s ease;
    }
    .tower-cam + .tower-cam {
      margin-left: -1px;
    }
    .tower-cam:first-child {
      border-radius: 5px 0 0 5px;
    }
    .tower-cam:last-child {
      border-radius: 0 5px 5px 0;
    }
    .tower-cam.active {
      position: relative;
      background: var(--airshow-theme-btn-active-bg, #1D0D78);
      color: #ffffff;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    }
    .tower-cam:focus-visible,
    .tower-close:focus-visible {
      outline: 2px solid rgba(160, 210, 255, 0.95);
      outline-offset: 2px;
    }
    .tower-live {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: #c4cbd3;
    }
    .tower-live i {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #ff4d4d;
      box-shadow: 0 0 6px rgba(255, 77, 77, 0.9);
      animation: tower-live-blink 1.6s ease-in-out infinite;
    }
    @keyframes tower-live-blink {
      50% { opacity: 0.35; }
    }
    .tower-close {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 32px;
      padding: 0 8px 0 11px;
      border: 1px solid rgba(0, 0, 0, 0.52);
      border-radius: 5px;
      background: rgba(52, 54, 58, 0.9);
      color: #ffffff;
      font: 600 12px/1 "Pretendard Variable", Pretendard, ui-sans-serif, sans-serif;
      cursor: pointer;
    }
    .tower-close span {
      display: grid;
      place-items: center;
      width: 16px;
      height: 16px;
      border-radius: 3px;
      background: #d0302a;
      font-size: 12px;
    }
    .tower-foot span {
      display: none;
    }
    #tower-view.tower-following .tower-foot span {
      display: inline;
    }
    .tower-foot {
      position: absolute;
      left: 50%;
      bottom: 92px;
      transform: translateX(-50%);
      padding: 4px 10px;
      border-radius: 4px;
      background: rgba(10, 12, 14, 0.5);
      color: rgba(235, 240, 245, 0.85);
      font-size: 11px;
      letter-spacing: 0.04em;
      pointer-events: none;
    }
    .tower-strips {
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      overflow: hidden;
    }
    .tower-strip {
      position: absolute;
      left: 0;
      top: 0;
      display: flex;
      align-items: stretch;
      min-width: 128px;
      border-radius: 2px;
      background:
        repeating-linear-gradient(0deg, rgba(120, 100, 60, 0.05) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, #f7f0da 0%, #ece2c3 100%);
      box-shadow: 0 0 0 1px rgba(60, 48, 20, 0.35), 0 4px 10px rgba(0, 0, 0, 0.35);
      color: #1b1d20;
      will-change: transform;
      transition: opacity 0.2s ease;
    }
    .tower-strip[hidden] {
      display: none;
    }
    .tower-strip-band {
      width: 6px;
      flex: none;
      border-radius: 2px 0 0 2px;
      background: #2f6fd6;
    }
    .tower-strip-dep .tower-strip-band {
      background: #e0a12c;
    }
    .tower-strip-ground .tower-strip-band {
      background: #3d9a5c;
    }
    .tower-strip-id {
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 1px;
      padding: 4px 8px 4px 7px;
      border-right: 1px solid rgba(60, 48, 20, 0.28);
    }
    .tower-strip-id b {
      max-width: 150px;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 12.5px;
      font-weight: 800;
      letter-spacing: 0.01em;
      white-space: nowrap;
    }
    .tower-strip-id span,
    .tower-strip-data span {
      font-size: 10.5px;
      font-weight: 650;
      color: #4a4434;
      font-variant-numeric: tabular-nums;
    }
    .tower-strip-data {
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 1px;
      padding: 4px 8px;
      text-align: right;
    }
    .tower-strip-data .tower-strip-alt {
      color: #1b1d20;
      font-weight: 750;
    }
    .tower-strip-stem {
      position: absolute;
      left: var(--stem-x, 50%);
      top: 100%;
      width: 1.5px;
      height: var(--stem, 20px);
      background: linear-gradient(180deg, rgba(20, 22, 26, 0.75), rgba(20, 22, 26, 0.2));
      transform: translateX(-50%);
    }
    .tower-strip-own {
      box-shadow: 0 0 0 2px #1D0D78, 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    .tower-strip-own .tower-strip-band {
      width: 8px;
      background: #1D0D78;
    }
    .tower-strip-own::before {
      content: "YOUR FLIGHT";
      position: absolute;
      left: 0;
      bottom: 100%;
      padding: 2px 6px 1px;
      border-radius: 3px 3px 0 0;
      background: #1D0D78;
      color: #ffffff;
      font-size: 8.5px;
      font-weight: 800;
      letter-spacing: 0.12em;
      white-space: nowrap;
    }
    .tower-minimap {
      position: absolute;
      left: 16px;
      bottom: 116px;
      z-index: 2;
      padding: 6px 6px 22px;
      border-radius: 9px;
      background: linear-gradient(180deg, #33363b 0%, #23262a 100%);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);
      cursor: default;
    }
    .tower-minimap canvas {
      display: block;
      width: 230px;
      height: 160px;
      border-radius: 4px;
      box-shadow: inset 0 0 0 1px #0a0b0c;
    }
    .tower-minimap-cap {
      position: absolute;
      left: 9px;
      bottom: 5px;
      font-size: 9.5px;
      font-weight: 700;
      letter-spacing: 0.16em;
      color: #aeb6bf;
    }
    .tower-minimap-cap b {
      color: #ffffff;
    }
    html.airshow-mobile-runtime .tower-head {
      gap: 6px;
      padding: 4px;
    }
    html.airshow-mobile-runtime .tower-head-icon,
    html.airshow-mobile-runtime .tower-head-id em,
    html.airshow-mobile-runtime .tower-live {
      display: none;
    }
    html.airshow-mobile-runtime .tower-head-id {
      font-size: 0;
      padding: 0 2px 0 4px;
    }
    html.airshow-mobile-runtime .tower-head-id b {
      font-size: 13px;
    }
    html.airshow-mobile-runtime .tower-cam {
      height: 30px;
      min-width: 0;
      padding: 0 9px;
      font-size: 11px;
    }
    html.airshow-mobile-runtime .tower-close {
      height: 30px;
      padding: 0 6px 0 8px;
      font-size: 11px;
    }
    html.airshow-mobile-runtime .tower-foot {
      display: none;
    }
    html.airshow-mobile-runtime .tower-minimap {
      left: auto;
      right: 10px;
      bottom: 58px;
      padding: 4px 4px 17px;
    }
    html.airshow-mobile-runtime .tower-minimap canvas {
      width: 132px;
      height: 92px;
    }
    html.airshow-mobile-runtime .tower-minimap-cap {
      left: 6px;
      bottom: 3px;
      font-size: 8px;
    }
    html.airshow-mobile-runtime .tower-strip {
      min-width: 0;
    }
    html.airshow-mobile-runtime .tower-strip-id {
      padding: 2px 6px 2px 5px;
    }
    html.airshow-mobile-runtime .tower-strip-id b {
      max-width: 110px;
      font-size: 10.5px;
    }
    html.airshow-mobile-runtime .tower-strip-id span,
    html.airshow-mobile-runtime .tower-strip-data span {
      font-size: 9px;
    }
    html.airshow-mobile-runtime .tower-strip-data {
      padding: 2px 6px;
    }
    html.airshow-mobile-runtime .tower-strip-own::before {
      padding: 1px 4px 0;
      font-size: 7.5px;
    }
    @media (prefers-reduced-motion: reduce) {
      #tower-view,
      .tower-strip,
      .tower-live i {
        transition: none;
        animation: none;
      }
    }
