/* ==========================================================================
   Chaqmoq Studios (fandub.uz) — Global Mobil Moslashuv va Displey Barqarorligi
   (Masshtablash, kutilmagan zoom in/out va vizual sakrashlarni 100% bartaraf etish)
   ========================================================================== */

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior-x: none;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.wrap, main, section, header, footer,
.hero, .room, .player, .screen, .film,
.grid, .dubs, .prem-grid, .sched, .opts,
.team, .voice-grid, .cards, .rc-grid, .cast, .crew, .more {
  max-width: 100%;
  min-width: 0;
}

img, svg, video, canvas, iframe {
  max-width: 100%;
}

/* Mobil qurilmalarda tugmalarni tez-tez bosganda (masalan, chat reaksiyalari)
   ikki marta bosish (double-tap zoom) hodisasini butunlay bloklash */
a, button, .btn, .chip, .sub-chip, .ep-btn, .emos button, input, select, textarea, label, summary {
  touch-action: manipulation;
}

/* Smartfonlarda (< 768px) input/select/textarea bosilganda iOS Safari va Android Chrome
   avtomatik yaqinlashtirib (zoom-in qilib) yubormasligi uchun shrift kamida 16px bo'lishi shart */
@media (max-width: 768px) {
  input,
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="url"],
  input[type="number"],
  input[type="password"],
  input[type="datetime-local"],
  select,
  textarea {
    font-size: 16px !important;
  }

  .wrap {
    padding-left: 14px !important;
    padding-right: 14px !important;
    width: 100% !important;
  }

  /* Header va Navigatsiya barqarorligi */
  header {
    flex-wrap: wrap !important;
    gap: 10px 12px !important;
    padding: 12px 0 !important;
  }

  nav {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px 12px !important;
    font-size: 14px !important;
    overflow-x: visible !important;
  }

  nav a {
    white-space: nowrap;
  }

  nav a.btn,
  header #login {
    margin-left: auto;
    padding: 8px 14px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }

  /* Bosh sahifa Hero va Premyera Chiptasi (Ticket) */
  .hero {
    gap: 22px !important;
    padding: 16px 0 32px !important;
  }

  .hero h1, .top h1, .info h1 {
    font-size: clamp(26px, 7.5vw, 38px) !important;
    line-height: 1.12 !important;
    word-break: break-word;
  }

  .hero p, .top p {
    font-size: 15px !important;
    margin: 10px 0 18px !important;
  }

  .ticket {
    transform: none !important;
    animation: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px 16px !important;
    margin: 0 !important;
    border-radius: 18px !important;
  }

  .ticket::before,
  .ticket::after {
    display: none !important;
  }

  .ticket .row {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .ticket h2 {
    font-size: clamp(20px, 5.8vw, 26px) !important;
    margin: 4px 0 12px !important;
    word-break: break-word;
  }

  .ticket .count,
  .cd {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .ticket .count div,
  .cd div {
    min-width: 0 !important;
    width: 100% !important;
    padding: 8px 4px !important;
    text-align: center !important;
  }

  .ticket .count b,
  .cd b {
    font-size: clamp(18px, 5.2vw, 26px) !important;
  }

  .ticket .stub {
    border-left: 0 !important;
    border-top: 2px dashed rgba(42, 27, 0, 0.35) !important;
    padding: 12px 0 0 !important;
    margin-top: 4px !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .ticket .stub b {
    font-size: 20px !important;
  }

  /* Katalog va Bosh sahifa kartochkalari (2 ustunli barqaror setka) */
  .grid,
  .dubs,
  .more {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px 10px !important;
  }

  .dub,
  .more a {
    min-width: 0 !important;
    padding: 8px !important;
    border-radius: 14px !important;
  }

  .dub h3,
  .more a h3 {
    font-size: 14px !important;
    line-height: 1.25 !important;
    word-break: break-word;
  }

  .dub-meta-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  .dub-cat-label {
    font-size: 11px !important;
  }

  .cat-ad-badge {
    font-size: 10px !important;
    padding: 2px 7px !important;
    max-width: 100%;
    white-space: normal;
  }

  /* Premyera xonasi va Video pleyer mobil barqarorligi */
  .room {
    padding: 18px 14px !important;
    gap: 20px !important;
    border-radius: 18px !important;
  }

  .player:not(.full):not(.pfs) .screen {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    min-height: 200px !important;
    border-radius: 14px !important;
  }

  .player.full .screen,
  .player.pfs .screen {
    flex: 1 !important;
    width: 100vw !important;
    height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
  }

  .bar {
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }

  .bar input {
    min-width: 0 !important;
    padding: 10px 14px !important;
  }

  .bar .btn {
    padding: 10px 14px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .emos {
    gap: 6px !important;
    justify-content: flex-start !important;
  }

  .emos button {
    width: 44px !important;
    height: 40px !important;
    font-size: 20px !important;
  }

  .player-meta-bar,
  .room-credits-box,
  .prem-section {
    padding: 12px 14px !important;
    border-radius: 14px !important;
  }

  .rc-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .prem-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 12px !important;
  }

  .next,
  .show {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 14px 16px !important;
  }

  .next .btn,
  .show .btn {
    width: 100% !important;
    text-align: center !important;
  }

  /* Dublyaj sahifasi (dublyaj.html) */
  .film .poster {
    max-width: 220px !important;
    margin: 0 auto !important;
  }

  .cta {
    gap: 8px !important;
  }

  .cta .btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  section {
    padding: 28px 0 !important;
  }
}

@media (max-width: 400px) {
  .prem-grid {
    grid-template-columns: 1fr !important;
  }
  .team {
    grid-template-columns: 1fr !important;
  }
}

/* === YAKUNIY MOBIL + DESKTOP BARQARORLIK POLIROVKASI === */
@media (max-width: 768px) {
  header nav {
    gap: 6px 8px !important;
  }
  header nav a:not(.btn) {
    padding: 6px 11px !important;
    font-size: 12.5px !important;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }
  .btn, button.btn, a.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn.sm {
    min-height: 34px;
  }
  #partner-screen, #screen {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
  }
}
@media (max-width: 420px) {
  .wrap {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .grid, .dubs {
    gap: 10px 8px !important;
  }
  .emos button {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
  }
}
