.cast-controls {
  display: flex;
  gap: 10px;
}

.cast-nav-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  transition: var(--trans);
}

.cast-nav-btn:hover {
  background: rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.35);
}

.cast-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.cast-scroll::-webkit-scrollbar {
  display: none;
}

@media (max-width: 640px) {
  .hero {
    height: auto;
    min-height: 640px;
  }

  .hero-content {
    padding-top: 152px;
  }

  .hero-bg {
    background-position: center top;
  }

  .hero-title {
    max-width: none;
  }

  .cast-controls {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Unified page treatment */
.page-body { background: linear-gradient(180deg, rgba(8, 17, 31, .12), rgba(8, 17, 31, .56) 30%, rgba(8, 17, 31, .9)); }
.page-header { position: relative; margin-top: 24px; padding: 38px 36px 34px; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(120deg, rgba(255, 107, 53, .16), rgba(21, 35, 56, .84) 52%, rgba(255, 209, 102, .08)); box-shadow: var(--shadow); }
.page-header::after { position: absolute; right: -50px; bottom: -75px; width: 230px; height: 230px; border: 1px solid rgba(255, 209, 102, .18); border-radius: 50%; content: ''; }
.page-header h1, .page-header p, .page-header .section-kicker { position: relative; z-index: 1; }
.page-header p { max-width: 700px; }
.filter-bar { position: sticky; top: calc(var(--nav-h) + 10px); z-index: 20; margin-top: 22px; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: rgba(8, 17, 31, .84); backdrop-filter: blur(16px); box-shadow: 0 14px 32px rgba(0, 0, 0, .16); }
.filter-btn { border-color: transparent; background: rgba(255, 255, 255, .055); }
.filter-btn:hover, .filter-btn.active { box-shadow: inset 0 0 0 1px rgba(255, 107, 53, .34); }
.movie-grid-wrap { padding-top: 8px; }
.movie-grid { gap: 22px; }
.movie-card { border-radius: 20px; box-shadow: 0 12px 32px rgba(0, 0, 0, .22); }
.movie-card-info { padding: 14px 15px 16px; }
.movie-card-title { font-size: 14px; }
.pagination { padding-top: 44px; }
.page-btn { background: rgba(21, 35, 56, .7); }
.empty-state { border-color: rgba(255, 209, 102, .18); }
.person-card { border-color: rgba(255, 209, 102, .14); }
.detail-main { padding-bottom: 12px; }
.detail-stats .stat-card, .provider-card { border-color: rgba(255, 255, 255, .11); }

/* CEAN chart */
.box-office-header { margin-bottom: 24px; }
.box-office-summary { position: relative; }
.box-office-stat { min-height: 122px; display: flex; flex-direction: column; justify-content: center; border-color: rgba(255, 209, 102, .16); }
.box-office-chart { gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 26px; background: rgba(10, 20, 34, .58); box-shadow: var(--shadow); }
.box-office-row { min-height: 86px; grid-template-columns: 38px 58px minmax(0, 1fr) max-content; padding: 12px 18px; border-color: rgba(255, 255, 255, .09); }
.box-office-row:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 0, 0, .18); }
.box-office-rank { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: rgba(255, 209, 102, .12); }
.box-office-poster { width: 58px; height: 76px; border-radius: 12px; }
.box-office-film-line strong { font-size: 16px; }
.box-office-gross { padding: 8px 11px; border-radius: 10px; background: rgba(255, 209, 102, .1); }
.box-office-note { padding: 14px 17px; border-left: 3px solid var(--accent); border-radius: 0 14px 14px 0; background: rgba(255, 255, 255, .035); }

/* Image-led homepage chart, deliberately placed near the footer. */
.box-office-home-section { padding-top: 56px; padding-bottom: 46px; }
.box-office-home-section .section-header { align-items: end; }
.box-office-home-row-wrap { padding-top: 4px; padding-bottom: 6px; }
.box-office-home-card { width: 198px; position: relative; overflow: hidden; }
.box-office-home-card .movie-card-poster { aspect-ratio: 2 / 2.72; }
.box-office-home-card .movie-card-poster::after { position: absolute; inset: auto 0 0; height: 46%; content: ''; background: linear-gradient(transparent, rgba(8, 17, 31, .74)); pointer-events: none; }
.box-office-home-card .movie-card-poster img { height: 100%; }
.box-office-home-card .box-office-home-rank { position: absolute; z-index: 2; top: 11px; left: 11px; width: 38px; height: 34px; display: grid; place-items: center; margin: 0; border: 1px solid rgba(255, 209, 102, .25); border-radius: 10px; background: rgba(8, 17, 31, .78); color: var(--accent-2); font-size: 13px; font-weight: 800; backdrop-filter: blur(8px); }
.box-office-new { position: absolute; z-index: 2; right: 10px; bottom: 11px; }
.box-office-home-gross { margin: 5px 0 3px; color: var(--accent-2); font-size: 13px; font-weight: 800; }
.box-office-home-card .movie-card-year { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .page-header { margin-top: 16px; }
  .filter-bar { position: static; }
}

@media (max-width: 640px) {
  .page-header { width: calc(100% - 32px); padding: 29px 22px; border-radius: 23px; }
  .movie-grid { gap: 14px; }
  .box-office-chart { width: calc(100% - 32px); padding: 10px; border-radius: 20px; }
  .box-office-row { grid-template-columns: 32px 46px minmax(0, 1fr); min-height: 76px; padding: 10px; }
  .box-office-poster { width: 46px; height: 60px; }
  .box-office-rank { width: 29px; height: 29px; font-size: 11px; }
  .box-office-film-line { gap: 6px; }
  .box-office-film-line strong { font-size: 13px; }
  .box-office-gross { padding: 0; background: transparent; }
  .box-office-home-card { width: 166px; }
  .box-office-home-section { padding-top: 44px; }
}

@media (max-width: 480px) {
  .hero {
    min-height: 600px;
  }

  .hero-content {
    padding-top: 136px;
    padding-bottom: 36px;
  }

  .hero-thumb-row {
    margin-top: 20px;
  }

  .detail-backdrop {
    height: 340px;
  }
}

@media (max-width: 380px) {
  .hero {
    min-height: 560px;
  }

  .hero-title {
    font-size: 1.9rem;
  }
}

.box-office-header { padding-bottom: 18px; }
.box-office-header .section-kicker { margin-bottom: 16px; }
.box-office-summary, .box-office-chart, .box-office-note { width: min(var(--max-w), calc(100% - 56px)); margin-left: auto; margin-right: auto; }
.box-office-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.box-office-stat { padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(255, 107, 53, .14), rgba(18, 31, 51, .88)); box-shadow: var(--shadow); }
.box-office-stat span { display: block; color: var(--text-sub); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.box-office-stat strong { display: block; margin-top: 7px; font-size: clamp(1.1rem, 2vw, 1.65rem); letter-spacing: -.04em; }
.box-office-chart { display: flex; flex-direction: column; gap: 10px; }
.box-office-row { display: grid; grid-template-columns: 28px 46px minmax(0, 1fr) max-content; gap: 14px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(14, 26, 44, .8); transition: transform var(--trans), border-color var(--trans), background var(--trans); }
.box-office-row:hover { transform: translateX(3px); border-color: rgba(255, 107, 53, .45); background: rgba(22, 37, 60, .94); }
.box-office-rank { color: var(--accent-2); font-size: 13px; font-weight: 800; text-align: center; }
.box-office-poster { width: 46px; height: 62px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.box-office-copy { min-width: 0; }
.box-office-film-line { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.box-office-film-line strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.box-office-film-line span, .box-office-copy p { color: var(--text-sub); font-size: 12px; }
.box-office-bar-track { height: 8px; margin: 9px 0 6px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.box-office-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.box-office-gross { color: var(--accent-2); font-size: 14px; white-space: nowrap; }
.box-office-note { margin-top: 14px; color: var(--text-dim); font-size: 12px; }
.new-entry { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; background: rgba(84, 211, 156, .16); color: #a6f1ce !important; font-size: 10px !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }

.box-office-home-section { padding-top: 48px; }
.box-office-home-section .section-header { align-items: flex-end; }
.box-office-home-section .section-kicker { margin-bottom: 10px; }
.box-office-home-list { width: min(var(--max-w), calc(100% - 56px)); margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.box-office-home-row { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(255, 107, 53, .13), rgba(14, 26, 44, .9)); transition: transform var(--trans), border-color var(--trans); }
.box-office-home-row:hover { transform: translateY(-4px); border-color: rgba(255, 107, 53, .45); }
.box-office-home-rank { display: block; margin-bottom: 15px; color: var(--accent-2); font-size: 13px; font-weight: 800; }
.box-office-home-copy { min-height: 76px; }
.box-office-home-copy strong { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.box-office-home-copy span { display: block; margin-top: 7px; overflow: hidden; color: var(--text-sub); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.box-office-home-row > strong { display: block; margin-top: 10px; color: var(--accent-2); font-size: 13px; }

@media (max-width: 640px) {
    .box-office-summary, .box-office-chart, .box-office-note { width: calc(100% - 32px); }
    .box-office-summary { grid-template-columns: 1fr; gap: 10px; }
    .box-office-row { grid-template-columns: 24px 40px minmax(0, 1fr); gap: 10px; padding: 10px; }
    .box-office-poster { width: 40px; height: 54px; }
    .box-office-gross { grid-column: 3; justify-self: end; margin-top: -4px; }
    .box-office-home-list { width: calc(100% - 32px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .box-office-home-section .section-header { align-items: flex-start; }
}
