/* ── Theme color ─────────────────────────────────────────────────────────── */

:root {
  --theme-color: #4b2b82; /* default PDM purple; overridden by JS */
}

/* star3000 font family — local files */

@font-face {
  font-family: 'star3_smallregular';
  src: url(fonts/star3000_small.eot);
  src: url(fonts/star3000_small.eot?#iefix) format("embedded-opentype"),
       url(fonts/star3000_small.woff2) format("woff2"),
       url(fonts/star3000_small.woff) format("woff"),
       url(fonts/star3000_small.ttf) format("truetype"),
       url(fonts/star3000_small.svg#star3_smallregular) format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'star3_largeregular';
  src: url(fonts/star3000_large.eot);
  src: url(fonts/star3000_large.eot?#iefix) format("embedded-opentype"),
       url(fonts/star3000_large.woff2) format("woff2"),
       url(fonts/star3000_large.woff) format("woff"),
       url(fonts/star3000_large.ttf) format("truetype"),
       url(fonts/star3000_large.svg#star3_largeregular) format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'star3_large_heavyregular';
  src: url(fonts/star3000_large_heavy.eot);
  src: url(fonts/star3000_large_heavy.eot?#iefix) format("embedded-opentype"),
       url(fonts/star3000_large_heavy.woff2) format("woff2"),
       url(fonts/star3000_large_heavy.woff) format("woff"),
       url(fonts/star3000_large_heavy.ttf) format("truetype"),
       url(fonts/star3000_large_heavy.svg#star3_large_heavyregular) format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'star3_small_heavyregular';
  src: url(fonts/star3000_small_heavy.eot);
  src: url(fonts/star3000_small_heavy.eot?#iefix) format("embedded-opentype"),
       url(fonts/star3000_small_heavy.woff2) format("woff2"),
       url(fonts/star3000_small_heavy.woff) format("woff"),
       url(fonts/star3000_small_heavy.ttf) format("truetype"),
       url(fonts/star3000_small_heavy.svg#star3_small_heavyregular) format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'star3regular';
  src: url(fonts/star3000.eot);
  src: url(fonts/star3000.eot?#iefix) format("embedded-opentype"),
       url(fonts/star3000.woff2) format("woff2"),
       url(fonts/star3000.woff) format("woff"),
       url(fonts/star3000.ttf) format("truetype"),
       url(fonts/star3000.svg#star3regular) format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'star3_heavyregular';
  src: url(fonts/star3000_heavy.eot);
  src: url(fonts/star3000_heavy.eot?#iefix) format("embedded-opentype"),
       url(fonts/star3000_heavy.woff2) format("woff2"),
       url(fonts/star3000_heavy.woff) format("woff"),
       url(fonts/star3000_heavy.ttf) format("truetype"),
       url(fonts/star3000_heavy.svg#star3_heavyregular) format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'star3_extended_heavyregular';
  src: url(fonts/star3000_extended_heavy.eot);
  src: url(fonts/star3000_extended_heavy.eot?#iefix) format("embedded-opentype"),
       url(fonts/star3000_extended_heavy.woff2) format("woff2"),
       url(fonts/star3000_extended_heavy.woff) format("woff"),
       url(fonts/star3000_extended_heavy.ttf) format("truetype"),
       url(fonts/star3000_extended_heavy.svg#star3_extended_heavyregular) format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'star3_extra_largeregular';
  src: url(fonts/star3000_extra_large.eot);
  src: url(fonts/star3000_extra_large.eot?#iefix) format("embedded-opentype"),
       url(fonts/star3000_extra_large.woff2) format("woff2"),
       url(fonts/star3000_extra_large.woff) format("woff"),
       url(fonts/star3000_extra_large.ttf) format("truetype"),
       url(fonts/star3000_extra_large.svg#star3_extra_largeregular) format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'star3_extendedregular';
  src: url(fonts/star3000_extended.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* Base */

html, body {
  width: 100%;
  height: 100%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  background: #000032;
  margin: 0;
  overflow: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

iframe {
  width: 100%;
  height: 100%;
}

.scaled-iframe {
  -webkit-transform: scale(1.2);
  -ms-transform: scale(1.2);
  transform: scale(1.2);
}

/* Main container */

#current-condition {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  margin: auto;
  width: 100%;
  height: 100%;
  background-color: var(--theme-color);
  font-family: 'star3regular';
  font-size: 40pt;
  letter-spacing: 0pt;
  color: white;
  text-shadow: 2px 2px 6px #646464;
}

/* Main content area */

#current-condition .main {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  width: 100%;
  overflow: hidden;
  margin: auto;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  text-transform: uppercase;
  position: relative;
}

/* Two stacked board slots — both in viewport so iframes initialize fully.
   transform: translateZ(0) creates a stacking context that traps position:fixed
   children (disinteraction-overlay, h1.overlayed) within the slot. */
#current-condition .main .board-slot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  overflow: hidden;
  -webkit-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
  background-color: var(--theme-color); /* fallback before JS sets the gradient */
}

#current-condition .main h1 {
  font-weight: normal;
  padding-top: 0.5em;
  margin: 0.9em auto 0.9em 1.8em;
  font-size: 1em;
}

#current-condition .main h1.stars {
  margin: 0.9em auto 0.9em auto;
  text-align: center;
}

#current-condition .main h1.stars::before,
#current-condition .main h1.stars::after {
  content: '*';
}

#current-condition .main h1.stars.large {
  font-size: 1.5em;
}

#current-condition .main h1.overlayed {
  position: fixed;
  width: 100%;
  z-index: 1;
}

#current-condition .main .mini {
  font-family: 'star3_smallregular';
  font-size: 0.8em;
  line-height: 0.6em;
}

#current-condition .main .autoscroll-wrapper {
  margin-top: 1em;
  overflow: hidden;
}

#current-condition .main p {
  box-sizing: border-box;
  line-height: 1.25em;
  padding: 0 1.8em;
  margin: 0 auto auto auto;
  width: 100%;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  word-wrap: break-all;
}

#current-condition .main p.small {
  font-family: 'star3_smallregular';
}

#current-condition .main [data-hook=locating] {
  position: relative;
  z-index: 10;
  margin: auto;
}

#current-condition .main .cover {
  z-index: 2;
  width: 100vw;
  height: 100vh;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

#current-condition .main .cover.stretch {
  background-size: cover;
}

/* Board background images — set via inline style in server-rendered HTML */
#current-condition .main .ny-region     { }
#current-condition .main .namerica      { background-color: #c1e7ff; }
#current-condition .main .wradar        { background-color: #001020; }
#current-condition .main .flight-delays { background-color: #334d65; }

#current-condition .main .center {
  text-align: center;
}

/* Weather / data tables */

#current-condition .main .table-wrapper {
  height: 100%;
}

#current-condition .main table {
  margin: 0 auto auto auto;
  padding: 0 1.8em;
  width: 100%;
}

#current-condition .main table.mountains td {
  font-size: 0.5em;
}

#current-condition .main table .location {
  text-align: left;
}

#current-condition .main table .delay-type {
  width: 1%;
  white-space: nowrap;
  text-align: left;
  padding-right: 1em;
}

#current-condition .main table .temp {
  width: 2.5em;
  text-align: right;
}

#current-condition .main table .wind {
  text-align: right;
  width: 3.5em;
}

#current-condition .main table .sky {
  text-align: right;
  width: 5.5em;
}

#current-condition .main table th {
  padding-top: 0;
  margin-top: 0;
  vertical-align: top;
  text-align: left;
  font-family: 'star3_smallregular';
}

#current-condition .main table td:nth-child(2) {
  text-align: right;
}

/* Board wrapper (injected by JS) */

#current-condition .main .wrapper {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  z-index: 1;
}

/* Video embeds */

#current-condition .video-wrapper {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

[data-hook=ustream] {
  -webkit-transform: scale(1.8);
  -ms-transform: scale(1.8);
  transform: scale(1.8);
}

[data-hook=live-flights] {
  -webkit-transform: scale(2);
  -ms-transform: scale(2);
  transform: scale(2);
}

/* Overlay to prevent click-through on iframes */
.disinteraction-overlay {
  z-index: 1000;
  position: fixed;
  width: 100vw;
  height: 100vh;
  background-color: #0000ff;
  opacity: 0.01;
}

/* Divider bar */

#current-condition .divider {
  border-top: 0.12em solid white;
  box-shadow: 0 -1px 0px 0px #646464;
  padding: 0 1.8em 0 3em;
  box-sizing: border-box;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
  position: relative;
  overflow: visible;
}

/* ── Logo button + menu wrapper ──────────────────────────────────────────── */

#current-condition .logo-btn-wrap {
  position: absolute;
  left: 0.3em;
  top: 0;
  -webkit-transform: translateY(-66.67%);
  -ms-transform: translateY(-66.67%);
  transform: translateY(-66.67%);
  font-size: inherit;
  height: 3em;
  z-index: 20;
}

#current-condition .logo-btn {
  height: 100%;
  background: var(--theme-color);
  border: 4px solid white;
  box-sizing: border-box;
  padding: 0.32em;
  cursor: pointer;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  line-height: 0;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  outline: none;
}

#current-condition .logo-btn img {
  height: 100%;
  width: auto;
  display: block;
}

/* ── Logo menu ───────────────────────────────────────────────────────────── */

#logo-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--theme-color);
  border: 4px solid white;
  box-sizing: border-box;
  font-size: 0.35em;
  font-family: 'star3_smallregular', monospace;
  white-space: nowrap;
  min-width: 12em;
}
#logo-menu.open { display: block; }

#logo-menu-links {
  padding: 0.4em 0;
}

#current-condition .menu-link {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.6em;
  padding: 0.45em 0.8em;
  color: white;
  text-decoration: none;
  letter-spacing: 0.05em;
}
#current-condition .menu-link:hover {
  background: rgba(255, 255, 255, 0.15);
}
#current-condition .menu-link svg {
  width: 1.4em;
  height: 1.4em;
  flex-shrink: 0;
}

#logo-menu-controls {
  border-top: 0.12em solid white;
  padding: 0.4em 0;
}

#current-condition .menu-control {
  width: 100%;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.6em;
  padding: 0.45em 0.8em;
  background: none;
  border: none;
  color: white;
  font-family: 'star3_smallregular', monospace;
  font-size: 1em;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
#current-condition .menu-control:hover {
  background: rgba(255, 255, 255, 0.15);
}
#current-condition .menu-control svg {
  width: 1.4em;
  height: 1.4em;
  flex-shrink: 0;
}

#current-condition .divider .left,
#current-condition .divider .right {
  display: block;
  white-space: nowrap;
  font-family: 'star3_smallregular';
  font-size: 1em;
  letter-spacing: 0;
}

#current-condition .divider .left {
  margin: -0.1em auto auto 0;
}

#current-condition .divider .right {
  margin: -0.1em 0 auto auto;
}

/* Footer / ticker */

#current-condition footer {
  overflow: hidden;
  width: 100%;
  margin-bottom: 0.55em;
}

#current-condition footer span {
  display: inline;
  white-space: nowrap;
}

#current-condition footer .mobile-play-overlay {
  display: none;
  width: 100vw;
  text-align: center;
}

/* ── Theme picker (inside logo menu) ─────────────────────────────────────── */

#logo-menu-theme {
  border-top: 0.12em solid white;
  padding: 0.5em 0.8em;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.6em;
}

.menu-theme-label {
  font-size: 1em;
  letter-spacing: 0.05em;
  color: white;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

#theme-swatches {
  display: -webkit-flex;
  display: flex;
  gap: 0.45em;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
}

.theme-swatch {
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  border: 0.14em solid rgba(255,255,255,0.4);
  cursor: pointer;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  -webkit-transition: border-color 0.15s, -webkit-transform 0.15s;
  transition: border-color 0.15s, transform 0.15s;
}

.theme-swatch:hover {
  border-color: white;
  -webkit-transform: scale(1.2);
  transform: scale(1.2);
}

.theme-swatch.active {
  border-color: white;
  box-shadow: 0 0 0 0.1em rgba(255,255,255,0.6);
}

/* ── Screen effects ──────────────────────────────────────────────────────── */

/* Base overlay — sits above boards (z:1/2) and divider (z:auto), below logo
   button wrap (z:20). pointer-events:none so it never blocks interaction. */
#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

/* Grain canvas — drawn at half viewport res by JS, CSS stretches it up.
   Half-res gives chunkier, more VHS-like grain texture. */
#grain-canvas {
  display: none;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 16;
  opacity: 0.18;
  mix-blend-mode: overlay;
}

/* ── Scanlines (TERMINAL) ────────────────────────────────────────────────── */

body.fx-scanlines #fx-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent          0px,
    transparent          1px,
    rgba(0, 0, 0, 0.55)  1px,
    rgba(0, 0, 0, 0.55)  2px
  );
}

/* ── Vignette (BROADCAST) ────────────────────────────────────────────────── */

body.fx-vignette #fx-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 20%,
    rgba(0, 0, 0, 0.95) 100%
  );
}

/* ── Phosphor glow (TERMINAL) ────────────────────────────────────────────── */
/* Boosts saturation + contrast to make the green pop like a phosphor screen. */

body.fx-glow #current-condition {
  -webkit-filter: saturate(2.2) brightness(1.25) contrast(1.2);
  filter: saturate(2.2) brightness(1.25) contrast(1.2);
}

/* ── Flicker (TERMINAL) ──────────────────────────────────────────────────── */
/* Occasional irregular brightness dip — like a fluorescent tube catching. */

@-webkit-keyframes fx-flicker {
  0%, 70%, 72%, 74%, 76%, 90%, 92%, 94%, 100% { opacity: 1; }
  71%, 75%, 91%, 93% { opacity: 0.80; }
  73% { opacity: 0.90; }
}
@keyframes fx-flicker {
  0%, 70%, 72%, 74%, 76%, 90%, 92%, 94%, 100% { opacity: 1; }
  71%, 75%, 91%, 93% { opacity: 0.80; }
  73% { opacity: 0.90; }
}
body.fx-flicker #current-condition {
  -webkit-animation: fx-flicker 14s ease-in-out infinite;
  animation: fx-flicker 14s ease-in-out infinite;
}

/* ── Rolling bar (BROADCAST) ─────────────────────────────────────────────── */
/* Slow-drifting horizontal band — 60Hz power-line interference artifact. */

@-webkit-keyframes fx-roll {
  from { top: 105%; }
  to   { top:  -5%; }
}
@keyframes fx-roll {
  from { top: 105%; }
  to   { top:  -5%; }
}
.fx-rolling-bar {
  position: fixed;
  left: 0;
  right: 0;
  height: 24px;
  pointer-events: none;
  z-index: 17;
  background: -webkit-linear-gradient(
    top,
    transparent,
    rgba(255, 255, 255, 0.2) 50%,
    transparent
  );
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.2) 50%,
    transparent
  );
  -webkit-animation: fx-roll 8s linear infinite;
  animation: fx-roll 8s linear infinite;
}

/* ── Chromatic aberration (VHS) ──────────────────────────────────────────── */
/* Applied to the whole #current-condition so boards, divider, and ticker all
   get color fringing. pointer-events:none on #fx-layer means the logo button
   stays clickable even though effects paint above it. */

body.fx-chroma #current-condition {
  -webkit-filter: url(#chroma-filter);
  filter: url(#chroma-filter);
}

/* ── VHS glitch stripe (VHS) ─────────────────────────────────────────────── */
/* Brief horizontal artifact injected at a random Y by JS, then removed. */

.fx-glitch-stripe {
  position: fixed;
  left: 0;
  right: 0;
  height: 6px;
  pointer-events: none;
  z-index: 17;
  background: rgba(100, 200, 255, 0.7);
  mix-blend-mode: screen;
  -webkit-transform: translateX(-8px);
  transform: translateX(-8px);
}

/* Responsive breakpoints */

@media only screen and (max-width: 640px) {
  #current-condition {
    font-size: 12pt;
  }
  #current-condition [data-hook=ustream] {
    -webkit-transform: scale(1.4);
    -ms-transform: scale(1.4);
    transform: scale(1.4);
  }
  #current-condition .main h1 {
    width: 100%;
    margin: 0.45em auto 0.45em 0.9em;
  }
  #current-condition .main h1.stars {
    text-align: center;
    margin: 0.45em auto 0.45em auto;
  }
  #current-condition .main p {
    padding: 0 0.9em;
  }
  #current-condition .main table {
    padding: 0 0.9em;
  }
  #current-condition .divider {
    padding: 0 0.9em 0 0.9em;
  }
}

