/* Title page, streams, person, search, explore, See All and library screens
   (src/ui/DetailScreen.tsx, TitleExtrasViews.tsx, PersonScreen.tsx,
   SearchScreen.tsx, ExploreScreen.tsx, BrowseScreen.tsx, LibraryScreen.tsx).
   Android dp x 2. Chrome 56: no gap, aspect-ratio or inset. */

/* ---------------------------------------------------------------- layout */

.dt-screen { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
.dt-fill { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* spacedBy(n) for a column's direct children */
.dt-spaced-8 > * + * { margin-top: 8px; }
.dt-spaced-16 > * + * { margin-top: 16px; }
.dt-spaced-20 > * + * { margin-top: 20px; }
.dt-spaced-24 > * + * { margin-top: 24px; }
.dt-spaced-28 > * + * { margin-top: 28px; }

.clamp5, .clamp6 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp5 { -webkit-line-clamp: 5; }
.clamp6 { -webkit-line-clamp: 6; }

/* Grid pages (LazyVerticalGrid, GridCells.FixedSize(posterWidth), PagePadding, lines 18.dp apart) */
.dt-grid-track { padding: 72px 72px 96px 184px; }
.dt-grid-span { margin-bottom: 36px; }
.dt-grid-cells { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; margin-right: -36px; }
.dt-grid-cell { width: 220px; flex: none; margin: 0 36px 36px 0; }
.dt-cell-title { color: #fff; font-size: 26px; font-weight: 600; }
.dt-cell-sub { color: var(--muted); font-size: 24px; }

/* ---------------------------------------------------------------- overlays */

.dt-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(0,0,0,0.85); display: flex; flex-direction: row; align-items: center; justify-content: center; }
.dt-overlay.dt-overlay-heavy, .dt-overlay.dt-overlay-review { background: rgba(0,0,0,0.9); }
.dt-overlay-column { position: relative; height: 100%; max-width: 100%; }
/* LazyColumn centred in its Box: short content sits mid-screen, long content scrolls. */
.dt-center-track { min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.dt-center-track > * { flex: none; }
.dt-overlay-review .dt-center-track > * + * { margin-top: 28px; }

.dt-review-full-author { color: #fff; font-size: 52px; font-weight: 700; }
.dt-review-full-rating { color: var(--silver); font-size: 32px; }
.dt-paragraph { color: var(--accent); font-size: 34px; line-height: 52px; padding: 16px; border-radius: 16px; background: transparent; transition: background-color 150ms; white-space: pre-wrap; }
.dt-paragraph.focused { background: rgba(255,255,255,0.06); }

.dt-rate { display: flex; flex-direction: column; align-items: center; }
.dt-rate > * + * { margin-top: 40px; }
.dt-rate-title { color: #fff; font-size: 60px; font-weight: 700; }
.dt-rate-note { color: var(--muted); font-size: 30px; }

.dt-menu { width: 1040px; max-width: 100%; }
.dt-menu-title { color: #fff; font-size: 48px; font-weight: 700; padding-bottom: 16px; margin-bottom: 16px; }
.dt-menu-message { color: rgba(255,255,255,0.75); font-size: 32px; line-height: 1.35; margin-bottom: 24px; }

.dt-sheet-title { color: #fff; font-size: 48px; font-weight: 700; padding-bottom: 12px; }
.dt-center-track > .dt-sheet-body { margin-top: 24px; }
.dt-sheet-body > * + * { margin-top: 20px; }

/* ---------------------------------------------------------------- title page */

/* PageArtwork: 78% x 78% at the top trailing corner, fading left (0 → 55%) and down (40% → 100%), alpha 0.85 */
.dt-artwork { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
.dt-artwork-frame {
  position: absolute; top: 0; right: 0; width: 78%; height: 78%; overflow: hidden; opacity: 0.85;
  /* One mask per box (nested): old Chromium draws a composited two-layer mask as nothing. */
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, #000 55%);
  mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, #000 55%);
}
.dt-artwork-v {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, #000 40%, rgba(0,0,0,0) 100%);
}
.dt-artwork-v > img, .dt-artwork-v > video, .dt-artwork-v > div > video, .dt-artwork-frame > img, .dt-artwork-frame > video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

.dt-loading-name { color: #fff; font-size: 76px; font-weight: 700; }

.dt-header > * + * { margin-top: 20px; }
.dt-facts { color: var(--silver); font-size: 30px; font-weight: 500; white-space: pre; overflow: hidden; }
.dt-cert { color: var(--silver); font-size: 24px; font-weight: 700; border-radius: 8px; background: rgba(255,255,255,0.12); padding: 2px 12px; white-space: nowrap; }
.dt-makers { color: var(--silver); font-size: 28px; }
.dt-description { color: var(--accent); font-size: 30px; line-height: 42px; max-width: 1520px; }

/* A tile (TV Surface with a focused border): scale on focus, a white ring outside the picture */
.dt-tile { position: relative; flex: none; border-radius: 20px; background: var(--chip); transition: transform 180ms var(--ease); }
.dt-tile-clip { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 20px; overflow: hidden; }
.dt-tile.focused { z-index: 2; }
.dt-tile.focused::after { content: ""; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px; border: 4px solid #fff; border-radius: 24px; pointer-events: none; }
.dt-chip-badge { position: absolute; color: #fff; font-size: 22px; font-weight: 700; background: rgba(0,0,0,0.7); border-radius: 999px; padding: 4px 16px; white-space: nowrap; }

/* EpisodeCard: 200 x 112 dp still, focus 1.06; dimming lives on the picture and text, never the card */
.dt-episode { width: 400px; flex: none; }
.dt-episode-tile { width: 400px; height: 224px; background: var(--surface); }
.dt-episode-tile.focused { transform: scale(1.06); }
.dt-episode-text { padding: 16px 6px 0; }
.dt-episode-text > * + * { margin-top: 4px; }
.dt-episode-title { color: #fff; font-size: 28px; font-weight: 700; }
.dt-episode-air { color: var(--muted); font-size: 22px; }
.dt-episode-overview { color: rgba(255,255,255,0.75); font-size: 22px; line-height: 30px; }

/* CastRow / PeopleRow: round headshots */
.dt-cast { width: 240px; flex: none; display: flex; flex-direction: column; align-items: center; text-align: center; }
.dt-cast > * + * { margin-top: 12px; }
.dt-headshot { position: relative; width: 220px; height: 220px; flex: none; border-radius: 50%; background: var(--chip); transition: transform 180ms var(--ease); }
.dt-headshot-clip { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.dt-headshot.focused { transform: scale(1.08); z-index: 2; }
.dt-headshot.focused::after { content: ""; position: absolute; top: -6px; left: -6px; right: -6px; bottom: -6px; border: 6px solid #fff; border-radius: 50%; pointer-events: none; }
.dt-initials { color: var(--silver); font-size: 52px; }
.dt-cast-name { color: #fff; font-size: 26px; font-weight: 600; max-width: 100%; }
.dt-cast-part { color: var(--muted); font-size: 24px; max-width: 100%; }

/* VideosRow */
.dt-video { width: 480px; flex: none; }
.dt-video > * + * { margin-top: 12px; }
.dt-video-tile { width: 480px; height: 270px; }
.dt-video-tile.focused { transform: scale(1.05); }
.dt-video-name { color: #fff; font-size: 26px; }

/* AboutTable */
.dt-about { display: block; margin: 20px 72px 0 184px; max-width: 1800px; padding: 16px 44px; border-radius: 32px; background: rgba(255,255,255,0.05); transition: background-color 150ms; }
.dt-about.focused { background: rgba(255,255,255,0.12); }
.dt-about-row { display: flex; flex-direction: row; align-items: flex-start; padding: 18px 0; }
.dt-about-label { color: #fff; font-size: 28px; font-weight: 700; width: 340px; flex: none; }
.dt-about-value { color: var(--muted); font-size: 28px; flex: 1; min-width: 0; }
.dt-rule { height: 2px; background: rgba(255,255,255,0.12); }

/* ReviewsRow */
.dt-review { width: 720px; height: 360px; flex: none; padding: 32px; border-radius: 32px; background: rgba(255,255,255,0.08); transition: transform 150ms var(--ease), background-color 150ms; overflow: hidden; }
.dt-review > * + * { margin-top: 12px; }
.dt-review.focused { background: #fff; transform: scale(1.03); }
.dt-review-head { display: flex; flex-direction: row; align-items: center; }
.dt-review-author { color: #fff; font-size: 30px; font-weight: 700; flex: 1; min-width: 0; }
.dt-review-rating { color: var(--silver); font-size: 26px; flex: none; margin-left: 12px; }
.dt-review-text { color: var(--muted); font-size: 26px; line-height: 36px; }
.dt-review.focused .dt-review-author, .dt-review.focused .dt-review-rating { color: #000; }
.dt-review.focused .dt-review-text { color: #3a3a3a; }

/* ---------------------------------------------------------------- streams */

.dt-stream { display: flex; flex-direction: row; align-items: center; width: 100%; max-width: 1960px; padding: 32px 44px; border-radius: 36px; background: rgba(255,255,255,0.08); color: #fff; transition: transform 150ms var(--ease), background-color 150ms; }
.dt-stream.dt-stream-off { opacity: 0.55; }
.dt-stream.focused { background: #fff; color: #000; transform: scale(1.01); }
/* Format column (Apple TV's StreamFormatColumn): Android dp x 2, which are the tvOS points. */
.dt-stream-format { width: 210px; flex: none; display: flex; flex-direction: column; align-items: stretch; }
.dt-stream-format > * + * { margin-top: 16px; }
.dt-format-plate { display: flex; align-items: center; justify-content: center; padding: 12px; border-radius: 14px; background: rgba(0,0,0,0.38); border: 2px solid rgba(255,255,255,0.16); color: #fff; }
.dt-stream.focused .dt-format-plate { background: rgba(0,0,0,0.78); }
.dt-format-mark { display: block; flex: none; }
.dt-format-q { font-size: 34px; font-weight: 800; }
.dt-format-text { font-size: 24px; font-weight: 600; }
.dt-stream-quiet { color: var(--muted); }
.dt-stream.focused .dt-stream-quiet { color: #3a3a3a; }
.dt-stream-body { flex: 1; min-width: 0; padding-left: 32px; }
.dt-stream-body > * + * { margin-top: 8px; }
.dt-stream-badge { color: #000; background: #fff; font-size: 24px; font-weight: 700; border-radius: 12px; padding: 4px 14px; white-space: nowrap; }
.dt-stream.focused .dt-stream-badge { color: #fff; background: #000; }
.dt-stream-name { font-size: 36px; font-weight: 700; }
.dt-stream-file { font-size: 28px; opacity: 0.85; }
.dt-stream-rest { font-size: 24px; }
.dt-stream-play { color: var(--accent); flex: none; }
.dt-stream.focused .dt-stream-play { color: #000; }
.dt-stream-blocked { color: #ffd60a; flex: none; }

/* ---------------------------------------------------------------- person */

.ps-photo { position: relative; width: 280px; height: 420px; flex: none; border-radius: 24px; overflow: hidden; background: var(--surface); }
.ps-bio { color: var(--accent); font-size: 30px; line-height: 44px; }
.ps-info-row { display: flex; flex-direction: row; align-items: flex-start; padding: 8px 0; }
.ps-year { color: var(--silver); font-size: 30px; font-weight: 700; }

.ps-known { width: 560px; flex: none; }
.ps-known > * + * { margin-top: 12px; }
.ps-known-tile { width: 560px; height: 316px; border-radius: 24px; }
.ps-known-tile .dt-tile-clip { border-radius: 24px; }
.ps-known-tile.focused { transform: scale(1.05); }
.ps-known-tile.focused::after { border-radius: 28px; }
.ps-known-title { color: #fff; font-size: 28px; font-weight: 600; }
.ps-known-role { color: var(--muted); font-size: 24px; }

.ps-credit { display: flex; flex-direction: row; align-items: center; width: 100%; padding: 20px; border-radius: 28px; background: rgba(255,255,255,0.06); color: #fff; transition: transform 150ms var(--ease), background-color 150ms; }
.ps-credit > * + * { margin-left: 32px; }
.ps-credit.focused { background: #fff; color: #000; transform: scale(1.01); }
.ps-credit-poster { position: relative; width: 108px; height: 160px; flex: none; border-radius: 12px; overflow: hidden; background: var(--chip); }
.ps-credit-body { flex: 1; min-width: 0; }
.ps-credit-body > * + * { margin-top: 6px; }
.ps-credit-title { font-size: 32px; font-weight: 700; }
.ps-quiet { color: var(--muted); }
.ps-credit.focused .ps-quiet { color: #3a3a3a; }

/* ---------------------------------------------------------------- library */

.lb-hub { display: flex; flex-direction: row; align-items: center; width: 520px; box-sizing: border-box; flex: none; padding: 40px 36px; border-radius: 36px; background: rgba(255,255,255,0.08); color: #fff; transition: transform 150ms var(--ease), background-color 150ms; }
.lb-hub.focused { background: #fff; color: #000; transform: scale(1.03); }
.lb-hub-text { margin-left: 32px; min-width: 0; }
.lb-hub-title { font-size: 36px; font-weight: 700; }
.lb-hub-sub { color: var(--muted); font-size: 26px; margin-top: 8px; }
.lb-hub.focused .lb-hub-sub { color: #3a3a3a; }

/* Result format (docs/RESULT-FORMAT.md). A row with pack badges is a Nuvio-style card:
   text, then one clipped line of chips; focus is an outline, not a white fill, so
   transparent chips with coloured borders stay readable. */
.dt-stream.dt-card { background: rgba(255,255,255,0.05); border: 3px solid rgba(255,255,255,0.08); border-radius: 24px; padding: 20px 30px; }
.dt-stream.dt-card.focused { background: rgba(255,255,255,0.09); color: #fff; border-color: #8fb4ff; }
.dt-stream.dt-card.focused .dt-stream-quiet { color: var(--muted); }
.dt-stream.dt-card.focused .dt-stream-badge { color: #000; background: #fff; }
.dt-stream.dt-card.focused .dt-stream-blocked { color: #ffd60a; }
.dt-card .dt-stream-name { font-size: 30px; }
/* Result highlight (docs/RESULT-FORMAT.md): only the focused card's 3 px border changes. */
.dt-stream.dt-card { position: relative; }
.dt-stream.dt-card.hl-white.focused { border-color: #fff; }
.dt-stream.dt-card.hl-gold.focused { border-color: #ffc857; }
/* Pulse and rainbow draw the border on a layer of their own over the card's (now empty) border. */
.dt-stream.dt-card.hl-pulse.focused, .dt-stream.dt-card.hl-rainbow.focused { border-color: transparent; background-clip: padding-box; }
/* Pulse: a #8FB4FF ring whose opacity eases 100% <-> 35%, 1.2 s each way (opacity only). */
.dt-stream.dt-card.hl-pulse.focused::after { content: ""; position: absolute; top: -3px; left: -3px; right: -3px; bottom: -3px; border: 3px solid #8fb4ff; border-radius: 24px; pointer-events: none; animation: dt-hl-pulse 1.2s ease-in-out infinite alternate; will-change: opacity; }
@keyframes dt-hl-pulse { from { opacity: 1; } to { opacity: 0.35; } }
/* Rainbow: .dt-hl-ring is a 3 px frame (a mask cuts out its middle, so the card stays
   see-through) holding an oversized square of the hues that turns once every 3 s
   (transform only). Conic where the browser has it (Chromium 69+, Tizen 5.5+), a
   linear sweep of the same hues on older TVs. */
.dt-hl-ring { display: none; }
.dt-stream.dt-card.focused > .dt-hl-ring {
  display: block; position: absolute; top: -3px; left: -3px; right: -3px; bottom: -3px; padding: 3px;
  border-radius: 24px; overflow: hidden; pointer-events: none;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.dt-stream.dt-card.focused > .dt-hl-ring::before {
  content: ""; position: absolute; left: -1%; top: 50%; width: 102%; height: 0; padding-bottom: 102%; margin-top: -51%;
  background: linear-gradient(90deg, #ff5e5e, #ffa84d, #ffe24d, #5ee08a, #4dd8ff, #6e8bff, #c07bff, #ff5e5e);
  animation: dt-hl-spin 3s linear infinite; will-change: transform;
}
@supports (background: conic-gradient(red, blue)) {
  .dt-stream.dt-card.focused > .dt-hl-ring::before { background: conic-gradient(#ff5e5e, #ffa84d, #ffe24d, #5ee08a, #4dd8ff, #6e8bff, #c07bff, #ff5e5e); }
}
@keyframes dt-hl-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .dt-stream.dt-card.hl-pulse.focused::after, .dt-stream.dt-card.focused > .dt-hl-ring::before { animation: none; will-change: auto; }
}
.dt-card .dt-stream-file { font-size: 24px; opacity: 0.9; line-height: 1.25; }
.dt-stream-body.dt-stream-body-full { padding-left: 0; }
.dt-chips { display: flex; flex-direction: row; align-items: center; height: 34px; overflow: hidden; white-space: nowrap; }
.dt-stream-body > .dt-chips { margin-top: 12px; }
.dt-chips > * { flex: none; margin-right: 10px; }
.dt-chip { box-sizing: border-box; height: 34px; display: flex; align-items: center; padding: 0 4px; border-radius: 7px; font-size: 22px; font-weight: 600; }
.dt-chip img { height: 26px; width: auto; display: block; }
.dt-chip-pill { font-size: 22px; padding: 2px 12px; }
.dt-stream-source { white-space: pre-line; }

/* A stream link as a QR code (hold OK on a source). */
.dt-qr-page {
  background: rgba(8, 8, 12, 0.96);
}
.dt-qr-column {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.dt-qr-column .st-qr {
  margin: 36px auto 28px;
  border-radius: 24px;
}
.dt-qr-title {
  color: #fff;
  font-size: 52px;
  font-weight: 700;
}
.dt-qr-name {
  color: #fff;
  font-size: 34px;
  font-weight: 600;
}
.dt-qr-detail {
  color: var(--muted);
  font-size: 28px;
  max-width: 1400px;
  margin: 10px auto 0;
}
.dt-qr-note {
  color: var(--muted);
  font-size: 24px;
  margin-top: 14px;
}

/* Library › Watch Stats */
.ws-period {
  margin-top: 20px;
}
.ws-tile {
  width: 360px;
  box-sizing: border-box;
  padding: 28px 32px;
  border-radius: 32px;
  background: var(--surface, rgba(255, 255, 255, 0.08));
  color: #fff;
}
.ws-tile.focused {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 4px #fff;
}
.ws-value {
  font-size: 52px;
  font-weight: 700;
  margin-top: 14px;
}
.ws-label {
  font-size: 26px;
  color: var(--muted);
}
