/*
 * Motchill premium UI pass â€” additive layer over motchill-modern.css
 * Keeps existing layout/flow; refines surfaces, motion, controls, and dock nav.
 */

:root {
  --mtc-radius: 12px;
  --mtc-radius-sm: 8px;
  --mtc-ease: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  --mtc-ease-out: 0.22s ease-out;
  --mtc-card-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 32px rgba(0, 0, 0, 0.24);
  --mtc-thumb-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  --mtc-thumb-shadow-hover: 0 20px 42px rgba(0, 0, 0, 0.42);
}

body {
  font-weight: 500;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6,
.title,
.myui-block-title {
  letter-spacing: 0.02em;
}

/* â”€â”€ Surfaces & sections â”€â”€ */
.motchill-surface-card,
:is(.motchill-trending, .motchill-sidebar-list, .myui-panel-list, .detail-block, .myui-movie-detail, .video-p-first, #servers-container, .myui-panel-bg) {
  border-color: var(--mtc-border);
  box-shadow: var(--mtc-card-shadow);
}

.motchill-section-header,
.motchill-home-section__header,
:is(.motchill-trending, .motchill-sidebar-list) .myui-panel__head.active {
  border-bottom-color: rgba(var(--accent-hot-rgb), 0.28);
}

.motchill-home-section__title,
.motchill-recommended__title {
  font-weight: 500;
}

.motchill-home-section__header {
  padding-bottom: 22px;
}

.motchill-movie-card__thumb:not(.motchill-recommended__thumb):not(.motchill-home-section__thumb) {
  display: block;
  position: relative;
  padding-top: 142%;
  background-image: none !important;
}

.motchill-movie-card__thumb:not(.motchill-recommended__thumb)::before {
  content: none;
}

/* â”€â”€ Shared thumb clip (posters) â”€â”€ */
:is(.motchill-thumb-clip, .motchill-home-section__thumb-clip, .motchill-sidebar-list__thumb-clip) {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
  background-color: #050b10;
}

:is(.motchill-thumb-media, .motchill-home-section__thumb-media, .motchill-sidebar-list__thumb-media, .motchill-recommended__thumb-media) {
  position: absolute;
  inset: -12px;
  z-index: 1;
  background-color: #050b10;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.1);
  transform-origin: center center;
  backface-visibility: hidden;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

img.motchill-thumb-media {
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  object-fit: cover;
  background-image: none;
}

.motchill-movie-card__thumb:not(.motchill-recommended__thumb):not(.motchill-home-section__thumb),
.film-list .myui-vodlist__thumb,
.myui-vodlist__bd .myui-vodlist__thumb {
  border-radius: var(--mtc-radius);
  overflow: hidden;
  background-color: #050b10 !important;
  border: none !important;
  box-shadow: var(--mtc-thumb-shadow);
  transition: box-shadow var(--mtc-ease), transform var(--mtc-ease-out);
}

.motchill-card:hover .motchill-movie-card__thumb:not(.motchill-recommended__thumb),
.film-list .myui-vodlist__box:hover .myui-vodlist__thumb,
.myui-vodlist__bd .myui-vodlist__box:hover .myui-vodlist__thumb {
  box-shadow: var(--mtc-thumb-shadow-hover);
}

.motchill-home-section__box:hover :is(.motchill-thumb-media, .motchill-home-section__thumb-media),
.motchill-recommended__box:hover .motchill-recommended__thumb-media,
.motchill-card:hover :is(.motchill-thumb-media, .motchill-home-section__thumb-media) {
  transform: scale(1.2);
}

.motchill-sidebar-list__item:hover .motchill-sidebar-list__thumb-media {
  transform: scale(1.14);
}

.motchill-home-section__thumb,
.motchill-recommended__thumb {
  border-radius: var(--mtc-radius);
}

/* Detail poster (img-based) */
.detail-block .myui-content__thumb .picture {
  border: none !important;
  border-radius: var(--mtc-radius);
  overflow: hidden;
  box-shadow: var(--mtc-thumb-shadow);
  background: #050b10;
  transition: box-shadow var(--mtc-ease);
}

.detail-block .myui-content__thumb .picture img {
  display: block;
  width: 100%;
  border-radius: inherit;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.detail-block .myui-content__thumb .picture:hover {
  box-shadow: var(--mtc-thumb-shadow-hover);
}

.detail-block .myui-content__thumb .picture:hover img {
  transform: scale(1.06);
}

/* â”€â”€ Button system â”€â”€ */
.motchill-btn,
.myui-content__thumb .btn-watch,
.streaming-server,
.myui-content__list .btn,
.myui-content__operate .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    background-color var(--mtc-ease),
    border-color var(--mtc-ease),
    color var(--mtc-ease),
    transform var(--mtc-ease-out),
    box-shadow var(--mtc-ease);
}

.motchill-btn--primary,
.myui-content__thumb .btn-watch {
  min-height: 42px;
  border-color: rgba(var(--accent-hot-rgb), 0.45) !important;
  background: linear-gradient(180deg, rgba(var(--accent-hot-rgb), 0.95), rgba(168, 110, 74, 0.92)) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.motchill-btn--episode,
.myui-content__list .btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.motchill-btn:hover,
.streaming-server:hover,
.myui-content__list .btn:hover,
.myui-content__operate .btn:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-hot-rgb), 0.35) !important;
  background: rgba(var(--accent-hot-rgb), 0.14) !important;
  color: #fff !important;
}

.motchill-btn--primary:hover,
.myui-content__thumb .btn-watch:hover {
  background: linear-gradient(180deg, rgba(228, 165, 122, 0.98), rgba(178, 115, 78, 0.95)) !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
}

.motchill-btn.is-active,
.motchill-btn.active,
.streaming-server.active,
.myui-content__list .btn.active {
  border-color: rgba(var(--accent-hot-rgb), 0.55) !important;
  background: linear-gradient(180deg, rgba(var(--accent-hot-rgb), 0.32), rgba(148, 101, 75, 0.24)) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

/* Carousel prev/next */
.motchill-carousel__nav {
  transition: transform var(--mtc-ease-out), background-color var(--mtc-ease), border-color var(--mtc-ease), opacity var(--mtc-ease);
}

.motchill-carousel__nav:hover {
  transform: translateY(-50%) scale(1.04);
}

/* â”€â”€ Player toolbar (servers + actions) â”€â”€ */
.motchill-player-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--mtc-section-inner-gap);
  padding: 12px 14px;
  border: 1px solid var(--mtc-border);
  border-radius: var(--mtc-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(8, 12, 16, 0.92);
  box-shadow: var(--mtc-card-shadow);
}

.motchill-player-toolbar__label {
  margin: 0;
  color: rgba(var(--accent-hot-rgb), 0.92);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#ploption {
  margin: 0;
  justify-content: flex-start;
  gap: 8px;
}

#ploption .streaming-server {
  min-height: 34px;
  padding: 0 16px;
  font-size: 12px;
}

/* JW Player â€” minimal control bar */
.jwplayer.jw-state-playing .jw-controlbar,
.jwplayer .jw-controlbar {
  background: linear-gradient(180deg, transparent, rgba(5, 11, 16, 0.72) 38%, rgba(5, 11, 16, 0.94)) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0 10px 8px !important;
}

.jwplayer .jw-button-container .jw-icon {
  color: rgba(255, 255, 255, 0.88) !important;
  transition: color 0.18s ease, transform 0.18s ease;
}

.jwplayer .jw-button-container .jw-icon:hover {
  color: #fff !important;
  transform: scale(1.06);
}

.jwplayer .jw-slider-time .jw-rail,
.jwplayer .jw-progress-container .jw-rail {
  background: rgba(255, 255, 255, 0.14) !important;
}

.jwplayer .jw-slider-time .jw-buffer,
.jwplayer .jw-progress-container .jw-buffer {
  background: rgba(255, 255, 255, 0.22) !important;
}

.jwplayer .jw-slider-time .jw-progress,
.jwplayer .jw-progress-container .jw-progress {
  background: linear-gradient(90deg, var(--accent-hot), #b8734e) !important;
}

.jwplayer .jw-text-duration,
.jwplayer .jw-text-elapsed {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.jwplayer .jw-settings-menu {
  border-radius: 10px !important;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(10, 14, 18, 0.96) !important;
  backdrop-filter: blur(12px);
}

/* JW Player â€” watermark logo inset from player edge */
.jwplayer .jw-logo {
  margin: 20px !important;
}

@media (max-width: 767px) {
  .jwplayer .jw-logo,
  .jwplayer .jw-logo.jw-logo-top-right.jw-reset {
    margin: 10px 12px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 80px !important;
    max-width: 80px !important;
    height: 36px !important;
    min-height: 28px !important;
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }
}

/* Episode tabs */
#servers-container .nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: none;
}

#servers-container .nav-tabs > li {
  float: none;
  margin: 0;
}

#servers-container .nav-tabs > li > a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 12px;
  font-weight: 700;
  transition: background-color var(--mtc-ease), border-color var(--mtc-ease), color var(--mtc-ease);
}

#servers-container .nav-tabs > li.active > a,
#servers-container .nav-tabs > li > a:hover {
  border-color: rgba(var(--accent-hot-rgb), 0.42) !important;
  background: rgba(var(--accent-hot-rgb), 0.16) !important;
  color: #fff !important;
}

.motchill-episode-list {
  gap: 8px;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-hot-rgb), 0.38) transparent;
}

.motchill-episode-list::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.motchill-episode-list::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-hot-rgb), 0.38);
  border-radius: 999px;
}

/* â”€â”€ Dock navigation (mobile + desktop) â€” show after scroll past header â”€â”€ */
.motchill-bottom-nav {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(calc(100% + 24px));
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.32s;
}

.motchill-bottom-nav.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

body.dock-nav-visible {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

@media (min-width: 992px) {
  body.dock-nav-visible {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .motchill-bottom-nav {
    left: 50%;
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: min(720px, calc(100vw - 40px));
    padding: 6px 8px;
    border-radius: 18px;
    transform: translateX(-50%) translateY(calc(100% + 20px));
  }

  .motchill-bottom-nav.is-visible {
    transform: translateX(-50%) translateY(0);
  }

  .motchill-bottom-nav__item {
    height: 44px;
    flex-direction: row;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
  }

  .motchill-bottom-nav__item svg {
    width: 18px;
    height: 18px;
  }

  .motchill-bottom-nav__search {
    transform: none;
  }
}

@media (max-width: 767px) {
  body.dock-nav-visible {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .motchill-bottom-nav {
    left: 8px;
    right: 8px;
    width: auto;
    transform: translateY(calc(100% + 20px));
    border-radius: 18px;
  }

  .motchill-bottom-nav.is-visible {
    transform: translateY(0);
  }

  .motchill-bottom-nav__item {
    height: 52px;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
  }

  .motchill-bottom-nav__search {
    transform: translateY(-3px);
  }

  .motchill-bottom-nav.is-visible .motchill-bottom-nav__search {
    transform: translateY(-3px);
  }
}

/* Typography polish */
.myui-content__detail .title,
.myui-panel__head h1.title {
  font-weight: 500;
  line-height: 1.25;
}

.myui-content__detail .title2,
.myui-panel__head .title2 {
  font-weight: 500;
  line-height: 1.45;
}

.myui-vodlist__detail .title,
.motchill-movie-card__detail .title {
  font-weight: 600;
}

.myui-vodlist__detail .text,
.motchill-movie-card__detail .text {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.58);
}

.motchill-search-suggestion__body strong {
  font-weight: 400;
}

.motchill-search-suggestion__body small {
  font-weight: 500;
}

/* â”€â”€ Search overlay (header + tabbar) â”€â”€ */
body.search-open {
  overflow: hidden;
}

.motchill-search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1098;
  display: none;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
}

.motchill-search-backdrop.is-active {
  display: block;
}

.motchill-header-modern .myui-header__search.is-open,
body.search-open .myui-header__search.is-open {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.search-open .myui-header__search.is-open {
  position: fixed !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  bottom: auto !important;
  left: 12px !important;
  right: 12px !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  max-height: calc(100vh - 28px - env(safe-area-inset-top, 0px)) !important;
  z-index: 1100 !important;
  float: none !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  overflow: visible !important;
  grid-column: auto !important;
  border-top: 0 !important;
}

body.search-open .myui-header__search.is-open .container,
body.search-open .myui-header__search.is-open .row,
body.search-open .myui-header__search.is-open ul,
body.search-open .myui-header__search.is-open li.search-box,
body.search-open .myui-header__search.is-open .motchill-search-form {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.search-open .myui-header__search.is-open li.search-box {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  height: auto !important;
  min-height: 0 !important;
}

body.search-open .myui-header__search.is-open .motchill-search-form {
  position: relative !important;
  display: block !important;
  height: 44px !important;
  min-height: 44px !important;
}

body.search-open .myui-header__search.is-open .search_wd,
body.search-open .myui-header__search.is-open .form-control {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 12px 0 44px !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
}

body.search-open .myui-header__search.is-open .motchill-search-form .submit,
body.search-open .myui-header__search.is-open li.search-box .submit {
  left: 10px !important;
  right: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

body.search-open .myui-header__search.is-open .search-dropdown-hot,
body.search-open .myui-header__search.is-open .dropdown-box {
  position: relative !important;
  top: auto !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-top: 8px !important;
  padding-top: 0 !important;
  max-height: min(52vh, calc(100vh - 120px - env(safe-area-inset-top, 0px))) !important;
  overflow: hidden !important;
  transform: none !important;
  animation: none !important;
  -webkit-animation: none !important;
}

body.search-open .myui-header__search.is-open .dropdown-box.is-active,
body.search-open .myui-header__search.is-open .search-dropdown-hot.is-active {
  z-index: 1101;
  display: flex !important;
  flex-direction: column !important;
}

body.search-open .myui-header__search.is-open .motchill-search-trending,
body.search-open .myui-header__search.is-open .motchill-search-results,
body.search-open .myui-header__search.is-open .motchill-search-suggestions {
  min-height: 0;
  flex: 1 1 auto;
  max-height: min(52vh, calc(100vh - 120px - env(safe-area-inset-top, 0px)));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 992px) {
  body.search-open .myui-header__search.is-open {
    top: max(16px, env(safe-area-inset-top)) !important;
    left: 50% !important;
    right: auto !important;
    width: min(560px, calc(100vw - 40px)) !important;
    max-width: 560px !important;
    transform: translateX(-50%) !important;
  }
}

/* â”€â”€ Search modal (bottom nav + shared) â”€â”€ */
body.search-modal-open {
  overflow: hidden;
}

.motchill-search-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  pointer-events: none;
}

.motchill-search-modal.is-open {
  display: block;
  pointer-events: auto;
}

.motchill-search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.motchill-search-modal__panel {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  width: min(560px, calc(100vw - 24px));
  max-width: 560px;
  transform: translateX(-50%);
  z-index: 1;
}

.motchill-search-modal__box {
  position: relative;
  width: 100%;
}

.motchill-search-modal__form {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 48px;
}

.motchill-search-modal__input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(12, 16, 20, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-style: normal;
  -webkit-text-fill-color: #fff;
}

.motchill-search-modal__input::placeholder {
  color: rgba(255, 255, 255, 0.62);
  opacity: 1;
  font-weight: 500;
}

.motchill-search-modal__input:focus {
  outline: none;
  border-color: rgba(var(--accent-hot-rgb), 0.72);
  box-shadow: 0 0 0 4px rgba(var(--accent-hot-rgb), 0.1), 0 18px 36px rgba(0, 0, 0, 0.32);
}

.motchill-search-modal__close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.motchill-search-modal__submit {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent-hot);
  cursor: pointer;
  pointer-events: auto;
}

.motchill-search-modal__submit svg {
  width: 18px;
  height: 18px;
  opacity: 1;
  color: var(--accent-hot);
}

.motchill-search-modal__close svg {
  width: 16px;
  height: 16px;
}

.motchill-search-modal__close:hover {
  color: #fff;
  background: rgba(var(--accent-hot-rgb), 0.22);
}

.motchill-search-modal__box .motchill-search-modal__dropdown,
.motchill-search-modal__box .search-dropdown-hot {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 3;
  width: 100%;
  min-width: 0;
  max-width: none;
  max-height: min(620px, calc(100vh - 150px));
  margin: 0;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 8px;
  background: rgba(14, 18, 23, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transform: none;
}

/* â”€â”€ Search modal results scroll â”€â”€ */
.motchill-search-modal__box .motchill-search-results {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.motchill-search-modal__box .motchill-search-modal__dropdown.is-active,
.motchill-search-modal__box .search-dropdown-hot.is-active {
  display: flex;
}

.motchill-search-modal__box .motchill-search-modal__dropdown:empty,
.motchill-search-modal__box .search-dropdown-hot:empty {
  display: none !important;
}

.motchill-search-modal__box .motchill-search-suggestions {
  max-height: min(52vh, 420px);
}

@media (min-width: 992px) {
  .motchill-search-modal__panel {
    top: max(24px, env(safe-area-inset-top));
  }

  .motchill-search-modal__input {
    height: 52px;
    font-size: 16px;
  }

  .motchill-search-modal__form {
    height: 52px;
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Homepage premium v2 â€” compact cards, airy sections, clean UI
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
:root {
  --mtc-section-gap: 30px;
  --mtc-section-inner-gap: 11px;
  --mtc-card-gap: 11px;
  --mtc-card-padding: 13px;
  --mtc-home-grid-gap: 11px;
  --mtc-radius: 11px;
  --mtc-radius-sm: 7px;
}

/* â”€â”€ Header polish â”€â”€ */
.motchill-header-modern {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.motchill-header-modern .nav__content {
  border-top-color: rgba(255, 255, 255, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.motchill-header-modern .myui-header__search li.search-box .form-control {
  border-radius: 999px;
  font-style: normal;
  font-weight: 500;
}

.motchill-header-modern .myui-header__menu > li > a {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* â”€â”€ Recommended carousel â”€â”€ */
.motchill-recommended {
  margin-top: 18px;
  margin-bottom: 26px;
  gap: 14px;
  padding-left: 20px;
  padding-right: 20px;
}

.motchill-recommended__title {
  font-size: 21px;
  letter-spacing: 1px;
}

.motchill-recommended__title::before,
.motchill-home-section__title::before {
  width: 3px;
  height: 20px;
  top: 3px;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(212, 135, 78, 0.2);
}

.motchill-recommended-carousel {
  --carousel-gap: 11px;
  --carousel-slide-size: 162px;
  --carousel-nav-top: 40%;
}

.motchill-carousel__nav {
  width: 44px;
  height: 44px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(8, 12, 16, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.motchill-carousel__nav--prev {
  left: -22px;
}

.motchill-carousel__nav--next {
  right: -22px;
}

/* â”€â”€ Home layout spacing â”€â”€ */
.motchill-home-layout__main {
  gap: var(--mtc-section-gap);
}

.motchill-sidebar-stack {
  gap: var(--mtc-section-gap);
}

.motchill-home-section {
  gap: 14px;
}

.motchill-home-section__header {
  padding-bottom: 12px !important;
  border-bottom-color: rgba(var(--accent-hot-rgb), 0.22) !important;
}

@media (max-width: 767px) {
  .motchill-home-section {
    gap: 6px !important;
  }

  .motchill-home-section__header {
    padding-bottom: 6px !important;
  }
}

.motchill-home-section__title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.motchill-home-section__more {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px 10px 4px 12px;
  background: rgba(255, 255, 255, 0.03);
  flex: 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
}

.motchill-home-section__more:hover {
  color: var(--mtc-accent);
  border-color: rgba(var(--accent-hot-rgb), 0.28);
  background: rgba(var(--accent-hot-rgb), 0.08);
}

/* â”€â”€ Movie cards â€” compact 5-col grid â”€â”€ */
.motchill-home-section__list {
  gap: var(--mtc-home-grid-gap);
  display: flex !important;
  flex-wrap: wrap;
}

.motchill-home-section__cell {
  width: calc((100% - (var(--mtc-home-grid-gap) * 4)) / 5);
  float: none !important;
  flex: 0 0 auto;
  max-width: none !important;
}

.motchill-home-section__thumb,
.motchill-recommended__thumb {
  border-radius: var(--mtc-radius);
  padding-top: 148%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26) !important;
}

.motchill-home-section__box:hover .motchill-home-section__thumb,
.motchill-recommended__thumb:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.36) !important;
}

.motchill-movie-card__tag,
.motchill-recommended__tag {
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(135deg, var(--mtc-accent), var(--accent-hot-dark));
  border: 0;
  border-bottom: 1px solid #b8734e;
  box-shadow: 0 4px 10px rgba(var(--accent-hot-rgb), 0.28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.motchill-movie-card__detail,
.motchill-recommended__detail {
  padding: 0 9px 10px;
}

.motchill-movie-card__detail .title,
.motchill-recommended__detail .title {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.88);
}

.motchill-movie-card__detail .text,
.motchill-recommended__detail .text {
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.78;
}

.motchill-card-play__icon {
  width: 30px;
  height: 30px;
}

/* â”€â”€ Sidebar cards â”€â”€ */
.motchill-trending,
.motchill-sidebar-list {
  padding: var(--mtc-card-padding);
  border-radius: calc(var(--mtc-radius) + 2px);
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--accent-hot-rgb), 0.05), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008)),
    rgba(8, 12, 16, 0.92);
}

.motchill-trending .myui-panel__head.active,
.motchill-sidebar-list .myui-panel__head.active {
  padding: 0 4px 10px !important;
  border-bottom-color: rgba(var(--accent-hot-rgb), 0.22) !important;
}

.motchill-trending__title,
.motchill-sidebar-list__title {
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.motchill-trending__icon,
.motchill-sidebar-list__icon {
  width: 18px;
  height: 18px;
}

.motchill-trending__tabs {
  gap: 4px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.motchill-trending__tab,
.motchill-trending .tabs .tab,
.motchill-trending .most-view .tabs .tab {
  padding: 7px 0;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
}

.motchill-trending__list {
  gap: 6px;
  padding: 0 2px;
  margin-top: 6px;
}

.motchill-trending__item {
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
}

.motchill-trending__item:hover {
  border-color: rgba(var(--accent-hot-rgb), 0.16);
  background: rgba(var(--accent-hot-rgb), 0.08);
  transform: none;
}

.motchill-trending__rank,
.motchill-sidebar-list__rank {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.motchill-trending__rank.is-top-1,
.motchill-sidebar-list__rank.is-top-1 {
  color: #fff;
  background: linear-gradient(135deg, #e4a06e, #a8653f);
}

.motchill-trending__rank.is-top-2,
.motchill-sidebar-list__rank.is-top-2 {
  color: #fff;
  background: linear-gradient(135deg, #b8bcc6, #7a808a);
}

.motchill-trending__rank.is-top-3,
.motchill-sidebar-list__rank.is-top-3 {
  color: #fff;
  background: linear-gradient(135deg, #c9926a, #8f5a38);
}

.motchill-trending__thumb {
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  height: 48px;
  display: block;
  overflow: hidden;
  border-radius: 5px;
  background-color: #050b10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.motchill-trending__thumb-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background-color: #050b10;
}

.motchill-trending__thumb-media {
  position: absolute;
  inset: -6px;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.motchill-trending__item:hover .motchill-trending__thumb-media {
  transform: scale(1.16);
}

.motchill-trending__item a {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.motchill-trending__views {
  font-size: 11px;
  opacity: 0.68;
}

.motchill-sidebar-list__items {
  gap: 6px;
  padding: 0 2px;
}

.motchill-sidebar-list__item {
  gap: 8px;
  padding: 7px 8px !important;
  border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
}

.motchill-sidebar-list__item:hover {
  border-color: rgba(var(--accent-hot-rgb), 0.16);
  background: rgba(var(--accent-hot-rgb), 0.08);
  transform: none;
}

.motchill-sidebar-list__thumb {
  width: 44px;
  flex: 0 0 44px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.motchill-sidebar-list__detail .title a {
  font-size: 12px;
  font-weight: 600;
}

.motchill-sidebar-list__detail p {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.48);
  margin: 2px 0 0;
}

/* â”€â”€ Footer â€” lighter â”€â”€ */
.motchill-footer {
  margin-top: 28px;
  border-top-color: rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 40%), #070b0f;
}

.motchill-footer__main {
  padding: 28px 0 22px;
}

.motchill-footer__main .motchill-footer__container {
  gap: 32px;
}

.motchill-footer__logo-mark {
  width: 34px;
  height: 28px;
}

.motchill-footer__logo-text {
  font-size: 18px;
  letter-spacing: 1.5px;
}

.motchill-footer__desc {
  font-size: 12px;
  line-height: 1.55;
  max-width: 320px;
}

.motchill-footer__heading {
  font-size: 11px;
  margin-bottom: 10px;
  letter-spacing: 0.08em;
  opacity: 0.88;
}

.motchill-footer__column a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.52);
}

.motchill-footer__bottom {
  padding: 12px 0 0px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.12);
}

.motchill-footer__copyright,
.motchill-footer__tagline,
.motchill-footer__credit {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
}

.motchill-footer__tagline-icon {
  width: 14px;
  height: 12px;
  opacity: 0.5;
}

/* â”€â”€ Bottom nav floating pill â”€â”€ */
.motchill-bottom-nav {
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(var(--accent-hot-rgb), 0.12), transparent 45%),
    linear-gradient(180deg, rgba(16, 20, 25, 0.92), rgba(8, 11, 15, 0.94));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.motchill-bottom-nav__item {
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  border-radius: 14px;
  transition:
    color var(--mtc-ease),
    background-color var(--mtc-ease),
    transform var(--mtc-ease-out);
}

.motchill-bottom-nav__item svg {
  opacity: 1;
  color: currentColor;
}

.motchill-bottom-nav__item span {
  color: inherit;
}

.motchill-bottom-nav__item:hover,
.motchill-bottom-nav__item.active {
  color: #fff;
  background: rgba(var(--accent-hot-rgb), 0.14);
  border-color: rgba(var(--accent-hot-rgb), 0.22);
}

.motchill-bottom-nav__search {
  color: #fff;
}

.motchill-bottom-nav__search span,
.motchill-bottom-nav__search svg {
  color: #fff;
  opacity: 1;
}

@media (min-width: 1200px) {
  .motchill-recommended-carousel {
    --carousel-slide-size: 172px;
    --carousel-visible: 6;
  }
}

@media (max-width: 1199px) {
  .motchill-home-section__cell {
    width: calc((100% - (var(--mtc-home-grid-gap) * 4)) / 5);
  }

  .motchill-recommended-carousel {
    --carousel-slide-size: 156px;
    --carousel-visible: 5;
  }
}

@media (max-width: 991px) {
  .motchill-recommended-carousel {
    --carousel-slide-size: 140px;
    --carousel-visible: 4;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .motchill-home-section__cell {
    width: calc((100% - (var(--mtc-home-grid-gap) * 4)) / 5);
  }
}

@media (min-width: 992px) and (max-width: 1439px) {
  .motchill-home-section__cell {
    width: calc((100% - (var(--mtc-home-grid-gap) * 3)) / 4);
  }
}

@media (max-width: 767px) {
  :root {
    --mtc-section-gap: 22px;
    --mtc-home-grid-gap: 6px;
  }

  .motchill-recommended__title,
  .motchill-home-section__title {
    font-size: 16px;
  }

  .motchill-home-section__cell {
    width: calc((100% - (var(--mtc-home-grid-gap) * 2)) / 3);
  }

  .motchill-recommended-carousel {
    --carousel-slide-size: 112px;
    --carousel-visible: 3.08;
  }

  .motchill-trending__thumb {
    flex: 0 0 32px;
    width: 32px;
    height: 44px;
  }
}