/* snow-globe — CRT nostalgia meets lo-fi television */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@300;400&display=swap');

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  cursor: none;
}

body:hover {
  cursor: default;
}

/* ── TV Screen Container ───────────────────────── */

#screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

#player-wrap {
  position: absolute;
  /* Slightly oversize to push YouTube's top/bottom overlays off screen */
  top: -60px;
  left: 0;
  right: 0;
  bottom: -60px;
  z-index: 1;
  overflow: hidden;
}

#click-guard {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: default;
  pointer-events: none;
}

#click-guard.active {
  pointer-events: all;
}

#now-playing {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  z-index: 50;
  text-align: center;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 2s ease;
}

#unmute-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  z-index: 100;
  transition: opacity 1s ease;
  pointer-events: none;
}

#player-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Bump Card ─────────────────────────────────── */

#bump {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

#bump.active {
  opacity: 1;
  pointer-events: auto;
}

#bump-text {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  color: #d0d0d0;
  text-align: center;
  max-width: 60ch;
  padding: 2rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

#bump.active #bump-text {
  opacity: 1;
  transform: translateY(0);
}

/* ── TV Guide bump ─────────────────────────────── */

#bump-guide {
  display: none;
  width: min(880px, 92vw);
  font-family: 'Space Mono', monospace;
  background: linear-gradient(180deg, #1a1f6b 0%, #0d1147 100%);
  border: 2px solid rgba(120, 150, 255, 0.35);
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(40, 70, 200, 0.35), inset 0 0 60px rgba(0, 0, 20, 0.5);
  color: #d8e0ff;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#bump.guide-mode #bump-text { display: none; }
#bump.guide-mode #bump-guide { display: block; }
#bump.guide-mode.active #bump-guide { opacity: 1; }

.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(180deg, #2a3aa0, #1a247a);
  border-bottom: 2px solid rgba(120, 150, 255, 0.4);
}

.guide-logo {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ffd76a;
  text-transform: lowercase;
}

.guide-title {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  color: #aab6ff;
}

.guide-clock {
  font-size: 0.8rem;
  color: #d8e0ff;
  letter-spacing: 0.1em;
}

.guide-grid { padding: 0.15rem 0; }

.guide-row {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid rgba(120, 150, 255, 0.12);
}

.guide-row:last-child { border-bottom: none; }

.guide-cell {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.3;
  /* wrap full channel/show names onto as many lines as they need instead of
     truncating with an ellipsis; the row auto-grows to fit the tallest cell */
  white-space: normal;
  overflow-wrap: break-word;
  align-self: start;
  border-left: 1px solid rgba(120, 150, 255, 0.12);
}

.guide-cell:first-child { border-left: none; }

.guide-timerow .guide-cell {
  color: #ffd76a;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 30, 0.35);
}

.guide-corner { color: #aab6ff !important; }

.guide-chan { color: #aab6ff; }

.guide-chan b {
  color: #ffd76a;
  margin-right: 0.4rem;
}

.guide-show { color: #e6ebff; }

.guide-show.now {
  background: rgba(255, 215, 106, 0.14);
  color: #fff3cf;
}

.guide-ticker {
  overflow: hidden;
  white-space: nowrap;
  background: #0a0e3a;
  border-top: 2px solid rgba(120, 150, 255, 0.4);
  padding: 0.4rem 0;
}

.guide-ticker span {
  display: inline-block;
  padding-left: 100%;
  color: #9fe8c9;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: guide-marquee 22s linear infinite;
}

@keyframes guide-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@media (max-width: 600px) {
  #bump-guide { width: 96vw; }
  .guide-title { display: none; }
  .guide-cell { padding: 0.4rem 0.4rem; font-size: 0.62rem; }
}

/* ── Watermark ─────────────────────────────────── */

#watermark {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 20;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.12);
  user-select: none;
  pointer-events: none;
}

/* ── Block indicator ───────────────────────────── */

#block-label {
  position: fixed;
  top: 20px;
  left: 24px;
  z-index: 20;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0);
  user-select: none;
  pointer-events: none;
  transition: color 2s ease;
}

#block-label.visible {
  color: rgba(255, 255, 255, 0.15);
}

/* ── Clock ─────────────────────────────────────── */

#clock {
  position: fixed;
  top: 20px;
  right: 28px;
  z-index: 20;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0);
  user-select: none;
  pointer-events: none;
  transition: color 2s ease;
}

#clock.visible {
  color: rgba(255, 255, 255, 0.12);
}

/* ── Mute Button ───────────────────────────────── */

#mute-btn {
  position: fixed;
  bottom: 24px;
  left: 84px;
  z-index: 25;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.25);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  opacity: 0;
}

body.ui-awake #mute-btn {
  opacity: 1;
}

#mute-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.6);
}

#mute-btn.muted {
  color: rgba(255, 80, 80, 0.5);
}

/* ── CRT Scanline Overlay ──────────────────────── */

#crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  mix-blend-mode: multiply;
}

/* ── Vignette ──────────────────────────────────── */

#vignette {
  position: fixed;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* ── Static noise on load ──────────────────────── */

#static {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #111;
  opacity: 1;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

#static.off {
  opacity: 0;
}

#static canvas {
  width: 100%;
  height: 100%;
}

/* ── Loading state ─────────────────────────────── */

#loading {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#loading-text {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.15);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.4; }
}

/* ═══════════════════════════════════════════════════
   snow-guide — liftable printed program guide
   ═══════════════════════════════════════════════════ */

/* the little red TV-Guide-style logo (reused on button + masthead) */
.sg-logo {
  display: inline-flex; flex-direction: column; align-items: center;
  background: #e0102b; color: #fff; border-radius: 5px;
  padding: 4px 8px 5px; line-height: 1;
  font-family: 'Space Mono', 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(0,0,0,.45), inset 0 0 0 1.5px rgba(255,255,255,.18);
  text-transform: lowercase; user-select: none;
}
.sg-logo b { font-weight: 800; font-size: 1.05em; letter-spacing: .01em; }
.sg-logo i {
  font-style: normal; font-weight: 700; font-size: .62em; letter-spacing: .28em;
  margin-top: 2px; padding-top: 2px; padding-left: .28em;
  border-top: 1px solid rgba(255,255,255,.55);
}
.sg-logo--big { padding: 7px 12px 8px; border-radius: 7px; }

/* the button, sitting beside the mute button */
#guide-btn {
  position: fixed; bottom: 21px; left: 22px; z-index: 26;
  background: transparent; border: none; padding: 0; cursor: pointer;
  font-size: 12px; opacity: 0;
  transition: opacity .4s ease, transform .18s ease;
}
body.ui-awake #guide-btn { opacity: .82; }
#guide-btn:hover { opacity: 1; transform: translateY(-2px); }
#guide-btn:active { transform: translateY(0); }

/* the overlay + 3D stage for the lift */
#guidesheet {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 22px; box-sizing: border-box;
  background: rgba(0,0,0,0); perspective: 2000px;
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, background .5s ease, visibility 0s linear .65s;
}
#guidesheet.open {
  opacity: 1; visibility: visible; background: rgba(0,0,0,.5);
  transition: opacity .4s ease, background .5s ease;
}

/* the sheet of paper — lies flat, then lifts up from its bottom edge */
#guidesheet .sheet {
  width: min(1000px, 95vw); max-height: 92vh; overflow: hidden;  /* locked in place, no scrollbar */
  transform-origin: bottom center;
  transform: rotateX(85deg) translateY(40px) scale(.97);
  opacity: 0;
  transition: transform .62s cubic-bezier(.18,.86,.24,1), opacity .45s ease;
  color: #221c14;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.014) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #f6f1e4, #efe7d4);
  border-radius: 3px;
  box-shadow: 0 40px 80px rgba(0,0,0,.6), 0 2px 0 rgba(255,255,255,.5) inset;
  font-family: Georgia, 'Times New Roman', serif;
}
#guidesheet.open .sheet { transform: rotateX(0) translateY(0) scale(1); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  #guidesheet .sheet { transition: opacity .3s ease; transform: none; }
}

/* masthead — red bar like the printed guide */
.sheet-mast {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #e0102b, #b50d22);
  color: #fff; border-bottom: 3px solid #7e0a18;
}
.sheet-mast .sg-logo { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); background:#c20d24; }
.mast-meta { flex: 1; }
.mast-title { font-family:'Space Mono',monospace; font-weight:700; letter-spacing:.34em; font-size:.92rem; }
.mast-sub { font-family:'Space Mono',monospace; font-size:.66rem; letter-spacing:.05em; opacity:.85; margin-top:3px; text-transform:lowercase; }
/* paper-y close: a little torn-off cream chit with an inky serif × */
.sheet-close {
  background: linear-gradient(180deg, #f6f1e4, #ece2cd);
  color: #4a3f2e; border: 1px solid rgba(120, 90, 50, .35);
  width: 30px; height: 30px; border-radius: 3px;
  font-family: Georgia, 'Times New Roman', serif; font-size: 19px; line-height: 26px;
  cursor: pointer; transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.5);
  transition: transform .15s ease, background .2s ease;
}
.sheet-close:hover { background: linear-gradient(180deg, #fffaf0, #efe6d2); transform: rotate(-3deg) translateY(-1px); }
.sheet-close:active { transform: rotate(-3deg) translateY(0); }

/* newspaper columns of channels — just six channels, so two roomy columns */
.sheet-cols { column-count: 2; column-gap: 30px; padding: 20px 24px 10px; }
@media (max-width: 620px) { .sheet-cols { column-count: 1; } }

.chan { break-inside: avoid; margin: 0 0 17px; }

/* the real channel — boxed + tinted so the eye lands here first */
.chan--real {
  background: rgba(224, 16, 43, .055);
  border: 1.5px solid rgba(224, 16, 43, .55);
  border-radius: 5px;
  padding: 10px 12px 8px;
  box-shadow: 0 0 0 4px rgba(224, 16, 43, .05);
}
.chan--real h3 { color: #b50d22; border-bottom-color: #b50d22; margin-bottom: 6px; }
.chan h3 {
  margin: 0 0 5px; padding-bottom: 3px;
  font-family:'Space Mono',monospace; font-size:.84rem; font-weight:700;
  letter-spacing:.02em; color:#283a7a; text-transform:uppercase;
  border-bottom: 2px solid #283a7a;
  display:flex; align-items:baseline; gap:7px;
}
.chan h3 .cn { color:#b50d22; font-weight:800; }
.chan h3 .live { margin-left:auto; font-size:.6rem; letter-spacing:.12em; color:#b50d22; }

.prog { list-style: none; margin: 0; padding: 0; }
.prog li {
  font-size: .8rem; line-height: 1.32; padding: 1.5px 0;
  color:#2a241a; text-indent:-1.6em; padding-left:1.6em;
}
.prog li b { font-weight: 700; color:#1a1610; margin-right:.35em; font-variant-numeric: tabular-nums; }
.prog li em { font-style: italic; color:#6a5f4c; font-size:.92em; }
.prog li.now { background: rgba(224,16,43,.12); box-shadow:-4px 0 0 #e0102b; }
.prog li.now b { color:#b50d22; }

.sheet-foot {
  padding: 10px 22px 16px; margin-top: 4px;
  border-top: 1px dashed #c9bda2;
  font-family:'Space Mono',monospace; font-size:.62rem; letter-spacing:.05em;
  color:#8a7c63; text-transform:lowercase;
}
