/* Material Symbols */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

body.bubble-tv {
  margin: 0;
  padding: 0;
  background: #0b0f14;
  color: #e5e7eb;
  font-family: 'Roboto Flex', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1;
}

* {
  scroll-behavior: auto !important;
  transition: none !important;
  animation: none !important;
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.tv-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top left, #3a86ff 0, #0b0f14 60%, #000 100%);
  overflow: hidden;
}

.shell-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 650ms ease !important;
  will-change: opacity;
  z-index: 0;
}

.shell-backdrop.visible {
  opacity: 1;
}

.shell-backdrop-b {
  z-index: 1;
}

.shell-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right,
    #00000000,
    #00000080,
    #000,
    #000);
  z-index: 2;
  pointer-events: none;
}

.tv-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  z-index: 3;
}

.app-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
}

.nav-rail {
  width: 80px;
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 12px;
  gap: 16px;
  background: linear-gradient(to right, #000, #000, #00000000);
}

.nav-brand {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

.nav-items {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
    margin-top: 6px;
    justify-content: center;
}

.nav-item {
  width: 48px;
  height: 48px;
  border-radius: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  background: rgb(255 255 255 / 6%);
}

.nav-item.active {
  box-shadow: 0 0 0 2px rgb(255 255 255), 0 20px 45px rgba(0, 0, 0, 0.55);
  /*background: rgb(255 255 255);
  color: #000;*/
}

.nav-item.focused {
  box-shadow: 0 0 0 2px rgb(255 255 255), 0 20px 45px rgba(0, 0, 0, 0.55);
  background: rgb(255 255 255);
  color: #000;
}

.nav-footer {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-clock {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.app-topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 96px;
  position: relative;
}

.app-brand {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.85;
  white-space: nowrap;
}

.app-title {
  font-size: 18px;
  font-weight: 800;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-action {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 2px 10px 0px rgb(7 7 7 / 10%);
  background: rgb(255 255 255 / 6%);
}

.topbar-action.active {
  box-shadow: 0 0 0 1px rgb(255 255 255), 0 20px 45px rgba(0, 0, 0, 0.55);
  background: rgb(255 255 255);
  color: #000;
}

.app-clock {
  font-size: 20px;
  font-weight: 200;
  letter-spacing: 0.14em;
  opacity: 0.85;
}

.app-content {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.app-grid {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.app-grid.home-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  --home-poster-width: clamp(132px, 13vw, 168px);
  --home-row-gap: 16px;
  --home-media-height: calc(var(--home-poster-width) * 1.5);
  --home-hero-height: clamp(160px, 25vh, 500px);
}

.home-hero {
  height: var(--home-hero-height);
  flex: 0 0 var(--home-hero-height);
  min-height: var(--home-hero-height);
  padding: 18px 96px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.home-hero + .home-section {
  margin-top: 10px;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.9;
  filter: saturate(1.05) contrast(1.02);
}

.home-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,0.78), rgba(0,0,0,0.25) 55%, rgba(0,0,0,0.05)),
    linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.88));
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 62vw;
}

.home-hero.meta-active .home-hero-inner::after {
  content: '';
  position: absolute;
  inset: -10px -12px;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgb(255 255 255);
  background: rgba(0,0,0,0.10);
  pointer-events: none;
}

.home-hero-title {
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin-bottom: 10px;
}

.home-hero-meta {
  font-size: 14px;
  color: rgba(229, 231, 235, 0.92);
  opacity: 0.95;
  margin-bottom: 10px;
}

.home-hero-overview {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(229, 231, 235, 0.92);
  max-width: 72ch;
  text-shadow: 0 6px 24px rgba(0,0,0,0.75);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-hero-overview.full {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  -webkit-box-orient: initial;
  overflow: visible;
  text-overflow: clip;
}

.home-hero-actions {
  display: flex;
  gap: 12px;
  padding-bottom: 18px;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 700;
}

.hero-action.primary {
  background: rgba(255,255,255,0.92);
  color: #000;
}

.hero-action.active {
  box-shadow: 0 0 0 3px rgb(255 255 255);
}

.home-section {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  /*min-height: calc(24px + 12px + var(--home-media-height) + 32px);
  max-height: calc(32px + 12px + var(--home-media-height) + 48px);*/
  overflow: hidden;
}

.home-section.peek {
  opacity: 0.88;
  transform: translateY(-10px);
  min-height: calc(24px + 12px + (var(--home-media-height) * 0.36) + 18px);
  /*max-height: calc(24px + 12px + (var(--home-media-height) * 0.36) + 18px);*/
}

.home-section-title {
    font-size: 18px;
    font-weight: 800;
    height: 32px !important;
    line-height: 1;
    display: flex;
    padding: 8px 96px 0;
    align-items: center;
}

.home-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 8px calc(100vw - 96px - var(--home-poster-width)) 12px 96px;
}

.app-grid.detail-layout {
  overflow-y: auto;
  --home-poster-width: clamp(132px, 13vw, 168px);
  --home-row-gap: 16px;
  --home-media-height: calc(var(--home-poster-width) * 1.5);
  --home-hero-height: clamp(160px, 25vh, 500px);
}

.detail-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 96px 20px;
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 64px 96px;
}

.detail-overlay-panel {
  width: min(980px, calc(100vw - 192px));
  max-height: min(72vh, 760px);
  overflow: auto;
  /* background: rgba(17, 24, 39, 0.92); */
  background: rgb(50 50 50 / 75%);
  border-radius: 22px;
  padding: 22px 22px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 30px 90px rgba(0,0,0,0.65);
}

.detail-overlay-title {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin-bottom: 10px;
}

.detail-overlay-meta {
  font-size: 14px;
  color: rgba(229, 231, 235, 0.92);
  opacity: 0.95;
  margin-bottom: 12px;
}

.detail-overlay-overview {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(229, 231, 235, 0.92);
  white-space: pre-wrap;
}

.home-row::-webkit-scrollbar {
  height: 0;
}

.home-poster {
  width: var(--home-poster-width);
  flex: 0 0 auto;
}

.card {
  border: none;
  padding: 6px;
  gap: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.card.active {
  outline: 4px solid rgb(255 255 255);
  outline-offset: -4px;
  border-radius: 8px;
  color: #111;
}

.poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, rgba(58,134,255,0.08), rgba(17,24,39,0.25));
  box-shadow: 0 0 0px 1px rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  position: relative;
}

.card.active > .poster {
  box-shadow: 0 0 0px 1px rgb(117 117 117 / 25%), 0 0 0px 6px rgb(255 255 255);
}

.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.poster-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(229, 231, 235, 0.92);
  text-shadow: 0 6px 22px rgba(0,0,0,0.65);
}

.poster-icon .material-symbols-rounded {
  font-size: 48px;
  line-height: 1;
  opacity: 0.95;
}

.card-meta {
  padding: 2px 0px 2px;
  display: none;
  flex-direction: column;
  height: 0;
  gap: 2px;
  min-height: 0;
  font-family: 'Roboto Condensed';
}

.card.active > .card-meta {
  box-shadow: 0 0 0px 6px rgb(255 255 255);
  background: #fff;
}

.card-title {
  font-size: 14px;
  height: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle {
  font-size: 12px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-toast {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.app-toast-inner {
  max-width: 70vw;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: #e5e7eb;
}

.player-root {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 6;
}

.player-root video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 16px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 35%, transparent 55%, rgb(0 0 0 / 75%));
  pointer-events: none;
}

.player-hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.player-hud-title {
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 18px rgba(0,0,0,0.9);
  max-width: 70vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-hud-clock {
  font-size: 18px;
  font-weight: 700;
  opacity: 0.95;
  text-shadow: 0 2px 18px rgba(0,0,0,0.9);
}

.player-hud-bottom {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-direction: column;
}

.player-hud-controls {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  gap: 14px;
}

.pbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.35);
  color: #e5e7eb;
}

.pbtn .material-symbols-rounded {
  font-size: 28px;
}

.pbtn.active {
  background: #fff;
  color: #000;
}

.player-progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  overflow: hidden;
}

.player-progress-inner {
  width: 100%;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, rgba(58,134,255,0.95), rgba(106,168,255,0.95));
}

.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #e5e7eb;
  opacity: 0.9;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

