/*
 * FilmKio-like skin for Video.js on /play.
 * Black bars around the picture: usually letterbox/pillarbox (video aspect != frame) — same as native <video> with object-fit: contain.
 * Extra black bands from layout: fixed by full-bleed frame + overlay head (no separate topbar).
 * Subtitles: style .vjs-text-track-cue only — not every div under .vjs-text-track-display (that caused a full-player black overlay).
 */
body.play_online {
  background: #000;
  font-family: "iranyekan", "YekanBakh", system-ui, sans-serif;
}

.tamasha-videojs-shell {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  background: #000;
  color: #fff;
  font-family: "iranyekan", "YekanBakh", system-ui, sans-serif;
}

.tamasha-player-stage {
  background: #000;
}

.tamasha-player-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

/* Overlay header — mirrors FilmKio .head_controller */
.tamasha-player-head {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  pointer-events: none;
}

.tamasha-player-head-inner {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px 0 0;
  pointer-events: auto;
}

.tamasha-player-back {
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  color: #fff;
  text-decoration: none;
}

.tamasha-player-back-icon {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}

.tamasha-player-title {
  flex: 1;
  min-width: 0;
  margin-top: 5px;
  padding: 0 12px 0 80px;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tamasha-filmkio-skin .video-js {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  font-family: "iranyekan", "YekanBakh", system-ui, sans-serif;
}

.tamasha-filmkio-skin .video-js .vjs-tech {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Big play area — soft vignette like FilmKio .main_play_button_holder */
.tamasha-filmkio-skin .vjs-big-play-button {
  z-index: 12;
  border: 0;
  border-radius: 50%;
  width: 88px;
  height: 88px;
  line-height: 88px;
  margin-top: -44px;
  margin-left: -44px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.tamasha-filmkio-skin .vjs-big-play-button .vjs-icon-placeholder::before {
  font-size: 2.8em;
}

/* Foot bar — FilmKio .foot_controller spacing */
/* Default Video.js bar hidden — custom FilmKio-like foot replaces it */
.tamasha-filmkio-skin .vjs-control-bar {
  display: none !important;
}

.tamasha-fk-symbols-hidden {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.tamasha-fk-foot {
  /* Isolate from page RTL so flex order matches FilmKio (LTR control strip). */
  direction: ltr;
  unicode-bidi: isolate;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 24;
  padding: 6px 10px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.78) 40%, rgba(0, 0, 0, 0.92) 100%);
  pointer-events: auto;
  box-sizing: border-box;
}

.tamasha-fk-time_row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.tamasha-fk-progress_wrap {
  position: relative;
  flex: 1;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.tamasha-fk-progress_wrap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 5px;
  background: hsla(0, 0%, 100%, 0.22);
}

.tamasha-fk-buffer {
  position: absolute;
  left: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 5px;
  background: rgba(233, 131, 8, 0.38);
  width: 0%;
  pointer-events: none;
  z-index: 1;
}

.tamasha-fk-played {
  position: absolute;
  left: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 5px;
  background: #d79608;
  width: 0%;
  pointer-events: none;
  z-index: 2;
}

.tamasha-fk-scrub {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #f5ad11;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  left: 0%;
  z-index: 3;
  pointer-events: none;
}

.tamasha-fk-hover_time {
  position: absolute;
  bottom: 100%;
  margin-bottom: 6px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(11, 14, 15, 0.92);
  color: #fff;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 4;
}

.tamasha-fk-button_bar {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  min-height: 70px;
}

.tamasha-fk-left_btns,
.tamasha-fk-right_btns {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
}

.tamasha-fk-spacer {
  flex: 1;
  min-width: 8px;
}

.tamasha-fk-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  overflow: visible;
}

.tamasha-fk-btn:hover {
  background: hsla(0, 0%, 100%, 0.06);
}

.tamasha-fk-icon {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.tamasha-fk-settings .tamasha-fk-icon {
  width: 32px;
  height: 32px;
}

.tamasha-fk-hover_panel {
  position: absolute;
  bottom: calc(100% - 6px);
  right: 0;
  left: auto;
  transform: none;
  min-width: 0;
  width: max-content;
  max-width: min(300px, calc(100vw - 20px));
  max-height: min(55vh, calc(100dvh - 120px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 12px;
  border-radius: 8px;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  background: rgba(11, 14, 15, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 40;
  box-sizing: border-box;
  word-wrap: break-word;
}

.tamasha-fk-hover_panel.is-open {
  display: block;
}

.tamasha-fk-settings_panel,
.tamasha-fk-subs_panel {
  direction: rtl;
  text-align: right;
}

.tamasha-fk-vol_panel {
  bottom: 72px;
  min-width: 56px;
  padding: 14px 10px 18px;
}

.tamasha-fk-vol_track {
  position: relative;
  width: 8px;
  height: 120px;
  margin: 0 auto;
  border-radius: 6px;
  background: hsla(0, 0%, 100%, 0.18);
  cursor: pointer;
}

.tamasha-fk-vol_fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70%;
  border-radius: 6px;
  background: linear-gradient(180deg, #f5ad11, #d79608);
  pointer-events: none;
}

.tamasha-fk-vol_knob {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.tamasha-fk-panel_row {
  margin-top: 10px;
}

.tamasha-fk-panel_row:first-child {
  margin-top: 0;
}

.tamasha-fk-panel_title {
  font-size: 0.95rem;
  font-weight: 600;
  color: hsla(0, 0%, 100%, 0.88);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.08);
}

.tamasha-fk-panel_opts {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.tamasha-fk-panel_opts--wrap {
  justify-content: flex-start;
}

.tamasha-fk-opt {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid hsla(0, 0%, 100%, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.tamasha-fk-opt.is-active,
.tamasha-fk-opt:hover {
  border-color: rgba(245, 173, 17, 0.45);
  color: #f5ad11;
  background: rgba(245, 173, 17, 0.1);
}

.tamasha-fk-quality_host {
  position: relative;
  display: flex;
  align-items: center;
}

.tamasha-fk-quality_wrap {
  position: relative;
}

.tamasha-fk-quality_trigger {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.tamasha-fk-quality_wrap.is-open .tamasha-fk-quality_trigger {
  border-color: hsla(0, 0%, 100%, 0.35);
}

.tamasha-fk-quality_label {
  opacity: 0.85;
  font-size: 0.9rem;
  font-weight: 500;
}

.tamasha-fk-quality_value {
  color: #f5ad11;
  font-size: 1.05rem;
}

.tamasha-fk-quality_dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 150px;
  max-width: min(300px, calc(100vw - 20px));
  max-height: 55vh;
  overflow-y: auto;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: 6px;
  background: rgba(11, 14, 15, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.tamasha-fk-quality_dropdown[hidden] {
  display: none !important;
}

.tamasha-fk-quality_item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border: 0;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.06);
  background: transparent;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.tamasha-fk-quality_item:last-child {
  border-bottom: 0;
}

.tamasha-fk-quality_item.is-active,
.tamasha-fk-quality_item:hover {
  background: rgba(245, 173, 17, 0.12);
  color: #f5ad11;
}

.tamasha-filmkio-skin .vjs-progress-holder {
  height: 5px;
  border-radius: 5px;
  margin: 0;
}

.tamasha-filmkio-skin .vjs-play-progress {
  background-color: #d79608;
  border-radius: 5px;
}

.tamasha-filmkio-skin .vjs-load-progress div {
  background: rgba(233, 131, 8, 0.45);
  border-radius: 5px;
}

.tamasha-filmkio-skin .vjs-slider {
  background-color: hsla(0, 0%, 100%, 0.2);
  border-radius: 5px;
}

.tamasha-filmkio-skin .vjs-time-control {
  font-size: 1.05rem;
  font-weight: 600;
  padding-left: 0.6em;
  padding-right: 0.6em;
}

.tamasha-filmkio-skin .vjs-button > .vjs-icon-placeholder::before {
  font-size: 1.85em;
  line-height: 1.65;
}

/* Do not style every div under .vjs-text-track-display — wrappers are full-size and would paint the whole player black. */
.tamasha-filmkio-skin .vjs-text-track-display {
  background: transparent !important;
}

.tamasha-filmkio-skin .vjs-text-track-cue {
  font-size: var(--tamasha-subtitle-size, 28.96px) !important;
  color: var(--tamasha-subtitle-color, #fff) !important;
  background: var(--tamasha-subtitle-bg, rgba(0, 0, 0, 0.5)) !important;
  font-family: "iranyekan", "YekanBakh", system-ui, sans-serif !important;
  line-height: 1.5 !important;
}

.tamasha-filmkio-skin .vjs-text-track-cue > div {
  background: transparent !important;
  color: inherit !important;
  font-size: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
}

/* Scrollable season sections and episode grid. */
.tamasha-series-nav {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 38px;
  padding: 24px 28px 64px;
  background: #050505;
  overflow-y: auto;
  pointer-events: auto;
}

.tamasha-series-nav[hidden] {
  display: none;
}

.tamasha-fk-btn.tamasha-fk-episodes.is-active {
  background: hsla(0, 0%, 100%, 0.1);
}

.tamasha-ep_head {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.tamasha-filmkio-skin .video-js .tamasha-ep_close {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 48px;
  border: 1px solid #c8ae7b;
  border-radius: 10px;
  background: #151823;
  color: #dfc28c;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  padding: 8px 20px;
}

.tamasha-ep_section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tamasha-ep_section + .tamasha-ep_section {
  margin-top: 30px;
}

.tamasha-ep_season_title {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
  color: #f5f5f5;
  font-size: clamp(20px, 3vw, 27px);
  font-weight: 700;
  line-height: 1.5;
}

.tamasha-ep_season_title::after {
  content: "";
  flex: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.tamasha-ep_grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.tamasha-filmkio-skin .video-js .tamasha-ep_btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 58px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #151823;
  color: #fff;
  font-family: inherit;
  font-size: clamp(15px, 2.6vw, 19px);
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

.tamasha-filmkio-skin .video-js .tamasha-ep_btn:hover {
  background: #252a38;
}

.tamasha-filmkio-skin .video-js .tamasha-ep_btn.is-active {
  background: #e5c17a;
  border-color: #e5c17a;
  color: #25221b;
}

@media screen and (max-width: 600px) {
  .tamasha-series-nav {
    padding: 16px 14px 48px;
    gap: 32px;
  }

  .tamasha-ep_section {
    gap: 24px;
  }

  .tamasha-ep_grid {
    gap: 12px 9px;
  }

  .tamasha-filmkio-skin .video-js .tamasha-ep_btn {
    min-height: 52px;
    font-size: 15px;
  }
}

@media screen and (max-width: 320px) {
  .tamasha-ep_grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/*
 * Mobile / narrow: FilmKio shrinks controls so quality/CC/settings/fullscreen stay in view.
 * Without this, fixed 70px buttons + quality chip overflow and get clipped by overflow:hidden.
 */
@media screen and (max-width: 1024px) {
  .tamasha-fk-button_bar {
    min-height: 50px;
  }

  .tamasha-fk-btn {
    width: 50px;
    height: 50px;
  }

  .tamasha-fk-icon {
    width: 28px;
    height: 28px;
  }

  .tamasha-fk-settings .tamasha-fk-icon {
    width: 24px;
    height: 24px;
  }

  .tamasha-fk-volume {
    display: none;
  }

  .tamasha-fk-quality_trigger {
    min-width: 0;
    min-height: 40px;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.9rem;
  }

  .tamasha-fk-vol_panel {
    bottom: 52px;
  }
}

@media screen and (max-width: 600px) {
  .tamasha-fk-foot {
    padding: 4px 6px 8px;
  }

  .tamasha-fk-button_bar {
    min-height: 40px;
    gap: 0;
  }

  .tamasha-fk-left_btns,
  .tamasha-fk-right_btns {
    gap: 0;
  }

  .tamasha-fk-spacer {
    min-width: 0;
    flex: 1 1 0;
  }

  .tamasha-fk-btn {
    width: 36px;
    height: 36px;
  }

  .tamasha-fk-icon {
    width: 22px;
    height: 22px;
  }

  .tamasha-fk-settings .tamasha-fk-icon {
    width: 20px;
    height: 20px;
  }

  .tamasha-fk-quality_label {
    display: none;
  }

  .tamasha-fk-quality_trigger {
    min-height: 28px;
    padding: 2px 8px;
    border-radius: 8px;
  }

  .tamasha-fk-quality_value {
    font-size: 0.85rem;
  }

  .tamasha-fk-time_row {
    font-size: 0.85rem;
    gap: 6px;
    margin-bottom: 2px;
  }

  .tamasha-fk-hover_panel {
    max-width: min(280px, calc(100vw - 12px));
  }

  .tamasha-fk-settings_panel,
  .tamasha-fk-subs_panel {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media screen and (max-width: 380px) {
  .tamasha-fk-btn {
    width: 42px;
    height: 42px;
  }

  .tamasha-fk-icon {
    width: 19px;
    height: 19px;
  }

  .tamasha-fk-settings .tamasha-fk-icon {
    width: 17px;
    height: 17px;
  }

  .tamasha-player-title {
    font-size: 0.95rem;
  }
}

/* ------------------------------------------------------------------ */
/* Mobile polish — portrait & landscape: attractive, clean, touchable  */
/* ------------------------------------------------------------------ */

@media screen and (max-width: 768px) {
  /* Head: compact bar with a soft top gradient for legibility */
  .tamasha-player-head {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    padding-top: env(safe-area-inset-top, 0px);
  }

  .tamasha-player-head-inner {
    padding: 0 4px 0 0;
  }

  .tamasha-player-back {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    transition: background 0.2s ease;
  }

  .tamasha-player-back:active {
    background: rgba(255, 255, 255, 0.14);
  }

  .tamasha-player-back-icon {
    width: 24px;
    height: 24px;
  }

  .tamasha-player-title {
    font-size: 1.05rem;
    margin-top: 10px;
    padding: 0 10px 0 52px;
  }

  /* Big play: glassy disc */
  .tamasha-filmkio-skin .vjs-big-play-button {
    width: 72px;
    height: 72px;
    line-height: 72px;
    margin-top: -36px;
    margin-left: -36px;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .tamasha-filmkio-skin .vjs-big-play-button .vjs-icon-placeholder::before {
    font-size: 2.2em;
  }

  /* Foot: glassy bar honoring the home-indicator safe area */
  .tamasha-fk-foot {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.62) 34%, rgba(0, 0, 0, 0.86) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .tamasha-fk-time_row {
    font-size: 0.82rem;
    gap: 10px;
    margin-bottom: 4px;
    padding: 0 2px;
  }

  .tamasha-fk-remaining {
    opacity: 0.95;
  }

  .tamasha-fk-total {
    opacity: 0.6;
  }

  /* Progress: thicker track, glowing knob */
  .tamasha-fk-progress_wrap {
    height: 26px;
  }

  .tamasha-fk-progress_wrap::before,
  .tamasha-fk-buffer,
  .tamasha-fk-played {
    height: 4px;
    margin-top: -2px;
  }

  .tamasha-fk-played {
    background: #f5ad11;
  }

  .tamasha-fk-scrub {
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    box-shadow: 0 0 0 4px rgba(245, 173, 17, 0.22), 0 2px 8px rgba(0, 0, 0, 0.5);
  }

  /* Buttons: comfortable 46px touch targets with feedback */
  .tamasha-fk-button_bar {
    min-height: 0;
  }

  .tamasha-fk-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .tamasha-fk-btn:active {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(0.94);
  }

  .tamasha-fk-icon {
    width: 21px;
    height: 21px;
  }

  .tamasha-fk-settings .tamasha-fk-icon {
    width: 19px;
    height: 19px;
  }

  .tamasha-fk-hover_panel {
    max-width: min(300px, calc(100vw - 20px));
  }
}

/* Landscape phones: short viewport — compact single-row feel */
@media screen and (max-height: 500px) {
  .tamasha-player-head {
    padding-top: env(safe-area-inset-top, 0px);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
  }

  .tamasha-player-head-inner {
    padding: 0 4px 0 0;
  }

  .tamasha-player-back {
    width: 40px;
    height: 40px;
  }

  .tamasha-player-back-icon {
    width: 20px;
    height: 20px;
  }

  .tamasha-player-title {
    font-size: 0.95rem;
    margin-top: 6px;
    padding: 0 8px 0 44px;
  }

  .tamasha-filmkio-skin .vjs-big-play-button {
    width: 60px;
    height: 60px;
    line-height: 60px;
    margin-top: -30px;
    margin-left: -30px;
  }

  .tamasha-filmkio-skin .vjs-big-play-button .vjs-icon-placeholder::before {
    font-size: 1.9em;
  }

  .tamasha-fk-foot {
    padding: 4px 14px calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .tamasha-fk-time_row {
    font-size: 0.76rem;
    gap: 10px;
    margin-bottom: 2px;
  }

  .tamasha-fk-progress_wrap {
    height: 20px;
  }

  .tamasha-fk-progress_wrap::before,
  .tamasha-fk-buffer,
  .tamasha-fk-played {
    height: 3px;
    margin-top: -1.5px;
  }

  .tamasha-fk-scrub {
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
  }

  .tamasha-fk-button_bar {
    min-height: 0;
  }

  .tamasha-fk-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .tamasha-fk-icon {
    width: 18px;
    height: 18px;
  }

  .tamasha-fk-settings .tamasha-fk-icon {
    width: 16px;
    height: 16px;
  }
}

/* ------------------------------------------------------------------ */
/* Poster fills the whole stage edge-to-edge before playback starts,  */
/* like a backdrop behind the big play button — never letterboxed.    */
/* Force-hide once playback started or on error.                      */
/* ------------------------------------------------------------------ */
.tamasha-filmkio-skin .vjs-poster {
  background-color: #000;
}

.tamasha-filmkio-skin .vjs-poster img {
  object-fit: cover;
}

.tamasha-filmkio-skin.is-playing .vjs-poster,
.tamasha-filmkio-skin.has-error .vjs-poster {
  display: none !important;
}

/* Chrome auto-hide — head + foot fade away during playback and come
 * back on mouse move or a tap on the video surface. */
.tamasha-player-head,
.tamasha-fk-foot {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.tamasha-filmkio-skin.chrome-hidden {
  cursor: none;
}

.tamasha-filmkio-skin.chrome-hidden .tamasha-player-head {
  opacity: 0;
  transform: translateY(-100%);
}

.tamasha-filmkio-skin.chrome-hidden .tamasha-player-head-inner {
  pointer-events: none;
}

.tamasha-filmkio-skin.chrome-hidden .tamasha-fk-foot {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

/* Playback error overlay with retry — shown instead of a stuck poster. */
.tamasha-fk-error_overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
}

.tamasha-fk-error_overlay[hidden] {
  display: none;
}

.tamasha-fk-error_box {
  text-align: center;
  padding: 28px 36px;
  border-radius: 16px;
  background: rgba(20, 24, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.tamasha-fk-error_title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.tamasha-fk-error_text {
  font-size: 1.1rem;
  opacity: 0.75;
  margin-bottom: 18px;
}

.tamasha-fk-error_retry {
  border: 0;
  border-radius: 10px;
  padding: 10px 26px;
  font: inherit;
  font-weight: 700;
  background: #f5ad11;
  color: #0b0e0f;
  cursor: pointer;
}

.tamasha-fk-error_retry:hover {
  filter: brightness(1.1);
}

/* ------------------------------------------------------------------ */
/* Phones: settings & subtitle panels open as a bottom sheet spanning   */
/* the control bar, instead of hanging off their (edge-placed) button.  */
/* ------------------------------------------------------------------ */
@media screen and (max-width: 768px), screen and (max-height: 500px) {
  .tamasha-fk-btn.tamasha-fk-settings,
  .tamasha-fk-btn.tamasha-fk-subtitles {
    position: static;
  }

  /* A transform would re-anchor the sheet to the button while pressed. */
  .tamasha-fk-btn.tamasha-fk-settings:active,
  .tamasha-fk-btn.tamasha-fk-subtitles:active {
    transform: none;
  }

  .tamasha-fk-settings_panel,
  .tamasha-fk-subs_panel {
    left: 8px;
    right: 8px;
    bottom: calc(100% + 4px);
    width: auto;
    max-width: none;
    max-height: min(62vh, calc(100dvh - 150px));
    transform: none;
    padding: 12px 14px 14px;
    border-radius: 14px;
    background: rgba(11, 14, 15, 0.985);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    cursor: default;
  }

  .tamasha-fk-settings_panel .tamasha-fk-panel_opts,
  .tamasha-fk-subs_panel .tamasha-fk-panel_opts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 6px;
  }

  .tamasha-fk-settings_panel .tamasha-fk-opt,
  .tamasha-fk-subs_panel .tamasha-fk-opt {
    min-height: 40px;
    padding: 6px 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tamasha-fk-panel_title {
    font-size: 0.88rem;
    margin-bottom: 6px;
  }
}

@media screen and (max-height: 500px) {
  .tamasha-fk-settings_panel,
  .tamasha-fk-subs_panel {
    max-height: calc(100dvh - 90px);
  }
}

/* ------------------------------------------------------------------ */
/* Phones: fullscreen must always fit. The volume button is useless on */
/* touch devices (hardware keys) — and video.js' `.video-js button`     */
/* rule out-ranked the old hide rule, pushing fullscreen off-screen.    */
/* ------------------------------------------------------------------ */
@media screen and (max-width: 1024px), (hover: none) and (pointer: coarse) {
  .tamasha-filmkio-skin .tamasha-fk-btn.tamasha-fk-volume {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .tamasha-filmkio-skin .tamasha-fk-button_bar {
    flex-wrap: nowrap;
  }

  .tamasha-filmkio-skin .tamasha-fk-left_btns,
  .tamasha-filmkio-skin .tamasha-fk-right_btns {
    flex-shrink: 0;
  }

  .tamasha-filmkio-skin .tamasha-fk-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .tamasha-filmkio-skin .tamasha-fk-btn.tamasha-fk-fullscreen .tamasha-fk-icon {
    width: 22px;
    height: 22px;
  }
}

@media screen and (max-width: 360px) {
  .tamasha-filmkio-skin .tamasha-fk-btn {
    width: 39px;
    height: 42px;
  }

  .tamasha-filmkio-skin .tamasha-fk-foot {
    padding-left: 6px;
    padding-right: 6px;
  }
}

/* ================================================================== */
/* Phone layout (.tamasha-mobile-ui, set by videojs-boot.js):          */
/* tools top-right · big ±10 in the centre · one rounded bottom pill   */
/* ================================================================== */
.tamasha-mobile-ui .tamasha-fk-foot {
  padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.tamasha-mobile-ui .tamasha-fk-time_row,
.tamasha-mobile-ui .tamasha-fk-button_bar {
  display: none;
}

.tamasha-fk-pill {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  background: rgba(24, 26, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.tamasha-fk-pill .tamasha-fk-btn,
.tamasha-mobile-ui .tamasha-fk-top_tools .tamasha-fk-btn {
  display: flex;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
}

.tamasha-fk-pill .tamasha-fk-btn .tamasha-fk-icon {
  width: 20px;
  height: 20px;
}

.tamasha-fk-pill .tamasha-fk-play_toggle .tamasha-fk-icon {
  width: 22px;
  height: 22px;
}

/* Every pill control stays — volume included (tap = mute, slider above). */
.tamasha-filmkio-skin.tamasha-mobile-ui .tamasha-fk-pill .tamasha-fk-btn.tamasha-fk-volume {
  display: flex;
}

.tamasha-fk-pill .tamasha-fk-btn[hidden] {
  display: none !important;
}

.tamasha-fk-pill .tamasha-fk-remaining,
.tamasha-fk-pill .tamasha-fk-total {
  flex-shrink: 0;
  min-width: 40px;
  color: #fff;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.tamasha-fk-pill .tamasha-fk-total {
  opacity: 0.7;
}

.tamasha-fk-pill .tamasha-fk-progress_wrap {
  flex: 1 1 auto;
  min-width: 50px;
  height: 30px;
  touch-action: none;
}

.tamasha-fk-pill .tamasha-fk-progress_wrap::before,
.tamasha-fk-pill .tamasha-fk-buffer,
.tamasha-fk-pill .tamasha-fk-played {
  height: 4px;
  margin-top: -2px;
}

.tamasha-fk-pill .tamasha-fk-scrub {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
}

.tamasha-fk-pill .tamasha-fk-vol_panel {
  bottom: calc(100% + 10px);
  right: 50%;
  transform: translateX(50%);
}

/* Top-right tools (head) */
.tamasha-mobile-ui .tamasha-player-head-inner {
  align-items: center;
}

.tamasha-fk-top_tools {
  direction: ltr;
  position: absolute;
  top: calc(6px + env(safe-area-inset-top, 0px));
  left: 52px;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
}

.tamasha-mobile-ui .tamasha-player-back {
  position: relative;
  z-index: 2;
}

.tamasha-mobile-ui .tamasha-player-title {
  padding-left: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tamasha-fk-top_tools .tamasha-fk-btn {
  position: static;
  background: rgba(0, 0, 0, 0.35);
}

.tamasha-fk-top_tools .tamasha-fk-quality_trigger {
  min-width: 0;
  min-height: 34px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

.tamasha-fk-top_tools .tamasha-fk-quality_label {
  display: none;
}

.tamasha-fk-top_tools .tamasha-fk-quality_dropdown {
  top: calc(100% + 6px);
  bottom: auto;
  left: 0;
  right: auto;
}

/* Settings / subtitle sheets drop down under the top tools */
.tamasha-mobile-ui .tamasha-fk-settings_panel,
.tamasha-mobile-ui .tamasha-fk-subs_panel {
  position: absolute;
  top: calc(52px + env(safe-area-inset-top, 0px));
  bottom: auto;
  left: 8px;
  right: 8px;
  width: auto;
  max-width: none;
  max-height: calc(100% - 140px);
  transform: none;
  z-index: 60;
}

/* Centre ±10s buttons */
.tamasha-fk-center {
  direction: ltr;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 14%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 30;
  transition: opacity 0.3s ease;
}

.tamasha-fk-center .tamasha-fk-btn {
  display: flex;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.tamasha-fk-center .tamasha-fk-icon {
  width: 34px;
  height: 34px;
}

.tamasha-filmkio-skin.chrome-hidden .tamasha-fk-center,
.tamasha-filmkio-skin.chrome-hidden .tamasha-fk-top_tools {
  opacity: 0;
  pointer-events: none;
}

.tamasha-filmkio-skin.chrome-hidden .tamasha-fk-center .tamasha-fk-btn {
  pointer-events: none;
}

/* Hide the video.js big play button behind the centre controls once started */
.tamasha-mobile-ui.is-playing .vjs-big-play-button {
  display: none;
}

/* Double-tap feedback */
.tamasha-fk-seek_flash {
  position: absolute;
  top: 50%;
  z-index: 35;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.tamasha-fk-seek_flash.is-back { left: 10%; }
.tamasha-fk-seek_flash.is-fwd { right: 10%; }

.tamasha-fk-seek_flash.is-on {
  animation: tamasha-seek-flash 0.7s ease forwards;
}

@keyframes tamasha-seek-flash {
  0% { opacity: 0; transform: translateY(-50%) scale(0.85); }
  20% { opacity: 1; transform: translateY(-50%) scale(1); }
  100% { opacity: 0; transform: translateY(-50%) scale(1); }
}

@media (max-width: 360px) {
  .tamasha-fk-pill .tamasha-fk-btn { width: 34px; height: 34px; }
  .tamasha-fk-pill .tamasha-fk-remaining,
  .tamasha-fk-pill .tamasha-fk-total { min-width: 36px; font-size: 0.72rem; }
  .tamasha-mobile-ui .tamasha-player-title { padding-left: 170px; font-size: 0.9rem; }
}

/* Phones: no double-tap zoom / grey tap flash on the player (iOS Safari),
   and subtitles lift above the bottom pill while the controls are shown. */
.tamasha-mobile-ui .video-js,
.tamasha-mobile-ui .video-js * {
  -webkit-tap-highlight-color: transparent;
}

.tamasha-mobile-ui .video-js {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.tamasha-mobile-ui .vjs-text-track-display {
  transition: bottom 0.3s ease;
}

/* Only where the picture reaches the bottom edge (landscape / fullscreen);
   in portrait the picture is letterboxed well above the pill. */
@media (orientation: landscape) {
  .tamasha-filmkio-skin.tamasha-mobile-ui:not(.chrome-hidden) .vjs-text-track-display {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

.tamasha-filmkio-skin.tamasha-mobile-ui:not(.chrome-hidden) .video-js.vjs-fullscreen .vjs-text-track-display,
.tamasha-filmkio-skin.tamasha-mobile-ui:not(.chrome-hidden).vjs-fullscreen .vjs-text-track-display {
  bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
}

.tamasha-fk-pill .tamasha-fk-vol_track {
  touch-action: none;
}

/* Centre play/pause between the ±10 buttons (phones) */
.tamasha-fk-center {
  align-items: center;
}

.tamasha-fk-center .tamasha-fk-btn.tamasha-fk-center_play {
  width: 76px;
  height: 76px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.tamasha-fk-center .tamasha-fk-center_play .tamasha-fk-icon {
  width: 36px;
  height: 36px;
}

/* The centre button replaces video.js' big play button on phones */
.tamasha-mobile-ui .vjs-big-play-button {
  display: none !important;
}

/* While paused the centre controls stay visible even if the bar fades */
.tamasha-filmkio-skin.tamasha-mobile-ui:not(.is-playing) .tamasha-fk-center {
  opacity: 1;
}

/* "Tap for sound" — shown when the browser blocked autoplay with sound */
.tamasha-fk-unmute {
  position: absolute;
  top: calc(60px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 55;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(20, 22, 26, 0.9);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
}

.tamasha-fk-unmute[hidden] {
  display: none !important;
}
