/* OES CRT video library wall */

@font-face {
  font-family: "VCR OSD Mono";
  src: url("/fonts/VCR_OSD_MONO_1.001.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --crt-amber: #fbd7a3;
  --crt-olive: #7df1b4;
  --crt-ink: #0c0704;
  --crt-deep: #1a0d06;
}

body.vhs-library {
  /* VHS logo tiled at roughly 1/6 size over the solid base */
  background:
    url("/images/VHSlogo.png") repeat,
    radial-gradient(circle at 12% 18%, rgba(255, 217, 166, 0.08), transparent 18%),
    radial-gradient(circle at 78% 22%, rgba(125, 241, 180, 0.06), transparent 18%),
    #2c1606;
  background-size: 213px auto, auto, auto, auto;
  color: #fcefd8;
  font-family: "VCR OSD Mono", "Lyno-Stan", monospace;
}

body.vhs-library header {
  background: rgba(237, 216, 204, 0.92);
  border-bottom: 2px solid rgba(255, 217, 166, 0.28);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.vhs-library .nav-bar a {
  background-color: transparent;
  color: #ffe9c5;
}

body.vhs-library .nav-bar a:hover {
  background-color: rgba(210, 139, 60, 0.32);
  color: #fffaf2;
}

.vhs-library .blob-red {
  background: #b64f17;
}

.vhs-library .blob-blue {
  background: #6a3210;
}

.vhs-library .blob-red-2 {
  background: #f1c07c;
}

.vhs-library .blob-container {
  width: 115%;
  height: min(70vh, 820px);
  left: -7%;
  top: -7%;
  right: auto;
  bottom: auto;
  inset: auto;
  z-index: 0;
}

.vhs-library main {
  position: relative;
  z-index: 2;
}

.library-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.library-hero .title-container {
  text-align: center;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fbd7a3;
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.hero-description {
  max-width: 740px;
  margin: 0.4rem auto 0;
  color: #f6d7ad;
  line-height: 1.5;
}

.wall-intro {
  background: linear-gradient(135deg, rgba(20, 10, 6, 0.82), rgba(12, 6, 3, 0.85));
  border: 1px solid rgba(255, 221, 168, 0.2);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  color: #f6d7ad;
  box-shadow: inset 0 0 0 1px rgba(255, 221, 168, 0.08);
}

.crt-wall {
  background-image: url("/images/VHSlogo.png"),
    linear-gradient(160deg, rgba(26, 12, 5, 0.88), rgba(11, 6, 3, 0.9));
  background-repeat: no-repeat, no-repeat;
  background-position: center 6px, center;
  background-size: 1280px auto, cover;
  border: 1px solid rgba(255, 221, 168, 0.26);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: 10px 12px 0 rgba(0, 0, 0, 0.45), 0 16px 46px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.vhs-logo-bg {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1280px, 95vw);
  height: calc(min(1280px, 95vw) * 0.51);
  aspect-ratio: 1280 / 654;
  background: url("/images/VHSlogo.png") center/contain no-repeat;
  opacity: 0.3;
  filter: grayscale(1) brightness(1.3) drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 1;
}

.wall-grid {
  display: grid;
  gap: 1.1rem;
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  justify-items: center;
  position: relative;
  z-index: 2;
}

.library-wall-grid {
  width: 100%;
}

@media (min-width: 1080px) {
  .wall-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .wall-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

.tv-unit {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(150deg, rgba(28, 13, 6, 0.9), rgba(12, 6, 3, 0.94));
  border: 1px solid rgba(255, 221, 168, 0.26);
  border-radius: 11px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.45), 0 14px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: relative;
  overflow: hidden;
}

.tv-unit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 12%, rgba(255, 217, 166, 0.08), transparent 35%);
  opacity: 0.7;
  pointer-events: none;
}

.tv-unit>* {
  position: relative;
  z-index: 1;
}

.tv-unit.tv-static .tv-screen--video,
.tv-unit.tv-static .tv-screen--embed {
  opacity: 0.4;
  filter: grayscale(1) contrast(1.15);
}

.tv-unit.tv-empty .tv-screen--video,
.tv-unit.tv-empty .tv-screen--embed {
  opacity: 0;
}

.crt-shell {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.crt-shell--wall {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
}

.crt-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 50% 35%, rgba(20, 10, 6, 0.6), rgba(10, 5, 3, 0.85));
  border-radius: 18px;
  overflow: hidden;
}

.crt-frame--wall {
  background: none;
}

/* Aligns video to the transparent window of the Sony Trinitron frame */
.crt-screen {
  position: absolute;
  top: 20.4%;
  left: 20.3%;
  width: 59.7%;
  height: 42.3%;
  overflow: hidden;
  border-radius: 12px;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.7),
    0 0 24px rgba(125, 241, 180, 0.28);
  background: #000;
  z-index: 1;
}

.tv-screen {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
  position: relative;
  z-index: 1;
  object-fit: cover;
}

.tv-screen--embed {
  object-fit: cover;
}

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, 0.22) 0px,
      rgba(0, 0, 0, 0.22) 2px,
      rgba(255, 255, 255, 0) 3px);
  mix-blend-mode: soft-light;
  opacity: 0.5;
  z-index: 2;
}

.crt-glare {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.03) 38%,
      rgba(255, 255, 255, 0) 60%);
  z-index: 3;
}

.trinitron-overlay {
  position: absolute;
  inset: 0;
  background: url("/video/sonycrtfrfame.png") center center / contain no-repeat;
  pointer-events: none;
  opacity: 0.96;
  z-index: 5;
}

.screen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%,
      rgba(251, 215, 163, 0.08),
      rgba(12, 7, 4, 0.7));
  color: var(--crt-amber);
  font-family: "VCR OSD Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  text-align: center;
  z-index: 7;
}

.tv-unit.tv-empty .screen-overlay {
  opacity: 0.85;
}

.tv-unit.tv-static .screen-overlay {
  opacity: 0.9;
  background:
    repeating-linear-gradient(to bottom,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 1px,
      rgba(0, 0, 0, 0.08) 2px,
      rgba(0, 0, 0, 0.08) 3px),
    linear-gradient(120deg, rgba(255, 217, 166, 0.08), rgba(12, 7, 4, 0.9));
  animation: crtSnow 0.18s steps(2) infinite;
}

@keyframes crtSnow {
  0% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(-3px, 2px, 0);
  }

  100% {
    transform: translate3d(2px, -2px, 0);
  }
}

.crt-caption {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--crt-amber);
  letter-spacing: 0.08em;
  padding: 0 0.1rem 0.15rem;
  text-transform: uppercase;
}

.pilot-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #9fe7c6, #2b7a52 75%);
  box-shadow: 0 0 10px #7df1b4, 0 0 0 2px rgba(125, 241, 180, 0.28);
}

.vcr {
  padding: 0.8rem 0.9rem 0.95rem;
  background: linear-gradient(180deg, rgba(20, 10, 6, 0.95), rgba(11, 6, 3, 0.95));
  border: 1px solid rgba(255, 221, 168, 0.24);
  border-radius: 12px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.55), 0 12px 26px rgba(0, 0, 0, 0.45);
  color: #ffe9c5;
}

.vcr-title-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--crt-amber);
  margin-bottom: 0.35rem;
}

.vcr-slot {
  margin: 0.35rem 0 0.7rem;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px dashed rgba(255, 221, 168, 0.38);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.55), rgba(32, 18, 10, 0.6));
  color: #fcefd8;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.9rem;
  transition: border-color 0.1s ease, box-shadow 0.1s ease, transform 0.1s ease;
  text-align: center;
  padding: 0.4rem 0.6rem;
}

.vcr-slot--wall {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  text-transform: none;
  letter-spacing: 0.06em;
  padding: 0.65rem 0.7rem;
  gap: 0.2rem;
  flex-direction: column;
}

.slot-title {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffe9c5;
}

.slot-desc {
  margin: 0;
  font-size: 0.9rem;
  color: #f6d7ad;
  line-height: 1.4;
}

.vcr-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.vcr-btn {
  padding: 0.38rem 0.65rem;
  background: linear-gradient(180deg, #2a170c, #140a06);
  border: 1px solid rgba(255, 221, 168, 0.35);
  border-radius: 8px;
  color: #ffe9c5;
  font-family: "VCR OSD Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.vcr-btn:hover {
  box-shadow: 0 0 0 1px #d28b3c;
}

.vcr-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.status-panel {
  margin-top: 0.4rem;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: #9fe7c6;
  font-family: "VCR OSD Mono", monospace;
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
}

.status-label {
  color: var(--crt-amber);
}

@media (max-width: 640px) {
  .crt-frame {
    aspect-ratio: 1 / 1;
  }
}
