/* Self-hosted Google Fonts (OFL): same subsets and unicode-ranges as fonts.googleapis.com */
@font-face {
  font-family: 'Archivo Black';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/archivo-black-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo Black';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/archivo-black-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/vt323-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/vt323-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/vt323-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-top: #020622;
  --bg-mid: #788cae;
  --bg-bottom: #d3d1e3;
  --ink: #f4f1ea;
  --ink-dim: rgba(244, 241, 234, 0.62);
  --live: #3ddc84;
  /* VT323: the green-on-black VCR / TV on-screen-display look, used site-wide. */
  --font-ui: 'VT323', ui-monospace, Menlo, monospace;
  --font-mono: 'VT323', ui-monospace, Menlo, monospace;
  --phosphor: 0 0 6px rgba(244, 241, 234, 0.32);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bottom) 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

@media (hover: hover) {
  #gl { cursor: grab; }
  #gl.is-grabbing { cursor: grabbing; }
  #gl.is-button { cursor: pointer; }
}

.spin-hint {
  position: fixed;
  top: max(54px, calc(env(safe-area-inset-top) + 40px));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  background: rgba(10, 14, 34, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: var(--phosphor);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.spin-hint.is-visible { opacity: 1; transform: translate(-50%, 0); }
.spin-hint svg { animation: spin-hint 2.4s ease-in-out infinite; }
@keyframes spin-hint {
  0%, 15% { transform: rotate(0deg); }
  65%, 100% { transform: rotate(360deg); }
}

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 24px 0;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: var(--phosphor);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease 0.4s;
}
body.is-ready .hud { opacity: 1; }

.hud__name { font-weight: 400; white-space: nowrap; flex-shrink: 0; margin-right: 16px; }
.hud__name small { font-size: 18px; color: var(--ink-dim); margin-left: 12px; }

.hud__now {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 19px;
  text-transform: uppercase;
  color: var(--ink-dim);
  min-width: 0;
}
/* long channel names get cut short with "…" on narrow screens instead of wrapping */
.hud__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud__dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
  transition: background 0.3s, box-shadow 0.3s;
}
.hud__now.is-live .hud__dot {
  background: var(--live);
  box-shadow: 0 0 10px var(--live);
}

.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  justify-items: center;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bottom) 100%);
  transition: opacity 0.9s ease, visibility 0.9s;
  z-index: 50;
}
body.is-ready .loader { opacity: 0; visibility: hidden; }
.loader__bar {
  width: 160px;
  height: 2px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  overflow: hidden;
}
.loader__bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--ink);
  animation: loader 1.1s ease-in-out infinite;
}
.loader__text {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-shadow: var(--phosphor);
}
@keyframes loader {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

.fatal {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 20px;
}

@media (max-width: 600px) {
  .hud { padding-left: 16px; padding-right: 16px; }
  .hud__name small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .loader__bar span { animation: none; width: 100%; }
  .spin-hint svg { animation: none; }
}
