.media-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.8s ease-in-out;
}
#media-layer-front {
  z-index: 2;
}
#media-layer-back {
  z-index: 1;
}
#media-layer-front.empty,
#media-layer-back.empty {
  display: none;
}

/* Images: fit without cropping */
#media-layer-front img,
#media-layer-back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Videos: cover to prevent pixelation on large screens (TVs) */
#media-layer-front video,
#media-layer-back video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Ticker overlay: logo box (anchor) + scrolling text region */
#ticker-overlay {
  position: absolute;
  z-index: 10;
  width: 100%;
  pointer-events: none;
  overflow: hidden;
  bottom: 0;
  display: flex;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.6);
}
#ticker-overlay.position-top {
  top: 0;
  bottom: auto;
}
#ticker-overlay.position-bottom {
  bottom: 0;
  top: auto;
}

#ticker-logo-box {
  flex: 0 0 auto;
  height: 100%;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  background: #241e71;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
}
#ticker-logo-box.hidden {
  display: none;
}
#ticker-logo-img {
  height: 100%;
  max-height: 64px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

#ticker-bar {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 10px 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: #fff;
  background: #cc0000;
}
#ticker-bar .ticker-text {
  position: absolute;
  white-space: nowrap;
  display: inline-block;
  will-change: transform;
  animation: ticker-scroll 20s linear infinite;
}
@keyframes ticker-scroll {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}
#empty-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
#empty-screen.hidden {
  display: none;
}
#empty-screen span {
  color: #666;
  font-family: sans-serif;
  font-size: 14px;
  margin-top: 12px;
}
