:root {
  --bg: #050505;
  --bg-2: #111111;
  --surface: rgba(18, 18, 18, 0.82);
  --text: #ffffff;
  --muted: #b3b3b3;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #e50914;
  --accent-dark: #ab0610;
  --radius: 6px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.08) 28%, #050505 78%),
    radial-gradient(circle at 72% 10%, rgba(229, 9, 20, 0.16), transparent 28%);
  z-index: -1;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 44px calc(44px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.topbar,
.nav-links,
.search-panel,
.section-heading,
.title-row,
.meta-row,
.actions,
.provider-row,
.provider-chips {
  display: flex;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  padding: 16px 0;
  background: linear-gradient(180deg, #050505 0%, rgba(5, 5, 5, 0.72) 72%, transparent 100%);
}

.brand-logo {
  width: clamp(130px, 18vw, 210px);
  height: auto;
  object-fit: contain;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
}

.nav-links {
  align-items: center;
  gap: 18px;
  flex: 1;
}

.nav-links a {
  color: #e8e8e8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a.active {
  color: #fff;
  font-weight: 900;
}

.mobile-apk-link {
  display: none;
}

.download-apk-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.download-apk-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.icon-button,
.action-button {
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  font-size: 13px;
  font-weight: 800;
}

.icon-button.active {
  background: var(--accent);
}

.account-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.account-button.signed-in {
  background: rgba(255, 255, 255, 0.16);
}

#accountAvatar {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(229, 9, 20, 0.82);
}

#accountAvatar:empty::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

#accountAvatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.search-panel {
  align-items: end;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(14px);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-field {
  flex: 1;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #151515;
  color: var(--text);
  outline: none;
}

input {
  width: 100%;
  min-width: 280px;
  padding: 0 14px;
  font-size: 15px;
}

select {
  width: 160px;
  padding: 0 12px;
}

.country-badge {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: var(--radius);
  background: rgba(229, 9, 20, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.26);
}

.detail-pane {
  min-width: 0;
  overflow: hidden;
  min-height: 560px;
}

.hero {
  position: relative;
  min-height: 580px;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: flex-end;
  padding: 58px 0;
  background-size: cover;
  background-position: center;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hero::before {
  background:
    linear-gradient(90deg, #050505 0%, rgba(5, 5, 5, 0.82) 34%, rgba(5, 5, 5, 0.16) 74%),
    linear-gradient(0deg, #050505 0%, rgba(5, 5, 5, 0) 38%);
}

.hero::after {
  background: linear-gradient(180deg, transparent 62%, #050505 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(700px, 90%);
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

h3 {
  margin-bottom: 14px;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 70px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-content p {
  color: #f1f1f1;
  font-size: 16px;
}

.meta-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.meta-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.detail-body {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-top: 0;
  padding: 0 0 22px;
}

.overview {
  max-width: 720px;
  color: #e2e2e2;
  line-height: 1.58;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.actions {
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.action-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  line-height: 1;
}

.action-button.primary {
  background: var(--accent);
  color: #fff;
}

.action-button.primary:hover {
  background: var(--accent-dark);
}

.action-button:not(.primary):hover {
  background: rgba(255, 255, 255, 0.26);
}

.providers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.provider-row {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.provider-row--loading {
  border-color: rgba(229, 9, 20, 0.52);
  background: rgba(229, 9, 20, 0.1);
}

.provider-row--signal {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
}

.provider-row--loading .provider-name::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  animation: loadingDots 1.2s steps(4, end) infinite;
}

@keyframes loadingDots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75%,
  100% {
    content: "...";
  }
}

.provider-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.provider-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 5px;
  object-fit: cover;
  background: #252525;
}

.provider-name {
  font-weight: 900;
}

.provider-mode {
  color: var(--muted);
  font-size: 13px;
}

.provider-row .icon-button {
  min-width: 42px;
  padding: 0;
}

.catalog-section {
  min-width: 0;
  margin-top: 18px;
}

.categories-root {
  display: grid;
  gap: 34px;
  min-width: 0;
}

.category-group {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.category-group > h2 {
  margin: 0;
  padding-top: 8px;
  font-size: 30px;
  line-height: 1.1;
}

.category-row {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.category-row h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.carousel-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.section-heading {
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

#statusStrip {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.title-row {
  --card-width: clamp(260px, 24vw, 386px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: clamp(8px, 0.8vw, 12px);
  overflow-x: auto;
  padding: 6px 2px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.title-row::-webkit-scrollbar {
  display: none;
}

.carousel-button {
  position: absolute;
  top: 6px;
  bottom: 18px;
  z-index: 2;
  width: clamp(38px, 4vw, 52px);
  border: 0;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, background 150ms ease;
}

.carousel-shell:hover .carousel-button:not([disabled]),
.carousel-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.carousel-button[disabled] {
  opacity: 0;
  pointer-events: none;
}

.carousel-button:hover {
  background: rgba(0, 0, 0, 0.78);
}

.carousel-button span {
  display: block;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 300;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.carousel-button.prev {
  left: -2px;
  border-radius: var(--radius) 0 0 var(--radius);
}

.carousel-button.next {
  right: -2px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.result-card {
  position: relative;
  width: var(--card-width);
  min-width: var(--card-width);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #161616;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.result-card:hover,
.result-card.selected {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.44);
}

.result-card.selected {
  outline: 2px solid var(--accent);
}

.poster {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #252525;
}

.result-card > span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  padding: 42px 10px 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.88));
}

.result-title {
  display: block;
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}

.result-meta {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.provider-chips {
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(229, 9, 20, 0.18);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
}

.empty-state {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.feed-page {
  height: calc(100vh - 104px);
  height: calc(100dvh - 104px);
  min-height: 620px;
  display: grid;
  gap: 18px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  border-radius: var(--radius);
}

.feed-page::-webkit-scrollbar {
  display: none;
}

.feed-item {
  position: relative;
  min-height: calc(100vh - 110px);
  min-height: calc(100dvh - 110px);
  display: grid;
  align-content: end;
  gap: 18px;
  padding: clamp(18px, 4vw, 42px);
  overflow: hidden;
  border-radius: var(--radius);
  scroll-snap-align: start;
  background: #0b0b0b;
}

.feed-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--feed-bg);
  background-size: cover;
  background-position: center;
  filter: blur(24px) saturate(1.2);
  transform: scale(1.12);
  opacity: 0.48;
}

.feed-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.76) 58%, #050505),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 62%);
}

.feed-visual,
.feed-copy,
.feed-actions {
  position: relative;
  z-index: 1;
}

.feed-visual {
  width: min(760px, 100%);
  align-self: center;
  justify-self: center;
}

.feed-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
  border-radius: var(--radius);
  background: #000;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
}

.feed-video--poster {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.feed-video--poster::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.48);
}

.feed-video--poster span {
  position: relative;
  z-index: 1;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.62);
  font-size: 13px;
  font-weight: 900;
}

.feed-copy {
  width: min(760px, 100%);
}

.feed-copy h2 {
  margin: 8px 0 8px;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 0.98;
}

.feed-copy p {
  max-width: 720px;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #e6e6e6;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.feed-platform {
  margin-top: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.feed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feed-action {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.feed-action.primary,
.feed-action.active {
  border-color: transparent;
  background: var(--accent);
}

.page-header {
  min-height: 300px;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 80px 0 36px;
  background:
    linear-gradient(90deg, rgba(229, 9, 20, 0.18), transparent 42%),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.04));
}

.page-header h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.98;
}

.page-header p:not(.eyebrow) {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.details-page {
  min-height: 100vh;
}

.back-link {
  display: inline-flex;
  margin: 18px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font: inherit;
  cursor: pointer;
}

.back-link:hover {
  color: var(--accent);
}

.detail-page-hero {
  border-radius: var(--radius);
  overflow: hidden;
}

.details-body {
  padding-inline: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  position: relative;
  width: min(980px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  border-radius: 8px;
  background: #101010;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.72);
  scrollbar-width: none;
}

.modal-panel::-webkit-scrollbar {
  display: none;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.modal-hero {
  position: relative;
  min-height: 410px;
  display: flex;
  align-items: flex-end;
  padding: 34px;
  background-size: cover;
  background-position: center;
}

.modal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #101010 0%, rgba(16, 16, 16, 0.2) 48%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.12));
}

.modal-hero-content {
  position: relative;
  z-index: 1;
  width: min(690px, 100%);
}

.modal-hero-content h3 {
  margin: 0 0 12px;
  font-size: clamp(32px, 6vw, 62px);
  line-height: 1.05;
}

.modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 26px;
  padding: 24px 34px 34px;
}

.modal-overview {
  color: #e5e5e5;
  line-height: 1.62;
}

.trailer-frame,
.trailer-card {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #000;
}

.trailer-embed {
  display: grid;
  gap: 10px;
}

.trailer-frame {
  display: block;
  border: 0;
}

.trailer-actions {
  display: flex;
  justify-content: flex-end;
}

.trailer-fallback {
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.trailer-fallback:hover {
  color: #fff;
  text-decoration: underline;
}

.trailer-card {
  position: relative;
  display: block;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
}

.trailer-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: opacity 160ms ease, transform 160ms ease;
}

.trailer-card:hover img {
  opacity: 0.48;
  transform: scale(1.03);
}

.trailer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.86));
}

.trailer-card::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  transform: translate(-50%, -50%);
  font-size: 24px;
  line-height: 1;
}

.trailer-card span {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 4px;
}

.trailer-card strong {
  font-size: 16px;
}

.trailer-card small {
  color: var(--muted);
}

.trailer-placeholder {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .app-shell {
    padding: calc(env(safe-area-inset-top) + 28px) 18px calc(34px + env(safe-area-inset-bottom));
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 14px;
    align-items: start;
    min-height: 96px;
    padding: 12px 0 10px;
  }

  .brand-link {
    justify-self: start;
  }

  .nav-links {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 8px 11px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
  }

  .mobile-apk-link {
    display: inline-flex;
  }

  .download-apk-button {
    display: none;
  }

  #favoritesToggle,
  .account-button {
    display: none;
  }

  .search-panel {
    align-items: stretch;
    flex-direction: column;
  }

  input,
  select {
    width: 100%;
    min-width: 0;
  }

  .hero {
    min-height: 520px;
    padding: 38px 0;
  }

  .detail-body {
    margin-top: 0;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .details-body {
    gap: 22px;
  }
}

@media (max-width: 520px) {
  .title-row {
    --card-width: min(78vw, 330px);
  }

  .brand-logo {
    width: 128px;
  }

  .icon-button {
    padding: 0 10px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  h3 {
    font-size: 34px;
    line-height: 1.12;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-hero {
    min-height: 330px;
    padding: 22px;
  }

  .modal-hero-content h3 {
    font-size: 34px;
    line-height: 1.08;
  }

  .modal-body {
    padding: 20px;
  }

  .details-body {
    padding-inline: 0;
  }

  .action-button {
    width: 100%;
  }
}
