/* Oceanic tracks: labelled track lines on the map and a printed track-message slip (thermal paper, OCR-B). */
@font-face {
  font-family: "Aeroshow Pass";
  src: url("/fonts/ocr-b-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Map labels: shown and named by the declutter (fade in over 200 ms, hidden at once). */
.oceanic-label { pointer-events: none; }
.oceanic-label .otl-row {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.oceanic-end.is-west .otl-row { flex-direction: row-reverse; }
.oceanic-label .otl-row > span { transition: opacity 0.2s ease; }
.oceanic-label .otl-row.is-off { opacity: 0; }
.oceanic-label .otl-row.no-name > span:not(.otl-letter) { visibility: hidden; opacity: 0; }
.oceanic-label .otl-row.is-cut,
.oceanic-label .otl-row.is-cut > span { transition: none; }
.oceanic-end { font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif; }
.oceanic-end .otl-letter {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e9f2ff;
  border-radius: 50%;
  background: rgba(10, 24, 48, 0.86);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.oceanic-end .otl-fix {
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(10, 24, 48, 0.72);
  color: #e9f2ff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.oceanic-end.is-hi .otl-letter {
  border-color: #ffc35c;
  background: #ffc35c;
  color: #241600;
  box-shadow: 0 0 0 3px rgba(255, 195, 92, 0.3), 0 2px 8px rgba(0, 0, 0, 0.45);
}
.oceanic-end.is-hi .otl-fix { color: #ffd98f; }
/* Crowded tracks: smaller letters, still centred on the track end (26 px slot). */
.oceanic-end .otl-row.is-small .otl-letter {
  width: 13px;
  height: 13px;
  margin: 0 5.5px;
  border-width: 1px;
  font-size: 9px;
}
.oceanic-end.is-hi .otl-row.is-small .otl-letter { box-shadow: 0 0 0 2px rgba(255, 195, 92, 0.3), 0 1px 4px rgba(0, 0, 0, 0.45); }
.oceanic-point i {
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border: 1.5px solid #e9f2ff;
  border-radius: 1px;
  background: rgba(10, 24, 48, 0.8);
  transform: rotate(45deg);
}
.oceanic-point.is-hi i { border-color: #ffc35c; background: #241600; }
.oceanic-point span {
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(10, 24, 48, 0.72);
  color: #ffd98f;
  font-family: "Aeroshow Pass", monospace;
  font-size: 10px;
  line-height: 14px;
}

/* Printed track message */
.oceanic-track-card {
  position: fixed;
  left: 12px;
  top: 118px;
  z-index: 1304;
  width: 384px;
  box-sizing: border-box;
  padding: 14px 12px 10px 12px;
  color: #2a2a2e;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 21px, rgba(0, 0, 0, 0.025) 21px 22px),
    #f7f5ef;
  font-family: "Aeroshow Pass", monospace;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), 0 2px 6px rgba(0, 0, 0, 0.25);
  /* torn thermal-paper edge at the top */
  clip-path: polygon(0 6px, 3% 0, 6% 6px, 9% 0, 12% 6px, 15% 0, 18% 6px, 21% 0, 24% 6px, 27% 0, 30% 6px, 33% 0, 36% 6px, 39% 0, 42% 6px, 45% 0, 48% 6px, 51% 0, 54% 6px, 57% 0, 60% 6px, 63% 0, 66% 6px, 69% 0, 72% 6px, 75% 0, 78% 6px, 81% 0, 84% 6px, 87% 0, 90% 6px, 93% 0, 96% 6px, 100% 0, 100% 100%, 0 100%);
  animation: otc-print 0.24s ease-out;
}
.oceanic-track-card[hidden] { display: none; }
.otc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(42, 42, 46, 0.45);
}
.otc-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.otc-title { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.otc-sub { font-size: 10px; color: rgba(42, 42, 46, 0.72); text-transform: uppercase; }
.otc-fold {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(42, 42, 46, 0.3);
  border-radius: 50%;
  background: transparent;
  color: #2a2a2e;
  cursor: pointer;
  transition: transform 0.18s ease;
}
.oceanic-track-card.is-folded .otc-fold { transform: rotate(-90deg); }
.otc-rows { display: flex; flex-direction: column; padding: 4px 0 2px; }
.otc-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  column-gap: 6px;
  padding: 3px 0;
  font-size: 10px;
  line-height: 14px;
}
.otc-letter { grid-row: span 2; font-size: 12px; font-weight: 400; }
.otc-route { word-spacing: 0.1em; }
.otc-levels { color: rgba(42, 42, 46, 0.62); font-size: 9.5px; }
.otc-row.is-hi .otc-route,
.otc-row.is-hi .otc-letter {
  background: linear-gradient(176deg, rgba(255, 213, 0, 0) 12%, rgba(255, 213, 0, 0.62) 14% 86%, rgba(255, 213, 0, 0) 88%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.otc-you {
  grid-column: 2;
  margin-top: 1px;
  color: #a2410d;
  font-size: 10px;
  text-transform: uppercase;
}
.otc-foot {
  padding-top: 5px;
  border-top: 1px dashed rgba(42, 42, 46, 0.45);
  font-size: 9px;
  color: rgba(42, 42, 46, 0.6);
  text-transform: uppercase;
}
.otc-attrib {
  display: block;
  margin-top: 2px;
  text-transform: none;
}
.oceanic-track-card.is-folded .otc-row:not(.is-hi),
.oceanic-track-card.is-folded .otc-foot,
.oceanic-track-card.is-folded .otc-levels { display: none; }
.oceanic-track-card.is-folded:not(.has-hi) .otc-rows { display: none; }
@keyframes otc-print {
  0% { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: none; }
}

html.airshow-mobile-runtime .oceanic-track-card { left: 8px; top: 72px; width: 336px; padding: 11px 10px 7px; }
html.airshow-mobile-runtime .otc-rows { max-height: 150px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* Phone printout: never taller than the space above the map attribution line. */
html.airshow-mobile-runtime .oceanic-track-card:not(.is-tab):not([hidden]) {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 158px);
}
html.airshow-mobile-runtime .oceanic-track-card:not(.is-tab) .otc-rows { flex: 1 1 auto; min-height: 0; max-height: none; }
html.airshow-mobile-runtime .otc-sub { font-size: 9px; }
html.airshow-mobile-runtime .otc-title { font-size: 11px; }
html.airshow-mobile-runtime .oceanic-track-card { cursor: pointer; }

/* Phone: the printout starts as a one-line tab torn from the same thermal paper. */
.otc-tab { display: none; }
html.airshow-mobile-runtime .oceanic-track-card.is-tab {
  width: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  clip-path: none;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.4)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
html.airshow-mobile-runtime .oceanic-track-card.is-tab > :not(.otc-tab) { display: none; }
html.airshow-mobile-runtime .oceanic-track-card.is-tab .otc-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 10px 6px 11px;
  border: 0;
  border-radius: 0;
  background: #f7f5ef;
  color: #2a2a2e;
  font-family: "Aeroshow Pass", monospace;
  font-size: 11.5px;
  line-height: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  clip-path: polygon(0% 4px, 5% 0, 10% 4px, 15% 0, 20% 4px, 25% 0, 30% 4px, 35% 0, 40% 4px, 45% 0, 50% 4px, 55% 0, 60% 4px, 65% 0, 70% 4px, 75% 0, 80% 4px, 85% 0, 90% 4px, 95% 0, 100% 4px, 100% 100%, 0 100%);
}
.otc-tab:focus-visible { outline: 2px solid #ffc35c; outline-offset: 2px; }
.otc-tab-letter {
  padding: 0 3px;
  font-weight: 400;
  background: linear-gradient(176deg, rgba(255, 213, 0, 0) 12%, rgba(255, 213, 0, 0.62) 14% 86%, rgba(255, 213, 0, 0) 88%);
}
.otc-tab-chev { flex: 0 0 auto; color: rgba(42, 42, 46, 0.72); }

@media (prefers-reduced-motion: reduce) {
  .oceanic-track-card { animation: none; }
  .otc-fold,
  .oceanic-label .otl-row,
  .oceanic-label .otl-row > span { transition: none; }
}
