@charset "UTF-8";

:root {
  --bg-main: #06080e;
  --bg-elevated: #0d121d;
  --bg-card: #131a29;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #facc15;
  --accent-emerald: #10b981;
  --accent-red: #e50914;
  --focus-ring: #facc15;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --font-sans: "Be Vietnam Pro", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --in-oklab: ;
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size-adjust: from-font;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@supports not (font-size-adjust: from-font) {
  html {
    line-height: 1.5;
  }
}

body {
  min-height: 100vh;
  background-color: var(--bg-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  padding-bottom: 90px;
}

button,
input,
select,
textarea,
optgroup {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
}

/* ==================================================
   FOCUS STATES FOR BOTH CURSOR & REMOTE KEYS
   ================================================== */
[data-focusable] {
  transition: transform 0.18s ease,
              box-shadow 0.18s ease,
              background-color 0.16s ease,
              border-color 0.16s ease;
  outline: none;
}

[data-focusable]:focus-visible,
[data-focusable].tv-focused {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.24),
              0 16px 36px rgba(0, 0, 0, 0.85) !important;
  z-index: 25;
}

/* ==================================================
   STICKY SMART HEADER
   ================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 8, 14, 0.82);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.48);
}

.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 3.5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 14px var(--accent-red);
}

.search-box-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
  min-width: 220px;
}

.search-input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  translate: 0 -50%;
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, 0.48);
  pointer-events: none;
}

.smart-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.smart-search-input.has-leading-icon {
  padding-left: 38px;
}

.smart-search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.16);
  outline: none;
}

.ui-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -2px;
}

.ui-icon.play-solid {
  width: 14px;
  height: 14px;
}

.tv-remote-svg {
  width: 18px;
  height: 18px;
}

.search-suggest-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  background: #0e121c;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.78);
  max-height: 70dvh;
  overflow-y: auto;
  contain: content;
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 11px;
  background: transparent;
  border: 1px solid transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.search-suggest-item:hover,
.search-suggest-item:focus-visible {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.45);
  outline: none;
}

.search-suggest-thumb {
  width: 38px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #141926;
}

.search-suggest-meta {
  flex: 1;
  min-width: 0;
}

.search-suggest-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.search-suggest-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}

.search-suggest-empty {
  padding: 12px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.smart-search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.smart-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: translate 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.smart-action-pill:hover {
  translate: 0 -1px;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.smart-action-pill.primary {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.45);
  color: var(--accent);
  font-weight: 700;
}

.smart-action-pill.primary:hover {
  background: var(--accent);
  color: #050608;
  box-shadow: 0 6px 20px rgba(250, 204, 21, 0.32);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ==================================================
   MAIN CONTAINER & FEATURED SPOTLIGHT BANNER (GOOGLE STITCH CINEMA EDITION)
   ================================================== */
.app-main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px 3.5vw 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-banner {
  position: relative;
  width: 100%;
  min-height: clamp(540px, 72vh, 690px);
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  padding: clamp(160px, 24vh, 250px) 38px 28px;
  gap: 26px;
  isolation: isolate;
  background: #0b101b;
  box-shadow:
    0 28px 72px -12px rgba(0, 0, 0, 0.85),
    0 0 64px -16px rgba(250, 204, 21, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hero-backdrop-wrap {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: brightness(1.05) contrast(1.05) saturate(1.14);
  transition: opacity 0.35s ease, transform 0.6s ease;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      820px 480px at 18% 76% var(--in-oklab),
      rgba(5, 7, 13, 0.92) 0%,
      rgba(5, 7, 13, 0.7) 44%,
      rgba(5, 7, 13, 0.26) 74%,
      rgba(5, 7, 13, 0) 100%
    ),
    linear-gradient(
      to top var(--in-oklab),
      rgba(5, 7, 13, 0.96) 0%,
      rgba(5, 7, 13, 0.72) 26%,
      rgba(5, 7, 13, 0.2) 55%,
      rgba(5, 7, 13, 0) 82%
    );
}

.hero-main-layout {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
  max-width: 720px;
  padding: 2px;
}

.hero-poster-frame {
  display: none;
}

.hero-poster-card {
  width: 84px;
  height: 126px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #090d16;
  display: block;
}

.hero-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.hero-title {
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: #ffffff;
  text-wrap: balance;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.95),
    0 10px 28px rgba(0, 0, 0, 0.88);
}

.hero-orig {
  font-size: 0.96rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: -3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.hero-meta-imdb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3.5px 10px;
  border-radius: 7px;
  background: rgba(6, 9, 16, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: #fde047;
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 3.5px 10px;
  border-radius: 7px;
  background: rgba(6, 9, 16, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-size: 0.77rem;
  font-weight: 600;
}

.hero-overview {
  font-size: 0.94rem;
  line-height: 1.62;
  color: #f1f5f9;
  text-wrap: pretty;
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.95),
    0 4px 16px rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.play-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 100%);
  color: #050608;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 18px rgba(250, 204, 21, 0.24);
  transition: translate 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.play-cta:hover {
  background: var(--accent);
  translate: 0 -2px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 24px rgba(250, 204, 21, 0.42);
}

.secondary-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 18, 32, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: translate 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.secondary-cta:hover,
.secondary-cta.saved {
  translate: 0 -1px;
  border-color: var(--accent);
  color: var(--accent);
}

.secondary-cta.icon-only-cta {
  padding: 10px 12px;
  justify-content: center;
}

.hero-platforms-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.hero-platforms-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #94a3b8;
}

.stage-platforms {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.platform-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
}

.platform-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--plat-color, #94a3b8);
  box-shadow: 0 0 8px var(--plat-color, transparent);
}

/* Bottom Horizontal Floating Glass Dock for Top 5 Featured Movies */
.hero-rail-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(7, 10, 18, 0.74);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 10px 14px 11px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-rail-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(253, 224, 71, 0.92);
  padding: 0 4px;
}

.hero-switcher {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.hero-item-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition: translate 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.hero-item-btn img {
  width: 36px;
  height: 52px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-item-btn:hover {
  translate: 0 -2px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.hero-item-btn.active {
  translate: 0 -2px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.22), rgba(250, 204, 21, 0.08));
  border-color: rgba(250, 204, 21, 0.72);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(250, 204, 21, 0.16);
}

.hero-item-title {
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.22;
  color: #ffffff;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.hero-item-sub {
  font-size: 0.71rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 2px;
}

/* ==================================================
   CONTINUE WATCHING BAR
   ================================================== */
.continue-section {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(13, 18, 29, 0.9));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.continue-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(8, 11, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.continue-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-emerald);
}

.continue-card img {
  width: 52px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.continue-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.continue-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.continue-bar-fill {
  height: 100%;
  background: var(--accent-emerald);
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.text-link-btn:hover {
  color: #fff;
}

/* ==================================================
   SMART FILTER HUB (TOPICS + PLATFORMS + SORT)
   ================================================== */
.smart-filter-hub {
  background: linear-gradient(145deg, rgba(16, 22, 36, 0.88), rgba(10, 14, 24, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.filter-row-topics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(248, 250, 252, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: translate 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.topic-pill-count {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}

.topic-pill:hover {
  translate: 0 -1px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.topic-pill.active {
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 100%);
  color: #050608;
  border-color: #fef08a;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.24);
}

.filter-row-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.platform-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.platform-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.plat-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.plat-filter-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.plat-filter-chip.active {
  background: rgba(250, 204, 21, 0.18);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 800;
}

.sort-control-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.smart-sort-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* ==================================================
   SMART MOVIE GRID & CARDS (APPLE TV+ / MUBI EDITION)
   ================================================== */
.catalog-container {
  display: flex;
  flex-direction: column;
  gap: 38px;
}

.topic-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-sub-hint {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.section-count {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
}

.section-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.section-more-btn:hover,
.section-more-btn:focus-visible {
  color: #fef08a;
  border-color: rgba(245, 197, 24, 0.45);
  background: rgba(245, 197, 24, 0.1);
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 28px 20px;
}

.movie-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 0;
  transition: translate 0.22s ease;
}

.movie-card:hover,
.movie-card:focus-within {
  translate: 0 -5px;
}

.poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.52);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover .poster-wrap,
.movie-card:focus-within .poster-wrap {
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow:
    0 20px 44px -8px rgba(0, 0, 0, 0.85),
    0 0 24px rgba(250, 204, 21, 0.15);
}

.poster-trigger {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: block;
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: scale 0.35s ease;
}

.movie-card:hover .movie-poster {
  scale: 1.045;
}

.poster-rating-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(6, 8, 14, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  border: 1px solid rgba(250, 204, 21, 0.36);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.card-watchlist-btn,
.card-share-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 8, 14, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: scale 0.15s ease, opacity 0.18s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.card-share-btn {
  right: 48px;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
}

.movie-card:hover .card-share-btn,
.movie-card:focus-within .card-share-btn {
  opacity: 1;
  pointer-events: auto;
}

.card-watchlist-btn:hover,
.card-share-btn:hover {
  scale: 1.12;
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--accent);
}

.card-watchlist-btn.saved {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.poster-play-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(6, 8, 14, 0.25) 0%, rgba(6, 8, 14, 0.68) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.poster-trigger:hover .poster-play-overlay,
.poster-trigger:focus-visible .poster-play-overlay {
  opacity: 1;
}

.play-circle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 100%);
  color: #050608;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.72), 0 0 18px rgba(250, 204, 21, 0.35);
}

.poster-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.poster-progress-fill {
  height: 100%;
  background: var(--accent-emerald);
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}

.card-title-btn {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.16s ease;
}

.card-title-btn:hover {
  color: var(--accent);
}

.card-sub {
  font-size: 0.77rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.card-plat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.71rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.card-plat-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ==================================================
   ALL-IN-ONE CINEMA DARKROOM THEATER & QUICK-ADD MODALS
   ================================================== */
dialog {
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: linear-gradient(165deg, #0b0f19 0%, #06080f 100%);
  color: var(--text-primary);
  width: min(1180px, 95vw);
  max-height: 94vh;
  padding: 0;
  box-shadow:
    0 36px 96px rgba(0, 0, 0, 0.94),
    0 0 64px rgba(250, 204, 21, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: opacity 0.2s ease, scale 0.2s ease;
}

@starting-style {
  dialog[open] {
    opacity: 0;
    scale: 0.97;
  }
}

#quickAddDialog {
  width: min(820px, 94vw);
}

dialog:modal {
  /* MANDATORY per prevent-page-scroll-under-modal-dialog */
  overscroll-behavior: contain;
}

dialog::backdrop {
  /* MANDATORY per prevent-page-scroll-under-modal-dialog & light-dismiss-a-dialog */
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(3, 5, 10, 0.94);
  backdrop-filter: blur(10px);
}

#movieDialog::backdrop {
  /* Avoid full-screen 60fps GPU backdrop-filter recompositing behind active video decoder */
  background-color: rgba(3, 5, 10, 0.96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.theater-modal,
.quick-add-shell {
  display: flex;
  flex-direction: column;
  padding: 18px 22px 22px;
  gap: 14px;
  max-height: 94vh;
  overflow-y: auto;
}

.theater-topbar,
.quick-add-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.theater-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.theater-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.theater-sub {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.theater-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.source-selector,
.theater-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: translate 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.source-btn:hover {
  translate: 0 -1px;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.source-btn.active {
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 100%);
  border-color: #fef08a;
  color: #050608;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.28);
}

.source-btn.icon-compact {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
}

.close-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.close-modal-btn:hover {
  background: var(--accent-red);
  color: #fff;
}

.resume-notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  font-size: 0.83rem;
  font-weight: 600;
  flex-shrink: 0;
}

.resume-restart-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(6, 8, 14, 0.6);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 195px;
  flex-shrink: 0;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.9), 0 0 42px rgba(250, 204, 21, 0.08);
}

.player-stage video,
.player-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.ad-banner-mask-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16.8%;
  background: #000000;
  z-index: 14;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ad-banner-mask-overlay.active {
  opacity: 1;
}

.upnext-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at center, rgba(8, 10, 16, 0.84) 0%, rgba(5, 6, 10, 0.96) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.upnext-card {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(18, 23, 35, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

.upnext-header-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.upnext-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upnext-poster {
  width: 58px;
  height: 84px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.upnext-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upnext-countdown-label {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.upnext-countdown-label strong {
  color: #fbbf24;
  font-size: 0.95rem;
}

.upnext-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upnext-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.upnext-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-top: 4px;
}

.upnext-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #e50914);
  transition: width 10s linear;
}

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

.upnext-play-btn {
  flex: 1;
  justify-content: center;
  padding: 9px 14px;
  font-size: 0.86rem;
}

.upnext-cancel-btn {
  padding: 9px 14px;
  font-size: 0.84rem;
}

.modal-info-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.modal-info-left {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-meta-line {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
}

.modal-overview-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.8);
}

.modal-credits-line {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.modal-platforms-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-platforms-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-related-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.related-mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.related-mini-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.related-mini-card.same-series {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(229, 9, 20, 0.08));
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.related-mini-card.same-series:hover {
  border-color: #fbbf24;
}

.related-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-bottom: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.related-badge.series-badge {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.related-mini-card img {
  width: 40px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Quick Add Modal Styles */
.quick-add-search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-add-search-row .smart-search-input {
  flex: 1;
  min-width: 220px;
}

.quick-status-text {
  font-size: 0.84rem;
  color: #34d399;
  min-height: 20px;
}

.quick-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
}

.quick-result-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  align-items: center;
}

.quick-result-card img {
  width: 52px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
}

.app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: #ffffff;
  color: #050608;
  font-weight: 800;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  display: none;
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  background: var(--bg-elevated);
  border-radius: 16px;
  border: 1px dashed var(--border-subtle);
}

/* ==================================================
   SHARED ADMIN UTILITY CLASSES
   ================================================== */
.tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-card);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.tv-btn-primary {
  background: var(--accent-red);
  border-color: var(--accent-red);
}
.tv-btn-amber {
  background: #ffffff;
  border-color: #ffffff;
  color: #050608;
  font-weight: 700;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
}
.badge-featured {
  background: var(--accent);
  color: #050608;
}

/* ==================================================
   CINEMA FOOTER
   ================================================== */
.app-footer {
  margin-top: 28px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(8, 10, 16, 0.85);
  padding: 36px 4vw 48px;
}

.footer-inner {
  max-width: 1580px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-brand-col {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
}

.footer-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.footer-disclaimer {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-links-col {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================================================
   TABLET & MOBILE RESPONSIVE ADAPTATION
   ================================================== */
@media (max-width: 900px) {
  .hero-banner {
    grid-template-columns: 1fr;
    min-height: 490px;
    padding: 145px 18px 18px;
    gap: 18px;
  }

  .hero-main-layout {
    max-width: 100%;
    padding: 0;
  }

  /* Keep Top 5 selector visible on tablet & mobile as a horizontal touch strip */
  .hero-rail-wrap {
    display: flex;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(7, 10, 18, 0.88);
    overflow: hidden;
  }

  .hero-switcher {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    gap: 8px;
  }

  .hero-switcher::-webkit-scrollbar {
    display: none;
  }

  .hero-item-btn {
    flex: 0 0 215px;
    scroll-snap-align: start;
    padding: 5px 8px;
  }

  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px 12px;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 32px;
  }

  /* 1. Compact 2-Row Sticky Mobile Header */
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 8px;
    padding: 9px 12px;
  }

  .brand-mark {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    padding: 4px 2px;
    gap: 7px;
  }

  .brand-dot {
    width: 8px;
    height: 8px;
  }

  .nav-right {
    grid-column: 2;
    grid-row: 1;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .nav-right .smart-action-pill {
    padding: 6px 10px;
    font-size: 0.73rem;
    gap: 5px;
  }

  .search-box-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  /* 16px font-size prevents iOS Safari from auto-zooming on input focus */
  .smart-search-input,
  .smart-sort-select {
    font-size: 16px;
    padding: 9px 14px;
  }

  .smart-search-input.has-leading-icon {
    padding-left: 38px;
  }

  /* 2. Mobile Main Layout & Hero Showcase */
  .app-main {
    padding: 12px 12px 0;
    gap: 16px;
  }

  .hero-banner {
    min-height: 450px;
    border-radius: 18px;
    padding: 125px 14px 14px;
    gap: 16px;
  }

  .hero-backdrop {
    object-position: center 22%;
  }

  .hero-vignette {
    background:
      linear-gradient(
        to top var(--in-oklab),
        rgba(5, 7, 13, 0.98) 0%,
        rgba(5, 7, 13, 0.88) 46%,
        rgba(5, 7, 13, 0.34) 76%,
        rgba(5, 7, 13, 0.08) 100%
      );
  }

  .hero-content {
    gap: 8px;
  }

  .hero-title {
    font-size: 1.32rem;
    line-height: 1.18;
  }

  .hero-orig {
    font-size: 0.78rem;
  }

  .hero-meta {
    gap: 5px;
  }

  .hero-meta-imdb,
  .hero-meta-pill {
    font-size: 0.7rem;
    padding: 2px 7px;
  }

  .hero-overview {
    font-size: 0.8rem;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .hero-actions {
    width: 100%;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .play-cta {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .secondary-cta {
    padding: 10px 10px;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .hero-platforms-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    gap: 6px;
  }

  .hero-platforms-bar::-webkit-scrollbar {
    display: none;
  }

  .hero-platforms-label {
    flex-shrink: 0;
    font-size: 0.7rem;
  }

  .stage-platforms {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .hero-rail-label {
    font-size: 0.68rem;
  }

  .hero-item-btn {
    flex: 0 0 156px;
    padding: 4px 6px;
    gap: 8px;
  }

  .hero-item-btn img {
    width: 30px;
    height: 42px;
  }

  .hero-item-title {
    font-size: 0.76rem;
  }

  .hero-item-sub {
    font-size: 0.68rem;
  }

  /* 3. Single-Row Horizontal Swipeable Topic Bar */
  .smart-filter-hub {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .topic-pills-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 7px;
    width: 100%;
  }

  .topic-pills-bar::-webkit-scrollbar {
    display: none;
  }

  .topic-pill {
    padding: 8px 14px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  /* 4. Continue Watching Swipe Rail on Mobile */
  .continue-section {
    padding: 12px 13px;
    border-radius: 16px;
    gap: 10px;
  }

  .section-sub-hint {
    display: none;
  }

  .continue-grid {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
  }

  .continue-grid::-webkit-scrollbar {
    display: none;
  }

  .continue-card {
    flex: 0 0 245px;
    padding: 8px;
  }

  /* 5. Clean 2-Column Mobile Movie Grid */
  .catalog-container {
    gap: 24px;
  }

  .topic-section {
    gap: 12px;
  }

  .section-title {
    font-size: 1.04rem;
    gap: 8px;
  }

  .section-count {
    font-size: 0.72rem;
    padding: 2px 8px;
  }

  .movies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }

  .movie-card {
    padding: 7px;
    border-radius: 14px;
    gap: 7px;
  }

  .movie-card:hover {
    transform: none;
  }

  .poster-wrap {
    border-radius: 10px;
  }

  .poster-rating-badge {
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    font-size: 0.68rem;
    border-radius: 6px;
  }

  .card-watchlist-btn,
  .card-share-btn {
    top: 6px;
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }

  .card-watchlist-btn {
    right: 6px;
  }

  .card-share-btn {
    right: 38px;
    font-size: 0.72rem;
  }

  .poster-stream-badge {
    bottom: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    padding: 2px 6px;
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-title-btn {
    font-size: 0.85rem;
    line-height: 1.25;
  }

  .card-sub {
    font-size: 0.7rem;
  }

  .card-platforms {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
    margin-top: 2px;
  }

  .card-platforms::-webkit-scrollbar {
    display: none;
  }

  .card-plat-chip {
    padding: 2px 6px;
    font-size: 0.64rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 6. Mobile Bottom-Sheet Theater & Quick-Add Modals */
  dialog,
  #quickAddDialog {
    width: 100%;
    max-width: 100%;
    max-height: 94dvh;
    margin: auto 0 0 0;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .theater-modal,
  .quick-add-shell {
    padding: 14px 13px 26px;
    gap: 11px;
    max-height: 94dvh;
  }

  .theater-topbar {
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .theater-title-group {
    flex: 1;
    width: auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }

  .theater-title {
    font-size: 1.02rem;
    line-height: 1.22;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .theater-sub {
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .close-modal-btn {
    padding: 7px 13px;
    font-size: 0.78rem;
  }

  .player-stage {
    position: sticky;
    top: 0;
    z-index: 15;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: calc((100vw - 26px) * 9 / 16);
    flex-shrink: 0;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.78);
  }

  .theater-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .source-selector {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }

  .source-selector::-webkit-scrollbar {
    display: none;
  }

  .source-btn {
    padding: 7px 12px;
    font-size: 0.76rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Hide TV-remote seek buttons on touch screens; native video controls handle seek/play */
  #btnSeekBack,
  #btnPlayPause,
  #btnSeekForward {
    display: none;
  }

  .theater-controls {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
  }

  .theater-controls .source-btn {
    flex: 1 1 calc(33.33% - 6px);
    min-width: 98px;
    text-align: center;
    justify-content: center;
    padding: 9px 8px;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  .modal-info-bar {
    gap: 14px;
  }

  .modal-info-left {
    min-width: 0;
    width: 100%;
  }

  .modal-meta-line {
    font-size: 0.78rem;
  }

  .modal-overview-text {
    font-size: 0.83rem;
    line-height: 1.5;
  }

  .modal-credits-line {
    font-size: 0.76rem;
  }

  .modal-platforms-box {
    width: 100%;
  }

  .modal-platforms-box .stage-platforms {
    flex-wrap: wrap;
  }

  .modal-related-grid {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
  }

  .modal-related-grid::-webkit-scrollbar {
    display: none;
  }

  .related-mini-card {
    flex: 0 0 185px;
  }

  /* Quick Add Suggestion Modal on Mobile */
  .quick-add-search-row {
    flex-direction: column;
    gap: 8px;
  }

  .quick-add-search-row .smart-search-input,
  .quick-add-search-row .smart-sort-select,
  .quick-add-search-row .play-cta,
  .quick-add-search-row .smart-action-pill {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .quick-results-grid {
    grid-template-columns: 1fr;
    max-height: 46dvh;
  }

  /* 7. Mobile Footer & Centered Toast */
  .app-footer {
    padding: 24px 14px 36px;
    margin-top: 18px;
  }

  .footer-inner {
    gap: 18px;
  }

  .footer-desc {
    font-size: 0.82rem;
  }

  .footer-disclaimer {
    font-size: 0.72rem;
  }

  .footer-links-col {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .footer-links-col .smart-action-pill {
    justify-content: center;
    font-size: 0.78rem;
    padding: 9px 10px;
  }

  #btnFooterTop {
    grid-column: 1 / -1;
  }

  .app-toast {
    left: 12px;
    right: 12px;
    bottom: 14px;
    text-align: center;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.8rem;
    line-height: 1.35;
  }
}

@media (max-width: 390px) {
  .brand-mark {
    font-size: 0.78rem;
  }
  .nav-right .smart-action-pill {
    padding: 5px 8px;
    font-size: 0.69rem;
  }
  .hero-actions {
    flex-wrap: wrap;
  }
  .play-cta {
    width: 100%;
    flex: 1 1 100%;
  }
  .secondary-cta {
    flex: 1;
    justify-content: center;
  }
}

.card-director {
  font-size: 0.72rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -1px;
}

.credit-filter-btn {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.credit-filter-btn:hover {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde047;
}

.credit-inline-link {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.28);
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.credit-inline-link:hover {
  color: #fde047;
  text-decoration-color: #fde047;
}

.search-suggest-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fde047;
  padding: 8px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4px;
}

.search-suggest-badge.suggest-pill {
  background: rgba(250, 204, 21, 0.16);
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.35);
}

/* ==================================================
   AI CINEMA ASSISTANT (TÌM PHIM & HỎI ĐÁP BẰNG AI)
   ================================================== */
.ai-cta-pill {
  background: rgba(245, 197, 24, 0.1);
  border-color: rgba(245, 197, 24, 0.36);
  color: #fef08a;
  font-weight: 700;
}

.ai-cta-pill:hover {
  background: rgba(245, 197, 24, 0.2);
  border-color: rgba(245, 197, 24, 0.65);
  color: #ffffff;
}

#aiChatDialog {
  width: min(860px, 95vw);
}

.ai-chat-shell {
  display: flex;
  flex-direction: column;
  padding: 18px 22px 20px;
  gap: 12px;
  height: min(84vh, 760px);
  max-height: 92vh;
}

.ai-prompt-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex-shrink: 0;
  scrollbar-width: none;
}

.ai-prompt-chips::-webkit-scrollbar {
  display: none;
}

.ai-chip-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ai-chip-btn:hover {
  background: rgba(245, 197, 24, 0.16);
  border-color: rgba(245, 197, 24, 0.48);
  color: #fef08a;
  transform: translateY(-1px);
}

.ai-chat-messages {
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(5, 7, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overscroll-behavior: contain;
}

.ai-msg {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 92%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.58;
  word-break: break-word;
}

.ai-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(245, 197, 24, 0.35);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  font-weight: 600;
}

.ai-msg.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.ai-msg-sender {
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.ai-msg-text {
  white-space: pre-wrap;
}

.ai-msg-movies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.ai-chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ai-chat-input-row .smart-search-input {
  flex: 1;
}

.ai-send-btn {
  padding: 10px 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.floating-ai-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 24, 0.42);
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fef08a;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.floating-ai-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.82), 0 0 22px rgba(245, 197, 24, 0.22);
}

@media (max-width: 640px) {
  .ai-chat-shell {
    padding: 14px;
    height: 88vh;
  }
  .floating-ai-btn {
    right: 14px;
    bottom: 14px;
    padding: 9px 14px;
    font-size: 0.8rem;
  }
}

/* ==================================================
   SMART TV CONNECT & PHONE REMOTE CONTROL
   ================================================== */
.tv-connect-pill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-weight: 700;
}

.tv-connect-pill:hover,
.tv-connect-pill.paired-active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.55);
  color: #ecfdf5;
}

.tv-send-cta {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.5);
  color: #ecfdf5;
}

.tv-send-cta:hover {
  background: rgba(16, 185, 129, 0.32);
  border-color: #34d399;
}

.tv-toolbar-btn {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  font-weight: 800;
}

.tv-toolbar-btn:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: #34d399;
  color: #fff;
}

.tv-paired-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(14, 165, 233, 0.15));
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #ecfdf5;
  font-size: 0.86rem;
  font-weight: 700;
  flex-wrap: wrap;
}

.tv-paired-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-beam-now {
  padding: 7px 15px;
  font-size: 0.82rem;
  border-radius: 999px;
  background: #10b981;
  color: #04130d;
  font-weight: 900;
}

.btn-beam-now:hover {
  background: #34d399;
}

#tvConnectDialog {
  width: min(760px, 95vw);
}

.tv-connect-shell {
  display: flex;
  flex-direction: column;
  padding: 20px 22px 24px;
  gap: 16px;
}

.tv-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tv-mode-tab:hover {
  color: #fff;
}

.tv-mode-tab.active {
  background: #ffffff;
  color: #050608;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.tv-connect-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tv-pair-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.tv-pair-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.tv-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tv-step-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.24);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.tv-code-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tv-code-input {
  width: 150px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #05070c;
  border: 2px solid rgba(52, 211, 153, 0.45);
  color: #fde047;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  text-align: center;
  outline: none;
}

.tv-code-input:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.tv-remote-deck {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.tv-remote-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tv-remote-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #a7f3d0;
}

.tv-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  display: inline-block;
  flex-shrink: 0;
}

.tv-remote-beam-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.tv-remote-beam-box img {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.tv-now-playing-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(5, 7, 12, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tv-now-playing-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6ee7b7;
}

.tv-now-playing-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
}

.tv-now-playing-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.tv-remote-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tv-remote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tv-remote-btn:hover {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  transform: translateY(-1px);
}

.tv-remote-btn:active {
  transform: scale(0.97);
}

.tv-remote-btn.primary-remote-btn {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(52, 211, 153, 0.55);
  color: #ecfdf5;
}

.tv-remote-btn.danger-remote-btn {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.38);
  color: #fecaca;
}

.tv-remote-icon {
  font-size: 1.25rem;
}

.tv-remote-sources-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-os-cast-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.tv-receiver-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: #ffffff;
  color: #050608;
  flex-shrink: 0;
}

.tv-qr-card img {
  width: 190px;
  height: 190px;
  border-radius: 8px;
  display: block;
}

.tv-qr-caption {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0f172a;
}

.tv-receiver-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tv-receiver-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fde047;
  font-size: 0.82rem;
  font-weight: 800;
}

.tv-receiver-badge.connected {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
}

.tv-receiver-instruction {
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.tv-pin-box-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tv-pin-huge {
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: 0.28em;
  padding: 8px 20px 8px 26px;
  border-radius: 16px;
  background: #05070c;
  border: 2px solid #facc15;
  color: #fde047;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.tv-receiver-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tv-floating-remote-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(6, 12, 18, 0.94);
  border: 1px solid rgba(52, 211, 153, 0.55);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.78), 0 0 20px rgba(16, 185, 129, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: min(560px, 94vw);
  width: max-content;
}

.tv-floating-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #ecfdf5;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.tv-floating-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tv-mini-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.tv-mini-btn.accent {
  background: #10b981;
  border-color: #34d399;
  color: #03150e;
}

@media (max-width: 680px) {
  .tv-receiver-layout {
    flex-direction: column;
    text-align: center;
  }
  .tv-receiver-badge {
    align-self: center;
  }
  .tv-pin-box-row {
    justify-content: center;
  }
  .tv-floating-remote-bar {
    bottom: 64px;
  }
}

/* ==================================================
   FULL-VIEWPORT CINEMA MODE (REMOTE TV & MOBILE FALLBACK)
   ================================================== */
#movieDialog.cinema-fullscreen-active {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: #000000 !important;
  inset: 0 !important;
}

#movieDialog.cinema-fullscreen-active .theater-modal {
  width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
  background: #000000 !important;
}

#movieDialog.cinema-fullscreen-active .theater-topbar,
#movieDialog.cinema-fullscreen-active .theater-toolbar,
#movieDialog.cinema-fullscreen-active .modal-info-bar,
#movieDialog.cinema-fullscreen-active .modal-deep-analysis-card,
#movieDialog.cinema-fullscreen-active .modal-related-section,
#movieDialog.cinema-fullscreen-active .resume-notice-bar,
#movieDialog.cinema-fullscreen-active .tv-paired-modal-bar {
  display: none !important;
}

#movieDialog.cinema-fullscreen-active .player-stage {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 100dvh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  border: none !important;
  background: #000000 !important;
  z-index: 30 !important;
}

#movieDialog.cinema-fullscreen-active .player-stage video,
#movieDialog.cinema-fullscreen-active .player-stage iframe {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.exit-cinema-fs-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 45;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 10, 16, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
  transition: opacity 0.3s ease, transform 0.15s ease;
}

.exit-cinema-fs-btn:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #f87171;
}

.exit-cinema-fs-btn.idle-dim {
  opacity: 0.18;
}

/* ==================================================
   MODAL SCROLL CONTAINMENT & LIGHTS-OFF AMBIENT MODE
   ================================================== */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

#movieDialog.lights-off-mode {
  background: #000000 !important;
  border-color: rgba(245, 197, 24, 0.15) !important;
  box-shadow: 0 0 120px rgba(0, 0, 0, 0.98) !important;
}

#movieDialog.lights-off-mode::backdrop {
  background: rgba(0, 0, 0, 0.96) !important;
  backdrop-filter: blur(16px) !important;
}

#movieDialog.lights-off-mode .theater-modal {
  background: #000000 !important;
}

#movieDialog.lights-off-mode .player-stage {
  box-shadow: 0 0 85px rgba(245, 197, 24, 0.16), 0 0 32px rgba(56, 189, 248, 0.1);
  border-color: rgba(245, 197, 24, 0.28);
}

#movieDialog.lights-off-mode .theater-topbar,
#movieDialog.lights-off-mode .modal-info-bar,
#movieDialog.lights-off-mode .modal-deep-analysis-card,
#movieDialog.lights-off-mode .modal-related-section,
#movieDialog.lights-off-mode .tv-paired-modal-bar {
  opacity: 0.18;
  transition: opacity 0.35s ease;
}

#movieDialog.lights-off-mode .theater-topbar:hover,
#movieDialog.lights-off-mode .modal-info-bar:hover,
#movieDialog.lights-off-mode .modal-deep-analysis-card:hover,
#movieDialog.lights-off-mode .modal-related-section:hover {
  opacity: 1;
}

.source-btn.sleep-active,
.tv-remote-btn.sleep-active {
  border-color: rgba(167, 139, 250, 0.7) !important;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(76, 29, 149, 0.45)) !important;
  color: #ede9fe !important;
}

.source-btn.lights-active,
.tv-remote-btn.lights-active {
  border-color: rgba(250, 204, 21, 0.75) !important;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.28), rgba(161, 98, 7, 0.4)) !important;
  color: #fef08a !important;
}

/* ==================================================
   REMOTE TIMELINE SCRUBBER & VOLUME SLIDERS
   ================================================== */
.tv-remote-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-slider-time {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fde047;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}

.tv-slider-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
}

.tv-remote-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
  cursor: pointer;
}

.tv-remote-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f5c518;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.tv-remote-slider.volume-slider::-webkit-slider-thumb {
  background: #38bdf8;
}

/* ==================================================
   DEEP CINEMA ANALYSIS & SPOILER CARD
   ================================================== */
.modal-deep-analysis-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(16, 22, 34, 0.9), rgba(10, 14, 23, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.deep-analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.deep-analysis-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.deep-analysis-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.01em;
}

.deep-analysis-sub {
  font-size: 0.77rem;
  color: #94a3b8;
}

.deep-analysis-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.deep-analysis-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.deep-analysis-curated {
  font-size: 0.88rem;
  line-height: 1.68;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.55);
  border-left: 3px solid #f5c518;
  padding: 12px 14px;
  border-radius: 10px;
  white-space: pre-line;
}

.deep-analysis-ai-box {
  font-size: 0.88rem;
  line-height: 1.72;
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 14px 16px;
  border-radius: 12px;
  white-space: pre-line;
}

/* ==================================================
   SMART TV & LOW-POWER GPU PERFORMANCE OPTIMIZATIONS
   ================================================== */
.topic-section:not(:first-child) {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 420px;
}

#btnFloatingAiChat {
  display: none !important;
}

html.is-smart-tv *,
html.is-smart-tv *::before,
html.is-smart-tv *::after,
html.is-smart-tv *::backdrop,
html.smooth-buffer-mode *,
html.smooth-buffer-mode *::before,
html.smooth-buffer-mode *::after,
html.smooth-buffer-mode *::backdrop {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.is-smart-tv .app-header,
html.smooth-buffer-mode .app-header {
  background: #06080e !important;
}

html.is-smart-tv [data-focusable],
html.smooth-buffer-mode [data-focusable] {
  transition: none !important;
}

html.video-theater-open .app-header,
html.video-theater-open .app-main,
html.video-theater-open .app-footer {
  content-visibility: hidden;
}

html.smooth-buffer-mode #movieDialog,
html.is-smart-tv #movieDialog,
html.smooth-buffer-mode .player-stage,
html.is-smart-tv .player-stage {
  box-shadow: none !important;
}

.smooth-mode-btn.active {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.72);
  color: #6ee7b7;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.buffer-cushion-overlay {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  z-index: 24;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100% - 28px));
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(6, 9, 16, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #f8fafc;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
  pointer-events: auto;
}

.buffer-cushion-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #6ee7b7;
}

.buffer-cushion-skip-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.buffer-cushion-skip-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.buffer-cushion-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.buffer-cushion-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, #10b981, #facc15);
  transition: width 0.25s linear;
}

/* ==================================================
   SCREENSHOT & VIDEO CLIP STUDIO IN THEATER
   ================================================== */
.shutter-flash-overlay {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  animation: shutterFlashAnim 0.36s ease-out forwards;
}

@keyframes shutterFlashAnim {
  0% {
    opacity: 0.78;
  }
  100% {
    opacity: 0;
  }
}

.video-clip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.32);
  flex-shrink: 0;
}

.clip-time-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clip-field-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #fde047;
}

.clip-time-input {
  width: 68px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 8, 14, 0.85);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.clip-time-input:focus {
  outline: none;
  border-color: #facc15;
}

.clip-mini-btn {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.clip-mini-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.clip-Quick-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.clip-dur-pill {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.clip-dur-pill:hover,
.clip-dur-pill.active {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.5);
  color: #fef08a;
}

.clip-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.clip-action-btn {
  padding: 7px 14px;
  font-size: 0.8rem;
  border-radius: 999px;
}

.clip-live-btn {
  padding: 7px 13px;
  font-size: 0.8rem;
}

.clip-live-btn.recording,
.clip-action-btn.recording {
  background: rgba(239, 68, 68, 0.24) !important;
  border-color: #ef4444 !important;
  color: #fecaca !important;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  flex-shrink: 0;
}

.clip-live-btn.recording .rec-dot {
  animation: recBlink 0.9s infinite ease-in-out;
}

@keyframes recBlink {
  0%, 100% {
    opacity: 1;
    scale: 1;
  }
  50% {
    opacity: 0.25;
    scale: 0.85;
  }
}

.capture-gallery-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.capture-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  color: #e2e8f0;
}

.capture-gallery-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.capture-item-card {
  width: 196px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.capture-item-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  overflow: hidden;
  background: #000;
}

.capture-item-preview img,
.capture-item-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.capture-item-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(6, 8, 14, 0.85);
  color: #fde047;
  font-size: 0.68rem;
  font-weight: 800;
  pointer-events: none;
}

.capture-item-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.capture-item-btn {
  flex: 1;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.capture-item-btn:hover {
  background: rgba(250, 204, 21, 0.22);
  border-color: rgba(250, 204, 21, 0.5);
  color: #fef08a;
}

.capture-item-del {
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.music-site-pill {
  text-decoration: none;
  border-color: rgba(229, 169, 60, 0.38);
  color: #f5c45e;
  background: rgba(229, 169, 60, 0.1);
}

.music-site-pill:hover {
  border-color: #f5c45e;
  background: rgba(229, 169, 60, 0.2);
  color: #fff;
}



