/* Shmotime TV (/tv) — the TV-set frame, screen layers, control bar and menus.
   Page markup: templates/tv-page.php. Behaviour: assets/js/tv.js. */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: sans-serif; }
#tv-wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #000; }
#tv { position: relative; aspect-ratio: 16/9; width: min(100%, calc(100vh * 16 / 9)); background: #000; }
#tv-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2000; pointer-events: none; }
#screen { position: absolute; left: 23.698%; top: 11.019%; width: 52.240%; height: 70.278%; overflow: hidden; }
#fuzz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1500;
}
#fuzz.hidden { display: none; }
#fuzz-label {
  position: absolute;
  bottom: 10%;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 1501;
  color: #aaa;
  font-family: monospace;
  font-size: 18px;
  letter-spacing: 4px;
}
#fuzz-label.hidden { display: none; }
#tap-to-start {
  position: absolute;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #000;
}
#tap-to-start p {
  color: #555;
  font-family: monospace;
  font-size: 24px;
  letter-spacing: 4px;
}
#controls.hidden { display: none; }
#btn-exit-fullscreen {
  display: none;
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 1800;
  background: rgba(34, 34, 34, 0.7);
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 16px;
  cursor: pointer;
}
#btn-exit-fullscreen:hover { background: rgba(51, 51, 51, 0.9); }
#player { width: 100%; height: 100%; border: none; display: block; }
#commercial {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1000;
  background: #000;
  color: #fff;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 16px;
}
#commercial.visible { display: flex; }
#commercial h1 {
  font-size: 4vw;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  animation: pulse 1.5s ease-in-out infinite;
}
#commercial p {
  font-size: 1.5vw;
  color: #888;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
#yt-commercial {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1000;
  background: #000;
  overflow: hidden;
}
#yt-commercial.visible { display: block; }
#yt-player { width: 300%; height: 100%; margin-left: -100%; }
#yt-fade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}
#controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(17, 17, 17, 0.85);
  border-top: 1px solid #333;
}
#now-playing {
  color: #ccc;
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  padding: 0 16px;
}
#now-playing:hover { color: #fff; }
#controls-left, #controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#controls-left button, #controls-right button {
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 16px;
  cursor: pointer;
}
#controls-left button:hover, #controls-right button:hover { background: #333; }
/* Menu overlay */
#menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #111;
  flex-direction: column;
}
#menu-overlay.visible { display: flex; }
#menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #333;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}
#menu-title { color: #fff; font-size: 18px; font-weight: 600; }
#menu-close {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
}
#menu-close:hover { color: #fff; }
#menu-body { overflow-y: auto; flex: 1; padding: 8px 0; max-width: 600px; margin: 0 auto; width: 100%; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  color: #ccc;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}
.menu-item:hover { background: #252525; }
.menu-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: #444;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.menu-toggle.on { background: #4a9eff; }
.menu-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.menu-toggle.on::after { transform: translateX(20px); }
.playlist-item {
  padding: 12px 20px;
  color: #ccc;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #222;
}
.playlist-item:hover { background: #252525; }
.playlist-item.active { color: #4a9eff; font-weight: 600; }
.playlist-item .playlist-show { color: #888; font-size: 12px; display: block; margin-top: 2px; }
