:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #161a20;
  --panel-soft: #1f2630;
  --text: #f6f7f9;
  --muted: #a9b0ba;
  --accent: #e50914;
  --line: #2d3540;
  --image-tone: 20, 26, 32;
  --image-tone-soft: rgba(20, 26, 32, 0.34);
  --image-tone-mid: rgba(20, 26, 32, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-feature-settings: "liga" 1, "calt" 1;
}

body.detail-open {
  overflow: hidden;
}

body.metadata-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  padding: 24px clamp(22px, 4vw, 64px) 18px;
  background:
    linear-gradient(180deg, rgba(5, 8, 11, 0.42), rgba(5, 8, 11, 0.1) 64%, rgba(5, 8, 11, 0)),
    linear-gradient(90deg, rgba(var(--image-tone), 0.08), rgba(var(--image-tone), 0.03) 52%, rgba(var(--image-tone), 0.06));
  border-bottom: 0;
  box-shadow: none;
  backdrop-filter: none;
  transition: background 180ms ease, box-shadow 180ms ease, backdrop-filter 180ms ease;
}

.topbar.is-scrolled {
  background:
    linear-gradient(180deg, rgba(8, 10, 13, 0.94), rgba(8, 10, 13, 0.82)),
    rgba(8, 10, 13, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -72px;
  height: 72px;
  background: linear-gradient(180deg, rgba(5, 8, 11, 0.08), rgba(5, 8, 11, 0));
  pointer-events: none;
  transition: opacity 180ms ease;
}

.topbar.is-scrolled::after {
  opacity: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  position: relative;
  color: #ffffff;
  background: rgba(246, 247, 249, 0.08);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.brand-mark::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(246, 247, 249, 0.92);
  box-shadow: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(246, 247, 249, 0.58);
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text span {
  color: #ffffff;
  font-size: 22px;
  letter-spacing: 0.16em;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 2.6vw, 34px);
}

.topnav-link {
  position: relative;
  min-height: 34px;
  padding: 0;
  color: rgba(246, 247, 249, 0.74);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
}

.topnav-link:hover,
.topnav-link.is-active {
  color: var(--text);
}

.topnav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.top-list-button {
  color: rgba(246, 247, 249, 0.74);
}

.top-list-button.is-active {
  color: var(--text);
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-end;
}

.top-action-button {
  width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: rgba(246, 247, 249, 0.78);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.top-action-button:hover,
.top-action-button.is-active,
.top-list-button.is-active {
  color: var(--text);
}

.top-action-button .lucide,
.hero-action .lucide,
.list-toggle .lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.4;
}

.top-action-button .lucide {
  width: 24px;
  height: 24px;
}

.search-panel {
  display: none;
}

.search-panel.is-open {
  display: block;
}

.search-view {
  display: none;
  padding: 28px clamp(18px, 4vw, 56px);
  background: rgba(10, 13, 17, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.search-view.is-open {
  display: block;
}

.search-view-inner {
  width: min(1760px, 100%);
}

.search-view label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap .lucide {
  position: absolute;
  left: 30px;
  width: 30px;
  height: 30px;
  color: rgba(246, 247, 249, 0.94);
  pointer-events: none;
  stroke-width: 2;
}

.search-view input {
  width: 100%;
  min-height: 88px;
  padding: 0 28px 0 72px;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(var(--image-tone), 0.14), rgba(var(--image-tone), 0.08)),
    rgba(42, 42, 42, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  outline: none;
  backdrop-filter: blur(10px);
  font-size: 30px;
}

.search-view input::placeholder {
  color: rgba(246, 247, 249, 0.66);
}

.search-view input:focus {
  border-color: rgba(255, 255, 255, 0.96);
  background:
    linear-gradient(90deg, rgba(var(--image-tone), 0.18), rgba(var(--image-tone), 0.1)),
    rgba(48, 48, 48, 0.96);
}

@media (max-width: 680px) {
  .search-view input {
    min-height: 64px;
    padding-left: 56px;
    font-size: 20px;
  }

  .search-input-wrap .lucide {
    left: 20px;
    width: 24px;
    height: 24px;
  }
}

.hero {
  position: relative;
  height: clamp(680px, 72vh, 820px);
  min-height: 680px;
  display: block;
  overflow: hidden;
  background: #0b0d10;
  cursor: pointer;
  outline: none;
  transition: filter 180ms ease;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5, 8, 11, 0.58), rgba(5, 8, 11, 0.13) 54%, rgba(5, 8, 11, 0.02)),
    linear-gradient(0deg, rgba(5, 8, 11, 0.82), rgba(5, 8, 11, 0.14) 38%, rgba(5, 8, 11, 0.02) 72%);
  pointer-events: none;
}

.hero:hover,
.hero:focus-visible {
  filter: brightness(1.12);
}

.hero-content {
  max-width: 620px;
  min-width: 0;
  height: 100%;
  padding: 150px clamp(24px, 4vw, 64px) 88px clamp(78px, 7vw, 132px);
  display: flex;
  flex-direction: column;
  justify-content: end;
  position: relative;
  z-index: 2;
  background: transparent;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  margin-left: 0;
  z-index: 0;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #0b0d10 0%, rgba(11, 13, 16, 0.82) 13%, rgba(11, 13, 16, 0.38) 28%, rgba(11, 13, 16, 0) 46%),
    linear-gradient(0deg, rgba(11, 13, 16, 0.12), rgba(11, 13, 16, 0) 34%);
  pointer-events: none;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 52px;
  height: 74px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: rgba(246, 247, 249, 0.86);
  background: rgba(9, 12, 16, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(12px);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.hero-nav:hover,
.hero-nav:focus-visible {
  color: #ffffff;
  background: rgba(9, 12, 16, 0.72);
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
  transform: translateY(-50%) scale(1.04);
}

.hero-nav-previous {
  left: clamp(14px, 1.8vw, 26px);
}

.hero-nav-next {
  right: clamp(12px, 2vw, 30px);
}

.hero-nav .lucide {
  width: 30px;
  height: 30px;
  stroke-width: 2;
}

.view-header {
  display: none;
  padding: 128px clamp(18px, 4vw, 56px) 22px;
  background:
    linear-gradient(180deg, rgba(10, 13, 17, 0.94), rgba(10, 13, 17, 0.72)),
    rgba(10, 13, 17, 0.94);
}

.view-header.is-open {
  display: block;
}

.view-header h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
}

.view-header p {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

body.view-search .hero,
body.view-list .hero,
body.view-search .category-bar,
body.view-list .category-bar {
  display: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h2 {
  margin: 0;
  font-size: clamp(38px, 4.9vw, 64px);
  line-height: 0.98;
}

.hero p {
  max-width: 540px;
  margin: 18px 0 0;
  color: #d8dde4;
  font-size: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  font-weight: 700;
}

.list-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  cursor: pointer;
}

.list-toggle.is-saved {
  color: #20c4ff;
  border-color: rgba(32, 196, 255, 0.48);
  background: rgba(32, 196, 255, 0.1);
}

.card-list-button {
  width: 100%;
  margin-top: auto;
}

.detail-info-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.detail-info-actions .location-link,
.detail-info-actions .metadata-toggle {
  width: 300px;
  min-height: 36px;
  justify-content: center;
  margin-top: 0;
  font-size: 16px;
  font-weight: 500;
}

.detail-list-button {
  width: 300px;
  min-height: 36px;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 500;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.detail-info-actions .location-actions,
.detail-info-actions .metadata-actions {
  width: 300px;
}

.location-link {
  width: auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.location-link:hover,
.location-link:focus-visible {
  border-color: rgba(32, 196, 255, 0.56);
  outline: none;
}

.location-link:disabled {
  cursor: wait;
  opacity: 0.68;
}

.location-link .lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.location-status {
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.metadata-actions {
  max-width: 100%;
  margin-top: 0;
}

.metadata-toggle,
.metadata-submit,
.metadata-modal-close {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(32, 196, 255, 0.08);
  border: 1px solid rgba(32, 196, 255, 0.28);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.metadata-toggle:hover,
.metadata-toggle:focus-visible,
.metadata-submit:hover,
.metadata-submit:focus-visible,
.metadata-modal-close:hover,
.metadata-modal-close:focus-visible {
  border-color: rgba(32, 196, 255, 0.62);
  outline: none;
}

.metadata-toggle .lucide,
.metadata-modal-close .lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.metadata-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
}

.metadata-modal.is-open {
  display: grid;
}

.metadata-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(12px);
}

.metadata-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(820px, 92vh);
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: rgba(15, 18, 23, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.66);
}

.metadata-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.metadata-modal-header h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.metadata-movie-title {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.metadata-modal-close {
  min-width: 38px;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.metadata-textarea {
  width: 100%;
  min-height: 420px;
  padding: 12px;
  color: var(--text);
  background: rgba(9, 12, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  outline: none;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  flex: 1;
}

.metadata-textarea:focus {
  border-color: rgba(32, 196, 255, 0.56);
}

.metadata-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.metadata-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.metadata-status {
  color: var(--muted);
  font-size: 13px;
}

.catalog {
  padding: 30px clamp(18px, 4vw, 56px) 56px;
  scroll-margin-top: 112px;
}

.catalog + .catalog {
  padding-top: 0;
}

.category-bar {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(10, 13, 17, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.category-bar::-webkit-scrollbar {
  height: 8px;
}

.category-bar::-webkit-scrollbar-track {
  background: transparent;
}

.category-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.category-filter {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  color: #d4d9e1;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.category-filter:hover,
.category-filter.is-active {
  color: #20c4ff;
  border-color: rgba(32, 196, 255, 0.44);
  background: rgba(32, 196, 255, 0.09);
}

.category-filter:hover {
  transform: translateY(-1px);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.title-group h1 {
  margin: 0;
  font-size: 26px;
}

.title-group span {
  color: var(--muted);
}

.random-toggle {
  width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: #121820;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.random-toggle .lucide {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.random-toggle.is-active {
  color: #20c4ff;
  border-color: rgba(32, 196, 255, 0.48);
  background: rgba(32, 196, 255, 0.08);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.movie-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #11151a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.movie-card:hover,
.movie-card:focus-visible {
  border-color: rgba(32, 196, 255, 0.55);
  transform: translateY(-3px);
}

.poster {
  aspect-ratio: 2 / 3;
  background: var(--fallback-bg, linear-gradient(135deg, #26313d, #50151b));
}

.poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-info {
  min-height: 260px;
  padding: 14px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.type-label {
  display: inline-block;
  margin-bottom: 8px;
  color: #20c4ff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.movie-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.15;
}

.movie-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  min-height: 52px;
  align-content: flex-start;
}

.chip {
  padding: 5px 7px;
  color: #e6e9ee;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 12px;
}

.empty {
  grid-column: 1 / -1;
  padding: 42px 0;
  color: var(--muted);
}

.detail-view {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  overflow-y: auto;
  padding: 32px clamp(22px, 5vw, 82px) 72px;
  background-position: center;
  background-size: cover;
  --image-tone: 20, 26, 32;
  --image-tone-soft: rgba(20, 26, 32, 0.34);
  --image-tone-mid: rgba(20, 26, 32, 0.22);
}

.detail-view.is-open {
  display: block;
}

.detail-actions {
  max-width: 1220px;
  margin: 0 auto 18px;
}

.detail-close {
  min-height: 42px;
  padding: 0 18px;
  color: var(--text);
  background: rgba(17, 21, 26, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  cursor: pointer;
}

.detail-nav {
  position: fixed;
  top: 50%;
  z-index: 34;
  width: 54px;
  height: 76px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: rgba(246, 247, 249, 0.88);
  background: rgba(17, 21, 26, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(12px);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.detail-nav:hover,
.detail-nav:focus-visible {
  color: #ffffff;
  background: rgba(17, 21, 26, 0.84);
  border-color: rgba(255, 255, 255, 0.36);
  outline: none;
  transform: translateY(-50%) scale(1.04);
}

.detail-nav-previous {
  left: clamp(10px, 2vw, 28px);
}

.detail-nav-next {
  right: clamp(10px, 2vw, 28px);
}

.detail-nav .lucide {
  width: 34px;
  height: 34px;
  stroke-width: 2.2;
}

.detail-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 360px) minmax(0, 780px);
  gap: clamp(34px, 5vw, 68px);
  align-items: start;
  min-height: calc(100vh - 164px);
}

.detail-poster {
  overflow: hidden;
  margin-top: 46px;
  background: #11151a;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.detail-poster img {
  display: block;
  width: 100%;
  max-height: min(68vh, 590px);
  object-fit: cover;
}

.detail-content {
  padding: 24px 0;
}

.detail-content h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
}

.country-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.country-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flag-frame {
  width: 22px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 3px;
  box-shadow: none;
}

.flag-frame .fi {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 2px;
  background-size: cover;
  filter: saturate(1.1) contrast(1.04);
}

.detail-synopsis {
  max-width: 720px;
  margin: 24px 0 0;
  color: #e2e6ec;
  font-size: 17px;
  line-height: 1.58;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.source-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.source-link:hover,
.source-link:focus-visible {
  border-color: rgba(32, 196, 255, 0.56);
  outline: none;
}

.source-icon {
  min-width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0b0d10;
  background: #f5c518;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
}

.source-link-filmaffinity .source-icon {
  color: #ffffff;
  background: #2b72b8;
}

.source-link-rottentomatoes .source-icon {
  color: #ffffff;
  background: #e31b23;
}

.ratings-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin-top: 16px;
}

.rating-card {
  min-width: 0;
  padding: 12px;
  color: var(--text);
  background: rgba(17, 21, 26, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  text-decoration: none;
}

.rating-card:hover,
.rating-card:focus-visible {
  border-color: rgba(32, 196, 255, 0.52);
  outline: none;
}

.rating-source {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.rating-card strong {
  display: block;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: normal;
}

.detail-trailer {
  margin-top: 28px;
}

.detail-trailer h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 16px;
}

.trailer-frame {
  overflow: hidden;
  max-width: 720px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.45);
}

.trailer-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 0;
}

.detail-block {
  margin-top: 24px;
}

.detail-block h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 16px;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.people-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  color: #dbeefe;
  background: rgba(32, 196, 255, 0.08);
  border: 1px solid rgba(32, 196, 255, 0.22);
  border-radius: 5px;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
}

.person-link:hover,
.person-link:focus-visible {
  color: #ffffff;
  border-color: rgba(32, 196, 255, 0.58);
  outline: none;
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px clamp(18px, 4vw, 56px);
  }

  .topnav {
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .topnav-link {
    flex: 0 0 auto;
    font-size: 15px;
  }

  .top-actions {
    justify-content: stretch;
  }

  .hero {
    height: 580px;
    min-height: 580px;
  }

  .hero-content {
    position: relative;
    z-index: 2;
    justify-content: end;
    background: transparent;
  }

  .hero-media {
    position: absolute;
    inset: 0;
  }

  .hero-nav {
    top: auto;
    bottom: 108px;
    width: 48px;
    height: 48px;
    transform: none;
  }

  .hero-nav:hover,
  .hero-nav:focus-visible {
    transform: scale(1.04);
  }

  .hero-nav-previous {
    left: 18px;
  }

  .hero-nav-next {
    right: 18px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .movie-card {
    min-height: 260px;
  }

  .detail-view {
    padding: 22px 18px 72px;
  }

  .detail-nav {
    top: auto;
    bottom: 18px;
    width: 48px;
    height: 48px;
    transform: none;
  }

  .detail-nav:hover,
  .detail-nav:focus-visible {
    transform: scale(1.04);
  }

  .detail-nav-previous {
    left: 18px;
  }

  .detail-nav-next {
    right: 18px;
  }

  .detail-nav .lucide {
    width: 28px;
    height: 28px;
  }

  .detail-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .detail-poster {
    max-width: 240px;
    margin-top: 0;
  }

  .ratings-panel {
    grid-template-columns: 1fr;
  }

  .detail-info-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-info-actions .location-link,
  .detail-info-actions .metadata-toggle {
    width: 100%;
  }

  .detail-list-button {
    width: 100%;
  }
}
