/* SKY.TUTI.LT — Retro radar scope console (round 16).
   Green-phosphor PPI console adopted from the MIT-licensed
   retro-adsb-radar project (license in licenses/retro-adsb-radar-MIT.txt):
   black background, bright/dim green scope, amber headers, monospace type —
   the palette of that app's config.py. The CRT scanline + vignette overlay
   and the glow effects are the web translation of its CRT-display look. */

#scopeView {
  position: absolute;
  inset: 0;
  z-index: 1050;               /* covers the map + legend; below toasts */
  display: none;
  background: #000;
  color: rgb(50, 255, 50);     /* BRIGHT_GREEN from config.py */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
  user-select: none;
  overflow: hidden;
}
#scopeView.on { display: block; }

/* ── CRT scanlines + vignette (toggleable from the console bar) ─────────── */
#scopeView .sc-crt {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .55) 100%);
}
#scopeView.nocrt .sc-crt { display: none; }

/* ── header ─────────────────────────────────────────────────────────────── */
.sc-head {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 180, 0, .55);   /* DIM_GREEN */
  background: linear-gradient(180deg, rgba(0, 40, 0, .5), rgba(0, 0, 0, 0));
}
.sc-headl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sc-badge {
  color: rgb(255, 191, 0);     /* AMBER */
  font-weight: 700;
  letter-spacing: .14em;
  font-size: 12px;
  text-shadow: 0 0 8px rgba(255, 191, 0, .45);
  white-space: nowrap;
}
.sc-feed { color: rgb(0, 180, 0); font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
.sc-headtitle {
  flex: 1;
  text-align: center;
  color: rgb(255, 191, 0);
  font-size: clamp(13px, 2.2vw, 20px);
  font-weight: 700;
  letter-spacing: .08em;
  text-shadow: 0 0 10px rgba(255, 191, 0, .4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── chip buttons (the console's "instruction line", app style) ─────────── */
.sc-chip {
  background: rgba(0, 60, 0, .25);
  color: rgb(50, 255, 50);
  border: 1px solid rgba(0, 180, 0, .8);
  border-radius: 3px;
  font: inherit;
  font-size: 11px;
  letter-spacing: .05em;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(50, 255, 50, .35);
}
.sc-chip:hover { background: rgba(50, 255, 50, .14); color: #eaffea; }
.sc-chip:active { transform: translateY(1px); }
.sc-chip.active {
  background: rgba(50, 255, 50, .18);
  color: #ffffff;
  border-color: rgb(50, 255, 50);
}
.sc-chip.sc-close { margin-left: auto; }
.sc-chip.sc-close:hover { color: rgb(255, 50, 50); border-color: rgb(255, 50, 50); background: rgba(255, 50, 50, .12); }

/* ── layout: scope left · data table right (the app's split screen) ─────── */
.sc-grid {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 460px);
  gap: 16px;
  padding: 12px 16px 14px;
  height: calc(100% - 49px);   /* header height */
  box-sizing: border-box;
}
.sc-scopepanel, .sc-tablepanel { display: flex; flex-direction: column; min-height: 0; }

.sc-title {
  text-align: center;
  color: rgb(255, 191, 0);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  margin-bottom: 8px;
  text-shadow: 0 0 9px rgba(255, 191, 0, .4);
}
.sc-scopewrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
#scopeCv { display: block; cursor: crosshair; }

.sc-instr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
  color: rgb(0, 180, 0);
  font-size: 11px;
  letter-spacing: .05em;
}
.sc-grouplbl { opacity: .82; margin-left: 4px; }   /* 2026-11-11: was .7 - ~3.98:1 on black, now >4.5:1 */
.sc-sep { opacity: .45; margin: 0 2px; }
.sc-hint { opacity: .8; margin-left: 6px; }   /* 2026-11-11: was .6 - ~3.15:1 on black, now ~4.97:1 */

/* ── AIRCRAFT DATA table (port of DataTable) ────────────────────────────── */
.sc-table {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 3px solid rgb(50, 255, 50);          /* the app's 3px BRIGHT_GREEN rect */
  box-shadow: 0 0 14px rgba(50, 255, 50, .18), inset 0 0 22px rgba(50, 255, 50, .05);
  background: rgba(0, 22, 0, .18);
}
.sc-ttitle {
  text-align: center;
  color: rgb(255, 191, 0);
  font-weight: 700;
  letter-spacing: .12em;
  font-size: 13px;
  padding: 9px 0 6px;
  text-shadow: 0 0 9px rgba(255, 191, 0, .4);
}
.sc-thead, .sc-trow {
  display: grid;
  grid-template-columns: 1.25fr .85fr .7fr .95fr .7fr;
  padding: 0 14px;
  font-size: 12.5px;
  letter-spacing: .04em;
}
.sc-thead { color: rgb(255, 191, 0); padding-bottom: 6px; }
.sc-thead span:nth-child(n+2), .sc-trow span:nth-child(n+2) { text-align: right; }
.sc-thead { border-bottom: 2px solid rgb(0, 180, 0); margin: 0 8px; padding-left: 6px; padding-right: 6px; }
.sc-tbody { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 0 6px; scrollbar-width: thin; scrollbar-color: rgba(50,255,50,.5) transparent; }
.sc-trow { color: rgb(50, 255, 50); padding: 4px 6px; margin: 0 8px; cursor: pointer; border-radius: 2px; }
.sc-trow:hover { background: rgba(50, 255, 50, .12); color: #ffffff; }
.sc-trow.mil { color: rgb(255, 50, 50); }
.sc-trow.mil:hover { background: rgba(255, 50, 50, .14); color: #ffd7d7; }
.sc-trow.emg span { color: rgb(255, 255, 0) !important; animation: sc-blink 1s steps(2) infinite; }
@keyframes sc-blink { 50% { opacity: .25; } }
.sc-tnone { text-align: center; color: rgb(0, 180, 0); opacity: .8; padding: 18px 8px; font-size: 12px; letter-spacing: .08em; }

/* status block pinned to the bottom of the table box, like the app */
.sc-status {
  border-top: 1px solid rgba(0, 180, 0, .5);
  margin: 0 14px;
  padding: 7px 0 9px;
  color: rgb(50, 255, 50);
  font-size: 12px;
  letter-spacing: .05em;
  line-height: 1.55;
}
.sc-status .sc-upd { color: rgb(255, 255, 0); }

/* ── ATC audio popover ──────────────────────────────────────────────────── */
.sc-atcpop {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .72);
}
.sc-atcpop.hidden { display: none; }
.sc-atccard {
  width: min(480px, 92vw);
  border: 3px solid rgb(50, 255, 50);
  background: #000;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 0 22px rgba(50, 255, 50, .25);
}
.sc-atctitle { color: rgb(255, 191, 0); font-weight: 700; letter-spacing: .12em; text-align: center; }
.sc-atcnote { color: rgb(0, 180, 0); font-size: 11px; line-height: 1.5; }
.sc-atcin {
  background: rgba(0, 40, 0, .3);
  border: 1px solid rgba(0, 180, 0, .8);
  color: rgb(50, 255, 50);
  font: inherit;
  font-size: 12px;
  padding: 8px;
  outline: none;
}
.sc-atcin:focus { border-color: rgb(50, 255, 50); box-shadow: 0 0 8px rgba(50, 255, 50, .3); }
.sc-atcrow { display: flex; gap: 8px; }

/* ── mobile: stack scope above the table (the app was a fixed 960×640) ──── */
@media (max-width: 880px) {
  .sc-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 52%) minmax(0, 48%);
    gap: 10px;
    padding: 8px 10px 10px;
    height: calc(100% - 45px);
  }
  .sc-headtitle { font-size: 12px; }
  .sc-badge { display: none; }
  .sc-thead, .sc-trow { font-size: 11.5px; padding-left: 4px; padding-right: 4px; }
  .sc-status { font-size: 11px; line-height: 1.45; }
  .sc-instr { font-size: 10px; }
  .sc-chip { font-size: 10px; padding: 4px 6px; }
  .sc-hint { display: none; }
}
