:root {
  --bg: #050505;
  --surface: #151515;
  --surface-2: #202020;
  --text: #f8f8f8;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #01b0ff;
  --green: #15b84a;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
  font-family: Inter, "Inter Fallback", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  height: auto;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  touch-action: auto;
  -webkit-overflow-scrolling: touch;
}

.pull-refresh {
  --pull-y: 0px;
  --pull-progress: 0;
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  z-index: 80;
  display: grid;
  place-items: center;
  min-width: 96px;
  height: 34px;
  border-radius: 17px;
  background: rgba(21, 21, 21, 0.86);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-46px + var(--pull-y)));
  transition:
    opacity 0.24s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.2s ease,
    background 0.2s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.pull-refresh.pulling {
  transition: opacity 0.08s ease, color 0.16s ease, background 0.16s ease;
}

.pull-refresh.ready,
.pull-refresh.refreshing {
  color: var(--accent);
  background: rgba(21, 21, 21, 0.94);
}

.pull-refresh.refreshing span::after {
  content: "...";
}

html {
  height: auto;
  overscroll-behavior-y: auto;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: auto;
  -webkit-overflow-scrolling: touch;
}

::-webkit-scrollbar {
  width: 6px;
  height: 0;
}

::-webkit-scrollbar:horizontal {
  display: none;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.shelf-row,
.nav-options,
.genre-options {
  scrollbar-width: none;
}


a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 16px calc(34px + env(safe-area-inset-bottom));
  overflow-x: clip;
}

.topbar {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 30px;
}

.fatal-error {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
  color: var(--text);
}

.fatal-error h1 {
  margin: 0;
  font-size: 28px;
}

.fatal-error p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.fatal-error button {
  width: fit-content;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #050505;
  cursor: pointer;
  font-weight: 800;
  padding: 12px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #050505;
  font-size: 24px;
  font-weight: 900;
}

.mobile-title,
.bottom-nav {
  display: none;
}

.top-actions {
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.header-nav {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.nav-menu {
  position: relative;
  flex: 0 0 auto;
}

.nav-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 9px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-pill svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.nav-pill.active,
.nav-pill[aria-expanded="true"] {
  background: rgba(1, 176, 255, 0.1);
  color: var(--accent);
}

.nav-pill[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav-options,
.genre-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: min(360px, calc(100vw - 40px));
  max-height: 310px;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 18, 18, 0.98);
  box-shadow: var(--shadow);
  padding: 8px;
}

.nav-options {
  width: 210px;
}

@media (min-width: 900px) {
  .nav-menu {
    position: static;
  }

  .nav-options {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    width: 100%;
    max-height: min(420px, calc(100vh - 110px));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    overflow-x: hidden;
  }

  .nav-options .nav-option {
    flex: 0 1 auto;
    min-width: 150px;
    max-width: 260px;
  }
}

.nav-option,
.genre-option {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0 10px;
  text-align: left;
}

.nav-option:hover,
.nav-option.active,
.genre-option:hover,
.genre-option.active {
  background: rgba(1, 176, 255, 0.12);
  color: var(--accent);
}

.round-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.round-button svg,
.back-link svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round-button.accent,
.round-button.active {
  color: var(--accent);
}

.menu-button {
  display: none;
}

.search-form {
  position: absolute;
  inset: 0 108px 0 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 44px;
  width: 0;
  max-width: none;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-10px);
  transition: width 0.22s ease, opacity 0.18s ease, transform 0.18s ease;
}

.search-open .search-form {
  width: auto;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (min-width: 900px) {
  .search-form {
    position: static;
    width: min(380px, 30vw);
    max-width: min(380px, 30vw);
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    transform: none;
  }

  #topSearchButton {
    display: none;
  }
}

.search-form input {
  min-width: 0;
  height: 44px;
  border: 2px solid var(--line);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0 16px;
  outline: none;
}

.search-submit {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.search-submit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-submit:hover {
  color: var(--accent);
}

.top-actions .round-button {
  position: relative;
  z-index: 12;
}

#watchedButton,
#favoritesButton,
.bottom-nav-button[data-mobile-nav="watched"],
.bottom-nav-button[data-mobile-nav="favorites"] {
  display: none;
}

.search-form input:focus {
  border-color: rgba(1, 176, 255, 0.75);
}

.search-form:focus-within input,
.search-form:focus-within .search-submit {
  border-color: rgba(1, 176, 255, 0.75);
}

.side-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
}

.side-menu {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 41;
  width: min(86vw, 360px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.98);
  box-shadow: var(--shadow);
  padding: max(18px, env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  transform: translateX(-104%);
  transition: transform 0.22s ease;
}

.side-menu-open .side-menu {
  transform: translateX(0);
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 850;
}

.side-menu-content {
  display: grid;
  gap: 18px;
}

.side-menu-loading {
  min-height: 80px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.side-menu-section {
  display: grid;
  gap: 6px;
}

.side-menu-section summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  cursor: pointer;
  margin: 0 0 4px;
  padding: 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  list-style: none;
}

.side-menu-section summary::-webkit-details-marker {
  display: none;
}

.side-menu-section summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.7;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.side-menu-section[open] summary {
  color: var(--accent);
  background: rgba(1, 176, 255, 0.1);
}

.side-menu-section[open] summary::after {
  transform: rotate(225deg);
}

.side-menu-section:not([open]) .nav-option {
  display: none;
}

.side-menu .nav-option {
  min-height: 42px;
  border-radius: 12px;
}

.genre-menu {
  position: relative;
  width: auto;
  margin-bottom: 0;
}

.genre-toggle {
  color: var(--muted);
}

.nav-option small {
  color: var(--muted);
}

.catalog-summary {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-footer {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 52px;
  padding: 22px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer p {
  margin: 0;
}

.shelves {
  display: grid;
  gap: 28px;
}

.shelf {
  min-width: 0;
}

.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.shelf-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.shelf-head button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
}

.shelf-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(136px, 180px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.shelf-scroll {
  position: relative;
  min-width: 0;
}

.shelf-arrow {
  position: absolute;
  top: 38%;
  z-index: 5;
  width: 38px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(10, 10, 10, 0.72);
  color: var(--text);
  cursor: pointer;
  opacity: 0.86;
  backdrop-filter: blur(10px);
}

.shelf-arrow.prev {
  left: 6px;
}

.shelf-arrow.next {
  right: 6px;
}

.shelf-arrow svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shelf-arrow:hover {
  color: var(--accent);
  opacity: 1;
}

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

.movie-card {
  min-width: 0;
  background: transparent;
  text-align: left;
  scroll-snap-align: start;
}

.poster-wrap {
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #202020, #101010);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rating-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 2px;
  padding: 3px 7px;
  font-size: 13px;
  font-weight: 800;
  background: rgba(80, 80, 80, 0.9);
  color: #fff;
}

.watch-status {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(1, 176, 255, 0.92);
  color: #031018;
  font-size: 12px;
  font-weight: 850;
}

.card-remove-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.72);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card-remove-button:hover {
  color: var(--accent);
  background: rgba(10, 10, 10, 0.9);
}

.card-remove-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rating-badge.good {
  background: var(--green);
}

.card-body {
  padding-top: 8px;
}

.card-title {
  min-height: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  margin: 34px auto 0;
  color: var(--muted);
  text-align: center;
}

.my-movies-panel {
  display: grid;
  gap: 22px;
}

.my-movies-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  align-content: center;
  min-height: 132px;
  border-radius: 14px;
  padding: 28px;
  background:
    radial-gradient(circle at 80% 50%, rgba(1, 176, 255, 0.34), transparent 35%),
    radial-gradient(circle at 48% 22%, rgba(44, 107, 255, 0.28), transparent 28%),
    linear-gradient(135deg, #063176, #01b0ff 64%, #071016);
  color: #fff;
  overflow: hidden;
}

.telegram-auth-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.telegram-login-button,
.telegram-logout-button {
  min-width: 92px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 10px;
  background: rgba(5, 5, 5, 0.38);
  color: #fff;
  cursor: pointer;
  padding: 10px 15px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.telegram-login-button span {
  font-weight: 850;
  font-size: 14px;
}

.telegram-login-button small {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.telegram-login-button:disabled {
  cursor: progress;
  opacity: 0.84;
}

.telegram-logout-button {
  min-height: 42px;
  font-weight: 800;
}

.my-movies-user {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.my-movies-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.my-movies-user-text {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.my-movies-hero strong {
  font-size: 38px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.my-movies-hero small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.my-movies-section {
  display: grid;
  gap: 12px;
}

.my-movies-section h2,
.my-section-head h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
}

.my-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.my-section-head button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 17px;
  cursor: pointer;
}

.continue-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 58px;
  gap: 18px;
  align-items: center;
  min-height: 126px;
  border-radius: 14px;
  padding: 18px;
  background:
    radial-gradient(circle at 82% 50%, rgba(1, 176, 255, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.continue-card img {
  width: 118px;
  height: 86px;
  object-fit: cover;
  border-radius: 10px;
  background: #161616;
}

.continue-info {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.continue-info strong {
  font-size: 24px;
  line-height: 1.1;
}

.continue-info small,
.continue-time {
  color: var(--muted);
  font-size: 15px;
}

.continue-progress {
  display: block;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.continue-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.continue-play {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: var(--accent);
}

.continue-play svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.my-collections {
  display: grid;
  gap: 8px;
}

.my-collection-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 14px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.my-collection-card::after {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.55;
}

.my-collection-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.my-latest-section {
  margin-top: 4px;
}

.my-collection-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(1, 176, 255, 0.12);
  color: var(--accent);
}

.my-collection-preview {
  position: relative;
  width: 82px;
  height: 72px;
  display: grid;
  place-items: center;
}

.my-collection-preview img {
  position: absolute;
  left: calc(var(--i) * 17px);
  z-index: var(--z);
  width: 48px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
}

.my-collection-icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.my-collection-icon.heart svg {
  fill: currentColor;
}

.my-collection-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.my-collection-card strong {
  min-width: 0;
  font-size: 24px;
  line-height: 1.15;
}

.my-collection-card small {
  color: var(--muted);
  font-size: 17px;
}

.my-collection-card.is-loading {
  pointer-events: none;
}

.my-collection-card.is-loading span,
.my-collection-card.is-loading strong,
.my-collection-card.is-loading small {
  min-height: 18px;
  border-radius: 6px;
  color: transparent;
  background: linear-gradient(90deg, #171717, #252525, #171717);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.page-button {
  min-width: 104px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.load-more-button {
  min-width: 168px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.load-more-button:hover {
  color: #fff;
  border-color: var(--accent);
  filter: brightness(1.08);
}

.page-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.back-link {
  width: fit-content;
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  margin-bottom: 16px;
}

.movie-page {
  display: grid;
  gap: 22px;
  align-items: start;
}

.movie-details-main {
  display: flex;
  gap: 20px;
  align-items: start;
}

.movie-details-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 14px;
}


.movie-poster-wrap {
  display: block;
  width: 260px;
  height: 390px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #202020, #101010);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  align-self: start;
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.movie-poster.is-empty {
  visibility: hidden;
}

.movie-info {
  display: grid;
  gap: 16px;
}

.movie-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.movie-heading-main {
  min-width: 0;
}

.movie-heading h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.movie-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.movie-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.movie-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.movie-action.share {
  width: 40px;
  padding: 0;
}

.movie-action svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.movie-action.active {
  border-color: rgba(1, 176, 255, 0.48);
  background: rgba(1, 176, 255, 0.12);
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .movie-action:hover {
    border-color: rgba(1, 176, 255, 0.48);
    background: rgba(1, 176, 255, 0.12);
    color: var(--accent);
  }
}


.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.chip-link {
  color: var(--accent);
  border-color: rgba(1, 176, 255, 0.45);
}

.movie-details {
  display: grid;
  gap: 18px;
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  font-size: 16px;
  line-height: 1.55;
}

.movie-details h2 {
  display: none;
}

.description-wrap {
  display: grid;
  gap: 8px;
  border: 0;
  box-shadow: none;
  background-image: none;
}

.description-wrap[hidden] {
  display: none;
}

.description {
  position: relative;
  margin: 0;
  color: #d8d8d8;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.description.collapsed {
  max-height: 3.1em;
  overflow: hidden;
}

.description-toggle {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
  font-weight: 500;
}

.facts {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0 18px;
  margin: 0;
  border: 0;
  box-shadow: none;
  background-image: none;
}

.facts dt {
  padding: 7px 0;
  border: 0;
  color: var(--muted);
  font-size: inherit;
  line-height: inherit;
}

.facts dd {
  margin: 0;
  min-width: 0;
  padding: 7px 0;
  border: 0;
  color: #e6e6e6;
  font-size: inherit;
  line-height: inherit;
}

.fact-links {
  display: inline;
}

.fact-links a {
  color: var(--accent);
}

@media (min-width: 901px) {
  .movie-details-main {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px 22px;
  }

  .movie-details-text {
    display: contents;
  }

  .description-wrap {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .movie-poster-wrap {
    grid-column: 1;
    grid-row: 2;
  }

  .facts {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #101010;
  border-radius: 12px;
  overflow: hidden;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.player.is-empty {
  font-size: 15px;
  color: var(--muted);
}


.player-fs-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 6;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0.82;
}

.player-fs-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player.is-fs {
  position: fixed;
  inset: 0;
  z-index: 300;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  border-radius: 0;
}

.is-loading .poster-wrap,
.is-loading .card-title,
.is-loading .card-meta {
  background: linear-gradient(90deg, #171717, #252525, #171717);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  color: transparent;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding-left: 20px;
    padding-right: 0;
  }

  .topbar,
  .catalog-summary,
  .site-footer,
  .catalog-panel,
  .movie-view {
    padding-right: 20px;
  }

  .topbar {
    flex-wrap: nowrap;
    align-items: center;
  }

  .menu-button {
    display: inline-grid;
  }

  .header-nav {
    display: none;
  }

  .search-form {
    inset: 0 128px 0 0;
    grid-template-columns: 1fr;
    max-width: none;
  }

  .search-open .search-form {
    width: auto;
  }

  .search-open .menu-button {
    opacity: 0;
    pointer-events: none;
  }

  .search-form input {
    border: 2px solid var(--line);
    border-radius: 10px;
    padding-right: 16px;
  }

  .search-submit {
    display: none;
  }

  .shelf-row {
    grid-auto-columns: 42vw;
  }

  .my-movies-panel {
    gap: 22px;
    padding-right: 20px;
  }

  .my-movies-hero {
    min-height: 126px;
    margin-right: 0;
    border-radius: 12px;
    padding: 22px;
  }

  .my-movies-user {
    gap: 12px;
  }

  .my-movies-avatar {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    border-radius: 12px;
  }

  .my-movies-hero strong {
    font-size: 34px;
  }

  .my-movies-hero small {
    font-size: 17px;
  }

  .my-movies-section h2,
  .my-section-head h2 {
    font-size: 23px;
  }

  .continue-card {
    grid-template-columns: 86px minmax(0, 1fr) 48px;
    gap: 12px;
    min-height: 96px;
    padding: 12px;
  }

  .continue-card img {
    width: 86px;
    height: 86px;
  }

  .continue-info strong {
    font-size: 20px;
  }

  .continue-info small {
    font-size: 14px;
  }

  .continue-time {
    display: none;
  }

  .continue-play {
    width: 46px;
    height: 46px;
  }

  .my-collections {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-right: 0;
  }

  .my-collection-card {
    grid-template-columns: 78px minmax(0, 1fr) 12px;
    min-height: 94px;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
  }

  .my-collection-icon {
    width: 54px;
    height: 54px;
    border-radius: 10px;
  }

  .my-collection-preview {
    width: 78px;
    height: 70px;
  }

  .my-collection-preview img {
    left: calc(var(--i) * 16px);
    width: 47px;
    height: 70px;
  }

  .my-collection-icon svg {
    width: 27px;
    height: 27px;
  }

  .my-collection-card strong {
    font-size: 22px;
    line-height: 1.1;
  }

  .my-collection-card small {
    color: #a8a8a8;
    font-size: 16px;
  }

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

  .movie-heading h1 {
    font-size: 24px;
  }

  .movie-info {
    gap: 12px;
  }

  .player {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    justify-self: center;
    transform: none;
  }

  .movie-details {
    padding: 0 0 16px;
    gap: 0;
    border-radius: 12px;
  }

  .movie-details h2 {
    display: none;
  }

  .movie-details-main {
    flex-direction: column;
    gap: 0;
  }

  .movie-poster-wrap {
    width: calc(100% - 32px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 16px;
    border-radius: 12px;
  }

  .movie-details-text {
    display: grid;
    gap: 14px;
    padding: 16px;
  }

  .facts {
    grid-template-columns: 110px 1fr;
  }
}

@media (max-width: 900px) {
  body {
    background: #000;
  }

  .app-shell {
    width: 100%;
    padding-top: calc(102px + env(safe-area-inset-top));
    padding-bottom: calc(94px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 35;
    height: calc(84px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    gap: 12px;
    align-items: end;
    margin: 0;
    padding: env(safe-area-inset-top) 16px 14px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .brand,
  .header-nav {
    display: none;
  }

  .menu-button {
    display: inline-grid;
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    background: transparent;
  }

  .topbar .round-button {
    width: 56px;
    height: 56px;
  }

  .topbar .round-button svg {
    width: 29px;
    height: 29px;
  }

  .mobile-title {
    grid-column: 2;
    grid-row: 1;
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 18px;
    font-weight: 850;
    line-height: 56px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
    gap: 0;
  }

  .top-actions #watchedButton,
  .top-actions #favoritesButton,
  .top-actions #myMoviesButton {
    display: none;
  }

  #topSearchButton {
    display: inline-grid;
    background: transparent;
  }

  .search-open #topSearchButton {
    color: var(--accent);
  }

  .search-form {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 14px);
    right: 84px;
    bottom: auto;
    left: 16px;
    height: 56px;
    z-index: 37;
    grid-template-columns: 1fr;
    width: auto;
    max-width: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    transition: opacity 0.14s ease, visibility 0.14s ease;
  }

  .search-open .search-form {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .search-open .menu-button,
  .search-open .mobile-title {
    opacity: 0;
    pointer-events: none;
  }

  .search-form input {
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(28, 28, 28, 0.96);
    caret-color: var(--accent);
    padding: 0 16px;
  }

  .search-open .search-form input,
  .search-form input:focus {
    border-color: rgba(1, 176, 255, 0.75);
    box-shadow: 0 0 0 3px rgba(1, 176, 255, 0.16);
  }

  .search-submit {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 34;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(18px);
  }

  .bottom-nav-button {
    min-width: 0;
    min-height: 58px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
  }

  .bottom-nav-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bottom-nav-button.active {
    color: var(--accent);
  }

  .bottom-nav-primary svg {
    width: 29px;
    height: 29px;
  }

  .bottom-nav-primary.active {
    color: var(--accent);
  }

  .bottom-nav-icon.logo {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--muted);
    color: #020202;
    font-size: 16px;
    font-weight: 950;
  }

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

  .side-menu {
    z-index: 45;
    padding-top: calc(18px + env(safe-area-inset-top));
  }

  .side-menu-backdrop {
    z-index: 44;
  }

  .movie-actions {
    align-self: start;
    justify-content: flex-end;
    gap: 6px;
  }

  .movie-action {
    min-height: 36px;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 12px;
  }

  .movie-action svg {
    width: 17px;
    height: 17px;
  }

  .movie-action.share {
    width: 36px;
  }

  .movie-action.share span {
    display: none;
  }

  .back-link {
    display: none;
  }
}

@media (max-width: 520px) {
  .movie-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: start;
  }

  .movie-heading-main {
    grid-column: 1;
    grid-row: 1;
  }

  .movie-actions {
    grid-column: 2;
    grid-row: 1;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .movie-action {
    width: 36px;
    min-width: 36px;
    padding: 0;
    border-radius: 10px;
  }

  .movie-action span {
    display: none;
  }
}
